576
FX3S/FX3G/FX3GC/FX3U/FX3UC Series
Programming Manual - Basic & Applied Instruction Edition
21 Real Time Clock Control – FNC160 to FNC169
21.8 FNC167 – TWR / Set RTC data
21.8 FNC167 – TWR / Set RTC data
Outline
This instruction writes the clock data to the built-in PLC real time clock.
1. Instruction format
2. Set data
3. Applicable devices
S1: This function is supported only in FX3G/FX3GC/FX3U/FX3UC PLCs.
S2: This function is supported only in FX
3U/FX3UC PLCs.
Explanation of function and operation
The clock data stored in to +6 is written to D8013 to D8019 for the built-in PLC real time clock.
- D8018 (year data) can be converted into the 4-digit mode. (Refer to the program example shown later.)
- When TWR (FNC167) instruction is executed, the clock data of the real time clock is immediately changed.
Accordingly, transfer the clock data several minutes ahead to to +6 in advance, and then execute
FNC167 instruction when the accurate time has come.
- When setting the clock data (time) using this instruction, it is not necessary to control the special auxiliary relay
M8015 (time stop and time setting).
- If a numeric value indicating impossible date/time is set, the clock data is not changed.
Set the correct clock data, and then write it.
- The day of the week (D8019) is automatically corrected in accordance with the date without regard to the written
numeric value.
Operand type Description Data type
Specifies the head device number to which the clock data is written.
(Seven devices are occupied.)
16-bit binary
Oper-
and
Type
Bit Devices Word Devices Others
System User Digit Specification System User
Special
Unit
Index
Con-
stant
Real
Number
Charac-
ter String
Pointer
XYMTCSD
.b KnX KnY KnM KnS T C D R
U\G
VZModifyKH E "
"P
S1 S2
Device Item Clock data Device Item
Time data to be set
D 10 Year
0 to 99
(lower two digits)
→
D8018 Year
Special data register
D 11 Month 1 to 12
→
D8017 Month
D 12 Day 1 to 31
→
D8016 Day
D 13 Hour 0 to 23
→
D8015 Hour
D 14 Minute 0 to 59
→
D8014 Minute
D 15 Second o to 59
→
D8013 Second
D 16 Day of week
0 (Sunday) to
6 (Saturday)
→
D8019 Day of week
P
FNC 167
TWR
−
Mnemonic Operation Condition
16-bit Instruction
3 steps
TWR
TWRP
Mnemonic Operation Condition
Continuous
Operation
Pulse (Single)
Operation
32-bit Instruction
S
S
S
S
Command
input
FNC167
TWRP
S
S
S