Analytics Builder 10.9.0 | Using Analytics Builder for Cumulocity IoT | Block Reference | Utility | Duration
 
Duration
apama.analyticskit.blocks.core.Duration
Measures the time elapsed from a set start time.
The start time is set by a start signal which activates the block. If the block is already active, then a start signal is ignored and the existing measurement remains unaffected. The block is deactivated with a reset signal which also disables any periodic outputs.
The block generates a float output of the time elapsed since the start signal, measured in seconds. If the block is inactive at the time it receives a measure signal, then 0.0 is generated as the output.
If multiple signals are received at the same time, they are processed in the order of measure, reset and start. Thus, for example, if measure and reset signals are received together, the block first generates an output with the current duration and then resets its state. Processing the inputs in this order allows the current state of the block to be output and the block to be restarted within a single unit of time, if desired.
Parameters
Name
Description
Type
Notes
Periodic Output (secs)
The amount of time (in seconds) between automatically generated outputs by an active block. If not set, then an output is only generated when a measure signal is received.
This must be a finite and positive number.
float
Optional
Input Port Details
Name
Description
Type
Measure
Triggers an output of the duration (in seconds) since the block was activated. If the block is inactive, then 0.0 is output.
pulse
Reset
Deactivates and resets the state of the block.
pulse
Start
Activates the block.
pulse
Output Port Details
Name
Description
Type
Duration
The time in seconds since a start signal was received.
float