DVP-ES2/EX2/SS2/SA2/SX2/SE&TP Operation Manual - Programming Operands: S 1 : Lower bound of the time for comparison (occupies 3 consecutive devices) S 2 : Upper bound of the time for comparison (occupies 3 consecutive devices) S : Current time of RTC (occupies 3 consecutive devices) D : Comparison result (occupies 3 consecutive devices) Explanations: 1. TZCP instruction compares current RTC time in S with the range set in S 1 ~ S 2 and the comparison result is stored in D . 2. S 1 , S 1 +1, S 1 +2: The “hour”, “minute” and “second” of the lower bound value for comparison. 3. S 2 , S 2 +1, S 2 +2: The “hour”, “minute” and “second” of the upper bound value for comparison. 4. S , S +1, S +2:
The “hour”, “minute” and “second” of the current time of RTC. 5. Usually the time of RTC in S is read by TRD instruction first then compared by TZMP instruction. If operand S , S 1 , S 2 exceed the available range, operation error occurs and M1067 = ON, M1068 = ON. D1067 stores the error code 0E1A (HEX). 6. If S S 1 and S S 2 , D is ON. When S > S 1 and S > S 2 , D +2 is ON. For other conditions, D + 1 will be ON. (Lower bound S 1 should be less than upper bound S 2 .) Program Example: When X0 = ON, TZCP instruction executes and M10~M12 will be ON to indicate the comparison results. When X0 = OFF, the instruction is disabled but the ON/OFF status of M10~M12 remains.
X0 M10 M10 ON when D0 Hour D1 Minute D10 Hour D11 Minute D2 Second D12 Second M11 ON when D0 Hour D10 Hour D20 Hour D1 Minute D11 Minute D21 Minute D2 Second D12 Second D22 Second M12 ON when D10 Hour D11 Minute D20 Hour D21 Minute D12 Second D22 Second 3-414 API Mnemonic Operands Function Controllers 161 TZCP P Time zone compare ES2/EX2 SS2 SA2 SX2 SE Typ e OP Bit Devices Word devices Program Steps X Y M S K H KnX KnY KnM KnS T C D E F TZCP, TZCPP: 9 steps S 1 * * * S 2 * * * S * * * D * * * 16-bit 32-bit SA2 SA2 SA2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE TZCP D0 D20 D10