1. Compare instructions less or equal to
1. Compare instructions less or equal to
1.1. Instruction description
The instruction less than or equal to is used to compare the size of two values. If the data above is less than or equal to the data below, the comparison result is true and the contact is connected.
In the instruction table, when 1 is at the top of the stack, the instruction performs load (LD), AND, and OR operations.
You can choose from three types: single character, double character, and float number
1.2. The valid operands of the instruction
1.2.1. Single word type(LDW<=,AW<=,ORW<=):
| Input/Output | Data Type | operand | Description |
|---|---|---|---|
| IN1 | 16 bit integer | D/CV/TV/AI/AO/K/H/V/Z/FD, bit composite word (X/Y/M/C/T/S), local variable (LW) | Input 1 |
| IN2 | 16 bit integer | D/CV/TV/AI/AO/K/H/V/Z/FD, bit composite word (X/Y/M/C/T/S), local variable (LW) | Input 2 |
1.2.2. Double words type(LDD<=,AD<=,ORD<=):
| Input/Output | Data Type | operand | Description |
|---|---|---|---|
| IN1 | 32-bit integer | D/CV/K/H/FD, bit composite word (X/Y/M/C/T/S), local variable (LD) | Input 1 |
| IN2 | 32-bit integer | D/CV/K/H/FD, bit composite word (X/Y/M/C/T/S), local variable (LD) | Input 2 |
1.2.3. Float type(LDF<=,AF<=,ORF<=):
| Input/Output | Data Type | operand | Description |
|---|---|---|---|
| IN1 | 32-bit real number | D/K/FD, local variable (LF) | Input 1 |
| IN2 | 32-bit real number | D/K/FD, local variable (LF) | Input 2 |
1.3. Example
Command table:
NETWORK 000
LDW&# 60;=D0 D1//Load D0 and D1, and compare whether D0 is' less than or equal to 'D1
ORW&# 60;=D4 D5//Compare whether D4 is' less than or equal to 'D5, and perform an' OR 'operation on the comparison result and the top of the stack value
AW&# 60;=D2 D3//Compare whether D2 is' less than or equal to 'D3, and perform an' AND 'operation on the comparison result and the stack top value
LDD=D6 D8//Load D6D7 and D8D9, and compare whether D6D7 is' less than or equal to 'D8D9
ORD&# 60;=D14 D16//Compare whether D14D15 is' less than or equal to 'D16D17, and perform an' OR 'operation on the comparison result and the top of the stack value
AD&# 60;=D10 D12//Compare whether D10D11 is' less than or equal to 'D12D13, and perform an' AND 'operation on the comparison result and the stack top value
LDF&# 60;=D18 D20//Load floating-point numbers D18D19 and D20D21, and compare whether floating-point number D18D19 is' less than or equal to 'floating-point number D20D21
ORF&# 60;=D26 D28//Compare whether floating-point number D26D27 is' less than or equal to 'floating-point number D28D29, and perform an' OR 'operation on the comparison result and the top of the stack value
AF&# 60;=D22 D24//Compare whether floating-point number D22D23 is' less than or equal to 'floating-point number D24D25, and perform an' AND 'operation on the comparison result and the top of the stack value
ORB//Perform an 'OR' operation between the top stack value and the current energy flow value
ORB//Perform an 'OR' operation between the top stack value and the current energy flow value
OUT Y000//Output Y000
图1 LE1
图2 LE2