LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

searching for a list of elements in an array

Hi,

In labview you can search an array for an element and it will return the index of the element that is found. Is it possible to search an array for a list of elements, say multiple elements that are follow each other.

For example if I have some array that looks like this

1
0
1
1
1
0
1
1
1
...


the array continues for about 3000 more elements. This is digital data thas has been slightly parsed from a pxi 6561. I would like to further parsing in array form since it would be more efficient than using strings, (less memory intensive). Is it possible to search in this array for the sequence 101, and return the index where this is found.

A sample of the array I am referring to is in the indicator of the vi I have attached.

Thank you,

-Tim
0 Kudos
Message 1 of 6
(3,645 Views)
101 you mean as an element of an array? [.......,101,.......]
 
Or three consecutive elements in an array are [.....,1,0,1....] ??
Message 2 of 6
(3,627 Views)
Hi,

I mean consecutive elements [..., 1, 0, 1, ...].

Thank you,

-Tim
0 Kudos
Message 3 of 6
(3,626 Views)

Look at attached VI

It returns the index of the first element of your [1,0,1] occurance

If your array is [1,0,1,0,1,0,0,0,1,0,1,1,1,1,....]  the 1,0,1 would be detected at following indices [0,2,8,...]

Hope this helps

Regards,

Dev

0 Kudos
Message 4 of 6
(3,617 Views)
Sorry, I no longer have LabVIEW 7.1, so here's a picture of a possible solution (the "=" is set to "compare aggregates").
 

Message Edited by altenbach on 12-06-2006 10:17 PM

Message 5 of 6
(3,616 Views)
A pic of the same
0 Kudos
Message 6 of 6
(3,611 Views)