Resampler block

This block resamples the input fields at a fixed sampling rate.

Return to Overview of blocks

Description

The Resampler block is used to combine data flows that execute at different sampling rates. It does this by starting a new data flow that executes at the rate to which the block is configured. At its execute instant, it reads the current values on the input port and copies them to the output port.  

NOTE: The Resampler block will always execute after the sources, regardless of the sampling rate of the Resampler. As such, if there are two data sources, with a sampling rate of 1s and 2s respectively, and the Resampler block has a resampling rate of 2000ms, then every two seconds, the execution order will be first the sources, and then the Resampler block.

WARNING: Never use more than one resampler in a blueprint.

Diagram showing the resAMPLER Block

Block Type

Time based block

Input/Output ports

The input port may contain fields of type double or integer.

There is an output field for every input field.

When new input fields are added to the input port, an output field with the same name will be generated.

Functions performed on tags

  • On the values - The output field value is copied from the input field value at every execute instant.

  • On the timestamp - The output timestamp is either copied from the input field, or the current execute time is used for the output field timestamp.

  • On the quality - The output field quality is copied from the input field quality at every execute instant.

Example

The table below shows the value and timestamp of two fields in the input port of the Resampler block, Tag1 and Tag2, and the corresponding fields in the output port of the Resampler block, Tag1_Out and Tag2_Out.  The timestamps of Tag1 and Tag2 are different and originate from different sources.  Tag1 and Tag2 are combined in the output after being resampled, with the result as shown in the table below, Tag1_Out and Tag2_Out.

Values and Timestamps of two fields in the Input port of the Resampler block

Return to top


Related topics:

  

CSense 2023- Last updated: June 24,2025