01-13-2015 07:18 AM
Dear All,
I'm new to LabVIEW, and this is the first time I try to use the asynchronous call.
I'm using LabVIEW 2011.
I want to build a directory for several VIs, and it should allow users to open more than one of the VIs at the same time by pushing the buttons. Before building this directory, I simply tried to use asynchronous call to call a VI form another VI, but found a big problem.
I followed the steps in the help file, created a strictly typed reference, set the option to x80 because I don't need the return. When I run it for the first time, it worked fine: the subVI popped up and run. Then I closed the subVI. But for the sencond time and on, when I run the caller VI, the subVI didn't pop up, instead it seemed to run silently on background because when I manually opened it from the file I found it running. Besides, I didn't find any option like "show front panel when called" of the asynchronous call.
The caller VI and subVI are attached. The address of subVI in caller VI should be changed accordingly.
What should I do to make it work properly? Thanks very much for any idea!
Solved! Go to Solution.
01-13-2015 08:11 AM
01-13-2015 10:50 AM
Hello GerdW,
Thanks so much. But I didn't find this "open FP when called" option in the right-click menu or properties of the "Start Asynchronous Call" icon. Could you tell me where to find it or how to set it?
Thanks again! 🙂
Best Regards,
Linjxz
01-13-2015 10:59 AM
Crtl+I to open vi properties but, you don't really want to do that. Once you leave a modal vi open and press run while testing some other code you'll understand the pain of working with modal vi's.
A better approach is to set the vi properties programaticly like this:
01-13-2015 11:15 AM
Jeff·Þ·Bohrer wrote:
A better approach is to set the vi properties programaticly like this:
Jeff, you will be happy to know that I used this tactic in full force on a project recently (lots of dialogs in this program). Not sure how many LabVIEW reboots it has saved me from. Reuse VIs made it even easier to do.
01-13-2015 11:29 AM
@crossrulz wrote:
Jeff·Þ·Bohrer wrote:
A better approach is to set the vi properties programaticly like this:
Jeff, you will be happy to know that I used this tactic in full force on a project recently (lots of dialogs in this program). Not sure how many LabVIEW reboots it has saved me from. Reuse VIs made it even easier to do.
Now if only "New..." was on a RCM in Project Explorer (it is under development)
01-13-2015 02:45 PM
Linjxz,
if you have already figured a solution via property node then you can disregard this answer. however the easist if not best practice method for doing what your want is to: with your FP open press ctrl+I, with "Window Appearance" selected from the drop down window click on customize. check the box for "Show Front Panel When Called" and then the corresponding "close Front Panel after ward if originally closed". Mind you that your sub VI will have to start execution closed for that to work where as programmaticly you can over come that hurdle.
Always looking to do more with less code,
Mark R
01-14-2015 01:48 AM
Yes! That's a great suggestion! Thanks Mark! 🙂
I did it as you said and it worked!
Just that If I close the subVI by the clicking the cross at up right corner of the window, it won't pop up next time I call. So I guess I need to force the loop to stop before the window close, right? Maybe I'd add an event case to stop the loop when window closed, or any other idea?
Best regards,
Linjxz
01-14-2015 05:58 AM
@linjxz wrote:
Yes! That's a great suggestion! Thanks Mark! 🙂
I did it as you said and it worked!
Just that If I close the subVI by the clicking the cross at up right corner of the window, it won't pop up next time I call. So I guess I need to force the loop to stop before the window close, right? Maybe I'd add an event case to stop the loop when window closed, or any other idea?
Best regards,
Linjxz
Yes, closing the front panel doesn't stop any loops, so it's probably running still. You can ofc. disable the Close-button and exit through some OK-button.
It's a good habit to add Front panel close and Application close-events.
/Y
01-14-2015 09:07 PM
@Yamaeda wrote:
@linjxz wrote:
Yes! That's a great suggestion! Thanks Mark! 🙂
I did it as you said and it worked!
Just that If I close the subVI by the clicking the cross at up right corner of the window, it won't pop up next time I call. So I guess I need to force the loop to stop before the window close, right? Maybe I'd add an event case to stop the loop when window closed, or any other idea?
Best regards,
Linjxz
Yes, closing the front panel doesn't stop any loops, so it's probably running still. You can ofc. disable the Close-button and exit through some OK-button.
It's a good habit to add Front panel close and Application close-events.
/Y
You're right Yamaeda! Thanks! 🙂