31.10.1.5 Confirming Execution Results - ADD/ADDP

Program Example

ADD

Adds one constant to another and stores the result in the integer variable.

  1. The AND instruction is executed when the positive transition instruction turns ON. When the ADD instruction is executed, the result value of 40, obtained from 25 + 15 = 40, is stored in D1.
    When the operation is a normally open instruction, as long as the variable is ON, the ADD instruction is always executed.

ADDP

  1. When the normally open instruction turns ON, the ADDP instruction will be executed. When the ADDP instruction is executed, the result value of 40, obtained from 25 + 15 = 40, is stored in D1. 
    Even when using a normally open instruction, the ADDP instruction executes only when it detects the upward transition.
    Therefore, even when the variable of the normally open instruction is always ON, the ADDP instruction is executed only for one scan.