572
DATERD, DATERDP
7.15
Clock instructions
: Head number of the devices where the read clock data will be stored (BIN 16 bits)
F
unct
i
on
(1) Reads "year, month, day, hour, minute, second, and day of week" from the clock element of the CPU module and stores
it as BIN value to the device designated by or later device.
(2) The "year" at is stored as 4-digit year indication.
(3) The "day of week" at +6 is stored as 0 to 6 to represent the days Sunday to Saturday.
(4) Compensation is made automatically for leap years.
Operat
i
on
E
rror
(1) In the following case, an operation error occurs, the error flag (SM0) turns ON, and an error code is stored into SD0.
Program
E
xamp
l
e
(1) The following program outputs the following clock data as BCD values:
Year ..................Y70 to Y7F
Month................Y68 to Y6F
Day ...................Y60 to Y67
Hour..................Y58 to Y5F
Minute...............Y50 to Y57
Second .............Y48 to Y4F
Week ................Y44 to Y47
DATERD, DATERDP
Reading clock data
7.15.1
DATERD, DATERDP
Setting
Data
Internal Devices
R, ZR
J \
U \G
Zn
Constants
Other
Bit
Word
Bit
Word
––
––
Day of week
Sun Mon Tue Wed Thu
Fri
Sat
Stored data
0
1
2
3
4
5
6
Error
code
Error details
Q00J/
Q00/
Q01
QnH
QnPH QnPRH
QnU
LCPU
4101
The range of the device specified by exceeds the range of the
corresponding device.
––
––
––
––
Basic
Process
High
performance
Redundant Universal
LCPU
DATERD
DATERDP
Command
Command
DA
TE
RD
DA
TE
RDP
D
D
D
D
D
Year
Month
Day
+1
+2
(1980 to 2079)
(1 to 12)
(1 to 31)
+3
(0 to 23)
+4
(0 to 59)
+5
(0 to 59)
+6
(0 to 6)
Hour (24-hour clock)
Minute
Second
Day of
w
eek
Clock element
D
D
D
D
D
D
D
D
D
D