opcuanode
Create OPC UA node objects
Description
An opc.ua.Node object stores information about a node in an OPC
UA server. You use this object to browse the server namespace, access data, and run
operations. Each node has a NodeType of Object,
Variable, or Method. Object nodes do not store data
values, and you use them to navigate the server namespace. Variable nodes store data values
such as sensor or actuator readings, and you read or write current and historical values using
these nodes. Method nodes behave as callable functions linked to objects, and you use them to
run object specific operations.
Creation
Description
creates an OPC UA node object or array of node objects using the namespace index and
identifier without associating the nodes with an OPC UA server. Each node object sets its
nodeList = opcuanode(index,id)Name property to 'index:id'. Other properties of
the node objects remain unknown until you associate the nodes with an OPC UA
server.
To associate the nodes with an OPC UA server, specify the client when using these
nodes with the writeValue or readValue function.
immediately associates the node object with the specified client
nodeList = opcuanode(index,id,uaClient)uaClient. If uaClient is connected at this time,
the function also retrieves other properties from the server associated with
uaClient.
Tip
Create node objects with
opcuanodeonly when you know the namespace index and identifier of the nodes you are interested in.If you do not know the namespace index and identifier for the node, create node objects by browsing the namespace of a connected OPC UA client object with
browseNamespaceorgetNamespace, or browse theParentandChildrenproperties of existing node objects.
Input Arguments
Output Arguments
Properties
Object Functions
findNodeById | Find OPC UA server node by namespace index and identifier |
findNodeByName | Find OPC UA server nodes by name |
getAllChildren | Recursively retrieve all children of OPC UA server node |
getNodeAttributes | Read OPC UA server node attributes |
invoke | Execute method node on OPC UA server |
isEmptyNode | True for empty nodes of OPC UA node array |
isObjectType | Determine if nodes are object type |
isVariableType | Determine if nodes are variable type |
readAtTime | Read historical data from nodes of OPC UA server at specific times |
readHistory | Read historical data from nodes on OPC UA server |
readProcessed | Read aggregate data from nodes of an OPC UA server |
readValue | Read values from nodes on OPC UA server |
writeValue | Write values to nodes on OPC UA server |
Examples
Limitations
When you create a method node object using
opcuanode, you cannot execute that node usinginvoke. To execute method nodes, create the node object usingbrowseNamespace,findNodeByName, orfindNodeById. (since R2024a)
Version History
Introduced in R2015bSee Also
Functions
opcua|findNodeByName|findNodeById|browseNamespace|readValue|getNamespace|writeValue|invoke