Mitsubishi Electronics FX3G User Manual

Page of 964
577
FX
3S
/FX
3G
/FX
3GC
/FX
3U
/FX
3UC
 Series
Programming Manual - Basic & Applied Instruction Edition
21 Real Time Clock Control – FNC160 to FNC169
21.8 FNC167 – TWR / Set RTC data
21
FNC160
-F
NC1
69
R
eal
 T
ime C
lock
 
C
ontrol
22
FNC17
0-F
NC
179
E
xternal D
evice
23
FNC
180
Alternate 
Instructions
24
FN
C181-
FNC18
9
O
thers
25
FNC190
-F
NC1
99
Bl
oc
k D
ata
 
Op
er
ation
26
FNC20
0-F
NC209
C
har
ac
te
r S
trin
Con
tro
l
27
FNC2
10-
FNC21
9
Dat
Operati
on 3
28
FNC220
-F
NC2
49
Da
ta 
C
omp
ari
son
29
FNC25
0-F
N
C
269
D
ata T
abl
Operation
30
FNC2
70-
FNC276
Ex
-Dev
ice
Caution
1. Number of occupied devices
Seven devices are occupied by 
.
Make sure that these devices are not used in other controls for the machine.
Program example
1. Example of setting the clock data (time)
In the program example shown below, the real time clock is set (to 15:20:30 on Tuesday, April 25, 2001).
• The shaded area indicates the set value of each item.
• When setting the time, it is recommended to set the time to several minutes ahead in advance, and then set X000 
to ON when the accurate time is reached.  The set time is then immediately written to the real time clock, and the 
clock data is updated.
• Every time X001 is set to ON, the current time can be corrected by ±30 seconds.
• When handling the year in the 4-digit mode, add the following program.
D8018 will specify the 4-digit year mode in the second scan and later after the PLC mode is changed to RUN.
- A PLC is normally operating in the 2-digit year mode.  When the above instruction is executed and "K2000 (fixed 
value)" is transferred to D8018 (year) in only one operation cycle after the PLC mode was changed to RUN, the 
year mode is switched to the 4-digit mode.
- Execute this program every time the PLC mode is changed to RUN.  Even if "K2000" is transferred, only the 
display format is changed to the 4-digit year mode.  The current date and time are not affected.
- In the 4-digit year mode, the set values "80 to 99" correspond to "1980 to 1999", and "00 to 79" correspond to 
"2000 to 2079".
Examples: 
"80" indicates 1980.  "99" indicates 1999.  "00" indicates 2000.  "79" indicates 2079.
• When the data access unit FX-10DU-E/20DU-E/25DU-E is connected, select the 2-digit year mode.  If the 4-digit 
year mode is selected, the year is not correctly displayed in the current version of the FX-10DU-E/20DU-E/25DU-E.
Note that the clock is changed to the 2-digit year mode when the clock is set from the FX-10DU-E/20DU-E/25DU-E 
while the PLC is operating in the 4-digit year mode.
   
S
X000
K1
D0
FNC 12
MOV
D1
K4
FNC 12
MOV
D2
K25
FNC 12
MOV
D3
K15
FNC 12
MOV
D4
K20
FNC 12
MOV
D5
K30
FNC 12
MOV
D6
K2
FNC 12
MOV
FNC167
TWR
D0
Year (lower two digits)
Month
Day
Hour
Minute
Second
Day of week
The current value of the built-in
real time clock is updated.
M8017
X001
The current value is
corrected by ±30 seconds.
M8002
FNC 12
MOV
K2000
D8018
Initial pulse