Delta Electronics VFD037CH23A-21 — сравнение календарных данных в PLC: функции и примеры [545/638]

Превью страниц Страница 545 / 638
Delta Electronics VFD750CH23A-00/-21 [545/638] Flag signal none
Chapter 16 PLC Function CH2000 Series
16-92
API
160
TCMP
P
Comparison of calendar data
Bit Devices Word Devices
X
Y
M
K H KnX KnY KnM T C D
S1
S2
S3
S
D
Operands:
Please refer to the specifications of each model for
the range of operands.
16-bit command (5 STEPS)
TCMP
TCMPP
32-bit command
Flag signal: none
Explanation
S1: Hour of comparison time, setting range is K0~K23
S2: Minute of comparison time, setting range is K0~K59 S3:
Second of comparison time, setting range is K0~K59
S: Current time of calendar (occupies 3 continuous devices)
D: Comparison result (occupies 3 continuous devices)
The range of operand S1, S2, S3: S1=0~23, S2 =S3=K0~59
S1, S2, S3 is compared to the current value of the head address S and save the
comparison result in D.
S1 is the hour of current time and the content is K0~K23. S2 is the minute of
current time and the content is K0~K59. S3 is the second of current time and the
content is K0~K59
The current time of real time clock specified by S is read by using TRD
command previously and then compared by using TCMP command. If the
content of S 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.
Example
When X10= On, the command is executed and the current time of real time clock in
(D20~D22) is compared to the set value 12:20:45 and the result is shown at
M10~M12. When X10 goes from OnOff, the command is not executed but the
On/Off state before M10~M12 is kept. Connect M10~M12 in series or in parallel and
then the result of , , are given.
X10
TCMP K12 K20 K45 D20
M10
M11
M12
M10
ON when12: 20: 45
>
D20 (
hr
)
D21
(min
)
D22
ON when 12: 20: 45
=
D20
D21
(m
in)
D22
(s
ec)
ON when12: 20: 45
<
D20
(
hr)
D21
()min
D22

Содержание

1610

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