1. Compare unequal instructions
1. Compare unequal instructions
1.1. Instruction Description
The instruction is used to compare whether two values are not equal. If the data above is not 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 floating point
| Type | Instruction | Description |
|---|---|---|
| Single character | LDW<>, AW<>, ORW<> | Compare two single character integers to see if they are not equal |
| Double word | LDD<>, AD<>, ORD<> | Compare two double word integers to see if they are not equal |
| Floating point | LDF<>, AF<>, ORF<> | Compare two floating point numbers to see if they are not equal |
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 word 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 number 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<>D0 D1//Load D0 and D1, and compare whether D0 is' not equal 'to D1
ORW<>D4 D5//Compare whether D4 is' not equal 'to D5, and perform an' OR 'operation on the comparison result and the stack top value
AW<>D2 D3//Compare whether D2 is' not 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' not equal 'to D8D9
ORD<>D14 D16//Compare whether D14D15 is' not equal 'to D16D17, and perform an' OR 'operation on the comparison result and the stack top value
AD<>D10 D12//Compare D10D11 to see if it is' not equal 'to D12D13, and perform an' AND 'operation on the comparison result and the top of the stack value
LDF<>D18 D20//Load floating-point numbers D18D19 and D20D21, and compare whether floating-point number D18D19 is' not equal 'to floating-point number D20D21
ORF<>D26 D28//Compare whether floating-point number D26D27 is' not equal 'to floating-point number D28D29, and perform an' OR 'operation on the comparison result and the top of the stack value
AF<>D22 D24//Compare whether floating-point number D22D23 is' not 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 NE1
图2 NE2