Returns the difference between two time of day values as an interval.
Informal Syntax:
Formal Syntax:
SUB_TOD_TOD( In1:=expression, In2:=expression )
| Parameter | Type | Description |
|---|---|---|
| In1 | TIME_OF_DAY | The first time of day value. |
| In2 | TIME_OF_DAY | The second time of day value to subtract from the first. |
The function SUB_TOD_TOD returns an interval, the result of In1 - In2.
If In2 is greater than In1, the returned interval will be negative. The return value will always be in the range: T#-23h59m59s999ms to T#-23h59m59s999ms.
| Example | Return Value |
|---|---|
| SUB_TOD_TOD( TOD#12:00:00.000, TOD#13:25:00.000 ) | T#-1h25m |
| SUB_TOD_TOD( TOD#12:00:00.000, TOD#11:40:00.000 ) | T#20m |
| SUB_TOD_TOD( TOD#12:00:00.000, TOD#12:00:00.000 ) | T#0 |
IEC 61131-3 Second Edition: Table 30.7b.
IEC 61131-3 Third Edition: Table 35.7b.
For other date and time functions.
For the meaning of terms used in Fernhill SCADA.