06-24-2014 04:26 AM
I'll try to explain as clear as I can.
I'm reading data from an excel workbook with multiple sheets (a new sheet for every measurement), this happens with code in the picture in the opening post. Once I exit the for loop with my data it becomes a 3D array. I want to display this data in a graph or chart or whatever so I can compare the measurements but a graph/chart can't show data from a 3D array so I need to convert it to a 2D array.
06-24-2014 04:45 AM - edited 06-24-2014 04:47 AM
Hi,
I think Simyfren already mentioned the correct solution: use the index array function. I attached a simple LV 2013 example.
06-24-2014 04:50 AM
Hi,
I know how to read the 3D array with an index function, but I want to put all the data from the 3D array into one 2D array, reading the different pages is not what I need.
06-24-2014 05:14 AM
Hi,
Sorry, I misunderstood. You could do that like this (I right-clicked the Build Array function and selected Concatenate Inputs):
06-24-2014 05:23 AM
That's almost how I'd like it, and that's where I wanted to use the Insert into Array VI. I would like to add the different pages in new columns, instead of rows. First of all: is that possible without using Insert into Array? Because I still get the same error with that VI.
06-24-2014 06:16 AM
Hi,
That could be solved by transposing the array. I used the transpose twice to keep the rows ordered as in the original 3D array. I changed the initial 3D array to better show why the first transpose is needed.
06-24-2014 06:32 AM - edited 06-24-2014 06:48 AM
Transposing twice didn't came up in my mind, looks good!
Except, when I try to implement this in my own pogram and I go into the 2nd for loop where the 3D array is indexed, the 3D array becomes a 2D array and I can't find the problem here.. Please see attached images.
*************
Well I've solved that part by right clicking the tunnel and disabling indexing. Next problem appeared when build the array in the last for loop, it creates a 3D array instead of a 2D array.. It might be very easy, but I'm not that experienced with LabView..
06-24-2014 07:42 AM
I forgot to look at where you are coming from. The 3rd dimension is created by the FOR loop that reads the excel file. That can be prevented: if you right-click the output tunnel of that loop, you can choose Tunnel Mode>Concatenating. You will get a 2D array out. You still need to transpose, but an additional FOR loop is not needed here. I made 2 examples, one with and one without transposing:
06-24-2014 08:15 AM
Sweet, a solution and I've learned some new stuff with the tunnels etc. Thanks!