Sample and Hold block

This block samples the input when a reset event occurs.

Return to Overview of blocks

Sample and Hold block

Description

The Sample and Hold block copies the fields on the input port to the fields on the output port only when a reset event occurs.  This action is referred to as sampling. The normal execution of the block holds the value constant,  i.e. the value of the output field(s) remains constant between reset events.  This action is referred to as hold. A reset event is triggered by the Reset on input change block.

diagram showing the sample and hold block

Block Type

Time based block

Input/Output ports

The block can accept any number of fields of any type.

There is an output field for every input field.  Output fields are created automatically to match the input fields.  New output field names will have the post-fix applied automatically, the post-fix is configurable by the user.

Functions performed on tags

  • On the values - When a reset event occurs, the input field is copied to the output field, the output field value will remain constant until the next reset event.

  • On the timestamp - The time stamp of the output field depends on the configuration.  When using the reset time option, the time stamp associated with the reset event is assigned to the output field.  When using the original time stamp, the time stamp of the input field is assigned to the output field.

  • On the quality - The output field quality is the same as the quality of the input field at the time of sampling.  Thus if the quality of the input field is bad at the time of sampling, the output field quality will be bad quality until a new, good quality, value has been sampled.

Example

The diagram below shows the input to the Reset on input change block, as well as the input to and output from the sample and hold block.  The reset on input change block is configured to reset the block if it detects a rising edge in its input field, thus since the data consists solely of 0's and 1's, this will only occur if the input field changes from 0 to 1.  Thus whenever the input to the Reset on input change block changes from 0 to 1, a reset event occurs and the sample and hold block samples its input fields.

This may be seen in the example below.

Return to top


Related topics:

  

CSense 2023- Last updated: June 24,2025