LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

stopping a subvi from the main vi with a global variable

 

Hello,

 

I want a vi and a subvi to stop simultaneously. Thus, I created a global variable, STOP, which I connected it with the stop of the main vi and also with the conditional terminal of the subvi. However, it doesn’t work. Could somebody explain where am I wrong?

 

Thank you in advance

 

 

Download All
0 Kudos
Message 1 of 20
(4,777 Views)

Polling principle is the key. In Your main.vi global variable won't get "true" until subvi ends. Your code should be modified.

0 Kudos
Message 2 of 20
(4,771 Views)

These vi's will do.

 

Regards.

Download All
0 Kudos
Message 3 of 20
(4,767 Views)

Thanks for your response but could you be more specific?

0 Kudos
Message 4 of 20
(4,766 Views)

I've changed main.vi a little. Just look.

0 Kudos
Message 5 of 20
(4,762 Views)

Thanks again, but I am using LabVIEW 8.6.1, could you please save the vis for this LabVIEW version.

 

Thank you in advance

0 Kudos
Message 6 of 20
(4,755 Views)
0 Kudos
Message 7 of 20
(4,739 Views)

Hi,

You are making 2 mistakes. The first is that you didn't temporize the loops. The second is that when you launch the main VI this straight away launch the subvi that get the control and don't release till something change the value of the global variable, but in that time the main isn't running, so even though you press the stop button the main is in not running mode and doesn't change the variable.

 

Try this with the VI server to pass trough the control between two VIs.

Ricky
Italian Developer engineer
www.www.selt-sistemi.com
Download All
0 Kudos
Message 8 of 20
(4,727 Views)

I'm sorry but I have forgot to tell you to be carefull to the machanical action of the stop button when you use the VI server method to pass the data  through VIs.

Ricky
Italian Developer engineer
www.www.selt-sistemi.com
0 Kudos
Message 9 of 20
(4,720 Views)

Dear g_Ricky,

 

Thank you for your reply. Could you please save the vis in 8.6.1 LabVIEW version because I can't open it.

 

Thank you in advance

0 Kudos
Message 10 of 20
(4,713 Views)