DIV_LTIME

Divides a long duration by a number.

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

The return type is LTIME.

Inputs

Name

Type

Description

IN1

LTIME

The duration to divide.

IN2

ANY_NUM

The numeric divisor.

Outputs

Name

Type

Description

Return value

LTIME

IN1 divided by IN2.

Description

Returns IN1 divided by the numeric value IN2. The result is an LTIME value. When IN2 is a floating-point type (REAL or LREAL), the quotient is computed as LREAL and truncated to whole milliseconds.

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

Example

result := DIV_LTIME(LTIME#2h, 3);   (* result = LTIME#40m *)

See Also

References

  • IEC 61131-3 Edition 3, Table 30