[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.

Functioning

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.

info

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:

Pins

Input

Description

Data type

Default value
Value range

EnFnct

Enable function

Enables the function.

Boolean

1

0 - The function is disabled.
1 - The function is enabled.

Stt

Start

Boolean

0

0 - No
1 - Yes

Stp

Stop

Boolean

0

0 - No
1 - Yes

Pers

Persistent

Boolean

0

0 - No
1 - Yes: the values are stored persistently.

BaObjRef

BA-Object reference
Link between function block and BACnet object.

Structure

---

BaObjRef
> DeviceID

Device identifier
[DeviceID] includes object type and object instance in one ID.
Identifies the device object: local or remote. A local device object can also be identified by value 16#3FFFFF.

Double Word

16#3FFFFF

BaObjRef
> ObjectID

Object identifier
[ObjectID] includes object type and object instance in one ID.
Identifies the object on a device.

Double Word

16#3FFFFF

BaObjRef
> ItemID

Item identifier
[ItemID] represents an index in a view node object that references the BACnet object.
[ObjectID] and [ItemID] together define an indirect reference to the BACnet object.
Value -1 indicates a direct interface.

Integer

-1

 

Output

Description

Data type

Default value
Value range

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.
[Dstb] = 0, if:
BACnet object access = Access successful
[Dstb] = 1, if:
BACnet object access = Error during access

Boolean

0

ErrCode

Error code indication

Integer

0: No error

= 0 - No error
> 0 - Error codes

Application

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).

Process response

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')