Floating Point Comparison Operation

Relational operators with Logical operators for float data (It supports only in XP and PLC-S CPU series)

 

Relational operators compare two float values to provide a true and false result.

If the comparison is true, the result is 1. (Instruction will carry on)

If the comparison is false, the result is 0. (Instruction will no carry on)

 

S1

Value to compare

S2

Value to compare

 

Instruction

Device address

No. of Steps

Flag

M

X

Y

K

L

F

T

C

S

Z

D

@D

Int.

Error

Zero

Carry

LDE x,

ANDE X,

ORE x,

S1

o

o

o

o

o

-

-

-

-

o

o

o

-

3

o

-

-

S2

o

o

o

o

o

-

-

-

-

o

o

o

-

 

 

LDE x (x : =, <, >, <=, >=, <>)

Functions

  • Compare two float values S1 and S2 and if the comparison is true, the instruction will carry on.

  • S1 and S2 are signed number.

 

Comparison

Operator

Result

= Equal

S1 = S2

True

< Less than

S1 < S2

True

<= Less than or equal

S1 <= S2

True

> Greater than

S1 > S2

True

>= Greater than or equal

S1 >= S2

True

<> Not equal

S1 ≠ S2

True

 

Example)

  • If X00 equals to D0 then Y10 will be turned ON.

 

 

  • If D0 is greater than or equals to 24.34 then Y11 will be turned ON.

 

 

 

ANDE x (x : =, <, >, <=, >=, <>)

Functions

  • Compare two float values S1 and S2 and if the comparison is true and multiple conditions are also true then the instruction will carry on.

  • S1 and S2 are signed number.

Comparison

Operator

Result

= Equal

S1 = S2

True

< Less than

S1 < S2

True

<= Less than or equal

S1 <= S2

True

> Greater than

S1 > S2

True

>= Greater than or equal

S1 >= S2

True

<> Not equal

S1 ≠ S2

True

 

Example)

-If M11 is ON and 24.59 equal D2 then Y12 will be turned ON.

 

 

 

ORE x (x : =, <, >, <=, >=, <>)

Functions

  • Compare two float values S1 and S2 and if either the comparison is true or other condition is true then the instruction will carry on.

  • S1 and S2 are signed number.

Comparison

Operator

Result

= Equal

S1 = S2

True

< Less than

S1 < S2

True

<= Less than or equal

S1 <= S2

True

> Greater than

S1 > S2

True

>= Greater than or equal

S1 >= S2

True

<> Not equal

S1 ≠ S2

True

 

Example)

If either M1A is ON or M30 is greater than or equal to D2 then Y13 will be turned ON.

 

 

If either X0 is ON or D0 is less than D2, Y14 will be turned ON.