WOLFRAM SYSTEM MODELER

TriggeredSampling

Model that samples data from an OPC UA node irregularly

Diagram

Wolfram Language

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

Information

This example demonstrates how to achieve irregular sampling from an OPC UA server using a triggered sampling block.

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

A triggered sampling block for reading data of type Real is used to sample data from a table at irregular time intervals. Each time the output from booleanTable is true, data is read from opcServer. The sampled signal is then passed through a lowpass Butterworth filter and used as a reference signal to control the height of the liquid in tank.

Plots of the sampled signal read from node 51031 on opcServer, the written values from the table, and the output from booleanTable. Note how data has been sampled each time the Boolean output trigger is true.


Plot of the reference signal and the height of the liquid in tank.

Components (10)

opcServer

Type: OPCUAServer

Description: A model used for setting up server parameters

triggeredReadReal

Type: TriggeredRead

Description: A block for reading data from items on an OPC server at intervals determined by an external Boolean signal (trigger)

tank

Type: ControlledTank

Description: Model of a simple tank with actuator input

PI

Type: LimPID

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

booleanTable

Type: BooleanTable

Description: Generate a Boolean output signal based on a vector of time instants

const

Type: Constant

Description: Generate constant signal of type Real

gain

Type: Gain

Description: Output the product of a gain value with the input signal

filter

Type: Filter

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

writeReal

Type: Write

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

combiTimeTable

Type: CombiTimeTable

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