SUB_LTOD_LTOD¶
Returns the difference between two long times-of-day as a duration.
Note
This feature requires IEC 61131-3 Edition 3. Use
--dialect iec61131-3-ed3 to enable it. See
Enabling Dialects and Features for details.
Signature¶
┌───────────────┐
IN1 ─┤ │
│ SUB_LTOD_LTOD ├─ OUT
IN2 ─┤ │
└───────────────┘
FUNCTION SUB_LTOD_LTOD : LTIME
VAR_INPUT
IN1 : LTIME_OF_DAY;
IN2 : LTIME_OF_DAY;
END_VAR
END_FUNCTION
The return type is LTIME.
Inputs
Name |
Type |
Description |
|---|---|---|
|
|
The minuend time-of-day. |
|
|
The subtrahend time-of-day. |
Outputs
Name |
Type |
Description |
|---|---|---|
Return value |
|
IN1 minus IN2 as a duration. |
Description¶
Returns the difference IN1 minus IN2 as an LTIME duration. Both
inputs and the result are in milliseconds.
The short form is SUB_TOD_TOD. An operand of the
short type (TIME_OF_DAY where LTIME_OF_DAY is expected) is
accepted and widened to 64 bits.
Example¶
result := SUB_LTOD_LTOD(LTOD#10:00:00, LTOD#08:30:00); (* result = LTIME#1h30m *)
See Also¶
SUB_TOD_TOD — the short form
ADD_LTOD_LTIME — add a duration to a long time-of-day
SUB_LTOD_LTIME — subtract a duration from a long time-of-day
References¶
IEC 61131-3 Edition 3, Table 30