10-12-2007 04:31 AM
10-12-2007 08:39 AM
Technically, your VI doesn't look ok at all.![]()
While your inner while loop is spinning, the outer while loop is paused, waiting for the inner to finish. The inner cannot finish because it needs the local variable to be updated, which can never happen. You need to get a better grasp of dataflow and how LabVIEW executes code. Turning on highlight execution would have revealed the problem. There is a simple way to accomplish what you want and it does not require any local variables or additional loops. Try the attached mod. It uses a shift register and a build array to accumulate values that pass.
10-13-2007 05:17 AM
10-13-2007 09:50 AM
You didn't have a connected variable through a tunnel - you had a local variable inside the while loop. The local wan't doing anything becuase the place where you were writing to it wasn't getting updated. Even if you had used a wire going through a tunnel, that wouldn't have worked either. The while loop would only get the intitial value of the wire. You can't pass updates to loop until it stops and your restart it.
And why did you go and mess up a perfectly good example.
The shift register and indicator will work just like I did it. A local variable is just bad programming in this case.
10-14-2007 07:03 PM