21 Applied Instructions (Real Time Clock Control)
21.5 HTOS / Hour to Second Conversion
553
FXCPU Structured Programming Manual
[Basic & Applied Instruction]
21
Applied Instructions
(Real Time
Clock Control)
22
Applied Instructions
(External Device)
23
Applied Instructions
(Extension
Function)
24
Applied Instructions
(Others)
25
Applied Instructions
(Block Data
Operation)
26
Applied Instructions
(Character
String Control)
27
Applied Instructions
(Data Operation 3)
28
Applied Instructions
(Data Comparison)
29
Applied Instructions
(Data Table
Operation)
30
Applied Instructions
(External Device
Communication)
Program example
This is a program for converting the time data being read out from the real-time clock built in the PLC, when
the X020 is ON, into the second unit, and storing in D100, D101.
Operation
1) Reading operation of clock data by TRD
2) Conversion operation to seconds by DHTOS
[Structured ladder/FBD]
TRD
EN ENO
d
D10
X020
DHTOS
EN
s
ENO
d
D100
D13
DHTOS(X020,D13,D100);
[ST]
TRD(X020,D10);
2004
1
31
D11
D10
D12
Year
20
21
23
D14
D13
D15
6D16
Month
Day
hour
minute
second
Real-time
clock
Day of week
Time data
Clock data
20
21
23
73283
D101,D100
D13
D14
D15