If an overflow occurs as a result of the instruction, the system variable (bit) #L_CalcCarry turns on.
When the execution result is 0, the system variable #L_CalcZero turns ON.
When checking the result using system variables, make sure the check takes place after the instruction has been executed. When checking the state after multiple instructions have been executed, system variables will store the result only of the last processed instruction.
Program Example
INC
Every time the INC instruction turns on, 1 is added.
The INC instruction is executed when the positive transition instruction turns ON. When the INC instruction is executed, 1 is added to the result data (integer variable) in D1.
When using a normally open instruction, as long as the instruction is passing power, the INC instruction continually executes adding 1 at each scan.
INCP
When the normally open instruction turns ON, the INCP instruction will be executed. When the INCP instruction is executed, 1 is added to the result data (integer variable) in D1.
Even when using a normally open instruction, the INCP instruction executes only when it detects an upward transition.
Therefore, even when the operation is continuously ON, the INCP instruction executes for only one scan and 1 is added to the result data (integer variable).