opcfind

Find OPC Toolbox objects with specific properties

Syntax

Out = opcfind
Out = opcfind('P1',V1,'P2',V2,...)
Out = opcfind(S)

Description

Out = opcfind returns a cell array, Out, of all existing OPC Toolbox™ objects.

Out = opcfind('P1',V1,'P2',V2,...) returns a cell array, Out, of toolbox objects whose property values match those passed as property name/property value pairs, P1, V1, P2, V2, etc.

Out = opcfind(S) returns a cell array, Out, of toolbox objects whose property values match those defined in structure S. The field names of S are object property names and the field values of S are the requested property values.

Examples

Create some OPC Toolbox objects:

da1 = opcda('localhost','Dummy.ServerA'); 
da2 = opcda('localhost','Dummy.ServerB');
da1.Tag = 'myopcTag';
da1.Timeout = 300;
grp = addgroup(da2,'TestGroup');
itm = additem(grp,{'Dummy.Tag1','Dummy.Tag2'});

Find all OPC Toolbox objects:

allObjCell = opcfind;

Find all objects with the Tag 'myopcTag':

myOPC = opcfind('Tag','myopcTag')

Find all daitem objects:

itmCell = opcfind('Type','daitem')

See Also

Was this topic helpful?