Explanation Of Real-Time Clock Instructions - Delta AH500 Programming Manual

Hide thumbs Also See for AH500:
Table of Contents

Advertisement

6.17.2 Explanation of Real-time Clock Instructions

API
Instruction code
1600
TRD
Device
X
Y
M
D
Symbol:
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.
Special data
Item
register
SR391
Year (A.D.)
SR392
Month
SR393
Day
SR394
Hour
SR395
Minute
SR396
Second
SR397
Week
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.
When SM220 is ON, the real-time clock is calibrated within ±30 seconds. If the value of the
2.
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
Operand
P
D
S
T
C
HC
D
Pulse instruction 16-bit instruction (3 steps) 32-bit instruction
AH500
Device in which the result is
D :
stored
General data
Value
00~99
1~12
1~31
0~23
0~59
0~59
1~7
C ha pt er 6 A p pl i e d In s tr uc t io ns
L
SM SR
E
PR
AH500
Word
Item
register
D0
Year (A.D.)
D1
Month
D2
Day
D3
Hour
D4
Minute
D5
Second
D6
Week
Function
Reading the time
K
16# "$"
DF
-
6 - 3 6 3

Advertisement

Table of Contents
loading

Table of Contents