SUB_LTIME

Returns the difference between two long durations.

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

The return type is LTIME.

Inputs

Name

Type

Description

IN1

LTIME

The duration to subtract from.

IN2

LTIME

The duration to subtract.

Outputs

Name

Type

Description

Return value

LTIME

IN1 minus IN2.

Description

Returns IN1 minus IN2, both LTIME durations, in 64-bit milliseconds.

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

Example

result := SUB_LTIME(LTIME#2h, LTIME#30m);   (* result = LTIME#1h30m *)

See Also

References

  • IEC 61131-3 Edition 3, Table 30