6
FUNCTIONS
6.5 Clock Function
6
- 19
1
O
verv
iew
2
Per
fo
rma
nce
S
p
ecifica
tio
n
3
S
equ
en
ce P
ro
g
ra
m
Co
nfig
ura
tio
n a
nd
E
xecut
io
n Co
nd
iti
o
ns
4
I/O N
unb
er
Assig
n
m
e
nt
5
Me
mor
ie
s a
nd
File
s
Ha
nd
led
by CP
U Mo
du
le
6
Func
tions
7
Co
mmu
nic
a
tion
us
in
g
bu
ilt
-i
n E
th
e
rne
t po
rt
s o
f
CP
U mod
u
le
8
Co
mm
un
icatio
n
w
ith
Int
e
lli
ge
nt
Fun
ction
Mo
du
le
(4) Changing and reading the clock data
(a) Changing the clock data
The clock data can be changed either by GX Developer or program.
1) Method to write from GX Developer
When using GX Developer, choose [Online] [Set time] to display the clock
setting window, and change the clock data.
2) Method to Write from the Program
When using a program, change the clock data with the clock data write
instruction (DATEWR).
Figure 6.12 shows a program for writing the set clock data to D0 to D6 with the
clock data write instruction (DATEWR).
Refer to the following manual for details of the DATEWR instruction.
Q QCPU (Q Mode)/QnACPU Programming Manual (Common
Instructions)
POINT
1. When the clock data is changed with GX Developer or program, the clock of 1/
1000 sec. is reset to 0.
2. Year data can be set up to 2037 in the clock data on GX Developer.
Figure 6.11 Set time screen
Figure 6.12 Program example of writing clock data
Write request
0
X0
Year 1999
Month 8
Day 10
Hour 11
Minute 35
Second 24
Day Tuesday: 2
MOVP
K1999
DO
MOVP
K8
D1
MOVP
D2
MOVP
D3
MOVP
D4
MOVP
D5
MOVP
D6
DATEWR
DO
K10
K11
K35
K24
K2