-

DIV / DIV_S

Type Function

Available as standard (non-safety-related) and safety-related type (*_S). For the safety-related type, the safety-related data types (SAFE*) are expected at the formal parameters.
Description Divides the operand connected to IN1 by the operand connected to IN2.

Note
This function is not extendable, no further inputs can be added.

Notes
  • Division of a TIME value by a larger data type (type casting): Before the division operation is performed, the larger data type (e.g., LINT, ULINT, LREAL) connected to IN2 is temporarily converted (casted) to the smaller TIME data type.
  • A division by zero leads to a runtime exception which results in calling an Event Handler and a controller stop.

    This applies only if the ENO output is not connected. For the EN/ENO behavior of the function in case of a division by zero, see the description below.

  • The result of the division is always rounded downwards. For example, 90/7 returns 12 not 13.
  • Overloaded function. The function can operate on various input data types.
  • The function provides implicit data type conversion at its input and output parameters according to the rules defined by the IEC 61131 standard.
Parameters Inputs

IN1

IN2

Output

Out
Error behaviorError behavior
Additional information EN/ENO behavior