297
T S U B P
S1
S2
D
1
2
M
3
○○
FNC
163
○○
X Y M S
D.b R.b
KnX KnY
KnM KnS
T C
D,R
V,Z
UnG
K,H
E
" $"
S1
D
S2
TSUB D0 D10 D20
X20
If the result of the time subtract is a negative value, the Borrow Flag M9021 will be set “ON” and the will display
the value where 24 hours is added to the difference.
If the result of the time subtraction equals to “0” (0 hour 0 min 0 sec), then the Zero Flag M9020 will be set “ON”.
-
=
=
-
S1
S2
D
S1
S2
D
S1
S2
D
D
S1
S2
D
(–14)+24=10
Time Subtraction
h m s
06 30 20
D0 = 6 (Hour)
D1 = 30 (Minute)
D2 = 20 (Second)
h m s
20 20 10
D10 = 20 (Hour)
D11 = 20 (Minute)
D12 = 10 (Second)
h m s
10 10 10
D20 = 10 (Hour)
D21 = 10 (Minute)
D22 = 10 (Second)
h m s
18 28 50
D0 = 18 (Hour)
D1 = 28 (Minute)
D2 = 50 (Second)
h m s
08 40 20
D10 = 8 (Hour)
D11 = 40 (Minute)
D12 = 20 (Second)
D20 = 9 (Hour)
D21 = 48 (Minute)
D22 = 30 (Second)
h m s
09 48 30
All the S1, S2 and D occupies 3 components respectively
S1 : the minuend of the time combination
S2 : the subtrahend of the time combination
D : the difference of the time combination
S1
S2
If the content value of the registers that designated by or exceeding the time value required, the PLC will
regard that as an operational error.
The designated time combination of the minuend will be subtracted to the designated time combination
and the combination of the difference will be stored at the assigned registers .
When X20 = “ON”, the instruction will be performed.
, also the M9021 = “ON”.
Operand
Devices