WOLFRAM SYSTEM MODELER

MultipleServers

Example that demonstrates a possible use of multiple OPC UA servers

Diagram

Wolfram Language

In[1]:=
SystemModel["OPCUA.Examples.MultipleServers"]
Out[1]:=

Information

This example demonstrates that using the OPCUA Library, it is possible to connect to multiple servers from one model.

This example requiers two OPC UA example servers running on localhost. Read about how to start the example servers here.

The readReal component reads data from a real-valued node "51031" on "opc.tcp://localhost:16664". The data is then passed through a Butterworth lowpass filter with a cutoff frequency of 0.2 Hz. Finally, the component writeReal writes the filtered data to node "51031" on "opc.tcp://localhost:16665".

There are several possible applications of being able to connect to more than one server from one model, such as processing data read from one server and writing the modified data to another server.

 If you have the possibility to set up a remote OPC UA server, what you need to do get this example to use the remote is to:

  1. Change hostName accordingly in component  opcServer or opcServer1, for example opcServer.hostName = "opc.tcp://raspberrypi:16664" and opcServer1.hostName = "opc.tcp://localhost:16664".
  2. Change the corresponding nodeID, nodeIDType, and nodeNamespace in the connected block so that it connects to a real-valued node on the second server.

 

Plot of the values on node 51031 read from component opcServer.


Plot of the filtered signal and the sampled data written to node 51031 on opcServer1.

Components (7)

opcServer

Type: OPCUAServer

Description: A model used for setting up server parameters

filter

Type: Filter

Description: Continuous low pass, high pass, band pass or band stop IIR-filter of type CriticalDamping, Bessel, Butterworth or ChebyshevI

readReal

Type: Read

Description: A block for reading data from items on an OPC server at intervals determined by parameter samplePeriod

writeReal

Type: Write

Description: A block for writing data to an item on an OPC server at intervals determined by parameter samplePeriod

opcServer1

Type: OPCUAServer

Description: A model used for setting up server parameters

combiTimeTable

Type: CombiTimeTable

Description: Table look-up with respect to time and linear/periodic extrapolation methods (data from matrix/file)

writeRealTable

Type: Write

Description: A block for writing data to an item on an OPC server at intervals determined by parameter samplePeriod