Triggered sampler
Samples the input at each rising edge of trigger and holds it.
- signal
- Boolean
- Modelica Standard Library
- 3 ports
- 1 parameter
triggeredSamplerLibraryLogicDescription
Samples a Real input at each rising edge of a Boolean trigger and holds that value until the next rising edge.
Example
Latch, timer, and sampler Start and stop buttons set and reset a flip-flop, which times the run, gates a signal, and samples the start time.
EnableStartStopEnabled startStart edgeStop edgeRunningRun timeSine 1 Hz0Gated sineClockStart time
Also in this example:ConstantSine waveClockANDSwitch (logic)RS flip-flopTimerBoolean constantBoolean stepRising edge
Ports
Inputs 2
-
trigger
Boolean trigger. The input is sampled each time it changes from false to true.
-
u
Real input to sample.
Outputs 1
-
y
Last sampled value; y_start until the first rising edge.
Parameters
-
Initial output
y_start0Output before the first rising edge of the trigger. Any real number.
Equations
Modelica
At each rising edge of trigger: y = u y = y_start at the start.
Implementation
Modelica Standard Library 4.1.0
MSL documentation Modelica.Blocks.Discrete.TriggeredSamplerAssumptions and limitations
- A trigger that is already true at the start does not sample; the first sample is at its next rising edge.
Tips
- For sampling at a fixed rate, use Zero-order hold.
See also
Select a block in Gradara and press F1 to open its page offline.