LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Trying to seach array with duplicate values

Solved!
Go to solution

I have two arrays, an example of the first array can be seen in the first column of the picture and the second array can be seen in the second column of the picture.

FordClark001_1-1759855694707.png

 

I need to read a configuration file and take the key name and search for it in the first array then take the key value and search the second array. The row that contains the matching value of both the first array key name and second array key value then needs to be deleted. Attached is my attempt that will only find and delete the first row if that point is specified in the configuration file, for example it would be able to find and delete 2, 45 and not 2, 54 from the picture above.

 

Does anyone have any suggestions to be able to find values that are not in only the first row?

 

Attached is the VI I created that doesn't work and a sample configuration file. To use the sample configuration file the current part number must be set to 01H03000 ATP.ini, the current test must be MIN UNLOCK, and the current condition must be Unlock Pressure.

Download All
0 Kudos
Message 1 of 3
(221 Views)

Hi Ford,

 


@FordClark001 wrote:

I have two arrays, an example of the first array can be seen in the first column of the picture and the second array can be seen in the second column of the picture.

 

Attached is the VI I created that doesn't work and a sample configuration file. To use the sample configuration file the current part number must be set to 01H03000 ATP.ini, the current test must be MIN UNLOCK, and the current condition must be Unlock Pressure.


Unfortunately your VI does not contain any of that array data.

And your ini file only contains a key "647", which is NOT shown in your image of "typical" array data!

 

So please provide senseful default data in your VI!

 

Generic advice: why do you open the INI file, but never close its reference? ALWAYS close references that you explicitely opened before…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 3
(191 Views)
Solution
Accepted by FordClark001

So why isn't the input a 2D array as shown?

 

It would be simpler to just autoindex on the two arrays, check for a match of both values, and use a conditional indexing output tunnel. 98% less code!

 

(Yes, it seems you attached the wrong ini file.)

 

Here's a quick draft...

 

altenbach_0-1759865286350.png

 

Of course your fields must be integer or strings. Comparing (or searching for) floating point values is extremely dangerous!

 

Message 3 of 3
(172 Views)