Main Content

getIDFromName

Get ID of OPC HDA aggregate type or item attribute

Description

ID = getIDFromName(obj,nameStr) returns the ID associated with the aggregate type or attribute item name specified in nameStr.

example

Examples

collapse all

Create an OPC HDA client and connect the client to the server.

hdaObj = opchda('localhost','Matrikon.OPC.Simulation');
connect(hdaObj);

Retrieve the ID of the TIMEAVERAGE aggregate type on the connected server.

descID = getIDFromName(hdaObj.Aggregates,'TIMEAVERAGE')
descID =

  int64

   4

Retrieve the ID of the DESCRIPTION item attribute on the connected server.

descID = getIDFromName(hdaObj.ItemAttributes,'DESCRIPTION')
descID =

  int64

   2

Input Arguments

collapse all

OPC HDA object for aggregate types or item attributes, specified as an opc.hda.AggregateTypes object or an opc.hda.ItemAttributes object.

Example: hdaObj.Aggregates

Property name of OPC HDA client aggregate types or item attributes, specified as a character vector, string, array of character vectors, or vector of strings.

Example: "TIMEAVERAGE"

Output Arguments

collapse all

Property ID of OPC HDA client aggregate type or item attribute, returned as a scalar or a vector.

Example: 4

Version History

Introduced before R2006a