From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How Does LabVIEW Handle Dialogs?

Solved!
Go to solution

Hello,

 

I keep coming up against something very frustrating in my LabVIEW programs which is probably due to me not understanding exactly how LabVIEW handles dialog (or for that matter VIs and front panels in general).

 

Let's say I have a Main Window and a Dialog which gets called at some point from the Main Window in the event loop (from a button press).image.png

As seen in the picture above, I am just adding the VI of that dialog box to the code in Main Window.

 

This works fine except in the case where I was just doing some work on the Dialog VIs code and don't close the entire VI.  I would think that it should not matter whether I have the code for a VI open in a project or not, however, in this case, both the Main Window and Dialog appear running when I start the Main Window and now I am unable to interact with either (the Main Window acts like its blocked by a modal but the Dialog's event loop does nothing even though it appears to be running).  Why does the Dialog start running before it is ever called?  Why do I suddenly loose the ability to interact with the Main Window?

 

Please let me know if this does not make sense.

 

 

0 Kudos
Message 1 of 4
(2,453 Views)
Solution
Accepted by topic author patrick.wright

It's not running, but likely set to modal behavior and waiting to run. Even in waiting to run state, the modal window will push itself to the top. I like to use a property node inside VIs that need to be modal, one at the beginning to set them to modal and another at the end to unset them from modal. Otherwise you can get into a bind when debugging, as you have found out!

0 Kudos
Message 2 of 4
(2,448 Views)

Thanks!  That makes sense from a solution standpoint.  My followup question is how can the VI/Dialog not be "running" but look like its running and still be modal modal but not actually be called for yet?  That seems counter-intuitive since I don't understand how LabVIEW handles its VIs.  Do you by any chance know a document I could read which explains the "lifecycle" of LabVIEW VIs.

0 Kudos
Message 3 of 4
(2,441 Views)

If a VI can be called by a running VI, it goes into the 'running' state, where it is reserved for execution (and looks like it is running) even though it isnt actually running in the way we think of as running. 

 

http://zone.ni.com/reference/en-XX/help/371361N-01/lvprop/vi_exestate/

Message 4 of 4
(2,424 Views)