ADD_LTIME

Returns the sum of 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 ─┤           │
     │ ADD_LTIME ├─ OUT
IN2 ─┤           │
     └───────────┘
FUNCTION ADD_LTIME : LTIME
  VAR_INPUT
    IN1 : LTIME;
    IN2 : LTIME;
  END_VAR
END_FUNCTION

The return type is LTIME.

Inputs

Name

Type

Description

IN1

LTIME

The first duration.

IN2

LTIME

The second duration.

Outputs

Name

Type

Description

Return value

LTIME

The sum of IN1 and IN2.

Description

Returns the sum of two LTIME durations IN1 and IN2, in 64-bit milliseconds.

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

Example

result := ADD_LTIME(LTIME#30d, LTIME#30d);   (* result = LTIME#60d *)

See Also

References

  • IEC 61131-3 Edition 3, Table 30