04-04-2006 09:13 AM
04-04-2006 09:27 AM
04-04-2006 10:48 AM
04-04-2006 11:10 AM
04-04-2006 11:23 AM
@lme999 wrote:
While this code executes, a variable is set so that a F will be sent to the loop condition terminal, and when that happens, the code executes one more time, then it is finishes.
Something is wrong here! (could it be there is a feedback node somewhere? Hidden wires?)
Please attach a simplified version of your VI that demonstrates this behavior. What is your LabVIEW version?
04-04-2006 12:33 PM
04-04-2006 12:47 PM
I would think that with the "Input" at 1 (or anything above 0.5), the RunDisp variable gets set to F on the first time the code inside the outer while loop is run. Then this causes an F to get sent to the "Run While True" loop condition terminal. I think the code should end there. But it goes back and runs the inner code one more time (as can be seen by the "Loop Count" beint at 2 when the code is finished".
When the "Input" is set at something below 0.5, then RunDisp is set to T, then the loop counter is 1 which is less than or equal to 1, so the value sent to the Run While True loop condition is T. So the code executes again. This time however, the loop counter is 2 which is not less than or equal to 1. So the value sent to the Run While True loop condition terminal is F. However the code executes one more time. For a total of 3 times.
If I change the constant that the loop counter is compared with to "0". Then the code always executes twice, regardless of the value of "input".
04-04-2006 12:54 PM
04-04-2006 01:03 PM
I agree with smercurio_fc .
Your code is a prime example for a race condition introduced by local variables. The local variable is read in the outer loop way before you write a different value in the inner loop. There is absolutely no need for any local variables, just use wires.
04-04-2006 01:23 PM