575
FX3G/FX3U/FX3UC Series Programmable Controllers
Programming Manual - Basic & Applied Instruction Edition
21 Real Time Clock Control – FNC160 to FNC169
21.8 FNC167 – TWR / Set RTC data
21
FNC160-FNC169
Real Time Clock
Control
22
FNC170-FNC179
External Device
23
FNC180
Alternate
Instructions
24
FNC181-FNC189
Others
25
FNC190-FNC199
Block Data
Operation
26
FNC200-FNC209
Character String
Control
27
FNC210-FNC219
Data
Operation 3
28
FNC220-FNC249
Data
Comparison
29
FNC250-FNC269
Data Table
Operation
30
FNC270-FNC274
Ex-Device
Inverter Comms
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
D1K4
FNC 12
MOV
D2K25
FNC 12
MOV
D3K15
FNC 12
MOV
D4K20
FNC 12
MOV
D5K30
FNC 12
MOV
D6K2
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