LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Case Structure is skipped without being executed

Solved!
Go to solution

Hi,

 

I am using LabVIEW RT to program a cRIO 9039.

I have a VI that calls some class methods and perform a check on the state of a class, coded as a typedef enumeration. The check is implemented with a Case Structure with just two cases: False and True.

Now my problem is that, no matter the value of the case selector, the Case Structure is completely skipped, i.e. neither of the two cases is executed.

What can cause this behaviour?

 

Find attached a snippet of my code. The Case Structure that causes problem is the one on the right, with a probe inside it. The other case structures are correctly executed.

 

0 Kudos
Message 1 of 6
(3,641 Views)
Solution
Accepted by topic author Cthulhu-TheGreatOldOne

Firstly, how do you know it's being skipped?

Secondly, is this deployed code to the cRIO?  I ask this because I've witnessed many faulty deploys where LV thinks one code is running on a RT controller but it's actually an older version because something is screwed up with the deploy from the IDE.

Try forcing a recompile of the sub-VI, redeploying (You can force a deploy) and re-test.

0 Kudos
Message 2 of 6
(3,596 Views)

Intaris asked the key question.  What makes you think it isn't operating?  I can't load the snippet as I don't have your class and the loading stops.  I have to make some guesses about the code.

 

Try putting a string constant in each case saying "True" and "False" and having an indicator outside the case structure reading the case.  With this, you can see if it changes from an empty value.

 

For troubleshooting, remove the logic as the input and place a true/false constant to watch what happens.

 

To answer your question "what can make it skip?"  The answer is simple.  Nothing.  It could theoretically hang.  But, if it were skipped there'd be nothing passed for data flow and the rest of the application wouldn't run.  Something has to have run.  We just need to figure out what.  It's more likely you're expecting one thing to happen while a different value is being fed to the case structure's selector terminal.

0 Kudos
Message 3 of 6
(3,551 Views)

I believe it is being skipped because I put two debugging probes inside the case structure and none of them is updated (if you look at the code snippet you can see one of the probe inside the case structure).

I will also try the debugging option you suggest and force a re-deploy.

 

Thanks, I will keep the post updated with any news.

0 Kudos
Message 4 of 6
(3,518 Views)

Could it be that the whole class method is not being called? 

Does your Class have a parent? 

0 Kudos
Message 5 of 6
(3,510 Views)

Indeed the class has a parent but the moethod is called for sure. I have checked it woth debugging probes and indicators.

Anyway, it seems that a re-deployment did the trick and the case structure is executed.

0 Kudos
Message 6 of 6
(3,507 Views)