LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Excel to labVIEW usage

Solved!
Go to solution

Hello,

 

I know that you can use labVIEW to write/read to/from excel. If you use labVIEW to read an excel file (CSV) what can you do it with it afterwards. I've seen quite a few videos and tutorials on reading/writing excel files, but I have not seen one that actually uses the excel file to do something in labVIEW. 

 

I think something like that is quite useful, and it seems like I just cannot find some examples or tutorials on that. So, I was wondering if someone could point me to the right direction in learning something like that, where you actually use the excel file in labVIEW, rather then just read it. 

 

I think that something like this would be directly related to the data type that comes out of reading an file, which would be like a 2d array string or integer. I was unable to find much on using 2d arrays as well. 

0 Kudos
Message 1 of 12
(3,578 Views)

Mostly we use csv files to store data. What do you need to do exactly?

0 Kudos
Message 2 of 12
(3,555 Views)

A CSV file is NOT an Excel file!

 

Anytime you have data, you wan to store it in some format that you can read again later, e.g. for re-analysis of the data. CSV files are realtively dumb, with the advantage that almost any software is able to easily read it.

 

What is your question?

0 Kudos
Message 3 of 12
(3,553 Views)

My question is that what can you do with after you read a csv file. 

 

What I am thinking of doing is some automation. So someone has a csv file that they import into labVIEW. And then from there the csv file is broken apart and can be used as a control.

 

Maybe the csv file has some text that reads a certain temperature. And then that temperature is created as an integer to control a ramping daq device or something like that (I'll try coming up with a better example)

0 Kudos
Message 4 of 12
(3,529 Views)

@kenypatel wrote:

My question is that what can you do with after you read a csv file. 


Since LabVIEW is a full featured programming language, you can do anything you want, no matter where the data comes from.

Why are you trying to single out file data? There is nothing special about it!

0 Kudos
Message 5 of 12
(3,520 Views)

We do behavioral experiments that involve moving speakers around in a dark room, playing sounds, possibly flashing lights, then asking subjects to "point to the sound" or "follow the sound with your eyes" or "push the button when you notice the missing sound pulse".  An Experiment typically consists of 100-200 Trials.  For each Trial, there are about 120 variables that can be set to determine (a) where the sound will be located, (b) if and how it moves during the Stimulus, (c) what sound(s) play during the Stimulus (including how loud, how many pulses, how often the pulses come, and a few other parameters), parameters for flashing lights (including a laser that can move), parameters for stationary lights, etc.

 

We use an Excel Workbook to organize each Experiment.  One Worksheet that we call Experiment has values that remain constant during the Experiment (like the Subject identifier, Version of the software, names of the Configuration files).  Another, the Trials Worksheet, has a row for every Trial, with a column for each of the 120 parameters that determine "what happens" during the Trial.  We also have a few "Output" columns at the end that we record a few Trial-specific data points, such as the number of samples recorded during the Trial (since LabVIEW is taking all kinds of analog and digital data).

 

To make things easy for the Experimenter (at the expense of the poor LabVIEW Developer), we designed the Workbook with two Experimenter-friendly Rules.  First, if a particular Trial Parameter, say Flashing Light #1, was not going to be used in this Experiment, we simply delete those columns from the Trials Worksheet, leaving us with a Worksheet containing only relevant Columns (typically 40-60).  The other thing is that if a particular Trial value is going to be a constant during the Experiment, we simply add its identifier as a new entry on the Experiment Worksheet along with its constant value and delete it from the Trials Worksheet.

 

This works very well.  Early in the development of this system, I timed how long it took to read (I don't remember how many, maybe 30 or 40) Trials, write some "fake" results in their Output Columns, then save the resulting Workbook.  I think it was about a second.

 

Needless to say, this would have been a nightmare without the Report Generation Toolkit.

 

Bob Schor

0 Kudos
Message 6 of 12
(3,518 Views)

That seems quiet amazing. I have no idea how someone is able to do something in labVIEW that quick. From all the forum posts that I have made it really does not seem I am an efficient labVIEW programmer. Even something like daq assistant turning on an output takes at least 3-6 seconds for me haha even though I seem to be using good hardware, so it probably is just me.

 

Anyways, would anyone be able to recommend me to learning resources (Free preference) where I can learn more about what I can do with an imported excel file. I really cannot seem to find any on youtube and on this forum. 

0 Kudos
Message 7 of 12
(3,452 Views)

Do you want to become a "Use Excel files in LabVIEW teacher" or you have something clear in mind you want to achieve?

0 Kudos
Message 8 of 12
(3,442 Views)
There are hundreds (maybe thousands) of posts where a file was imported and used for some specific purpose. I have no idea what you searched for but don't limit yourself to just Excel. Many use the Read From Spreadsheet. A common task is to import a waveform created by other software.
0 Kudos
Message 9 of 12
(3,419 Views)

I agree.  When I first heard about this project (about 8 years ago), they were using Excel, LabVIEW 7 with a much slower, more "difficult" Report Generation Toolkit, it took about a second to read a 50-cell row.  I remember trying to talk some of the students out of using Excel, but they made a good case that Excel was well-suited to the task.  if you are just looking for a way of writing data to a file, there are many easier ways to do this with LabVIEW than to use the RGT to write to Excel.  But if the Excel "need" comes first, then LabVIEW has some good tools to help with this task.

 

Bob Schor

0 Kudos
Message 10 of 12
(3,372 Views)