Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

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

Introduced in R2006a

Was this topic helpful?