03-28-2016 07:10 AM
Hi all,
I have an excel file and its consists of Freq, DOA, Voltage-1, 2, 3 & 4.
Freq & DOA are the inputs to find out the voltages. But here one frequency corresponding to set of DOA Values. That means Both the values (Freq & DOA) are repeating in the excel.
For more clarity please find the enclosed excel sheet.
If it is not repeating means we can easily search but here the value are repeating and i am not able to match the both row indexs.
Please provide the solution for this case.
Thanks & Regards,
S Nagaraju
Solved! Go to Solution.
03-28-2016 07:35 AM
03-28-2016 08:35 AM
Your data consist of 6 columns arranged as one Header row and multiple "Data" rows, where all of the data are numbers (integers, in fact).
You can easily read everything from Row 2 on into a 2D Array. To simplify the sorting and searching you'd need to do, I would advocate created a Cluster of 6 I32s (or Dbls), called Freq, DOA, Chan 1, Chan 2, Chan 3, and Chan 4, then (in a For Loop), make it a TypeDef ("My Data") and change the 2D array of I32s into a 1D Array of My Data.
Now your problem simplifies easily -- given a pair of Freq and DOA, locate the My Data record that matches and return the four Chan X values.
The solution to the first part (reading the Worksheet) has been covered numerous times, and there are Examples, I believe, in LabVIEW. If you get stuck, post your code (as VIs, please) and we'll help.
Bob Schor
03-28-2016 11:31 PM
Dear sir,
I followed your suggested approach. But I didn't understand “change the 2D array of I32s into a 1D Array of My Data”.
Here I am attaching the VI what I tired.
Kindly help for solution.
Thanks,
S Nagaraju
03-28-2016 11:58 PM
Dear ben64,
I am using Report Generation Toolkit.
Please find the enclosed VI which I tried initially and it is searching upto first match after that stopping.
Thanks,
S Nagaraju
03-30-2016 12:13 AM
HI Nagaraju,
The way Ben told is also a good idea to implement. You can also try sequential searching which means first search the frequency and use that index ass offset and search for the DOA. It should help you out.
03-30-2016 08:07 AM
@parkalaae wrote:HI Nagaraju,
The way Ben told is also a good idea to implement. You can also try sequential searching which means first search the frequency and use that index ass offset and search for the DOA. It should help you out.
I guess you're talking about Bob's idea.
Ben64
03-30-2016 12:08 PM
03-30-2016 11:15 PM
Thank you very much for the replay.
01-20-2019 08:27 PM
Hi @ben64, could you please give me a vi file. Thanks