Chapter 6 Applied Instructions
6-363
6.17.2 Explanation of Real-time Clock Instructions
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
Pulse instruction 16-bit instruction (3 steps)
32-bit instruction
Symbol:
D
:
Device in which the result is
stored
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 last two digits of the year number for A.D. are stored in SR391.
Example:
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.
Item Value
Item
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