Delta AH500 — 6.17.2 Explanation of Real-time Clock Instructions

AH500 Programming Manual 6.17.2 Explanation of Real-time Clock Instructions Symbol: D : Device in which the result Word Explanation: 1. D : The device in which the current time is stored 2. The operand D occupies seven consecutive devices. 3. The built-in real-time clock in the CPU module provides the data relating to the year, the week, the moth, the day, the minute, and the second. The data is stored in SR391~SR397. The instruction TRD is used to read the current time into the seven registers. 4. The first two digits of the year number for A.D. from the right are stored in SR391. When M0 is ON, the current time is read from the real-time clock into D0~D6.

The value 1 in SR397 represents Monday, the value 2 represents Tuesday, and by analogy, the value 7 represents Sunday. Example: Additional remark: 1. If D +6 exceeds the device range, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#2003. 2. When SM220 is ON, the real-time clock is calibrated within ± 30 seconds. If the value of the second in the real-time clock is within the range between 0 and 29, the value of the second is cleared to zero.

If the value of the second in the real-time clock is within the range between 30 6-364 API Instruction code Operand Function 1600 TRD P D Reading the time Device X Y M S T C HC D L SM SR E PR K 16# “$” DF D          Pulse instruction 16-bit instruction (3 steps) 32-bit instruction AH500 AH500 - Special data General data Item Value Item register register SR391 Year (A.D.) 00~99 D0 Year (A.D.) SR392 Month 1~12 D1 Month SR393 Day 1~31 D2 Day SR394 Hour 0~23 D3 Hour SR395 Minute 0~59 D4 Minute SR396 Second 0~59 D5 Second SR397 Week 1~7 D6 Week