Delta Electronics VFD037CH23A-21 — функция вычитания времени в PLC: Обзор и примеры [548/638]

Превью страниц Страница 548 / 638
Delta Electronics VFD450CH23A-00/-21 [548/638] D20 d21 d22
Chapter 16 PLC Function CH2000 Series
16-95
API
163
TSUB
P
Calendar data subtraction
Bit Devices Word Devices
X
Y
M
K H KnX KnY KnM T C D
S1
S2
D
Operands:
Please refer to the specifications of each model for the
range of operands.
16-bit command (5 STEPS)
TSUB
TSUBP
32-bit command
Flag signal: M1020 (Zero flag)
M1022 (Carry flag)
M1068 (calendar error)
Explanation
S1: Time Minuend S2: Time Subtrahend D: Subtraction result
Operand S1, S2, D occupies 3 continuous devices.
S1 S2 = D. The time data in the register specified by S2 is subtracted from the
time data in the register specified by S1 and the result is stored in the register
specified by D.
If the time data in S1, S2 exceeds the range, it will result in “operation error”. At this
time, the command won’t be executed and M1067=On, M1068=On, records error
code 0E1A (HEX) in D1067.
If the subtraction result is a negative value (less than 0), the Barrow Flag M1021=
On. The value of the result shows in D is the time remaining above 24 (twenty-four)
hour.
If the subtraction result is equal to 0 (zero, 0 hour, 0 minute, 0 second), the Zero
flag M1020= On.
Example
When X10= On, the command is executed. The time data specified by D10~D12 is
subtracted from the time data specified by D0~D2 and the result is stored in the
register specified by D20~D22.
X10
TSUB D0 D10 D20
D0
D1
D2
20(
20(
min)
5(
sec
)
D11
D12
hr
)
min
)
8(
sec
)
D20
D21
D22
5(
hr
)
49(
min
)
57(
sec
)
20: 20: 5
14: 30: 8
5: 49: 57

Содержание

1610

Изучите функцию вычитания времени в PLC, включая операнды, флаги и примеры использования. Узнайте, как правильно выполнять операции с временными данными.