← Math and Comparison

Modulo

easy

Outputs the remainder of dividing the dividend by the divisor.

What it teaches

The remainder left after integer division: 7 MOD 3 is 1. Its everyday job is wrapping — a cyclic buffer index, an every-Nth-part trigger, an encoder count folded back into one revolution. Two gotchas: the remainder follows the sign of the dividend, so -7 MOD 3 is -1 where school maths says 2; and DINT modulo by zero returns 0 instead of faulting.

Parameters

TagDirectionTypeDefaultDescription
In_DividendInputDINT7Value being divided
In_DivisorInputDINT3Value to divide by
Out_RemainderOutputDINT0Remainder of the division

Required behavior