> I have a 1D array of elements from 1 to 100. each number is repeated
> more than once in the array. i want to search the index when a new
> number is found for the first time in my array. if my array is
> {1,1,1,2,2,2,2,3,3,3,3,3,4,4,5,5,5,5....} i want to find the index
> when 1,2,3,4,5,.... are occured for the first time. when i use search
> 1D array function and put that in a loop and increment every time the
> search element the index i am reading is always -1.

I'm not sure exactly what you are looking for, so here are some options.

If you want to find the single index in the array where you have seen 
all of the values below a value, then build a small state machine with 
the state indicating what data values have been seen.  Within the 
states, look for the next value.  When you get to the last value, report 
the index.

If you are instead looking for adjacent items, for a certain pattern, 
you might want to use the correlation VIs.

If you are looking for the set of indices where each of the items first 
occurs, then you probably do want to use Search 1D Array, and make sure 
that the index builds into an array so you will have all of them, not 
just the last.  At any point, if you search for an element that isn't in 
the array beyond the position, then the node will return a -1.

Greg McKaskle


Reply via email to