LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

stop subVI without stopping main VI

I have made a vi named automation_final2.vi. But I have to used it in another Vi named automation1.vi. I am using automation_final2.vi as subvi with made all the controls according to my need. But there is a problem if I am running automation1.vi and wanted to stop automation_final2 subvi with the stop control button that I am unable to do. Please help.

I am attaching both the vis.

0 Kudos
Message 1 of 3
(2,681 Views)

I hope your automation1.vi just calls Automation_final2.vi. try to use Automation_final2 .vi itself as main vi which will solve your problem simply

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 2 of 3
(2,654 Views)

LabVIEW works using a principle called 'dataflow'. Essentially, the problem you're having here is due to this design - subVIs don't execute until all of their inputs are available. In your case, the value of the 'Stop' boolean in your main VI is read, and that VALUE is passed to the inner, subVI.

 

When you try to change the outer VI's Stop control value, even if your outer (main) VI is responsive, it won't pass the new value to the subVI. If you want to do this, you'll need to set up some other communication method with your inner, subVI.

 

The simplest method would be to pass a reference to the outer stop control, instead of the value. Then, you can check the value using a property node. However, this isn't going to be the fastest way - just the simplest.

 

Alternative methods you can consider would include a User Event, or a Notifier. These are more advanced tools but will be very useful to you if you need to communicate between VIs often. Forum threads describing them can be found here and here.

 

Let us know if you need more help with one (or more) of these options. The Getting Started links at the top of this forum might also be helpful for you.


GCentral
Message 3 of 3
(2,641 Views)