LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

GUI in main-vi freezes while sub-vi in event structure runs

I have an event structure which triggers on different boolean buttons.

Inside the event structures I have different sub vis that performs different tasks.

This sub vis contains loops which eventually terminates, but as long as they are running my main vi freezes and I’m not able to do anything. I have attached an example which I hope demonstrates my problem. The example is made with LabView 8.

I hope anyone can tell me what is wrong.

 

Terje  

0 Kudos
Message 1 of 4
(3,551 Views)
Ok first things first, right click on the event structure with the go value change event selected. Then down at the bottom of the page it says lock front panel until event completes. Uncheck this now you can select both buttons. but another question is "is this the behavior that you really want" do you want to have it to where you must select the stop button first then hit the go button, why not just have it controlled by one button in a stop event, ie creat an event called stop and put the stop button and your subvi into it and have the event trigger on the stop button value change event.



Joe.
"NOTHING IS EVER EASY"
Message 2 of 4
(3,541 Views)
The reason is that you have to wait for the loop to stop executing in your subVI before you can press anything on your front panel. You have called the subVI with your main VI, so the focus is on your subVI and its code, instead of the main VI.

 If you want to be able to do actions while you have a subVI executing, the easiest way would be to use a proiducer/consumer style VI.

There are some good examples built in to LV, but if you need more help, post your questions.

Kenny
Kenny

0 Kudos
Message 3 of 4
(3,540 Views)

Thank you Jhoskins for solving my problem.

 

You are also correct about the second part. The stop button was actually only supposed to stop the subvi.

0 Kudos
Message 4 of 4
(3,526 Views)