NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Why last "elseif" was skipped in if else series sequence

Solved!
Go to solution

In my sequence of TS2016, there's a if...else if...else if...series flow.

but each time the last else if step was skipped even the else if condition is true.

I switch the last "else if" with previous "else if", the new last one still skipped.

anyone can tell why?

0 Kudos
Message 1 of 5
(2,670 Views)

The reason maybe my misunderstanding for else if, I should use just if end is OK.

0 Kudos
Message 2 of 5
(2,661 Views)

Hi,

 

There's no reason it should skip the last one if the condition is met.

 

Could you post a sequence file showing this behaviour, as I can't replicate the issue?

 

Thanks,

 

Nic

--------
Nico
Systems Engineer

Certified TestStand Architect Certified LabVIEW Architect

0 Kudos
Message 3 of 5
(2,640 Views)
Solution
Accepted by topic author johnnnywang

Johnnny, It has been a while since I looked at TestStand If/Else If/Else steps, but my recollection is that TestStand will only skip over an Else If when the If Condition for a previous If or Else If has evaluated to TRUE.  If none of the If Conditions evaluate to TRUE then the status for all of the If and Else If steps should be Done.

 

I couldn't resist it I had to check, so here are a few screen shots.

 

First if none of the If Conditions evaluate to TRUE (I set Locals.If to 0). NOTE: The Status for all Ifs and Else If is "Done".

If #1.PNG

 

Then if the If Condition of the If step evaluates to TRUE (I set Locals.If to 1)

If #2.PNG

Then it the If Condition of one of the Else If steps evaluates to TRUE (I set Locals.If to 2)

If #3.PNG

If you could expand your screen capture to include the Description (to show your If Conditions) and Status (to show how the execution ran) columns, it would be a big help.

Steve

0 Kudos
Message 4 of 5
(2,636 Views)

Thanks Steve~

With your sequence, I find out what i'm wrong.

not all the condition of my flow are relatives, so some of the else if are skipped when previous steps are evaluated.

Now I replace the non-relative steps with single if, it works now!

0 Kudos
Message 5 of 5
(2,622 Views)