07-24-2012 12:55 PM
Ah, I see. So how would I go about doing that?
07-24-2012 01:01 PM
Break the data dependency. Why do you connect the VISA Resource and address from the for loop to the while loop? It's not at all necessary. Why do you stop the while loop when the pump is stopped since you stop the pump after each iteration? Don't you want to stop the while loop when the for loop stops? That is going to take a bit more complicated logic than what you have right now.
07-24-2012 01:11 PM
I don't stop the while loop until the user hits the stop button.
07-24-2012 01:12 PM
But yes, I want to stop the while loop when the for loop stops. How do I do that?
07-24-2012 01:27 PM
@Mike227 wrote:
I don't stop the while loop until the user hits the stop button.
That's not true at all. Perhaps you are using yet a different VI than what you posted but what you have there is the while loop stops when the Stop button is true OR the Stopped Status is true.
A simple hack would be to set a local variable outside the for loop. Read that inside the while loop along with the front panel Stop button. There are other and more elegant ways but that should get you going in the right direction.
07-24-2012 01:29 PM
Why have you not implemented the state machine architecture like you were instructed to do in your other message thread?
We can't help you solve you problems if you aren't willing to follow the advice you were given and insist on blindly following your original path.
07-24-2012 01:46 PM
Dennis,
When I do that, receive this error. Can you show me the correct way?
07-24-2012 02:11 PM - edited 07-24-2012 02:17 PM
NO, NO, NO.
Simply wire the VISA Resource over on the left side to the while loop where it was before - into the shift register. Do NOT use a local variable for this and do NOT wire the VISA Resource into the OR gate. When I mentioned using a local, use a simple Boolean. Call it something like LoopDone. Place a True constant inside the for loop and wire it to the local OUTSIDE the loop. Place the same local INSIDE the while loop and wire that to the OR function. Before the for loop and while loop start, you have to initialize the local to false.
07-24-2012 02:46 PM
Sorry! I'm new here.
I still am getting this error....attached is my VI
Thank you!
07-24-2012 02:50 PM
When in doubt, right click.