HvacRuntimeCounter (FB)

FUNCTION_BLOCK HvacRuntimeCounter EXTENDS AbbLConC3

HvacRuntimeCounter is a device interface which can be controlled by an input DevOnAuto and an input DevOnManual. DevOnAuto or DevOnManual high turns the device output on. A Reset input is used to reset the runtime counters. When the device was not active for a time RunEvery, the FB turns on the device automatically for MinOnTime. Two setup variables MinOnTime and MinOffTime guarantee a minimum runtime and offtime of the device. If both DevOnAuto and DevOnManual inputs are FALSE, the offtime of the device is determined by RuntimeEvery input.

Let us understand the simple working of the block through the below scenario. Suppose MinOffTime = 7s, MinOnTime = 5s and RunEvery =20s then,

  • When DevOnAuto is high, after MinOfftime 7s the DevOn becomes TRUE.

  • After DevOnAuto is low, DevOn turns off / becomes low after MinOnTime 5s.

  • When DevOnManual is high, the DevOn turns on immediately regardless of MinOfftime and MinOntime.

  • When DevOnManual is low, th DevOn turns off immediately regardless of MinOfftime and MinOntime

  • If the DevOnAuto or DevOnManual is low for RunEvery time 20s, then the DevOn stays low for 20s, then turns high for MinOnTime 5s, and the cycle continues.

InOut:

Scope

Name

Type

Initial

Comment

Input

DevOnAuto

BOOL

FALSE

1: The device can be turned on automatically with DevOnAuto

DevOnManual

BOOL

FALSE

2: The device can be turned on manually with DevOnManual

Reset

BOOL

FALSE

3: Reset input is used to reset the runtime counters

Input Const

MinOnTime

TIME

TIME#10s0ms

1: Set a minimum ON time

MinOffTime

TIME

TIME#10s0ms

2: Set a minimum OFF time

RunEvery

TIME

TIME#10000m0s0ms

3: Set a RunEvery time for device to turn on automatically, (Doesnot work with DevOnAuto and DevOnManual inputs being high)

Inout

Runtime

UDINT

1: Counts the device operating hours

Cycles

UDINT

2: Number of switching cycles

Output

ErrorID

ERROR_ID

1: Error ID of Error

DevOn

BOOL

FALSE

2: Flag of device on signal