NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Inequality Operator Not Working As Expected

The inequality operator != is not working as expected with a logical boolean statement.

 

I have 2 numeric local variables:

Local.X = 80

Local.Y = 80

 

In an IF statement I have:

(Locals.X != 80) && (Locals.Y == 80)

 

If this Locals.X is not 80 and Locals.Y is equal to 80 then prompt the user a message.

 

My problem is when Locals.X = 80 and Locals.Y=80 the IF Statement runs to prompt the user the message when it should not.

 

Do I have a syntax issue?  Thanks!

0 Kudos
Message 1 of 3
(2,367 Views)

Hey, 

 

I tested your code and did not observe your behavior. How are you setting your locals? Can you share the snippet of code that is not working?

Message 2 of 3
(2,365 Views)

I also tried it out and did not see an issue. I also think it would help if you posted your code. 

 

Some things you might want to look at:

-how the representation is set for your local variables

-how you set the numeric format for your local variables

 

Pulido Technologies LLC

Message 3 of 3
(2,332 Views)