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 Description: A model used for setting up server parameters (name of host and server) |
|
---|---|---|
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 |