Mitsubishi MELSEC-Q/L Programming Manual page 574

Table of Contents

Advertisement

DATERD, DATERDP
7.15
Clock instructions
7.15.1
DATERD, DATERDP
Reading clock data
7.15.1
DATERD, DATERDP
DATERD
DATERDP
: Head number of the devices where the read clock data will be stored (BIN 16 bits)
D
Setting
Internal Devices
Data
Bit
Word
––
D
Function
(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
(2) The "year" at
is stored as 4-digit year indication.
D
(3) The "day of week" at
D
Day of week
Sun Mon
Stored data
0
1
(4) Compensation is made automatically for leap years.
Operation Error
(1) In the following case, an operation error occurs, the error flag (SM0) turns ON, and an error code is stored into SD0.
Error
code
The range of the device specified by
4101
corresponding device.
Program Example
(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
572
Command
Command
J
R, ZR
Bit
or later device.
D
Clock element
+6 is stored as 0 to 6 to represent the days Sunday to Saturday.
Tue
Wed Thu
Fri
Sat
2
3
4
5
Error details
exceeds the range of the
D
High
Basic
performance
\
U
\G
Word
––
D
Year
(1980 to 2079)
Month
D
+1
(1 to 12)
D
+2
Day
(1 to 31)
Hour (24-hour clock)
D
+3
(0 to 23)
Minute
D
+4
(0 to 59)
Second
D
+5
(0 to 59)
Day of week
D
+6
(0 to 6)
6
Q00J/
Q00/
QnH
Q01
––
––
Process
LCPU
Redundant Universal
DATERD
D
DATERDP
D
Zn
Constants
QnPH QnPRH
QnU
––
––
Other
LCPU

Advertisement

Table of Contents
loading

Table of Contents