269
4
4 Instructions 4.8.2 Clock Operations
◆
Function
Two time values in
hours:minutes:seconds
format are added together. The result is stored in designated variables.
If the addition of two time values results in a value greater than 24 hours, the carry flag M8022 is set to ON and the
actually displayed time is equal to the addition result minus 24:00:00.
If the result is 00:00:00, the zero ag M8020 is set to 1.
Example:
S2S1
D
〔TADD D10 D20 D40 〕
M10
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
18
46
25
S1 S2 D
09:50:16
08:56:09
18:46:25
If the addition of two time values results in a value greater than 24 hours, the carry ag M8022 is set to ON.
D10 (Hours)
D11 (Minutes)
D12 (Seconds)
D20 (Hours)
D21 (Minutes)
D22 (Seconds)
D40 (Hours)
D41 (Minutes)
D42 (Seconds)
15
50
16
12
56
09
4
46
25
S1 S2 D
15:50:16
12:56:09
04:46:25
TSUB: Clock data subtraction operation
◆
Overview
The TSUB instruction subtracts one time value from another in
hours:minutes:seconds
format. The result
is stored in designated variables.
TSUB S1 S2 D
Clock data subtraction
operation
Applicable model:
H3U
S1
Time
subtrahend
Time subtrahend, which is represented by hours, minutes, and
seconds respectively stored in three consecutive variable units
16-bit instruction
(7 steps)
TSUB:
Continuous
execution
TSUBP: Pulse
execution
S2
Time
minuend
Time minuend, which is represented by hours, minutes, and
seconds respectively stored in three consecutive variable units
D
Difference
between
two time
values
Difference between two time values, which is represented
by hours, minutes, and seconds respectively stored in three
consecutive variable units
◆
Operands
Operand
Bit Element Word Element
System·User System·User Bit Designation Indexed Address Constant
Real
Number
S1 X Y M T C S SM D R T C SD KnX KnY KnM KnS KnSM
V,Z
Modication K H E
S2 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.