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.
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.
08-21-2019 08:17 AM - edited 08-21-2019 08:22 AM
Am trying to create a pop up screen from my Main VI. So I need to reference to it using VI server from the Main and also close the SubVI when the user choses to close it.
In development mode I can use: current VI's path for the subVI or I can use current VI's path for the main and then build/strip path to get the subvi or I can use Application Directory.
Question is how will this be done when the application is built--- as in the application the path of the subvi does not exist anymore? Is it automatically located?
Solved! Go to Solution.
08-21-2019 08:51 AM
08-21-2019 08:58 AM
Hi rajiv,
In development mode I can use: current VI's path for the subVI or I can use current VI's path for the main and then build/strip path to get the subvi or I can use Application Directory.
You can also use a static VI reference…
Question is how will this be done when the application is built--- as in the application the path of the subvi does not exist anymore? Is it automatically located?
The path of the subVI typically stays the same inside the executable (since LV8 or so)…
08-21-2019 09:11 AM
@GerdW wrote:
...
You can also use a static VI reference…
...
That is my preferred method unless dynamic instanciation is required.
Ben
08-21-2019 02:27 PM
I do this using a sub-Panel in the Main VI. When I want to run (and see the Front Panel of) a sub-VI, I use a Static VI Reference to the sub-VI and wire it to an Insert VI Method for the sub-Panel. This not only starts the sub-VI running as a parallel asynchronous loop, it also provides access to controls and indicators on its Front Panel which act in the context of the sub-VI.
The same code works both in Development Mode and when built into an Executable (the Static VI Reference works wonders in this way).
Bob Schor
08-21-2019 02:36 PM
Piling it on...
Another bonus of the static reference is that it includes the target VI in the hierarchy of the caller. This means no surprises when we try to invoke the VI and find out it was broken since it was not open and some code change broke it.
Ben
08-26-2019 05:46 AM
Thank you all for the responses!!