WOLFRAM SYSTEM MODELER

varserver

A server with a custom list of variable nodes

Wolfram Language

In[1]:=
SystemModel["OPCUA.Documentation.varserver"]
Out[1]:=

Information

The OPCUA Library comes with an OPC UA server that can be used to serve a custom list of OPCUA.Types.UAReal.Double-valued variable nodes. The nodes are created in a flat structure in the local server namespace (corresponding to namespace index 1) and have string-based IDs. They are both readable and writable. The server executable varserver is located in a platform-specific subfolder of the Resource/Library folder:

  • Windows: win64
  • macOS: aarch64-darwin or darwin64
  • Linux: linux64 or linux32

The server could, for example be used to communicate between two System Modeler simulations on possibly different computers. One simulation would write data to the varserver, and the other simulation reads it.

Another use case, is to combine it with the OPCClassic library and have one simulation, on the OPC Classic server computer, relaying data to the varserver, there by tunneling the OPC Classic traffic through OPC UA and avoid all of the potential problems with configuring remote access to OPC Classic servers.

Usage
varserver [-p PORT] nodeID1 nodeID2 ... nodeIDN
  • PORT: The port to start the OPC UA server on (optional, default is 16664).
  • nodeIDN: String ID of node N.

Press Ctrl+C to stop the server. To use any of the OPCUA.Blocks.SamplerReal blocks to read or write data from one of the nodes, the following needs to be specified in the Node Identifier group:

  • nodeIDType: OPCUA.Types.UANodeIdType.StringId (nodes have string-based IDs).
  • nodeID: the node id specified on the command line within double quotes, e.g. "temperature".
  • nodeNamespace: 1 (nodes are created in the local server namespace corresponding to namespace index 1).

In addition to that, all write blocks need to set uaRealType to OPCUA.Types.UAReal.Double in the Parameters group.

Example
varserver pumpSpeed temperature
This will start the varserver on the default port serving the variable nodes pumpSpeed and temperature. The server will output log messages to the standard output about the startup procedure; the server is ready to be used when the message TCP network layer listening on ... is shown.
[04/01/2022 13:43:16.169] info/server  Adding variable pumpSpeed
[04/01/2022 13:43:16.169] info/server  Adding variable temperature
[04/01/2022 13:43:16.169] info/network TCP network layer listening on opc.tcp://computername.local:16664