LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LABVIEW help

Hi
I am trying to write a LABVIEW code for data acquisition from a pressure sensor. What I want to do is to write my pressure readings to an Excel spreadsheet. I want to start recording data when I am ready and stop at a desired time, using a switch or a controller. Please suggest how I can use the while loops for the same.
Vaibhav
0 Kudos
Message 1 of 9
(3,422 Views)
If you want LabVIEW to interface directly with Excel, you should use the Toolkits package that includes report Generation for MS Office products. If you don't have that, then writing to Excel form LabVIEW is a bit criptic. I'd suggest you just write your data to a text file and import it into Excel when all is done. That's generally what I do even if I have the Toolkit.
I'm not sure what your question has to do while loops.
Richard






0 Kudos
Message 2 of 9
(3,409 Views)
You seem to have conflicting requirements as far as how long to read the data. Is it for a desired amount of time, or is it until some "switch" or "controller" (whatever that is) is activated? If it's the latter, what is this "switch" or "controller"? Are you talking about a front panel button, or something external that generates some signal? If so, how are you monitoring this signal?
0 Kudos
Message 3 of 9
(3,402 Views)
Thanks a lot for replying. I have a while loop that helps me in taking data from my DAQ assistant to a waveform chart. Now i am interested in getting this data to a spreadsheet or a .txt file as you have suggested. I tried using the LABVIEW's I/O feature I inserted a 'write to spreadsheet.vi'. after my DAQ assistant ('outside the loop' connecting via loop tunnel to the wire going out from DAQ joining the 'write to spreadsheet.vi') . But this did not work. So this is what I am upto. Kindly suggest an appropriate solution
0 Kudos
Message 4 of 9
(3,384 Views)
What did not work? Do you have a broken wire? Do you not have any data? Do you have indexing enabled at the tunnel?




Message Edited by smercurio_fc on 06-11-2008 09:58 AM
0 Kudos
Message 5 of 9
(3,374 Views)


vaib wrote:
What I want to do is to write my pressure readings to an Excel spreadsheet.

I tried using the LABVIEW's I/O feature I inserted a 'write to spreadsheet.vi'.
 

You can't use "Write to Spreadsheet.vi" to write directly to Excel. 
To write to Excel, you will need to use Active-X. 
 
Do a search on Excel in this forum.  There's quite a bit of info on how to do that.
 
"Write to Spreadsheet.vi" will write to a text file..
 
RayR


Message Edited by JoeLabView on 06-11-2008 11:40 AM
0 Kudos
Message 6 of 9
(3,354 Views)
Just try putting the Write To Spreadsheet File inside the loop. As long as your loop is sufficiently slow as to not pound the hard drive, you can write one line at a time. 500mS or more should be OK. If the data is too fast, think about a Producer / Consumer scenario where the data is written to a Queue and read/writtten to file in a parallel loop. In fact, that's the best approach over all unless you're just shotgunning something quickly and want to get some data.
As far as putting your data write outside the loop, you have to build an array of data inside the loop (not recommended) and throw it into the file when the loop stops, as mentioned in another response.
Richard






0 Kudos
Message 7 of 9
(3,350 Views)
Hello everybody.. I am attaching an image of my vi. The thing is that I want this programme to record data when i push a button and stop when again push it (like a atart or stop button). Please advice me what are the modifications i have to make. Thanks for your continued support
0 Kudos
Message 8 of 9
(3,320 Views)
You could use an Event Structure with data.  If you select NI VI, and from Template, you can find the template for the Event Structure with Data.  Basically, it looks like a producer consumer loop, where the top look takes care of use events, such as pushing buttons, and the consumer loop has a State Machine which is triggere by the event loop.  A queue passes the event selection to the bottom loop.  That is how you would control the start / end of the sampling.
 
Your acquisition would be in the consumer loop (bottom). 
 
I don't have time to do a quick demo, but if you do a search on items mentionned above, you should be able to find an example of what I described..
 
RayR
0 Kudos
Message 9 of 9
(3,290 Views)