If the result exceeds 00:00:00 (hours, minutes, seconds) after the instruction, digits will overflow. The #L_CalcCarry for the system variable (bit) turns on.
If the operation result is 00:00' 00", 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
JADD
When the positive transition instruction is turned ON, time addition will be performed.
When the positive transition instruction turns ON, the JADD instruction will be executed. When the JADD instruction is executed, Data_1 (time variable) in operand S1 is added to Data_2 (time variable) in operand S2, and the result of the addition is stored in operand D1. When using a normally open instruction, as long as the instruction is passing power, the JADD instruction continually executes at each scan, performing the time add operation.
Example
For example, when Data_1 in operand S1 is 12:10:45, and Data_2 in operand S2 is 6:55:20, if a JADD instruction is executed, the result is 19:06:05, and 19:06:05 is stored in the result data in operand D1.
JADDP
When the normally open instruction turns ON, the JADDP instruction will be executed. When the JADDP instruction is executed, Data_1 (time variable) in operand S1 is added to Data_2 (time variable) in operand S2, and the result of the addition is stored in operand D1. Even when using a normally open instruction, the JADDP instruction executes only when it detects an upward transition.
Therefore, even when the variable of the NO instruction is always ON, the JADDP instruction is executed only for one scan.