02-23-2015 05:10 AM
@Sujo wrote:
You can use the search 1D array fucntion and a for loop
I'd say that's the "normal" solution, arrays are handled with array functions. Clean and easy. 🙂
/Y
02-23-2015 05:57 AM
i tried sujo's program but was unable to connect the string auto-indexing terminal with comparator output.
is it possible in LabVIEW 2010 ???
02-23-2015 07:32 AM
LabVIEW 2010 did not have the conditional indexing tunnels. So you will need to use a shift register, a case structure, and a Build Array in order to conditionally add elements to an array.
02-23-2015 11:26 AM - edited 02-23-2015 11:44 AM
@Sujo wrote:
You can use the search 1D array fucntion and a for loop
It would probably need a little bit more code, because if the indexing array has duplicate elements, the output array will also have duplicate elements. In the general case, the result will differ if you swap the two input arrays.
For large arrays, it also becomes very inefficient because the same elements of the non-indexing array need to inspected over and over when searching. For large inputs, It would probably be more efficient to sort tne inputs and then only search from the last looked at "good" location, keeping the "start index" in a shift register.
(For small input arrays with no duplicate elements, the shown solution is OK. Trying to achieve the stability and performance of the variant solution using plain array tools would require quite a bit mode code. ;))