LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Data logging time stamp incorrect in Excel

Hi all! Using LabVIEW 2020, I am trying to save voltage, current and temperature measurements to an Excel file with accurate time stamps for data tracking purposes. I would like to save a sample every second. Currently, the time stamp on my Excel file says it is saving every second, but in reality this is not the case. It is actually saving thousands of samples per second and eventually gets to a point where it invents its own time (the year changes from 2025 to 1904). I am wondering if this has to do with my sampling rate, which is 1000 samples/second. Is there a way to solve this time stamp issue without changing my sample rate? I attached pictures of the block diagram and Excel file.

 

BlockDiagram.jpg

Excel Snip.jpg

0 Kudos
Message 1 of 5
(354 Views)

In LabVIEW, a time/date stamp is internally the time in seconds since January 1, 1904, at 12:00 AM Greenwich mean time.  So if you ever see January 1 1904 (or, occasionally Dec 31 1903, if it's compensating with time zones), then you know that at some point your date/time calculation is getting a zero in it instead of the proper value.

 

You don't show the code that calculates time in any way, but since it always increases by exactly 1 second it's probably something where it takes the current time one time, then adds 1 second to it each loop after that.  You need to find that loop, and see what in it might reset that "current time" to zero somehow.  The most common cause for this is that the time tracking wire passed through a "use default if unwired" terminal, but there can be other things.

Message 2 of 5
(300 Views)

Thank you for your response, this was very helpful! I was playing around with the loop and noticed that the time sets to 0 after the number of samples are taken. For example, when my sample rate was 1000 samples/sec the time would update for those 1000 samples and then set to 1/1/1904.  When I changed the sample rate to 1 sample/sec the time will only be accurate for that one sample and then reset to 1/1/1904. I attached a picture of our block diagram with the get time block highlighted. We are trying to save three data sets from waveforms and export to Excel. 

 

Not sure if you would have any more insight on this issue but any help is much appreciated!

 

Time_blockdiagram.jpg

0 Kudos
Message 3 of 5
(219 Views)

Hi mags,

 

why do you wire a waveform into the Y input of the BuildWaveform function???

 

Please read the help for this function!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 5
(211 Views)

If you are acquiring the waveforms from DAQmx Read, they should already have accurate timing (t0 and dt) information. If you share your VIs (as opposed to screenshots of part of the Block Diagram), we can be more helpful as it is difficult to debug what we can't see.

Recommendation: use subVIs! Make a subVI to save an array of waveforms to file; make a subVI to scale your thermistor values; make a subVI to acquire your data. You can test your subVIs, we can help debug most subVIs without even needing hardware. 

Doug
Enthusiast for LabVIEW, DAQmx, and Sound and Vibration
0 Kudos
Message 5 of 5
(201 Views)