Main Content

getIDFromName

Translate OPC HDA aggregate type or item attribute name to numeric identifier

Syntax

ID = getIDFromName(Obj,NameStr)

Description

ID = getIDFromName(Obj,NameStr) returns the ID associated with the aggregate type or attribute item name NameStr. If NameStr is an array, ID is a vector of IDs.

Examples

Retrieve the ID of the TIMEAVERAGE item attribute provided by the Matrikon™ Simulation Server.

hdaObj = opchda('localhost','Matrikon.OPC.Simulation');
connect(hdaObj);
descID = getIDFromName(hdaObj.Aggregates,'TIMEAVERAGE')

Retrieve the ID of the DESCRIPTION item attribute provided by the Matrikon Simulation Server.

hdaObj = opchda('localhost','Matrikon.OPC.Simulation');
connect(hdaObj);
descID = getIDFromName(hdaObj.ItemAttributes,'DESCRIPTION')

See Also

Functions