Returns the result of an interval subtracted from a time of day.
Informal Syntax:
Formal Syntax:
SUB_TOD_TIME( In1:=expression, In2:=expression )
| Parameter | Type | Description |
|---|---|---|
| In1 | TIME_OF_DAY | The time of day value. |
| In2 | TIME | The interval to subtract from the time of day value. |
In2 can be any interval value, positive or negative.
The function SUB_TOD_TIME returns a TIME_OF_DAY value, the result of In1 - In2.
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 to 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 |
|---|---|
| SUB_TOD_TIME( TOD#12:00:00.000, T#4h30m ) | TIME_OF_DAY#17:30:00.000 |
| SUB_TOD_TIME( TOD#12:30:00.000, T#20h ) | TIME_OF_DAY#:16:30:00.000 |
| SUB_TOD_TIME( TOD#12:30:00.000, T#-20h ) | TIME_OF_DAY#:08:30:00.000 |
IEC 61131-3 Second Edition: Table 30.6b.
IEC 61131-3 Third Edition: Table 35.6b.
For other date and time functions.
For the meaning of terms used in Fernhill SCADA.