LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

time data from logged data vi

I would like to continuously acquire and save voltage vs. time data using DAQmx.  I am having problems writing time data into the spreadsheet.  I have found an NI example that works for running the prgram, but the written data only has y-values.  If I need to open this as an external spreadsheet, I have no way of knowing what the x-values are supposed to be.  I am still pretty new to Labview, but how does this application get time data correctly and output on the vi?  If there is a better way to aquire time data, please let me know.  Thanks!
0 Kudos
Message 1 of 4
(2,679 Views)
Hi Rosencrantz,
 
Probably the simplest way to acquire data and log it to file is to use the DAQ Assistant (an express VI located on the DAQmx functions palette).  The DAQ Assistant will help you configure your input task and will return dynamic data (as opposed to waveform data).  This dynamic data output can then be wired into a Write LV Measurement File VI which writes timestamp and data information to a spreadsheet file.  These two VIs will acquire and log data and you can just put them in a while loop if you would like to do this continually.
 
I hope this is helpful!  Please post if you have any further questions.
 
Happy coding,
Megan B.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 4
(2,663 Views)
Hi Megan-
Thanks for the info, but I think my program has a few items the DAQ assistant doesn't offer.  I have found a few ways to get timing info, but I am not sure if it is better to use a 1D WFM or 1D DBL.  Either will acquire my voltage data, but timing is the issue.  If I use the WFM, should I then just insert my own x-values based on t0 and dt?  If I use the 1D DBL, I can divide my iteration count by sampling frequency and place that into an array against my voltage data, but the x values are off by half once I get to high frequencies (1 kHz)???  Don't know why this is.  Should I just go with the waveform data?  It doesn't seem getting time data should be this difficult- am I missing somehting?  Thanks!
--Neal
0 Kudos
Message 3 of 4
(2,657 Views)
Hi Neal,
 
Yes you are definitely better off going with the waveform data and inserting your own timestamps based on d0 and dt.  I think the most probable reason your results are skewed when you use doubles is that there is some overhead in the looping and file I/O you are doing inside the loops. 
 
Hope this helps!
Megan B.
Applications Engineer
National Instruments
0 Kudos
Message 4 of 4
(2,645 Views)