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 interval is defined by the “Start hour” and “End hour” settings. 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 “Start hour” is earlier than “End hour”, the block is active between these times on the same day, for example from
08:00to16:30 - if “Start hour” is later than “End hour”, the active period crosses midnight, for example from
22:00to06:00
“Start hour” is included in the active period, while “End hour” 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 |
|---|---|
Name (name) |
Name displayed on the block in the editor. If left empty, clock-timer is displayed. |
Start hour (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 hour (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. |
“Start hour” and “End hour” must be different. Setting the same value for both 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. |
“Start hour” 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. |
“End hour” 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. |
“Start hour” and “End hour” are identical. For the block to work correctly, both values must be different. |
Examples
- With “Start hour” set to
08:00and “End hour” to16:30, output no. 1 is active from08:00to16:30, and then changes to false a few seconds after16:30. - With “Start hour” set to
22:00and “End hour” to06:00, output no. 1 is active in the evening and at night, and changes to false a few seconds after06:00. - With “Start hour” set to
00:00and “End hour” to00:01, the block is active only during the first minute of each day and switches off a few seconds after00:01.