DIV_TIME

Divides a time duration by a numeric value.

Signature

     ┌─────────┐
IN1 ─┤         │
     │DIV_TIME ├─ OUT
IN2 ─┤         │
     └─────────┘
FUNCTION DIV_TIME : TIME
  VAR_INPUT
    IN1 : TIME;
    IN2 : ANY_NUM;
  END_VAR
END_FUNCTION

The return type is TIME. IN2 may be any numeric type.

Inputs

Name

Type

Description

IN1

TIME

The duration to divide.

IN2

ANY_NUM

The numeric divisor. Must be non-zero.

Outputs

Name

Type

Description

Return value

TIME

IN1 divided by IN2.

Description

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

Example

result := DIV_TIME(T#6s, 3);        (* result = T#2s *)

See Also

References