[STPWATCH] Stop watch
Function block STPWATCH determines the time difference between an increasing edge at start input and an increasing edge at stop input.
STPWATCH determines the time difference between an increasing edge at start input and an increasing edge at stop input.
STPWATCH determines the time difference between an increasing edge at start input [Stt] and an increasing edge at stop input [Stp]. Following measurement, the time difference is available for further processing at output [Out]. Output [Out] always contains the last valid measured value for time. The entire functionality can be disabled by [EnFnct]: If [EnFnct] = 0, no new time measurement is carried out. Output value [Out] is saved remanently as an option, an old value is thus available after startup.

Output [TiEld] displays the expired time. It is used for testing during commissioning.
Requirements
- If [EnFnct] = 0, all current timings are reset. [Stt] and [Stp] are ignored.
- If further [Stt] pulses are issued during measurement, timing is reset and restarted. The interrupted timing is invalid.
- Further [Stp] pulses during the pause are ignored.
- After completion, i.e. [EnFnct] = 1 for the entire measurement, and [Stt] pulse was first followed by [Stp] pulse, output [Out] has a new value.
- [TiEld] is run as soon as a new measurement begins. This is true also for incomplete measurements.
- If no measurement is active, [TiEld] = 0.
- If an increasing edge occurs simultaneously at [Stt] and [Stp], the stop input is processed before the start input within the same cycle. Thus, the current measurement is ended and becomes valid before a new measurement starts.
Time for input and output signals:

Input | Description | Data type | Default value |
|---|---|---|---|
EnFnct | Enable function Enables the function. | Boolean | 1 |
0 - The function is disabled. | |||
Stt | Start | Boolean | 0 |
0 - No | |||
Stp | Stop | Boolean | 0 |
0 - No | |||
Pers | Persistent | Boolean | 0 |
0 - No | |||
|
BaObjRef | BA-Object reference | Structure | --- |
BaObjRef | Device identifier | Double Word | 16#3FFFFF |
BaObjRef | Object identifier | Double Word | 16#3FFFFF |
BaObjRef | Item identifier | Integer | -1 |
Output | Description | Data type | Default value |
|---|---|---|---|
Out | Output | Time | 0 ms |
TiEld | Elapsed time The time expired to date is pending. After reaching [Ti], [TiEld] is reset to 0. | Time | 0 ms |
Dstb | Disturbed [Dstb] indicates whether the referenced BACnet object was accessed. | Boolean | 0 |
ErrCode | Error code indication | Integer | 0: No error |
= 0 - No error | |||
The start and stop inputs allow for measuring runtimes between two different events, e.g. damper runtime between end switch "closed" and "open", or pause time of a pump between switch-off and the next switch-on (stop time with two buttons).
If the time between two identical events must be measured, e.g. the time between two switch-on events, this can be implemented by sending the event to both the stop input and the start input (timer with 1 button).
STPWATCH is processed with the values at the inputs from the third process cycle, as the values at the inputs are considered valid only then. [TiEld] = 0 is issued during the first two process cycles.
At start-up, STPWATCH reads the last saved counter value from the BACnet object and uses the value as the initial output value if [Pers] = 1. In the event of fault or for [Pers] = 0, the output value begins at 0.
The value of property 'Measured time' must be available on the associated BACnet object as an extension property ('Extension by persistence' = 'Stopwatch')