From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, 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: 

Close the caller of a subVi while the subVI runs

Solved!
Go to solution

Hello, I have the following setup and a problem that I can't solve yet:

a Main VI with its user interface that dynamically calls subVIs.

One of those subVI calls another VI which has second User Interface that should keep running in parallel with the main User Interface while the caller VI is closed and the next dynamically called subVI runs.

How can I achieve that? Everytime I arrive at the point where my subVI that calls the second UI runs, the VI with the UI starts successfully but the caller VI is "stuck" and waits for my UI to be closed in order to go to the next dynamically called subVI.

If someone can help me it would be very very appreciated!

0 Kudos
Message 1 of 11
(3,192 Views)

Hi cassaniti,

 

how are you calling your "subVIs"? Are you really calling them "dynamically" using VIServer methods?

(Mind to share an example VI or snippet?)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 11
(3,186 Views)

This is a snipped of the function that dynamically calls all the subVI. One of those subVI calls my second UI and remains stuck..

0 Kudos
Message 3 of 11
(3,180 Views)

Hi cassaniti,

 

One of those subVI calls my second UI and remains stuck..

So what is different for this subVI when other subVIs don't get stuck?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 11
(3,173 Views)

that while the other subVI perform some kind of measurement and then they are done, while this subVI is needed in order to launch the second UI with some specific parameters...

0 Kudos
Message 5 of 11
(3,159 Views)

Hi cassaniti,

 

then you must inspect this special subVI and not the calling MainVI.

 

Mind to share it along with your UI.vi?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 11
(3,132 Views)
Solution
Accepted by topic author cassaniti

@cassaniti wrote:

Everytime I arrive at the point where my subVI that calls the second UI runs, the VI with the UI starts successfully but the caller VI is "stuck" and waits for my UI to be closed in order to go to the next dynamically called subVI.


The PNG image you posted shows a standard Call-by-Reference, which is just like a subVI call, in that it waits for the subVI to finish.   But it sounds like you want to do an Asynchronous Call By Reference (ACBR), which is a different thing.  Look in the example finder for some examples of ACBR; you want "Fire and Forget", not "Call and CXollect".

 

 

0 Kudos
Message 7 of 11
(3,122 Views)
Solution
Accepted by topic author cassaniti

Block Diagram: Right-Click: Application Control -> Start Asynchronous Call 

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 8 of 11
(3,108 Views)

Thanks!! The Asynchronous Call is exactly what i needed. Specifically the "call and forget". I followed this example in order to do it:

http://zone.ni.com/reference/en-XX/help/371361J-01/lvhowto/acbr_call_and_forget/

0 Kudos
Message 9 of 11
(3,100 Views)

One more little question: how can I programmatically close this second UI that I asynchronously opened through another subVI? I don't have its reference number but only the VI name... is that possible or do I have to somehow access the task manager and kill it?

0 Kudos
Message 10 of 11
(3,096 Views)