LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

outputting a data point every second

Solved!
Go to solution

Ah, I see. So how would I go about doing that?

0 Kudos
Message 11 of 29
(1,942 Views)

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.

0 Kudos
Message 12 of 29
(1,940 Views)

I don't stop the while loop until the user hits the stop button.

0 Kudos
Message 13 of 29
(1,936 Views)

But yes, I want to stop the while loop when the for loop stops. How do I do that?

0 Kudos
Message 14 of 29
(1,934 Views)

@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.

0 Kudos
Message 15 of 29
(1,930 Views)

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.Smiley Mad

0 Kudos
Message 16 of 29
(1,927 Views)

Dennis,

 

When I do that, receive this error. Can you show me the correct way?

0 Kudos
Message 17 of 29
(1,922 Views)

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.

0 Kudos
Message 18 of 29
(1,915 Views)

Sorry! I'm new here.

 

I still am getting this error....attached is my VI

 

Thank you!

0 Kudos
Message 19 of 29
(1,902 Views)
Solution
Accepted by topic author Mike227

When in doubt, right click.

Message 20 of 29
(1,899 Views)