StopWatch (FB)¶
FUNCTION_BLOCK StopWatch
Short description¶
Measurement of time periods with reset option.Display of the total time (tElapsed) and the total time before the last measurement (tMeasured).
Portrayal¶
Interfaces¶
Inputs¶
Name Datatype
Range
Init-Value
Function
xEn BOOL Enable measurement
xReset BOOL Reset stopwatch
Outputs¶
Name Datatype
Range
Init-Value
Function
tMeasured TIME 0 .. 10 Days
0 Days
Measured time before the last measurement
tElapsed TIME 0 .. 10 Days
0 Days
Time measured since the last reset
Functional description¶
General¶
This function block is used to measure individual time periods (xEn = = 1).
The sum of the measured time periods is displayed at output tElapsed.
The sum of the measured time periods before the last measurement is displayed at the output tMeasured.
The sum of the measured time periods may not exceed 14400 minutes (= 10 days).
The input xReset (xReset*= 1) resets the outputs *tEleapsed*and *tMeasured to 0 regardless of the other states.
If the measurement is not enabled ( xEn*= 0), the outputs *tEleapsed*and *tMeasured are not changed.
Visualization¶
Information¶
Element Authors
Date
Version Note
Function
Adam Bartod 01.2017 1.0 Initial version
Programming
Adam Bartod 01.2017 1.0 Initial version
Test Jochen Reu 02.2017 1.0 Initial version
Documentation
Jochen Reu 06.2017 1.0 Initial version
Revision Lukas Pfänder 10.2017 1.0 Documentation
Codesys¶
- InOut:
Scope Name Type Comment Input xEn BOOL Enable measurement
xReset BOOL Reset stopwatch
Output tMeasured TIME Measured time before the last measurement
tElapsed TIME Time measured since the last reset