SUB_LTOD_LTIME

Subtracts a long duration from a long time-of-day.

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_LTIME ├─ OUT
IN2 ─┤                │
     └────────────────┘
FUNCTION SUB_LTOD_LTIME : LTIME_OF_DAY
  VAR_INPUT
    IN1 : LTIME_OF_DAY;
    IN2 : LTIME;
  END_VAR
END_FUNCTION

The return type is LTIME_OF_DAY.

Inputs

Name

Type

Description

IN1

LTIME_OF_DAY

The time-of-day to offset.

IN2

LTIME

The duration to subtract.

Outputs

Name

Type

Description

Return value

LTIME_OF_DAY

IN1 minus IN2.

Description

Returns a new LTIME_OF_DAY that is IN1 moved back by the duration IN2. Both values are in milliseconds.

The short form is SUB_TOD_TIME. An operand of the short type (TIME_OF_DAY and TIME where LTIME_OF_DAY and LTIME is expected) is accepted and widened to 64 bits.

Example

result := SUB_LTOD_LTIME(LTOD#10:00:00, LTIME#30m);   (* result = LTOD#09:30:00 *)

See Also

References

  • IEC 61131-3 Edition 3, Table 30