09-01-2013 11:13 AM
Hi,
I will be thankful if somebody could help me to write a program which would step through the rows of a 2D array and at a first element in the row smaller than a given number it will increment the counter and jump to the next row. After having gone through whole array, the counter will indicate the number of the rows meeting the verification condition.
Mike
09-01-2013 01:24 PM
You can use nested for loops with a shift register. If you right click on the inner one, select 'Conditional Terminal'. Just like a while loop,you can terminate it this way and still make use of the autoindexing. The outer for loop indexes by rows and the inner will index by element.
09-01-2013 01:34 PM - edited 09-01-2013 01:35 PM
Find attached 'Conditional Counter' (VI snippet).
Edited: Its worth knowing the concept of 'Auto Indexing'
09-01-2013 01:44 PM
That does not work since it only looks at element 0 in each row. As I understand the requirement, it should look at all elements in a row but only count a row once if multiple conditions exist.
09-01-2013 01:56 PM
Ohhh I considered checking only the first (zero indexed) element to be checked and then move on to the next row.
09-01-2013 07:37 PM - edited 09-01-2013 07:38 PM
I prefer doing these things with a comparrison and an Or Array Elements