LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Sub VI operation

Hello,
 
I have a VI which calls a sub VI's front panel for inputs, it calls for a number, then in the sub VI you select two boolean controls, both stop the sub.vis while loop, but one selects to send the number to the Main vi, while the other is supposed to send a "true" to stop the main VI's while loop.  What happens is that the function to send the number works fine, but if I just select the boolean to send out the "true" to end the test,  it does not exit the sub vi.  If I run the Sub VI on its own though it seems to work just fine.   I have attached the Sub vi.  Any suggestions?  I am sure I am just missing something simple 😞  
 
 
Andrew
 
 
 
0 Kudos
Message 1 of 5
(2,856 Views)

Doh! it was a very simple solution, I had another while loop waiting on the condition from the "enter serial number" boolean Smiley Mad

 

 

 

Andrew

0 Kudos
Message 2 of 5
(2,847 Views)

'glad you solved it.

Still, your subVI needs a small wait in the loop. There is no need to spin it millions of times per second doing nothing useful, starving all other running processes for CPU. 😉

(better yet, use an event structure)

Message 3 of 5
(2,832 Views)

Thanks for the advice altenbach,  I threw in a 2 second wait on the loop.

 

Andrew

0 Kudos
Message 4 of 5
(2,816 Views)
Two seconds is a bit long. You should set it such that it reacts without a perceptible delay when you press a button. Try 50-200ms.
Message 5 of 5
(2,807 Views)