genslwrite - Generate Simulink OPC Write block from MATLAB group object
Syntax
BlkPath = genslwrite(GrpObj)
BlkPath = genslwriteGrpObj, DestSys)
Description
BlkPath = genslwrite(GrpObj) generates
an OPC Write block from the dagroup object GrpObj,
and places the block in a new Simulink model. The generated OPC
Write block has the same name, update rate, and items as GrpObj. BlkPath indicates
the full path to the new OPC Write block.
BlkPath = genslwriteGrpObj, DestSys) generates
the OPC Write block and places it into the system defined by DestSys. DestSys must
be a model name or a path to a subsystem block. The OPC Write block
automatically takes a location that attempts to minimize overlap of
lines and blocks, however, the block might appear over an existing
annotation.
Examples
Create a group object with two items, and then construct an
OPC Write block from the group:
da = opcda('localhost', 'Matrikon.OPC.Simulation');
grp = addgroup(da, 'ExOPCREAD');
itm1 = additem(grp, 'Triangle Waves.Real8');
itm2 = additem(grp, 'Saw-Toothed Waves.Int2');
% Set update rate to 2 seconds:
grp.UpdateRate = 2;
% Construct OPC Write block:
blkPath = genslwrite(grp)
See Also
genslread
 | genslread | | get |  |
Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
Get the Interactive Kit