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: 

Difficulty with returning control to parent program after asynchronous subvi call

Solved!
Go to solution

I'm trying to set up a pop-up help directory for one of my programs.  This is the first time I've tried an asynchronous call and I can't seem to get it to work correctly. 

 

The attached HelpDir.vi is the parent program that gives the user different help files to choose from.  When the user selects a help file, its subvi should pop up.  I would like the user to be able to leave this help file up and close out the help directory or choose another help file to pull upsimulataneously if they wish.

 

The odd thing is that, currently, this vi works exactly as I want if I have highlight execution on, but running normally, the HelpDir.vi becomes unresponsive when one of the help files has been loaded and only becomes responsive again once the help file has been exited.

 

I set up the parent program with an event structure running asynchronous call-and-forget just as in the shipping example so I'm not sure why the parent program isn't recovering control after launching tyhe subvi.  Please take a look and let me know if you see what I'm missing.

 

P.S. You might have to update the two static references.  I'm not sure if they break when sending the code this way.

 

Thanks,

Tim

Download All
0 Kudos
Message 1 of 5
(2,694 Views)
Solution
Accepted by topic author PolymerTim

Change your dialogs to be Floating instead of Modal.  The modal windows will always be on top.  By changing it to Floating, then you can access your main VI's window as well.

 

The Highlight Execution must somehow override the modal window mess.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 5
(2,680 Views)

You may also want to detect if the VI is already open and running, and ignore the button press.  I found that if you click the button of a subVI that is already open, it doesn't seem to do anything.  But you have to click the continue button in that subVI multiple times (once for each time you clicked the button in themain VI) in order for it to stop running.

Message 3 of 5
(2,667 Views)

Thanks so much crossrulz and Ravens.  I'm away from my LabVIEW today, but I'll give this a try tomorrow.  The floating/modal window thing makes sense so I'm hopeful that will fix it.

 

Good thinking about checking for it already open.  I had noticed in playing around with it that if you clicked the button multiple times to load the subvi, it seems to queue the calls so when you close the first instance, it immediately opens the next.

0 Kudos
Message 4 of 5
(2,625 Views)

Thanks guys!  It works beautifully now using floating windows.

 

-Tim

0 Kudos
Message 5 of 5
(2,577 Views)