LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to maintain VI active while SubVI is running?

Hello
I need to run adjusting subVI when it's necessary and operate both VI and SubVI simultaneously. Then, when it's done, I want to close subVI (get out from memory) and stay in the main VI. I found only one decision: run subVI at the very beginning at the hiden mode, and show it whet it necessary. But this way is no good for memory optimization. Any good ideas?
0 Kudos
Message 1 of 9
(3,731 Views)

You CANNOT conclude on memory optimization like this.

If you explain more of your requirement exactly, maybe somebody else expert on this can comment on memory optimization issues & so on...

If you want your MainVI to be active even after SubVI is invoked, you can do so by various means.

By simply setting the Window property to be of non-modal dialog type, you can operate on both the windows. What I mean to say is you need not close the SubVI to return to your MainVI.

- Partha ( CLD until Oct 2027 🙂 )
0 Kudos
Message 2 of 9
(3,728 Views)

Sorry, forgot to mention...

You ve to use Floating dialog property for the VIs' Window property settings. Then you can operate on both the VIs simultaneously.

- Partha ( CLD until Oct 2027 🙂 )
0 Kudos
Message 3 of 9
(3,725 Views)

Thanks for reply

The problem is that I want not to have main VI in active state during subVI running, but operate it (main VI). At the following picture you can see an example. The question is, how to make the loop iterating without waiting for subVI?

PS Now I think, it's no possible.

Message Edited by Err on 09-18-2007 01:34 AM

0 Kudos
Message 4 of 9
(3,700 Views)


Err wrote:

The question is, how to make the loop iterating without waiting for subVI?


Your SubVI is still running because of a loop. If you want to iterate the loop in the MainVI without waiting for the SubVI, then you should not run the SubVI [having its own loop whose termination is not controlled from the MainVI] inside a loop in the MainVI.

maybe you should consider redesigning your program flow...

- Partha ( CLD until Oct 2027 🙂 )
0 Kudos
Message 5 of 9
(3,680 Views)

Err,

I am not sure that I understand exactly what you are trying to do (i.e. I do not understand your comment : "The problem is that I want not to have main VI in active state during subVI running, but operate it (main VI)").  If you are looking to launch Sub-Vi from your main Vi, try using an invoke node.  If you set the properties of Sub-Vi to close after completion and the properties of the invoke node to wait until complete then I believe Main Vi will suspend operation until Sub-Vi finishes. 

Jim

Jim

LV 2020
0 Kudos
Message 6 of 9
(3,674 Views)
To follow up on the invoke node usage, here is a good KnowledgeBase article that describes how to run a VI in Parallel to a top-level VI:

http://digital.ni.com/public.nsf/allkb/F60C3F5BC762B62986256CCD0054F26E
-Sam F, DAQ Marketing Manager
0 Kudos
Message 7 of 9
(3,654 Views)

Sam,

I tried to download the example provided in that link whiach is below.

Example Program: Using VI Server to Call subVIs that Run Parallel and Independently of the Calling V...

But, it takes me to the Dev Zone page instead... Smiley Surprised

Can you just post that example here, if it is still available in NI's internal resources.

I think it ll be of much help for beginners.

- Partha ( CLD until Oct 2027 🙂 )
0 Kudos
Message 8 of 9
(3,610 Views)
Hi Partha,

Sure, here is the correct link:

http://zone.ni.com/devzone/cda/epd/p/id/4911

I will also fix the original KnowledgeBase so that it points to the correct place - thanks for bringing that to my attention!

Best regards,

Message Edited by SamboNI on 09-19-2007 08:22 AM

-Sam F, DAQ Marketing Manager
0 Kudos
Message 9 of 9
(3,591 Views)