LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading spreadsheet data and converting to an array.

I want to be able to read a spreadsheet and then convert the data to a 2 dimensional array.
I have been able to read the spredsheet using the read spreadsheet VI in Labview 8.
But I haven't figured out where the data is stored once it is read and how to convert the data
to an array.
Any ideas?
 
0 Kudos
Message 1 of 8
(3,495 Views)
It's isn't stored anywhere, unless you wire the output of the 'read spreadsheet data vi' to something else.  For example an indicator.
 
See example vi...
0 Kudos
Message 2 of 8
(3,474 Views)

I got that part but I read the data in from the spreadsheet, now how do I access that data.

Say for example I store numbers in a spreadsheet and later I want to use them in labview.

How do I get the data into an array and access the data so I can use it?

 

 

0 Kudos
Message 3 of 8
(3,451 Views)
The data is in the "wire." This is a fundamental concept of LabVIEW. The controls and indicators are not the variables; they are just user access points. The "variable" (if you are familiar with text based languages) in LV is the wire. Just connect the wire to the icon of the function you wish to apply to the data (mean, for example) and the result will be on the wire coming out of the icon.

Lynn
0 Kudos
Message 4 of 8
(3,445 Views)

Yes I am familiar with text based languages. And I am new to Labview as you can tell.Smiley Very Happy

Thanks for the help is there an example anywhere I can study?

 

0 Kudos
Message 5 of 8
(3,443 Views)
Help >> Find Examples...
Also, you can right click on almost anything and select "Help".  A lot of the helpfiles have links to examples demonstrating the use of that function.  (Sadly, Read from Spreadsheet File is not one of these).

This forum is an incredible resource once you get the basics under your belt.
0 Kudos
Message 6 of 8
(3,434 Views)
Lots of examples come with LabVIEW. Under Help select "Search LabVIEW Help..." In the Contents box at the left of the browser window look for "Getting Started" and "LabVIEW Fundamentals." Those will get you through the initial shock of conversion to a graphical programming language.

The other key concept is that LV is dataflow driven. That means that any node (Function, VI , etc.) may execute only after data exists at all of its inputs. (Long complicated way to say "Follow the wires.") That is often a stumbling block for programmers converting from text languages.

Welcome to the world of wireworking!

Lynn
0 Kudos
Message 7 of 8
(3,436 Views)
Normally, data only flows once through a wire.    It is generated once at a source, and then flows through the wire to be processed at the next vi. 
 
If you want to store data, you need a special construct.
 
Typically, you can will use shift registers for that.   Your program will probably have a main execution loop.   The shift register of this loop then holds the data.    See the first attached example program .    Let it run, with highlight execution on (the lamp in the toolbar of the block diagram)     That will probably give you a good feeling for how Labview works.
 
The second example program is similar to the first.   But it uses an event loop, to handle the different parts of the program. 
 
 
There's other ways of storing data.   Often, you simply let the data flow to an indicator, and 'store' your information in the indicator.   When you need the data later, your read the indicator using a property node.  (right-click, create property node).   You can also use the property node to update the data in the indicator.
 
In the second example program, I showed both methods.  One where the data is updated using the shift register.   The second, where it is update using the property nodes.   (and also feed into the shift register, so that I don't break the rest of the program)
Message 8 of 8
(3,424 Views)