NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Test Stand IF-ELSE IF Statement Not Working As Expected

Hi everyone, I am using the IF and then ELSE IF statement Flow Control functions that come with Test Stand.

 

I have a numeric local variable in Test Stand.  If this number = 0 or 1, I want it to do code A and else if the number = 2, I want it to run code B.

 

This is how I have it written in TestStand

 

IF STATEMENT -> EXPRESSION: Locals.Number == 0 || 1

 

THEN DO Code A

 

ELSE IF -> EXPRESSION: Locals.Number == 2

 

THEN DO Code B

 

My issue is when Locals.Number = 2 it still runs Code A block.  What am I doing wrong?

 

Thanks so much!

0 Kudos
Message 1 of 3
(5,441 Views)

Try "(Locals.Number == 0) || (Locals.Number == 1)" instead of "Locals.Number == 0 || 1"

Message 2 of 3
(5,385 Views)

That did the job.  Thanks jsiegel.

0 Kudos
Message 3 of 3
(5,307 Views)