06-28-2012 07:08 AM
Hello,
One again, i'm back for another question, eager to learn more about labview and these countless obscure secrets.
Well my problem seem's to be a commun problem but i didn't find the answer in other topics.
Here are the levels of my VI (more simple if you directly look at VI)
1st level, I have a case event to launch the measure or to go back to the main Vi
2nd level (during the measure process), I have a while loop with a case event inside to stop the loop if the process is blocked. but it doesn't work.
And to make matters worse I can not press the buttons when the measurement started
I'm on this problem since 10 hours this is not a question asked without thinking but i'm realy blocked.
Thanks
Solved! Go to Solution.
06-28-2012 07:16 AM
You have set the outer event structures Start Case to "Lock front panel until this event case completes. This is why pressing the button is simply ignored.
Christian
06-28-2012 07:27 AM
Ok i just look at that and it solve the button problem, thanks.
The main problem, about stopping while loop during the process is still present.
Someone have any idea about that ?
06-28-2012 07:33 AM
When I press the button "stop measure" the while loop and so the exectuion of the VI stops. Is this not what you are asking for?
Christian
06-28-2012
07:45 AM
- last edited on
06-11-2025
04:54 PM
by
Content Cleaner
First of all, stacking event structures is going to be tricky very fast, so i want to disencourage to do this until you are an experienced LV developer. You are currently just dipping on the "first issues", which is commonly understood as caveats of the event structure.
The second thing is, i understand that you want to terminate the wait function itself (which represents your external code). This cannot be done. The reason is simple: LV is simply waiting for the code to complete. So telling LV to stop execution will come true as soon as LV "gets back the baton". This is going to happen once the external code has finished executing.
You CAN terminate the external thread using the Windows API, but you should/must restart the whole LV application to prevent memory corruption created by the killed threads (not suggested).
hope this helps,
Norbert
06-28-2012 07:48 AM
Ok, firstly, i updated my VI , this on is made with your advice.
Yes the VI stops but before it waiting for the end of the loop ( 10s in this case).
I want it to stop immediatly after pushing STOP button.
06-28-2012 08:30 AM
Norbert,
I understand, it seem's that LV is working only with flow. I can't stop the flow ..
An another solution would be to get my DAQ process (daq assistant + trigger) out of the sub VI and to put a manual button on trigger and DAQ assistant.
The manual button works, but it don't stop the loop. (look at en & condition on picture).
I send you a picture of the real VI because he is quite complex to send
06-28-2012 09:04 AM
I repeat:
If something is blocking the execution of LV code, LV will not terminate. So if you wait for e.g. 1M DAQ samples acquired with 1Hz, you will have to wait 1,000,000 seconds without being able to terminate this.
OK, this example is exaggerated, but i hope you get the point. For DAQmx, you can configure a timeout in order to not have such long times until *something* happens.
You should get in touch with concepts like
- streaming
- producer/consumer
hope this helps,
Norbert
06-28-2012 09:13 AM
Yes i understand. My solution works because the DAQ loop is looping every 0.17s.
So LV check STOP button every 0.17 s (much enough for me).
Tanks for your help.
The answer to this post is this is not possible to break flow. find an another solution 🙂