IEC operator for the modulo division of one variable by another one.
Allowed types:
oBYTE
oWORD
oDWORD
oLWORD
oSINT
oUSINT
oINT
oUINT
oDINT
oUDINT
oLINT
oULINT
The result of this function is the integer remainder of the division.
Different target systems may behave differently concerning a division by zero error. It can lead to a controller HALT, or may go undetected.
|
UNINTENDED EQUIPMENT OPERATION |
Use the check functions described in this document, or write your own checks to avoid division by zero in the programming code. |
Failure to follow these instructions can result in death, serious injury, or equipment damage. |
NOTE: For more information about the implicit check functions, refer to the chapter POUs for Implicit Checks.
Result in Var1 is 1.
LD 9
MOD 2
ST Var1
var1 := 9 MOD 2;