Showing results for 
Search instead for 
Did you mean: 

why does my case structure terminate entire loop on false?



I have a loop which contains some arguments as well as a case structure that has various arguments for true and no arguments for false, my issue is that i still want the loop to continue executing when the case is false (because outside the case there are still controls that need to be functioning) , but that seems to terminate the entire loop, I have tried a series of loops inside the primary loop with no luck.

Any help would be greatly appreciated,



0 Kudos
Message 1 of 11

You are probably getting an error in your application; you should handle errors correctly by wiring the error clusters from all nodes.


Also, you should open and close references when you do the reads and writes.

Adnan Zafar
Certified LabVIEW Architect
Coleman Technologies
0 Kudos
Message 2 of 11
Ok I've wired all the error I/O to a general error handler and no error was returned, ( I also added the open and close to my files 🙂 )  so the loop is still terminating when the internal case struct is false....
0 Kudos
Message 3 of 11

I can't run your VI since I do not have the hardware and you did not provide the external files. However, the only way for the while loop to terminate is for the front panel 'stop' button to be true.


p.s. You've got some terminals hidden underneath the while loop. Did you post the actual code that has the problem or is this a modified version?

0 Kudos
Message 4 of 11
Sorry i should say that it is not terminating on "TRUE" however it will run perfectly fine on its own (independant loop) it seems as though if there are many components running alongside a DAQ-mx the DAQ-mx runs continously on one iteration and hence the other components will only run once despite the fact they are in a loop, is this true? is there a way around it?
0 Kudos
Message 5 of 11
The code itself is huge so i just picked out the section that was not working correctly
0 Kudos
Message 6 of 11

Now, I don't understand what you are saying. What 'True' are you talking about now and exactly what runs on it's own? You've posted one vI and if the stop button is true, the while loop will stop and it does not matter what the case statement is or is not.


Are you calling this code as a subVI?

Message Edited by Dennis Knutson on 05-19-2009 01:53 PM
0 Kudos
Message 7 of 11
Hey sorry im a bit confusing... when i say true or false its with regards to the case structure, when the case struct is true the daq-mx components come to life and that seems to disrupt the rest of the while loop, labview itself doesnt stop (even when i press run once) but when i change the values of my controllers those values are not send to the feild point
0 Kudos
Message 8 of 11

Are you sure you are getting a signal in that analog read DAQmx function or your analog reference trigger?


Why do you have a timeout value of 259,200 seconds?  That is about 72 hours.  If your code is waiting on that timeout, then it will take 3 days (probably 6 days since the stop button would have already been read on that iteration) for the program to come to a stop if you are failing to read your analog input.

0 Kudos
Message 9 of 11
When the case statement is true, then you will need to acquire all of the samples, read several files, and then write several files. While this is happening, of course the code outside the case statement will pause. For how long, I cannot say because I don't have the hardware. 
0 Kudos
Message 10 of 11