270
4
4 Instructions4.8.3 Clock Conversion
◆
Function
One time value is subtracted from another in
hours:minutes:seconds
format. The result is stored in designated
variables.
If the subtraction of two time values results in a negative value, the borrow flag M8021 is set to ON and the actually
displayed time is equal to the subtraction result plus 24:00:00.
If the subtraction gets 00:00:00, the zero ag M8020 is set to 1.
Example:
S2S1
D
〔TSUB D10 D20
D40 〕
M11
Operation:
D10 (Hours)
D11 (Minutes)
D12 (Seconds)
D20 (Hours)
D21 (Minutes)
D22 (Seconds)
D40 (Hours)
D41 (Minutes)
D42 (Seconds)
09
50
16
08
56
09
00
54
07
S1 S2 D
09:50:16
08:56:09
00:54:07
If the subtraction of two time values results in a negative value, the borrow ag M8021 is set to ON.
D10 (Hours)
D11 (Minutes)
D12 (Seconds)
D20 (Hours)
D21 (Minutes)
D22 (Seconds)
D40 (Hours)
D41 (Minutes)
D42 (Seconds)
09
50
16
12
56
09
20
54
07
S1 S2 D
09:50:16
12:56:09
20:54:07
4.8.3 Clock Conversion
HTOS: Conversion from hours:minutes:seconds format to seconds
◆
Overview
The HTOS instruction converts time values in
hours:minutes:seconds
format to seconds.
HTOS
S D
Conversion from
hours:minutes:seconds
format to seconds
Applicable model:
H3U
S
Source
data
Start number of elements that store the time in
hours:minutes:seconds
format to be converted
16-bit instruction (5
steps)
HTOS: Continuous
execution
HTOSP: Pulse
execution
32-bit instruction (9
steps)
DHTOS: Continuous
execution
DHTOSP: Pulse
execution
D Result
Number of the element that stores the seconds
converted from a time value
◆
Operands
Operand
Bit Element Word Element
System·User System·User Bit Designation Indexed Address Constant
Real
Number
S X Y M T C S SM D R T C SD KnX KnY KnM KnS KnSM
V,Z
Modication K H E
D X Y M T C S SM D R T C SD KnX KnY KnM KnS KnSM
V,Z
Modication K H E
Note: The elements in gray background are supported.