LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to save exact time in file

Hello, I am using DAQmx to datalog some information. Sampling rate is 1Hz while I only need to log the data in to file every 30s. How can I resample the data and save the data into a file with correct time stamp?
 
Thank you very much 
 
0 Kudos
Message 1 of 4
(2,823 Views)
All you need to do is utilize the Time and Dialog functions and then put it in a While Loop with a time interval of, in your case, 30 seconds.
I am attaching a VI that shows the acquisition of data and the acquisition of time and date which is then placed in spreadsheet form into Microsoft Excel.
 
Good luck.
0 Kudos
Message 2 of 4
(2,804 Views)
Thanks Steve, I have tried the VI you sent. There is only one issue here, which is can I save both the data and the time stamp into one file instead of 2? And how can I retrieve these data in the file into a chart with correct time stamp?
 
I have tried to read the data from the file but I couldn't show it back to a chart.
Thank you very much.
0 Kudos
Message 3 of 4
(2,773 Views)
To answer your first question, yes...
Rather than having two Data Path constants, simply make one and then create a Local Variable and select the item to be the before mentioned File Path.  Local Variables are found in the Structures palette.  Wire the File Path variable to the Write to Spreadsheet VI.
 
To answer your second question...
When retrieving the data, you have to follow the file path you save it to.  I normally have the file paths save right to the desktop, and then I open them with Excel.  Once in Excel you can create charts and other things with your data.
 
Hope this helps
0 Kudos
Message 4 of 4
(2,748 Views)