MODΒΆ

The IEC Operators and additional, norm-extending \ functions Modulo Division of one variable by another of the types: BYTE, WORD, DWORD, SINT, USINT, INT, UINT, DINT, UDINT. The result of this function will be the remainder of the division. This result will be a whole number.

Example in IL:

LD 9
MOD 2
ST Var1 (* Result is 1 *)

Example in ST:

var1 := 9 MOD 2;

Example in FBD:

../_images/c8fa09d364a66b980a317d31114f82f9