OPC UA ClientMethodNode
OPC UA ClientMethodNode
OPC UA supports remote procedure calls (RPC) via method nodes. The OPC-UA-Client can also call these methods by using ClientMethodNodes.
Method nodes can have input arguments (parameters) and output arguments (return values). All arguments have a following property:
Property | Description |
---|---|
Type<string> | CDP value type of the argument values. Any CDP value type can be used to access any method node argument - value will be automatically converted, whenever possible. However, to avoid value loss in conversion choose compatible and best matching CDP value type for the ClientVariableNode. See also OPC UA Data Types. |
Input<bool> | Set to true for input arguments (parameters) and to false for output arguments (return values) |
Argument state can be observed at runtime via these read-only properties:
Property | Description |
---|---|
UAType<string> | OPC UA data type of the argument. See also OPC UA Data Types. |
Note: Method arguments (number and input/output direction) must be configured correctly in client - otherwise invalid argument error will be returned from server on method call. CDP Studio has a discovery functionality included. By using discovery you can easily explore remote method argument number and types and also add them into the OPC-UA-Client. See also OPC UA Server Discovery.
ClientVariableNode method execution can be configured by these configuration properties:
Property | Description |
---|---|
TriggerOnStartup<bool> | When set to true, method will be called immediately at system startup (at first successful connect to server). Default is true. |
TriggerOnTimeout<double> | Interval in seconds to wait before automatically re-calling method. Default is 0 (zero) that means no automatic time-based calling. |
TriggerOnChange<bool> | When set to true, method is called on input argument value change. Default is true. |
TriggerRouting<string> | Routed signal, property or parameter whose value edge change (i.e change from zero to non-zero or contrary) triggers method calling. |
ClientVariableNodes state can be observed at runtime via these read-only properties:
Property | Description |
---|---|
Executable<bool> | If set, the OPC UA method node is executable by client. |
StatusCode<unsigned int> | OPC UA status code of last method call |
StatusString<string> | OPC UA status string of last method call |
InvokedCount<uint64_t> | Number of times the method has been called (since system start) |
FailedCount<uint64_t> | Number of times the method call has been failed (since system start) |
Multi-Dimensional Arguments
In OPC UA, node variable values can be simple scalar values but can also be complex, up to three-dimensional values. CDP supports accessing these multidimensional values by following objects:
- ClientArgument1DArray - for one-dimensional array (vector ie. value-list)
- ClientArgument2DArray - for two-dimensional array (matrix ie. list of equally sized vectors)
- ClientArgument3DArray - for three-dimensional array (cube ie. list of equally sized matrices)
See also OPC UA Arrays.
Get started with CDP Studio today
Let us help you take your great ideas and turn them into the products your customer will love.