LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

save data to file at a slower sampling rate

This is probably a very simple question...but i'm a first time user and a student trying to complete a project.  I am using a USB 6008 to acquire an analog voltage signal continuously and view it on a graph.  I want to save the voltage data in a spreadsheet to be viewed later, but I would like to sample the signal only twice a second.  I am using version 8 student edition.  Any help would be greatly apprecitated  and if I have not provided enough information please ask. 
 
Jordan
0 Kudos
Message 1 of 13
(3,910 Views)
As a starting point, I would recommend you to look at the shipped examples that come with LabVIEW. You can find the shipped examples by looking under Help>>Find Examples>>Hardware Input and Output>>Daqmx>>Analog Measurements. This would be a good starting point for you.
 
I editted the Cont Acq&Graph Voltage-Int Clk.vi for your requirements. Please refer to the attached VI for the editted example.
 
I hope this helps!
 
Mehak D.
0 Kudos
Message 2 of 13
(3,876 Views)

Thank you very much and sorry for the delay in getting back to you.  I have a couple more questions.  Is there a way that I can strip the bundled data to just have the voltage because i don't need the timestamp as it uses too much memory for my low end DAQ.  I keep getting an error that data has been overwritten and is no longer available.  I would also like to slow the sampling rate down even more to 1 sample per second but still keep the waveform constant.  Thanks again

Jordan

0 Kudos
Message 3 of 13
(3,851 Views)
Under Cluster&Variant use Unbundle by Name to pull things out of clusters
0 Kudos
Message 4 of 13
(3,843 Views)

I tried to unbundle the data but it is the wrong type of data i guess.  All I want to do is display the waveform and save the voltage in excel file at 1 sample per sec.  Thanks

Jordan

0 Kudos
Message 5 of 13
(3,816 Views)

Hi jordan,

at the moment you have an array of waveforms, so to get one channel you have to index the array. To get the single elements use the "Get Waveform Components" function.

Mike

0 Kudos
Message 6 of 13
(3,814 Views)

Thanks for the help that worked perfectly.  My only other issue is slowing down the rate that samples are written to the spreadsheet I only want to have them written once a second.

Thanks again,  Jordan

0 Kudos
Message 7 of 13
(3,772 Views)

Hi Jordan,

you could insert a case structure and only write every 10th value to the file. The advantage is that you anyhow see all value in your Waveform.

Hope this helps.

Mike

0 Kudos
Message 8 of 13
(3,753 Views)

hello again, thanks for the help i really appreciate it.  I couldn't seem to get the case structure to work properly, I've attatched a section of the program where i'm trying to do what you suggested.  Maybe you could implement the case structure to make it work.  Thanks again

Jordan

Download All
0 Kudos
Message 9 of 13
(3,731 Views)
Yours is just reading in the whole array, and giving you the entire array back from the 0th row, 0th column.  The loop will only run once because the entire file is read at once and will hit the EOF in the first iteration.
 
Look at this instead.


Message Edited by Ravens Fan on 04-01-2008 12:16 AM
0 Kudos
Message 10 of 13
(3,718 Views)