Operator ‘DIV’¶
This IEC operator is used for dividing variables.
Permitted data types: BYTE, WORD, DWORD, LWORD, SINT, USINT, INT, UINT, DINT, UDINT, LINT, ULINT, REAL, LREAL, TIME
Attention
Division by zero may have different results depending on the target system.
Examples
ST:
var1 := 8/2;
FBD:
1. Series of DIV blocks, 2. Single DIV block, 3. DIV blocks with EN/ENO parameters
Note
Please note that it is possible to monitor division by zero at runtime by using the implicit monitoring functions CheckDivInt, CheckDivLint, CheckDivReal, and CheckDivLReal.
See also