Returns the sum of a time of day and an interval.
Informal Syntax:
Formal Syntax:
ADD_TOD_TIME( In1:=expression, In2:=expression )
| Parameter | Type | Description |
|---|---|---|
| In1 | TIME_OF_DAY | The time of day value. |
| In2 | TIME | The interval to add to the time of day value. |
The function ADD_TOD_TIME returns a TIME_OF_DAY value, the result of adding In2 to In1.
In2 can be any interval value, positive or negative. The In1 parameter, and the return value are TIME_OF_DAY values, and have a valid range of 00:00:00.000 to 23:59:59.000. If the result is more than 23:59:59.999, a multiple of 24 hours is subtracted to bring the value back into range. If the result is less than 00:00:00.000, a multiple of 24 hours is added to bring the value back into range.
| Example | Return Value |
|---|---|
| ADD_TOD_TIME( TOD#12:00:00.000, T#4h30m) | TIME_OF_DAY#16:30:00.000 |
| ADD_TOD_TIME( TOD#12:30:00.000, T#20h) | TIME_OF_DAY#:08:30:00.000 |
| ADD_TOD_TIME( TOD#12:30:00.000, T#-20h) | TIME_OF_DAY#:16:30:00.000 |
IEC 61131-3 Second Edition: Table 30.2b.
IEC 61131-3 Third Edition: Table 35.2b.
For other date and time functions.
For the meaning of terms used in Fernhill SCADA.