Part 34— Analog Value Sample
This allows you to control when and how values are sent through, which is particularly useful when working with systems where analog data needs to be updated at specific intervals or only when it changes.
Each time the <sample_all>
input receives a rising edge (from 0 to 1), all the analog inputs are sent to their respective outputs, regardless of whether the values have changed.
Optional Digital Input <sample_changed>
:
- This input only propagates analog values that have changed since the last sample.
- When
<sample_changed>
receives a rising edge, only those analog inputs that have new values since the last sampling will be propagated to the outputs. - This is useful for reducing data traffic in scenarios where only changes in value need to be communicated, such as over networked or remote systems.
Imagine you’re controlling a lighting system where each <ain>
represents the intensity of a light in a different room. You might use an oscillator to periodically trigger <sample_all>
, ensuring that the central control receives an update on all light levels at regular intervals. Additionally, <sample_changed>
can be used to only update rooms where the light intensity has changed, allowing for efficient use of the system’s resources.