31.10.5.5 Confirming Execution Results - MOD/MODP

Program Example

MOD

Performs modules operation on two constants and stores the result in the integer variable.

  1. When the positive transition instruction turns ON, the MOD instruction will be executed. When the MOD instruction is executed, the result value of 10, obtained from 25/15 = 1 (remainder 10), is stored in D1.
    When using a normally open instruction, as long as the operation is ON, the MOD instruction is always executed.

MODP

  1. When the normally open instruction turns ON, the MODP instruction is executed. When the MODP instruction is executed, the result value of 10, obtained from 25/15 = 1 (remainder 10), is stored in D1.
    Even when using a normally open instruction, the MODP instruction executes only when it detects the upward transition.
    Therefore, even when the NO instruction is always ON, the MODP instruction is executed only for one scan.