LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

For loop not indexing

I am trying to compare all of the y-components of an analog in wave signal to a given number. For some reason, even with auto-indexing on, only one number in the y-component array given by "get waveform components.vi" is compared. What is happening?

Thanks,
Joe
0 Kudos
Message 1 of 5
(2,855 Views)
There could be many reason. Could you attach a small example.

A FOR loop iterates only as many times as the smallest autoindexing array. Are there any other array inputs set to autoindexing? What is their size?

Could it be that a (1) is wired to the "N" terminal of the loop?
0 Kudos
Message 2 of 5
(2,849 Views)
Sorry about that, here's the code with the indexing loop.
0 Kudos
Message 3 of 5
(2,847 Views)
And here's the one where it's implemented.
0 Kudos
Message 4 of 5
(2,847 Views)
You only compare the last number, because the output of the loop is NOT autoindexing, thus only contains the last comparison.

Depending on what you need, you can do several things.

First of all, Simply delete the loop (right-click on it, select "remove FOR loop"), it is not needed. If you want a boolean array for the comparison result of each element, take the output of the comparison operation directly.

If you want a single boolean, feed the output of the comparison operation either through an "AND array elements" or "OR array elements" to get a TRUE if either at least one is bigger/equal or all are bigger/equal, respectively.

The image shows three possible outputs discussed above. Pick whatever you need.

Message Edited by altenbach on 06-17-2005 04:04 PM

Message 5 of 5
(2,845 Views)