WOLFRAM SYSTEM MODELER
TriggeredSamplingModel that samples data from an OPC item irregularly |
![]() |
SystemModel["OPCClassic.Examples.TriggeredSampling"]
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.
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.
Plot of the reference signal and the height of the liquid in tank2.
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) |
![]() |
opcServer |
Type: OPCServer |
---|---|---|
![]() |
triggeredReadReal |
Type: TriggeredRead |
![]() |
tank |
Type: ControlledTank |
![]() |
PI |
Type: LimPID |
![]() |
booleanTable |
Type: BooleanTable |
![]() |
const |
Type: Constant |
![]() |
gain |
Type: Gain |
![]() |
filter |
Type: Filter |