| OPC Toolbox™ | ![]() |
Generate Simulink® OPC Read block from MATLAB® group object
BlkPath = genslread(GrpObj)
BlkPath = genslread(GrpObj, DestSys)
BlkPath = genslread(GrpObj) generates an OPC Read block from the dagroup object GrpObj. The OPC Read block is placed in a new Simulink model. The generated OPC Read block has the same name, update rate, and items as GrpObj. If all items in GrpObj have the same data type, that data type is assigned to the OPC Read block's Value port. BlkPath is returned as the full path to the new OPC Read block.
BlkPath = genslread(GrpObj, DestSys) generates the OPC Read 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 Read block is automatically placed in a location that attempts to minimize overlap of lines and blocks. However, the block might be placed over an existing annotation.
Create a group object with two items and an update rate of 2 seconds.
da = opcda('localhost', 'Matrikon.OPC.Simulation');
grp = addgroup(da, 'ExOPCREAD');
itm1 = additem(grp, 'Triangle Waves.Real8');
itm2 = additem(grp, 'Saw-Toothed Waves.Int2');
grp.UpdateRate = 2;Construct an OPC Read block from the group.
blkPath = genslread(grp)
![]() | flushdata | genslwrite | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |