WOLFRAM SYSTEM MODELER
TankSystemA tank system model where height data is written to and read from an OPC item |
SystemModel["OPCClassic.Examples.TankSystem"]
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.
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 a MatrikonOPC 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.
writeReal |
Type: Write Description: A block for writing data to an item on an OPC server at intervals determined by parameter samplePeriod |
|
---|---|---|
opcServer |
Type: OPCServer Description: A model used for setting up server parameters (name of host and server) |
|
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 |