567
FX3G/FX3U/FX3GC/FX3UC Series
Programming Manual - Basic & Applied Instruction Edition
21 Real Time Clock Control – FNC160 to FNC169
21.6 FNC165 – STOH / Second to Hour Conversion
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-FNC275
Ex-Device
Inverter Comms
2. 32-bit operation (DSTOH and DSTOHP)
The time data in units of "second" stored in +1 and is converted into data in units of "hour, minute, and
second", and stored to three devices , +1, and +2 (hour, minute, and second).
For example, when "45,325 seconds" is specified, the operation is as follows:
Error
An operation error is caused in the following case; The error flag M8067 turns ON, and the error code is store in
D8067.
• When the data of is outside the allowable range (error code: K6706)
Program example
In the program shown below, the time data in units of "second" stored in D0 and D1 is converted into data in units of
"hour, minute, and second", and stored to D100, D101, and D102 when X020 turns ON.
Operation
• Converting the data in second into the data in hour, minute and second using STOHP instruction
(when "40,000 seconds" is specified by D1 and D0)
S
S
D
D
D
Command
input
FNC165
DSTOH
S
D
Hour
Minute
Second
D
+1
+2
D
D
(0 to 32767)
(0 to 59)
(0 to 59)
S
Second (0 to 117964799)
S
+1
12
35
25
D
+1
+2
D
D
S
45325
S
+1
S
X020
FNC165
DSTOH
D0 D100
END
11
6
40
40000D1,D0
D100
D101
D102