WOLFRAM SYSTEM MODELER

TriggeredSampling

Model that samples data from an OPC item irregularly

Diagram

Wolfram Language

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

Information

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

A triggered sampling block for reading data of type Real is used to sample data from a saw-toothed signal ("Saw-toothed Waves.Real8") 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 tank2.

A model that demonstrates how to achieve irregular sampling from an OPC server

Plots of the sampled signal read from opcServer and the output from booleanTable. Note how data has been sampled each time the Boolean output trigger is true.


A model that demonstrates how to achieve irregular sampling from an OPC server

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

Parameters (3)

k

Value: 0.05

Type: Real

Description: Gain value multiplied with input signal (gain.k)

kFlow

Value: 2

Type: VolumeFlowRate (m³/s)

Description: Constant inflow rate (const.k)

f_cut

Value: 0.5

Type: Frequency (Hz)

Description: Cut-off frequency (filter.f_cut)

Components (8)

opcServer

Type: OPCServer

triggeredReadReal

Type: TriggeredRead

tank

Type: ControlledTank

PI

Type: LimPID

booleanTable

Type: BooleanTable

const

Type: Constant

gain

Type: Gain

filter

Type: Filter