Delta AH500 Programming Manual page 540

Hide thumbs Also See for AH500:
Table of Contents

Advertisement

AH 5 00 Pr ogr am m ing Ma n ua l
API
Instruction code
1605
TCMP
Device X
Y
M
S
1
S
2
S
3
S
D
Symbol:
Explanation:
1.
The value of the hour, the value of the minute, and the value of the second specified by S
are compared with the value of the hour, the value of the minute, and the value of the second
in the devices starting from the device specified by S, and the comparison result is stored in D.
2.
The hour of the current time is in the device specified by S, and the value of the hour should be
within the range between 0 and 23. The minute of the current time is in the device specified by
S+1, and the value of the minute should be within the range between 0 and 59. The second of
the current time is in the device specified by S+2, and the value of the second should be within
the range between 0 and 59.
3.
The operand D occupies three consecutive devices. The comparison result is stored in D, D+1,
and D+2.
4.
Users generally use the instruction TRD to read the current time from the real-time clock first,
and then they use the instruction TCMP to compare the time.
5.
If the setting time in S
OFF.
6.
If the setting time in S
OFF.
7.
If the setting time in S
ON.
Example:
1.
When X0.0 is ON, the instruction is executed. The setting time 12 hour 20 minute 45 second is
compared with the current time in D20~D22, and the comparison result is stored in M10~M12.
When X0.0 is switched from ON to OFF, the instruction is not executed. Besides, the state of
M10, the state of M11, and the state of M12 remain the same as those before X0.0's being ON.
If users want to get the comparison result ≧, ≦, or ≠, they can connect M10~M12 is series or in
2.
parallel.
6 - 3 7 2
Operand
P
S
, S
, S
, S, D
1
2
3
S
T
C
HC
D
Pulse instruction 16-bit instruction (11 steps) 32-bit instruction
AH500
: Hour of the setting time
S
1
: Minute of the setting time
S
2
: Second of the setting time
S
3
S : Current time
D : Comparison result
~S
is larger than the current time in S, D is ON, D+1 is OFF, and D+2 is
1
3
~S
is equal to the current time in S, D is OFF, D+1 is ON, and D+2 is
1
3
~S
is less than the current time in S, D is OFF, D+1 is OFF, and D+2 is
1
3
Comparing the time
L
SM SR
E
PR
AH500
Word
Word
Word
Word
Bit
Function
K
16# "$"
DF
-
~S
1
3

Advertisement

Table of Contents
loading

Table of Contents