serveritems
(To be removed) Query server or name space for fully qualified item IDs
Support for the OPC Data Access (DA) standard will be removed in a future release. Instead use OPC Unified Architecture (UA). See Version History.
Syntax
FQID = serveritems(DAObj,ItemID)
FQID = serveritems(DAObj)
FQID = serveritems(DAObj, 'Filter1
',Val1,'Filter2
',Val2,
...)
FQID = serveritems(NS)
FQID
= serveritems(NS,ItemID)
Description
FQID = serveritems(DAObj,ItemID)
returns a
cell array of all fully qualified item IDs matching ItemID
that
are found on the OPC server defined by DAObj
.
DAObj
must be a connected opcda
object.
ItemID
is a partial character vector or string to search for,
and can contain the wildcard character '*'
.
FQID
is a character vector or cell array of character
vectors. You can use FQID
in a call to additem
to construct daitem
objects.
FQID = serveritems(DAObj)
returns all fully
qualified item IDs on the OPC server associated with
DAObj
.
FQID = serveritems(DAObj, '
allows you to filter the retrieved name space based on a number of available browse
filters. Available filters are described in the following table:Filter1
',Val1,'Filter2
',Val2,
...)
Browse Filter | Description |
---|---|
| Specify the |
| Specify the depth of the name space that you want returned.
A |
| Restricts the search to leaf nodes with particular access
right characteristics. Specify |
| Restricts the search to nodes with a particular canonical
data type. Valid data types are |
FQID = serveritems(NS)
and
FQID
= serveritems(NS,ItemID)
search the name space structure
defined by NS
, rather than querying the OPC server.
NS
is the result of a call to getnamespace
in either hierarchical or flat format.
Note that some servers may return item IDs that cannot be created on that server. These item IDs are usually branches of the OPC server name space.
You use the results of a call to serveritems
in a call to
serveritemprops
to return the property
information for items in the OPC server name space. The properties of the items in
the server name space include the server item's canonical data type, limits,
description, current value, etc.
Examples
Create a client for the Matrikon™ Simulation Server and connect to the server:
da = opcda('localhost', 'Matrikon.OPC.Simulation');connect(da);
Find all item IDs in the Matrikon Server containing the word 'Real'
:
realItmIDs = serveritems(da, '*Real*');
Add all items in the Random node to a group:
grp = addgroup(da, 'ServerItemsEx'); itm = additem(grp, serveritems(da, 'Random.*'));