LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple sheets from Excel into 2D array for graph

Solved!
Go to solution

Hi there,

 

I want to read multiple sheets from an excel workbook and create a 2D array from this data to create a graph containing all measured data in the workbook. I can't get this working, I tried things from connecting the graph directly to the 'Excel Get Data' to building an array to inserting into new array, nothing seems to work. I hope someone here can help me. A screenshot is below:

 

Excel lezen.gif

0 Kudos
Message 1 of 19
(2,982 Views)

Hi,

I found this example:

http://www.ni.com/example/28409/en/

 

Another example is attached. I think the attached example could serve as an inspiration.

 

Hope this helps!

 

Simyfren

0 Kudos
Message 2 of 19
(2,958 Views)

Sorry,

attached file here

Simyfren

0 Kudos
Message 3 of 19
(2,955 Views)

Thanks for your reply, but reading the excel sheets is not the problem. It gives me a 3D array with a page for every sheet, I need to convert this to 2D array so I can display it through a graph or chart and that's the point where I get stuck on..

 

*I'm using the Report Generation Toolkit to write and read excel files.

0 Kudos
Message 4 of 19
(2,950 Views)

HI,

try to use array function from programming palette. I think Index array function should help.

Simyfren

0 Kudos
Message 5 of 19
(2,945 Views)

I've already tried using Insert Into Array and Build Array, but I can't get it working with both of them.

0 Kudos
Message 6 of 19
(2,940 Views)
Your entire application is not clear from the code you provided, but the way the description is written you need to create the Excel graph INSIDE the for loop. That is where the data is still only 2D.
Michael Munroe, CLD, CTD, MCP
Automate 1M+ VI Search, Sort and Edit operations with Property Inspector 5.0, now with a new Interactive Window Manager!
Now supports full project automation using one-click custom macros or CLI.
0 Kudos
Message 7 of 19
(2,931 Views)

Hi,

I don't know you data structure correctly. But as Michael Munroe said, the way is tu put 3D array into for loop, then you have 2D array. Then if you index 2D pole, first element should be X channel, second element should be Y channel (but as I said I don't know your data structure precisely).

Simyfren

0 Kudos
Message 8 of 19
(2,920 Views)

I've tried using a for loop too, but when I use the 'Insert into Array' function it gives me an error.. I really don't know any other options Smiley Indifferenterror.gif

0 Kudos
Message 9 of 19
(2,906 Views)

First I thought I understand your problem until I read that you use the insert into array function.

 

Maybe you should give us a little bit more information of what u like to do.

Do you want to show the 2D array in a Graph or add new elements to the array or just get rid of the third dimension...?

 

Regards,

 

CMW

0 Kudos
Message 10 of 19
(2,900 Views)