Date and time instructions
294
Part II IEC Instructions
IS_VALID_TOD_INT
Check whether the TIME_OF_DAY is valid
To add an enable input and enable output to the instruction, select [With EN/ENO] from the
"Instructions" pane (LD, FBD or IL editor). To reuse an instruction select "Recently used" from the
context menu or press <Ctrl>+<Shift>+<v> in the programming window.
PLC types Availability of IS_VALID_TOD_INT (see page 1328)
Data type I/O Function
INT
1st input
2nd input
3rd input
4th input
hour
minute
second
millisecond
BOOL output set to TRUE if the resulting time of day value is valid
VALID := IS_VALID_TOD_INT(HOUR := HOUR_value,
MINUTE := MINUTE_value,
SECOND := SECOND_value,
MILLISECOND := MILLISECOND_value);
Description
IS_VALID_TOD_INT checks whether the combination of INT values for hour, minute, second, and
millisecond is a valid time of day value. The Boolean output flag is set if the time of day value is
valid.
Data types
Example
In this example the function has been programmed in ladder diagram (LD) and structured text (ST).
POU header
All input and output variables used for programming this function have been declared in the POU
header.
LD
ST
When programming with structured text, enter the following: