12-22-2016 04:44 AM
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.
Solved! Go to Solution.
12-22-2016 07:46 AM
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.
12-22-2016 12:16 PM
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.
12-23-2016 01:05 AM
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.
12-23-2016 01:56 AM
Could it be that the whole class method is not being called?
Does your Class have a parent?
12-23-2016 02:27 AM
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.