LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Pop Up VI freezes Use of Controls on Main VI

Solved!
Go to solution

I have wrriten a Main vi that uses multiple loops.  But for the sake of discussion, let's keep it simple at 2 loops.  Master/Slave.  In the slave loop, there is the possibility of a VI FP being opened during operation.  When opened, the Master loop is of course continuing to run while the slave is waiting for this pop up VI to close.  However, the controls (all placed in the Master loop) are technically frozen and incapable of being used.  Now, I understand the risks of those controls  still being accessible.  Events would take place, but the slave could never process them due to the pop up vi still being open.  But let's say you are a savvy programmer and are aware of those risks so you created a separate loop to handle pop ups for this very reason so as to allow you to still have FP control access on your main FP.  How does one go about doing this?  Are there settings that need setting?  Or is there a more savvy programmer way to do this?  Like changing that VI to its own separate .exe and just calling it to open and using the Shared Variable system to transfer data between the two?  I hope I've described the scenario well enough to garner responses and not further questions? Smiley Happy

0 Kudos
Message 1 of 10
(4,266 Views)

Hi Dose,

 

putting all text into one bulky paragraph makes it hard to read…

 

From what I get it seems you have problems to set up a proper producer-consumer scheme. Or you need to avoid modal frontpanels…

If it is something else you should attach your VI(s)!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 10
(4,257 Views)

It sounds like your pop up subVI is set to be modal.  That makes it frontmost and will block any interaction with the other windows.

 

Look under File >>  VI properties >> Windows Appearance.  You may want to try floating instead of modal.

Message 3 of 10
(4,255 Views)

Appreciate the responses.  Sorry about the big chunky Paragraph, I will definitely try to avoid that in the future.

 

I made the floating modification and the controls only respond until after the VI is closed.  I'm wondering if it's because I have two event loops running.  (Probably should have mentioned that)  Unfortunately, I cannot share the VIs due to government proprietary blah blah blah.  You understand.  So I made a very quick VI giving a very brief explanation of what's going on.  You'll have to trust me that there are no "bugs."  I've also attached an image of the pop up VI's settings.

 

LabVIEW Question.JPG

 LabVIEW Question 2.JPG

 

Edit: I just now noticed my comment on my image.  It's not Modal, it's floating.  Sorry about that.

0 Kudos
Message 4 of 10
(4,246 Views)

Hi Dose,

 

check your event case settings.

Most probably you have set them to the default blocking behaviour when an event is handled…

 

Read the LabVIEW help for event structures!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 5 of 10
(4,239 Views)

You should only have one event structure.

0 Kudos
Message 6 of 10
(4,237 Views)
Solution
Accepted by DailyDose

Seeing a VI structure and how you are using event structures makes me think you are having another issue.

 

Event cases, by default, have a setting that says "Lock Panel (defer processing of user actions) until the case for this event completes."  So if you have an event case that launches a subVI, but that subVI is long running, the event case does not complete until you finally end the subVI.  If you have that box checked, it is going to lock the front panel where you launched the subVI.

 

See if you have that box checked for your subVI event case, and if you do, try unchecking it.

One thing you'll have to watch out for is that if you keep firing the event that launched the subVI, you are going to build up all of those events in a queue.  Once you end your subVI, you'll see it pop up again, and again, and again until you finall exhaust all of the triggered events.

Message 7 of 10
(4,235 Views)

@OA1 wrote:

You should only have one event structure.


Not actually true.  As long as you know what you are doing, you can having multiple event structures.  It just isn't recommended for new users because they are more likely to get into trouble

 

Having an event structure inside another event structure is universally a bad idea.

Having event cases with long running code inside or embedded while loops you can't control is usually a bad idea.

Not understanding how the "Lock Panel" checkbox works is what usually gets new programmers in trouble.

 

Anyone using event structures should read Caveats and Recommendations when Using Events in LabVIEW - LabVIEW 2015 Help

Message 8 of 10
(4,231 Views)

Ah man... I've been regulated back to a "new user"... Smiley Sad

 

Anyways, the help was very much appreciated!  That fixed my issue.  Thank you!

0 Kudos
Message 9 of 10
(4,215 Views)

"Not understanding how the "Lock Panel" checkbox works is what usually gets new programmers in trouble"

Thanks RavensFan. This statement have saved me after a whole day of struggle. Kudos

0 Kudos
Message 10 of 10
(4,084 Views)