LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to read an excel file

 

 

Hi everyone,

 

I am working on an application in which I need to open an excel file , read each individual cell and populate the data in an array, the excel file is user defined and may have different # of rows each time, I use Variant/worksheet/Range/Cell ..Cell to set the range manually, is there any better way to define the range automatically for example once the excel file gets open it can define BOB and OF,

Thanks for the help.

0 Kudos
Message 1 of 3
(2,375 Views)

 

Hi shimblo,

 

it reads like the Excel files you need to process are containing channels/waveforms and descriptive information. If this is the case you can read these kind of Excel files using a DataPlugin and by this map it to the 'TDM world' - meaning you can access these Excel files as if they were TDM(S) files by using the Storage VIs and access waveform data and descriptive information in a general way.

 

For more details see

Message 2 of 3
(2,359 Views)

Hi Stefan R.,

 

The excel file looks like below:

 

Line# Mode Command Value(000.00) LL (V,A,kW) UL (V,A,kW) Time (00,00,00.00)
1 current charge 123.00 (34,-50,99) (-380,540,100) (00,20,10.02)
2 power discharge 124.00 (34,-50,99) (-380,540,100) (00,20,10.02)
3 current charge 124.00 (34,-50,99) (-380,540,100) (00,20,10.02)
4 power discharge 125.00 (34,-50,99) (-380,540,100) (00,20,10.02)
5 current charge 125.00 (34,-50,99) (-380,540,100) (00,20,10.02)
6 power discharge 126.00 (34,-50,99) (-380,540,100) (00,20,10.02)
7 current charge 126.00 (34,-50,99) (-380,540,100) (00,20,10.02)
8 power discharge 127.00 (34,-50,99) (-380,540,100) (00,20,10.02)
9 current charge 127.00 (34,-50,99) (-380,540,100) (00,20,10.02)
10 power discharge 128.00 (34,-50,99) (-380,540,100) (00,20,10.02)
11 current charge 128.00 (34,-50,99) (-380,540,100) (00,20,10.02)
12 power discharge 129.00 (34,-50,99) (-380,540,100) (00,20,10.02)
13 current charge 129.00 (34,-50,99) (-380,540,100) (00,20,10.02)
14 power discharge 130.00 (34,-50,99) (-380,540,100) (00,20,10.02)
15 current charge 130.00 (34,-50,99) (-380,540,100) (00,20,10.02)
16 power discharge 131.00 (34,-50,99) (-380,540,100) (00,20,10.02)
17 current charge 131.00 (34,-50,99) (-380,540,100) (00,20,10.02)
18 power discharge 132.00 (34,-50,99) (-380,540,100) (00,20,10.02)

these are the user enteries that later on sould be sorted as commands/values in array form, in this example the # of row is 18 but it that can vary each time, so I have to determine the #of rows each time and enter it manualy to my VI to read the whole file properly, is there any other method that the # of row can be determined automatically once the excel file is loaded?

Thanks for the help.

0 Kudos
Message 3 of 3
(2,350 Views)