11-15-2018 12:04 PM
Hello community,
The LabVIEW-Code should compare a 1D Array in intervals of 3 elements with a constant. If all elements in the interval
is less than the constant "2", then the while loop should stop verification.
I would appreciate any kind of suggestion and contributions.
Solved! Go to Solution.
11-15-2018 12:53 PM - edited 11-15-2018 01:14 PM
11-15-2018 01:23 PM
It is really not clear what you want, but here is some simple code that looks at the array and checks if there is a sequence of 3 elements that are all <2, and returns the first occurrence. While this is probably not the solution, it might give you some ideas....
11-15-2018 01:51 PM - edited 11-15-2018 01:51 PM
@altenbach wrote: I don't think you need the FOR loop at all.
Sure you do.
11-15-2018 01:58 PM
Thats exactly what I'm searching for! Thanky you very much.
11-15-2018 02:00 PM
@crossrulz wrote:
@altenbach wrote: I don't think you need the FOR loop at all.Sure you do.
I was under the impression that his FOR loop was for data prep and that the checking would be happening in his while loop. So, yes, one of the two loops is not needed. Still, the code was so broken that it was hard to tell what the intention of the various elements really was. 😄
11-15-2018 02:07 PM - edited 11-15-2018 02:12 PM
While Tim's code is simpler, my code is more flexible because I assumed that you'll ultimately receive data in the loop forever, one point at a time, then continue once the condition is met. Just change to a while loop and read your AI or whatever inside the loop.
Here's how that could look like. This loop will stop after three successive random numbers [0..10] are all <2.
11-15-2018 02:08 PM
@altenbach wrote:
@crossrulz wrote:
@altenbach wrote: I don't think you need the FOR loop at all.Sure you do.
I was under the impression that his FOR loop was for data prep and that the checking would be happening in his while loop. So, yes, one of the two loops is not needed. Still, the code was so broken that it was hard to tell what the intention of the various elements really was. 😄
I knew what you were saying. I was just trying to be a smart aleck.