LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

close vi and open again from a subvi

Hi,

My problem is:

I want to close the vi(1) in the subvi (2). How Can I close the vi(1) in my subvi(2) if vi(1) has called my subvi(2)? In my subvi(2) I need to close the vi (2) that has called the subvi (2) where I am now, and then, when I close the vi (1), I want to open the vi(1) (front panel) again when I press a button of my subvi(2). How Can I do it?

Thanks,

ToNi.
0 Kudos
Message 1 of 8
(3,144 Views)
This example shows the basic code for a VI to call
another VI and closes itself.

Version: LabVIEW 7.0

Cheers!
Ian F
Ian F
Since LabVIEW 5.1... 7.1.1... 2009, 2010, 2014
依恩与LabVIEW
LVVILIB.blogspot.com
Message 2 of 8
(3,128 Views)
Hi Ian

Nice code.

I posted some examples in another thread to the same topic started by ToNi, but I had problems to start the first vi after closing the second vi.

But just a little advice - if you use the Run VI function, wire a true-constant to Auto Dispose Ref. If you do not, you may keep unnecessary references in memory.

Just if you did not already know this. 😉

Thomas
Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
Message 3 of 8
(3,124 Views)
Nice reminder, Thomas 😛

Cheers!
ian f koo
Ian F
Since LabVIEW 5.1... 7.1.1... 2009, 2010, 2014
依恩与LabVIEW
LVVILIB.blogspot.com
0 Kudos
Message 4 of 8
(3,118 Views)
Hi,

Thanks very much, but I doesn't works because of in your block diagram, between open vi reference block and FP. Open property I put a call by reference node because I need to pass parameters to the subvi(2) from my vi(1) and then, when I call subvi(2) from my vi(1), vi(1) doesn't close and when I call vi(1) from my subvi(2) an error ocurrs (Modificar_pla_de_treball.vi is my vi(1) and Actualitzar_Pla_Treball.vi is my subvi(2)):


Error 1000 occurred at Open VI Reference in Actualitzar_Pla_Treball.vi->Modificar_pla_de_treball.vi

Possible reason(s):
LabVIEW: The VI is not in a state compatible with this operation.

because the vi(1) is still open.


How can I pass parameters to my subvi(2) using your diagram block?

Thanks, very much

ToNi.
0 Kudos
Message 5 of 8
(3,097 Views)
Hi,

Thanks very much, but I doesn't works because of in your block diagram, between open vi reference block and FP. Open property I put a call by reference node because I need to pass parameters to the subvi(2) from my vi(1) and then, when I call subvi(2) from my vi(1), vi(1) doesn't close and when I call vi(1) from my subvi(2) an error ocurrs (Modificar_pla_de_treball.vi is my vi(1) and Actualitzar_Pla_Treball.vi is my subvi(2)):


Error 1000 occurred at Open VI Reference in Actualitzar_Pla_Treball.vi->Modificar_pla_de_treball.vi

Possible reason(s):
LabVIEW: The VI is not in a state compatible with this operation.

because the vi(1) is still open.


How can I pass parameters to my subvi(2) using your diagram block?

Thanks, very much

ToNi.
0 Kudos
Message 6 of 8
(3,094 Views)
Hi again,

I think the problem is the following:

When I launch a subvi from a vi using a call by reference node, how can I tell it I am not interesting in wait until done? similar to invoke Method:run VI where I can set wait until done to false.

Thanks,

ToNi.
0 Kudos
Message 7 of 8
(3,082 Views)
Hi ToNi

Do you really have to close the vi's?

I don't want to force you to use the state-property (there's an example in your other thread to the same question), but I think you can avoid some problems.

Just have a try.

Thomas
Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 8 of 8
(3,073 Views)