Operator ‘MOD’¶
This IEC operator is used for modulo division.
The result of the function is the integer remainder of division.
Permitted data types: BYTE
, WORD
, DWORD
, LWORD
, SINT
, USINT
, INT
, UINT
, DINT
, UDINT
, LINT
, ULINT
Attention
Division by zero may have different results depending on the target system.
Examples
Result in Var1: 1
ST:
var1 := 9 MOD 2;
FBD: