From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

search 1D array

Solved!
Go to solution

Hello guys,

 

I have a noob question.

I try to search with "Search 1D Array" function into an elemens of array.

In this elements I have same element in diferent rows.  

If I run the "Search 1D Array" i receive only 1 index.

 

The question is:

How to find all indexes for that element ?1d array serch 

 

Thank you for your help!

0 Kudos
Message 1 of 12
(3,927 Views)

Hi a,

 

read the help for this search function.

Then use the 3rd input, which you have left unwired so far!

 

General comments/hint:

- clean up your BD, especially around the Search1DArray function: from your image it is unclear which wire is connected to which function input/output!

- Answer the question: Where should the search function start its search, when I want to find elements after the one element I already know?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 12
(3,921 Views)
Solution
Accepted by topic author Adrian_A

Use a loop.  The Search 1D Array has an input for telling it which index to start searching at.  So you can use a shift register to tell it to start searching at the element after the last one found.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 12
(3,918 Views)

In this case i'd loop through all elements and build a new array of the selected ones.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 4 of 12
(3,898 Views)

Hello GerdW,

 

I have read the help for search function. I want to start from index 0 because I dont know where will be the element (in wich row of column).

If you see, I read the  column 4 of the table dbo.WeighingCleaning and, in this table I need to find in wich rows exist my "Cod DMC" element. This element could be in more rows.

After I find all the rows I will be able to prind this rows and comapre the data.

 

Thank you!

0 Kudos
Message 5 of 12
(3,896 Views)

Hi a,

 

please answer the last question in my previous post!

(And read crossrulz's message carefully…)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 12
(3,885 Views)

I want to search the first element after the one element that I have found. (if I have understood  your question)

0 Kudos
Message 7 of 12
(3,876 Views)

Hi a.,

 

I want to search the first element after the one element that I have found.

Right!

But why do you start to search at index 0 all the time?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 12
(3,871 Views)

Thanks crossrulz

 

With your solution I have solved my problem.

0 Kudos
Message 9 of 12
(3,870 Views)

Because I dont know how to do that. 

How to start search after the index that I have found ?

0 Kudos
Message 10 of 12
(3,867 Views)