LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Extracting data from excel to a front panel using a PDA

Is such a thing possible?
 
I am trying to use an excel worksheet like an Access table. A PDA does not support Microsoft Access, so Excel is the next best thing.
If I have 4 column and 2 rows, as you know the header will be A B C and D
In the first row and will have 4 different values (Eg. 1, 2, 3 and 4) and in the second row 5, 6, 7 and 8.
I will have hundreds of rows later.
I want to be able to query it. For example check column A to see if there is a value 1 exist, if there is a 1, then return the four values of the row and display them in four different fields in the Front panel.
Any idea please?
 
If you have done the using just a PC, please still send something, it might give me some ideas
 
CheersSmiley Wink
 
 
 
0 Kudos
Message 1 of 8
(5,057 Views)

First, the concept. An Access table is functionally identical to an Excel sheet. It is only when adding other tables and relations that Access becomes a DB, so whatever you did before you should also be able to do now. If I understand what you want correctly, this should simply be a matter of indexing column A out of the array, using a Search 1D Array on it and using the index to get your other elements out of the 2D array.

Second, the reading. I don't think that the PDA module has any support for ActiveX yet, so you won't be able to read the Excel spreadsheet either. You will have to save it as a CSV file and then read that file in LV (use the Spreadsheet String to Array VI with a comma as the seperator). Note that if the array gets large, the PDA module might have problems reading or processing it. The same might hold true for the indexing out of column A (which will create a copy of it) and you might need to do some playing around to keep the memory consumption down.


___________________
Try to take over the world!
0 Kudos
Message 2 of 8
(5,047 Views)
OK, I'll try that. Not quite sure though. Thanks

Message Edited by TDSquare on 08-18-2006 03:51 AM

Message 3 of 8
(5,031 Views)

Hi

I'm unable to solve the problem. I tried to use the answer you suggested: simply a matter of indexing column A out of the array, using a Search Array on it and using the index to get your other elements out of the 2D array.

An example of what you said will be very helpful.

I use a Read from Spreadsheet to read the CSV file and then Insert Into Array VI and then an Indicator. I can see all the values in the indicator, but what I want to do I don't know how.

Just to clarify things again

: I want to search the first column (A or 1D array) for value (Preferably a String), if that String is found, get every thing in the Row (either Row has a value for A, B, C and D) should be returned and used to populate 4 String Controls.

I dont know how to use the String control to query the Array or how the Search 1D Array will do this.

Any help please.

0 Kudos
Message 4 of 8
(4,945 Views)
I have a feeling you read the entire file into a single cell of the array.
 
Anyway, here's a basic example of what I meant. You might need to change some stuff, but it shows the concept.
 
To learn more about LabVIEW, I suggest you try searching this site and google for LabVIEW tutorials. Here, here, here and here are a few you can start with and here are some tutorial videos. You can also contact your local NI office and join one of their courses.
In addition, I suggest you read the LabVIEW style guide and the LabVIEW user manual (Help>>Search the LabVIEW Bookshelf).

___________________
Try to take over the world!
Message 5 of 8
(4,940 Views)
Hey
 
That is very clever. I only know text-based programming, trying to interpret my algorithm into LabView Icon is quite different. I'm guessing it is straight forward to place results that was  displayed in 1D Array into 4 Separate String Control?
 
Thanks for you help. I can breathe abit easier now.
0 Kudos
Message 6 of 8
(4,933 Views)


@TDSquare wrote:

I'm guessing it is straight forward to place results that was  displayed in 1D Array into 4 Separate String Control?

Yes, it is. Simply use the Index Array function, resize it to have 4 outputs and create indicators from those outputs. This is really very basic stuff in LV, so I suggest you look at those links to become better acquainted with LV.

___________________
Try to take over the world!
Message 7 of 8
(4,923 Views)

Thanks, you are a great help. I'm looking at the links you sent me.

The Problem is solved.

Thanks

0 Kudos
Message 8 of 8
(4,893 Views)