09-08-2008 04:00 PM
09-08-2008 04:22 PM - edited 09-08-2008 04:24 PM
Your subVI is running. You just have no way to stop it!
When the VI starts, it takes the inputs going into it. A, B, and Stop which is probably unpressed and False when the main VI starts. So the subVI has a false on its stop terminal. There is no way to stop the subVI. You basically want to take the loop out of the subVI. Even if you press the Stop button on your main VI, it doesn't get read again until the subVI stops, the code in that iteration of the loop in the Main VI completes, and the loop in the Main VI starts again.
You will need to learn how dataflow works in LabVIEW. It seems like you are a new user, so I would recommend looking at the online LabVIEW tutorials, first.
LabVIEW Introduction Course - Three Hours
LabVIEW Introduction Course - Six Hours
09-08-2008 05:33 PM - edited 09-08-2008 05:34 PM
Of course, you could use a control reference for the Stop button.
With respect to the code, can you think of a better way to implement this code that you put in:
Think about it for a second.
09-08-2008 11:51 PM
09-09-2008 05:19 AM
09-09-2008 05:28 AM
the only problem is that you have place a while loop in the sub vi,
try remoe the subvi and run again
09-09-2008 05:30 AM
sorry should wrote , try removing while loop from the subvi
and this is not the only problem but it is a start...
09-09-2008 05:51 AM
Hello riot,
if you start your subVI with stop=false, your subVI is in an endless loop, which can't be stopped from your main VI.
How many times do you want to calculate your new flip-flop output value? I think 1 time is enough. Wire a TRUE constant to the conditional terminal, so your sub VI will execute only once and gives control back to your main VI.
BTW, use a Wait (ms) in your main loop to reduce CPU time.
Hope this helps.
Uli
09-09-2008 06:56 AM - edited 09-09-2008 06:57 AM
Smercurio wrote:
With respect to the code, can you think of a better way to implement this code that you put in:
How 'bout this.......