WOLFRAM SYSTEM MODELER

TankSystem

A tank system model where height data is written to and read from an OPC UA node on an OPC UA server

Diagram

Wolfram Language

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

Information

In this example, sampled data from one system is used to control the behavior of another, and the OPC server works as the communication link between these two systems.

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

The first system consists of a simple tank (tank1) with an outlet. The tank is fed with a medium in a pulse-wise manner determined by component pulse. The height of the medium in the tank is sampled every 0.2 seconds and written to an OPC UA Server (opcServer). The sampled data represents a height profile that should be mimicked in tank2 in the second system. To achieve this behavior, the height data read from opcServer is used as a reference signal to the PID component that controls the behavior of the second tank.

Plot of the height of tank1 and the sampled signal written to the OPC server.


 

Plot of the height of tank2 and the reference signal fed to the PID controller.

Components (8)

writeReal

Type: Write

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

opcServer

Type: OPCUAServer

Description: A model used for setting up server parameters

readReal

Type: Read

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

tank1

Type: SimpleTank

Description: Model of a simple tank holding liquid

pulse

Type: Pulse

Description: Generate pulse signal of type Real

step

Type: Step

Description: Generate step signal of type Real

PI

Type: LimPID

Description: P, PI, PD, and PID controller with limited output, anti-windup compensation, setpoint weighting and optional feed-forward

tank2

Type: ControlledTank

Description: Model of a simple tank with actuator input