LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Dialog SubVI does not return to running VI

Hi all... I have what I'm sure is a simple question. I just started refining a small program I made with Labview a few months ago (it was my first attempt, and did the basics). I'm now adding some user interface, database and reporting, but I'm stumped by something which I'm sure is simple.

I have a main VI which has 5 buttons on it. Each button calls it's own SubVI. However, before the user can start using it, when opened I want to display an information dialog screen. This screen has two buttons - Exit which shuts down Labview (works properly) and OK which I am trying to get to work. When the user presses OK, the dialog should close and the main VI should show and be running.

The dialog SubVI contains the 2 buttons i
n a While loop with the OK tied to the loop terminator and the Exit tied to the Labview Exit function. As it stands, when I run the main VI the dialog window appears. Pressing OK returns me to the main VI but it has stopped running. If I set the VI properties to re-entrant execution, it loops continuously between the main VI front panel and the dialog front panel. How do I get this dialog front panel to only show once and then return to a running main VI?

Thanks in advance for the help!

Dale S.
0 Kudos
Message 1 of 4
(2,831 Views)
Dale,
Let me see if I can help you out on this one. My best guess is that your main vi does not have an event-loop, i.e. it only executes once and if none of the five buttons was pressed during those milliseconds, nothing happens and it stops running (it reaches the end-statement).

I attached a simple example of a situation that I think ressembles your situation. A dialog is shown on start up and if the OK button is pressed, the main vi is executed in a never-ending while loop (reading the 5 buttons and acts accprdingly if any of them is pressed).

Put the dialog.vi in the same folder as the main.vi and then run the main vi.

I hope this helps. Please let us know if this was of any help for you. /Mikael Garcia

PS My example is for
LabVIEW version 6.02. If you need an older version, please let us know.
Download All
Message 2 of 4
(2,831 Views)
Thanks Mikael! All I was missing was the obvious - adding a boolean true to the loop terminator and I'm away to the races. What I had done was a simple mistake - button 5 was also tied to a Labview Exit function, and I just looped the boolean through to the loop terminator. Alas, I forgot that the button 5 boolean is false until pressed, hence the reason the loop only ran 1 iteration.

Thanks also to LabviewGuru for your offer of assistance. Hats off to all that read this forum - it's of great assistance to us beginners! Thanks!

Dale S.
0 Kudos
Message 4 of 4
(2,831 Views)
Dale,

Can you post your code or email it to me? I'm not sure of what's going on. My only guess is that when the OK button is pressed, it returns a True, which you have wired to your while loop. If this is the case, and your while loop's control is set to "Continue if True" then the true causes the dialog to pop up again.

Check that, if thats not it, put up or send the code.
Message 3 of 4
(2,831 Views)