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: 

Problem about asynchronous call: subVI front panel doesn't pop up when called.

Solved!
Go to solution

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!

Download All
0 Kudos
Message 1 of 11
(6,048 Views)

Hi linjxz,

 

when I run your example VIs as they are the subVI doesn't open, even on first call…

 

But as soon as I change the subVI settings to "Open FP when called" and "Close afterwards" it behaves like you want it to!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 11
(6,032 Views)

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

0 Kudos
Message 3 of 11
(6,008 Views)

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:

Capture.PNG

 


"Should be" isn't "Is" -Jay
Message 4 of 11
(6,001 Views)

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.


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 5 of 11
(5,997 Views)

@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.


Capture.PNG

 

Now if only "New..." was on a RCM in Project Explorer  (it is under development)


"Should be" isn't "Is" -Jay
0 Kudos
Message 6 of 11
(5,985 Views)
Solution
Accepted by topic author linjxz

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 

Message 7 of 11
(5,956 Views)

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

0 Kudos
Message 8 of 11
(5,930 Views)

@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

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Message 9 of 11
(5,910 Views)

@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! 🙂

Message 10 of 11
(5,878 Views)