• Skip to main content
  • Skip to header right navigation
  • Skip to site footer
CDP Studio logo

CDP Studio

The no-code and full-code software development tool for distributed control systems and HMI

  • Doc
  • Why CDP
    • Software developers
    • Automation engineers
    • Managers
  • Products
    • Automation Designer
    • HMI Designer
    • Maritime HMIs
  • Services
  • Use cases
  • Pricing
  • Try CDP

CDP Studio Documentation

  • Framework - Sequencer
  • RangeScanner

RangeScanner

RangeScanner

The RangeScanner is a sequencer block that allows to scan value ranges (like timestamp ranges) sequentially, not missing any value. It does this by requesting new spans (or sub-ranges), one by one, emitting the next span event when the previous span processed event was received. Span sizes can be limited by different attributes.

The block is useful for cases when we have to process some value range but the worker block can not handle this long or large work at once (for example because the result packet is getting too big etc). Then the RangeScanner block can be used to limit the span size and continue with the next span processing only after the worker block has reported that the previous span processing was done, like is illustrated in the block diagram below:

The block will scan the range continuously, without skipping any value, with the next span starting value to be equal to the previously processed span ending value.

Events

NameInput/OutputDescription
StartInputCauses the block to switch to started mode and will emit Started. Block will then emit a new Range event immediately and also after every following incoming NextRange event.
StartedOutputWill be emitted immediately after Start is received (before NextRange)
StopInputCauses the block to switch to stopped mode - i.e. it will NOT emit Range events anymore on subsequent NextRange events. It still saves the processed spans received NextRange events in the stopped mode. Will emit Stopped, after mode switched.
StoppedOutputWill be emitted after Stop is received
InitInputActs exactly as Stop, but will emit Inited, when done.
InitedOutputWill be emitted after Init is received
NextRangeInputInstructs the block that a range is processed and when in started mode, causes it to emit a new Range event with a span next to the one that was received.
RangeOutputWill be emitted on Start or NextRange and contains data with new span, next after previously processed span.

Arguments

NameDescription
RangeStartStart of the span. Will be emitted with Range event. When block is in timestamp scanning mode (i.e. MinTimeSpan is not zero) then the RangeStart is expected to be in TimeUnit set time units.
RangeEndEnd of the span. Will be expected with NextRange event and will be emitted with Range event. When block is in timestamp scanning mode (i.e. MinTimeSpan is not zero) then the RangeEnd is expected to be in TimeUnit set time units.

Properties

NameSpecial flagsDescription
MaxSpanWhen non-zero, sets the maximum span size (i.e. abs(RangeEnd - RangeStart) value) for Range events generated. When negative, then the range will be scanned downwards.
MinTimeSpanWhen non-zero, switches the block to timestamp scanning mode and sets the minimum timestamp span size in seconds so that smaller spans will not be emitted with Range event. RangeEnd's greater than the current system timestamp will then never be emitted, by waiting for MinTimeSpan before emitting the next Range event.
LastRangeEndPersistentLast LastRange, that was confirmed processed by input NextRange event. Note, that this value persists application restarts.
IsStartedRead-onlyWill be set to true when the block is in started mode.
TimeUnitSets time units for LastRangeEnd, RangeEnd and RangeStart.

Examples

Example With Limited Span Size

The following table shows some example events in input and corresponding output for RangeScanner block with MaxSpan set to 1000 and MinTimeSpan set to 0:

Timestamp (in increasing order)Input event (with argument values)Output event (with argument values)
`T_1`Init (RangeEnd=1000)
`T_2`StartRange (RangeStart=1000,RangeEnd=2000)
`T_3`NextRange (RangeEnd=2000)Range (RangeStart=2000,RangeEnd=3000)
`T_4`NextRange (RangeEnd=3000)Range (RangeStart=3000,RangeEnd=4000)
`T_5`Stop
`T_6`Init (RangeEnd=4000)
`T_7`StartRange (RangeStart=4000,RangeEnd=5000)

Example With Limited Minimum Time Size for Span

The following table shows some example events in input and corresponding output for RangeScanner block with MaxSpan set to 0 and MinTimeSpan set to 5 seconds:

TimestampInput event (with argument values)Output event (with argument values)
`T_1`Init (RangeEnd=`T_1`)
`T_1` + 8 secStartRange (RangeStart=`T_1`, RangeEnd=`T_1` + 8 sec)
`T_1` + 9 secNextRange (RangeEnd=`T_1` + 8 sec)
`T_1` + 13 secRange (RangeStart=`T_1` + 8 sec, RangeEnd=`T_1` + 13 sec)
`T_1` + 14 secNextRange (RangeEnd=`T_1` + 8 sec)
`T_1` + 19 secRange (RangeStart=`T_1` + 8 sec, RangeEnd=`T_1` + 13 sec)
`T_2`Stop
`T_3`Init (RangeEnd=`T_3`)
`T_3` + 1 secStart
`T_3` + 5 secRange (RangeStart=`T_3`, RangeEnd=`T_3` + 5 sec)

The content of this document is confidential information not to be published without the consent of CDP Technologies AS.

CDP Technologies AS, www.cdpstudio.com

Get started with CDP Studio today

Let us help you take your great ideas and turn them into the products your customer will love.

Try CDP Studio for free
Why CDP Studio?

CDP Technologies AS
Hundsværgata 8,
P.O. Box 144
6001 Ålesund, Norway

Tel: +47 990 80 900
E-mail: info@cdptech.com

Company

About CDP

Contact us

Services

Partners

Blog

Developers

Get started

User manuals

Support

Document download

Release notes

My account

Follow CDP

  • LinkedIn
  • YouTube
  • GitHub

© Copyright 2025 CDP Technologies. Privacy and cookie policy.

Return to top