OPC UA ClientVariableNode
OPC UA ClientVariableNode
In order to receive or send data in OPC UA, variable nodes must be used.
Note: CDP Studio has a discovery functionality included. By using discovery you can easily find the remote server node structure and variable types and create the best-matching OPC-UA-Client variable node configuration. See also OPC UA Server Discovery.
Single-channel (of any CDP signal type) and/or multi-channel (of type string) ClientVariableNodes can be added to the OPC-UA-Client node tree for sending and receiving information.
Choose a single-channel node to send or receive one channel (i.e. signal) value per OPC UA node. Choose a multi-channel (string) node to send or receive many channels (i.e. signals) encapsulated into one OPC UA node.
ClientVariableNode has the following configuration properties:
Property | Description |
---|---|
Type<string> | CDP value type of the node. Any CDP value type can be used to access any OPC UA data type - the value will be automatically converted, whenever possible. However, to avoid value loss in conversion, choose a compatible and best-matching CDP value type for the ClientVariableNode. See also OPC UA Data Types. |
Input<bool> | Set to true for variables whose value must be controlled by CDP (routed) or false for variables whose value changes must be observed only. Note: The input property in CDP is always considered from the CDP point of view (i.e. not from the OPC UA client point of view). |
Bidirectional<bool> | If set, the variable value is synced to the OPC UA network and also back from the OPC UA network despite the Input property value. Set Bidirectional to true when you need to control the variable value and also need to reflect the value changes received from OPC UA (e.g. value changes made by the server or other clients), for example when routing the value to the GUI widget. |
ChangeMonitoring<bool> | Set to false when node value change monitoring (subscription) for the node value changes is not needed. Defaults to true. When set to false, only the connect-time initial value from the server will be read. |
PublishingInterval<double> | Interval (in milliseconds) at which the server has to send data to the client. The component process period is used when PublishingInterval is set to 0. Note: ClientVariableNode creates an OPC UA monitoring item under one, shared OPC UA subscription for all ClientVariableNodes that have the same PublishingInterval. |
ClientVariableNode state can be observed at runtime via these read-only properties:
Property | Description |
---|---|
UAType<string> | OPC UA data type of the node. See also OPC UA Data Types. |
IsProperty<bool> | If set, the OPC UA variable node is an OPC UA property (otherwise it is an OPC UA data variable). |
MinimumSamplingInterval<double> | Minimum interval (in milliseconds) at which the server is checking the data source for changes. |
ServerTimestamp<string> | Timestamp when the value was registered in the server. |
SourceTimestamp<string> | Timestamp when the value was set by its source. |
ClientVariableNodeChannelGroup
ClientVariableNodeChannelGroup has a Channel sub-element where multiple channels can be added. These channels will then be used to receive or send the actual OPC UA value using a translator of <istream> type (for incoming values) and <ostream> type (for outgoing values), specified in the Translator element. When no Translators are specified, default TextTranslator<istream> and TextTranslator<ostream> are used, which results in sending and receiving channel values in text format, line by line. Since this Channel sub-element can also contain ChannelGroups, a complex tree-like structure can also be created. Channel-trees are most useful for JSONTranslator , where it will be used to send or receive channel values in JSON format.
ClientVariableNodeChannelGroup also has a ValueMap subelement that can be used to define transformations that will be done during translation between some CDP value to a corresponding OPC UA value and vice versa.
Multi-dimensional ClientVariableNodes
In OPC UA, node variable values can be simple scalars but can also be complex, up to three-dimensional values. CDP supports accessing these multidimensional values by the following objects:
- ClientVariableNode1DArray - for a one-dimensional array (vector i.e. value-list)
- ClientVariableNode2DArray - for a two-dimensional array (matrix i.e. list of equally sized vectors)
- ClientVariableNode3DArray - for a three-dimensional array (cube i.e. list of equally sized matrices)
See also OPC UA Arrays.
Variables of OPC UA Custom Data Types
In addition to variables of OPC UA built-in data types, variables of custom data types can also be added to the OPC-UA-Client. See in more detail what custom data types are and how to configure them at OPC UA Custom Data Types.
Note: CDP Studio has a discovery functionality included. By using discovery, all the custom data structure member elements are added automatically for you.
Get started with CDP Studio today
Let us help you take your great ideas and turn them into the products your customer will love.