Download 1775-6.4.1, PLC-3 Family Programmable Controller, Programming

Transcript
Chapter 6
Using Data-manipulation Instructions
6.3.5
Less Than (LES)
Required Parameters: Sources (A and B) addresses.
Description: The less-than instruction tells the processor to compare a
value at source (A) with the value at source (B):
If source
Then the rung is
A<B
true
A≥B
false
Example: Figure 6.10 shows a rung containing a less-than instruction.
The processor compares the source value in the accumulated value word
for counter 29 to the source value in input word 3. If the value in the
accumulated value word for counter 29 is less than the value in input word
3 (A < B), the processor turns on output O0013/01.
Figure 6.10
Example Rung for a Less-than Instruction
LES
O0013
( )
01
A<B
A : WCACC:0029
3600
B : WI000:0003
83
6.3.6
Less Than or Equal To (LEQ)
Required Parameters: Sources (A and B) addresses.
Description: The less-than-or-equal-to instruction tells the processor to
compare a value at source (A) with the value at source (B):
If source
Then the rung is
A≤B
true
A>B
false
Example: Figure 6.11 shows a rung containing a less-than-or-equal-to
instruction.
The processor compares the source values in integer words 7 and 8. If the
value in integer word 7 is less than or equal to the value in integer word 8
(A ≤ B), the processor turns on output O0013/01.
6-11