MOD
The IEC operator is used for modulo division.
The result of the function is the integer remainder of the division.
Permitted data types: BYTE, WORD, DWORD, LWORD, SINT, USINT, INT, UINT, DINT, UDINT, LINT, ULINT
In TwinCAT, division by zero always leads to an exception and the corresponding task is stopped. |
Samples:
Result: nVar is 1.
ST:
nVar := 9 MOD 2;
FBD: