WOLFRAM SYSTEM MODELER

MultipleServers

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 requires two OPC UA example servers running on localhost. Read about how to start the example servers here.

The read 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 write 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 endpointUrl accordingly in component client1 or client2
  2. Change the corresponding nodeID, nodeIDType and nodeNamespace in the connected read/write component so that it connects to a real-valued node on the remote server

Parameters (1)

errorHandling

Value: Types.ErrorHandling.ErrorWhenUncertain

Type: ErrorHandling

Description: How to handle node errors (request errors are handled by the connected Read/WriteNodeList component)

Components (9)

client1

Type: Client

Description: Client for connecting to an OPC UA server

filter

Type: Filter

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

client2

Type: Client

Description: Client for connecting to an OPC UA server

combiTimeTable

Type: CombiTimeTable

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

write

Type: Write

Description: Adds writing of a Real scalar node to a WriteNodeList

read

Type: Read

Description: Adds reading of a Real scalar node to a ReadNodeList

writeClock

Type: PeriodicExactClock

Description: Generate a periodic clock signal with a period defined by an Integer number with resolution

shift

Type: ShiftSample

Description: Shift the input clock by a fraction of the last interval and provide it as output clock

writeTableData

Type: Write

Description: Adds writing of a Real scalar node to a WriteNodeList