1. Compared less instructions

1. Compared less instructions

1.1. Instruction description

The less than instruction is used to compare the size of two values. If the data above is less than 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 word LDW<, AW<, ORW< Compare two single word integers to see if the first one is less than the last one
Double word LDD<, AD<, ORD< Compare two double word integers to see if the front is less than the back
Floating point LDF<, AF<, ORF< Compare two floating point numbers to see if the front is smaller than the back

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. Floating number types(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' less than 'D1

ORW< D4 D5 // Compare whether D4 is' less than 'D5, and perform an' OR 'operation on the comparison result and the stack top value

AW< D2 D3 // Compare whether D2 is' less than '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 D8D9

ORD< D14 D16 // Compare whether D14D15 is' less than 'D16D17, and perform an' OR 'operation on the comparison result and the stack top value

AD< D10 D12 // D10D11 to see if it is' less than 'D12D13, and perform an' AND 'operation on the comparison result and the stack top value

LDF< D18 D20 // Load floating-point numbers D18D19 and D20D21, and compare whether floating-point number D18D19 is' less than 'floating-point number D20D21

ORF< D26 D28 // Compare whether floating-point number D26D27 is' less than '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' less than '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

OUT Y000 // output Y000

L1

图1 L1

L2

图2 L2