LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to Return control to original vi after calling sub-vi?

Solved!
Go to solution

Hello All,

 

Currently, I am facing the problem that once i call a sub-vi, the control goes into the sub-vi.

 

How can i program it that once i call a sub-vi, the control goes into the sub-vi, complete the necessary task and comeback to the original vi and same can be done again in the loop?

 

Your help would be highly appreciated.

 

Thanks in advance.

 

Regards,

Nishant

0 Kudos
Message 1 of 14
(1,107 Views)
Highlighted

Hi Nishant,

 

make an indicator in the subVI and connect it to the connector pane too...

Best regards,
GerdW
CLAD expired, using LV2011SP1 + LV2017 (+LV2019 sometimes) on Win7+cRIO
Kudos are welcome Smiley Wink

0 Kudos
Message 2 of 14
(1,104 Views)

Hello Gred,

 

There is an Error Out indicator there in the VI. But, still the problem exists.

 

So, will this work? Or shall i create one specific indicator?

 

Regards,

Nishant

0 Kudos
Message 3 of 14
(1,097 Views)

Hi Nishant,

 

I don't know how the error out will help you (apart from controlling dataflow).

 

In the subVI: right-click the control's terminal, create indicator, connect control's terminal and newly created indicator, wire indicator to connector pane.

 

Now the control, that is wired to the subVI, will be forwarded "through" the subVI... Isn't it what you need?

 

And, please, type my name correctly...

Message Edited by GerdW on 02-10-2010 05:40 PM
Best regards,
GerdW
CLAD expired, using LV2011SP1 + LV2017 (+LV2019 sometimes) on Win7+cRIO
Kudos are welcome Smiley Wink

0 Kudos
Message 4 of 14
(1,093 Views)
The default behavior is that as soon as the subVI finishes, control will return to the Main. Have you done something silly like have a loop in the subVI that you cannot terminate because you are not showing the front panel of the subVI?
0 Kudos
Message 5 of 14
(1,090 Views)
You could perhaps use a locale variable on sub VI output linked to the control.  Or input a reference linked to that control to the subVI


Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 6 of 14
(1,082 Views)

Hello Dennis,

 

Yeah, i have used the while loop inside the sub-vi and not showing the front panel of sub-vi.

 

Here with this I have attached the vi that i am using for sub-vi, can you suggest me modification in that?

 

Thanks for the help.

 

Regards,

Nishant

0 Kudos
Message 7 of 14
(1,057 Views)
Remove the while loop. This would seem to be pretty basic. Even standalone, what would be the point of a loop? What's the point of the whole subVI?
0 Kudos
Message 8 of 14
(1,053 Views)

Hello Dennis,

 

But that would not do as the open window will be called continuously and it will return the error.

 

Regards,

Nishant

0 Kudos
Message 9 of 14
(1,047 Views)

That makes no sense to me. Each time you call the subVI, you would presumably be passing a new project path, library path, and variable array. Your subVI should have the Close Window method in it. The while loop does not serve any purpose. It would add the variable names and then return.

 

0 Kudos
Message 10 of 14
(1,038 Views)