01-03-2021 10:08 AM
Hello NI community,
Attached is a LabVIEW 2018 SP1 application in which 2 1D arrays of string are compared. If they match, then an array of indices is generated. In this application, the array of indices should be 57, 56, and 170 in order.
However, I only get the index of 170. I would appreciate your help in solving this minor problem.
Solved! Go to Solution.
01-03-2021 10:40 AM - edited 01-03-2021 10:40 AM
Change the tunnels of the inner for loop to a shift register, as you have for the outer for loop.
01-03-2021 11:28 AM - edited 01-03-2021 11:28 AM
01-03-2021 11:57 AM - edited 01-03-2021 12:00 PM
Assuming that the elements in the master array are unique and each selected exists (If it does not, you'll get -1), all you need is the following:
(the function is "Search array". btw. I don't understand the purpose of your flat sequence.)
01-03-2021 12:04 PM
Thanks for your help, GerdW & UliB
01-03-2021 12:06 PM
Thanks, altenbach
01-04-2021 10:40 AM
Hello altenbach,
Attached is an updated version "2021_01_03_string_comparison_01.vi" in which the array of master item codes is embedded in a tree control. If an item code is selected, then it becomes disabled.
I would appreciate your help in getting the last item code in the tree control disabled. Thanks.
By the way, I hope you understand the purpose of my flat sequence structure.
01-04-2021 10:49 AM - edited 01-04-2021 10:50 AM
cha@bellflight.com wrote:
By the way, I hope you understand the purpose of my flat sequence structure.
No I don't understand the purpose of your flat sequence!!! You code would work identically if you remove the flat sequence because all important execution orders are fully determined by dataflow principles.
cha@bellflight.com wrote:
Attached is an updated version "2021_01_03_string_comparison_01.vi" in which the array of master item codes is embedded in a tree control. If an item code is selected, then it becomes disabled.
I would appreciate your help in getting the last item code in the tree control disabled. Thanks.
Sorry, it is not clear what you want. First you say you want the selected item disabled then you say you want the last item disabled. Are these the same or different things? What is the order of items (first/last/etc.)? Don't you need a loop and e.g. event structure to tell when selections change? To react to user interactions?
01-04-2021 11:13 AM
01-04-2021 11:23 AM
Thanks, altenbach, for your help,
I still use tree control in conjunction with an event structure in a WHILE loop, and get all 3 item codes, P00016, P00017, and X00028 disabled!