Chapter 5 CPU Module
5-
32
3) Read / write RTC data
a) Read RTC data
The current RTC data
Description
Memory Area (Word)
Upper byte
Lower byte
Data
(BCD format)
F053
Lower 2 digits of year
Month
h9812
F054 Day
Hour
h2219
F055 Minute
Second
h3746
F056
Higher 2 digits of year
Date
h1902
Example : 1998. 12. 22. 19:37:46, Tuesday
b) Write RTC data
There is two ways to write new RTC data to the CPU.
The first one is using a handy loader (KLD-150S) or graphic loader (KGL-WIN). For detailed information, refer the
user’s manual of KLD-150S or KGL-WIN.
The second one is write sequence program. By switching a special bit on, user can replace the current RTC data
with the preset data stored in a specified memory area. The followings are the memory address of preset data and
an example program.
4) The preset RTC data
Description
Memory Area (Word)
Upper byte
Lower byte
Data
(BCD format)
D4990
Lower 2 digits of year
Month
h9901
D4991 Day
Hour h1711
D4992 Minute
Second h5324
D4993
Higher 2 digits of year
Date
h1900
Example : 1999. 1. 17. 11:53:24, Sunday
M1904 : RTC data change bit
When the M1904 bit is switched on, the new data in D4990 ~ D4993 (K1000S : D9990 ~ D9993) will be moved to F53 ~ F56.
After data is moved, M1904 has to be switched off immediately because current data will be updated every scan while M1904
is on.
<Example
program>
[ MOV h9901 D4990 ]
[ MOV h1711 D4991 ]
[ MOV h5324 D4992 ]
[ MOV h1900 D4993 ]
[ D M1904 ]
Start switch
P000
Other Program
:1999 January
:17th 11 o’clock
:53min 24sec
:1999, Sunday
:Changing enable