Skip to content

clock-timer

Description

The clock-timer block is used to determine whether the current time of day falls within the configured time interval. It operates according to the device's local time and does not require any inputs.

The block has two configuration parameters: the start time and the end time. When the current time falls within the configured interval, the block is active. When the current time is outside this interval, the block is inactive.

The interval can operate in two ways:

  • if the start time is earlier than the end time, the block is active between these times on the same day, for example from 08:00 to 16:30
  • if the start time is later than the end time, the active period crosses midnight, for example from 22:00 to 06:00

The start time is included in the active period, while the end time is not. In practice, the state changes a few seconds after the configured minute is reached.

The description visible below the block shows the current state and the time of the next change, for example active until 16:30 or inactive until 08:00.

Configuration parameters

Parameter name Value
Start time (startHour) Required time in the HH:MM format. It defines the beginning of the active period. The allowed range is from 00:00 to 23:59.
End time (endHour) Required time in the HH:MM format. It defines the end of the active period. The allowed range is from 00:00 to 23:59.

Both times must be different. Setting the same value for the start and end time causes a configuration error.

Input handling

The clock-timer block has no inputs and does not react to signals from other blocks.

Block outputs

Output number and name Output description
1. Activity output. Returns the value true when the current time falls within the configured active interval. Outside this interval, it returns false.
2. Inactivity output. Returns the opposite value of output no. 1, that is true when the block is outside the active interval, and false when the block is active.

Both outputs are of the logical type and change simultaneously when the block state changes.

Errors visible to the user

The block can display the following error messages:

Error code Error description
Invalid start time configuration. The startHour parameter has an invalid value. A time in the HH:MM format must be provided, in the range from 00:00 to 23:59.
Invalid end time configuration. The endHour parameter has an invalid value. A time in the HH:MM format must be provided, in the range from 00:00 to 23:59.
Start time equals end time. The start time and end time are identical. For the block to work correctly, both values must be different.

Examples

  • For startHour = 08:00 and endHour = 16:30, output no. 1 is active from 08:00 to 16:30, and then changes to false a few seconds after 16:30.
  • For startHour = 22:00 and endHour = 06:00, output no. 1 is active in the evening and at night, and changes to false a few seconds after 06:00.
  • For startHour = 00:00 and endHour = 00:01, the block is active only during the first minute of each day and switches off a few seconds after 00:01.