9 Application Instructions API 150-199 API 162 Operands: S 1 : Time summand S 2 : Time addend D : Time sum Explanations: 1. S 1 , S 2 , and D will occupy 3 consecutive devices. 2. See the specifications of each model for their range of use. 3. Flags: M1020 (zero flag); M1022 (carry flag) 4. S 1 + S 2 = D . The hour, minute, and second of the RTC designated in S 1 plus the hour, minute, and second designated in S 2 . The result is stored in the hour, minute, and second of the register designated in D . 5. If S 1 and S 2 exceed their ranges, the program will regard this as an operation error and the instruction will not be executed.
M1067 and M1068 will be On and D1067 record the error code 0E1A (hex). 6. If the sum is larger than 24 hours, the carry flag M1022 will be On and the value in D will be the result of “sum minuses 24 hours”. 7. If the sum equals 0 (00:00:00), the zero flag M1020 will be On. Program Example: 1. When X10= On, TADD instruction will be executed and the hour, minute and second in RTC designated in D0 ~ D2 will plus the hour, minute and second in RTC designated in D10 ~ D12. The sum is stored in the hour, minute and second of the register designated in D20 ~ D22. X10 26 50 10 8 6 40 6 14 08:10:20 06:40:06 14:50:26 20 2. If the sum is larger than 24 hours, M1022 will be On.
X10 D20 18 38 10 40 11 30 8 6 18:40:30 11:30:08 06:10:38 30 DVP-PLC Application Manual 9-70 Mnemonic Operands Function TADD P Time Addition Type OP Bit Devices Word Devices Program Steps X Y M S K H KnX KnY KnM KnS T C D E F TADD, TADDP: 7 steps S 1 * * * S 2 * * * D * * * PULSE 16-bit 32-bit ES EH3 SV2 ES EX SS EH3 ES EX SS SA SX SC EH SV EH3 SV2 EX SS SA SX SC EH SV SA SX SC EH SV SV2 TADD D0 D10 D20 TADD D0 D10