6
- 20
6.5 Clock Function
6
FUNCTIONS
(b) Reading Time Data
When the time data is read to the data register, use either of the following
instructions in the program.
• Time data read instruction (DATERD)
• Expanded time data read instruction (S(P).DATERD)
The figure below shows an example of a program used to read the clock data with
the DATERD instruction and then store it in D10 to D16.
* 1 : Figure 6.14 shows the clock data stored in D10 to 16.
Refer to the following manual for details of the DATERD instruction and
S(P).DATERD instruction.
Q QCPU (Q Mode)/QnACPU Programming Manual (Common Instructions)
POINT
Time Data can be written to and read from by special relays (SM210 to SM213)
and special registers (SD210 to SD213).
Refer to Appendix 1 for details on special relay. Refer to Appendix 2 for details on
special registers.
Figure 6.13 Program that stores clock data
Figure 6.14 Clock data stored
Read request
X1
DATERD
D10
The time data is read and
then stored in D10 to 16. *
1
D10
D11
D12
D13
D14
D15
D16
2004
4
1
11
35
24
2
4 digits in AD
Month
Date
Hour
Minute
Second
Day of the week
(