LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Modifying the High Speed Data Logger" Example to include DAQ AI & GPIB timestamps

Hope someone can help here, I'm confused about the most efficient method to collect the timestamp information on a point-by-point basis on 8 differential channels. The Waveform File I/O VIs would appear to work but are these not just datalog files? Ideally I'd like to convert this streamed binary file (including AI timestamps) into a spreadsheet file.

Any suggestions on the best way to get the timestamps given that the HSDL example only includes the "Start Time" in the header?
0 Kudos
Message 1 of 9
(2,654 Views)
Hello,

The High Speed Data Logger example saves much more than just the start time in the header. On the diagram, check out the "create binary header" subVI, and you'll see that all the timing and channel information is also saved in the header. To see how to read this infomation back out of your data file, look at the example "High Speed Data Reader.vi". On the diagram is the subVI "strip binary header" which returns timing and channel information.

Regards,

Doug
0 Kudos
Message 2 of 9
(2,653 Views)
Thanks Doug. I see what you mean about the extra hardware parameters. Very useful, however I'm still looking for some example that shows how to do the the scan rate to date/time conversion accurately. I've searched most of the NI site and externally. Any suggestions on the modification to the HSDR/HSDL examples. Unfortuanately I'm in a time crunch so any assistance would be greatly appreciated.
0 Kudos
Message 3 of 9
(2,653 Views)
Here's the steps I would take to ultimately get a spreadsheet file with timestamps and data:

1) Log the data using the High Speed Data Logger.
2) Open the High Speed Data Reader to modify it.
3) Take the start time (string output) and convert it to a number.
4) Using your scan rate to determine the time between points (interval time = 1/scan rate), create an array of timestamps in a for loop. The logic will be timestamp = start time + iteration*interval time.
5) Combine this array and the "Logged Data" output and feed them into the "Write to Spreadsheet File.vi" or another similar File I/O VI.
6) Run the modified version of the High Speed Data Reader.
0 Kudos
Message 4 of 9
(2,653 Views)
Thanks Matt,

I saw this how to determine the scan rate yesterday from a hardware timed AI scan in this article (http://zone.ni.com/devzone/conceptd.nsf/webmain/DC7ED3935E25F65D86256802007B8F4A?OpenDocument). Had to dig for it mind you! I'll try this and see if it works for me. Thanks!
0 Kudos
Message 5 of 9
(2,653 Views)
Matt - In part 3) you mentioned "take the start time and convert it to a number". I'm assuming you mean convert it to seconds to use the Universal Time notation i.e. to use the Date/Time to Seconds and Seconds to Date/Time VIs??
0 Kudos
Message 6 of 9
(2,653 Views)
Correct - maybe. Depending on your scan rate you may or may not want to create your own custom date/time format. If all you need is second resolution for your timestamp, you can use these utilities and store your numbers in integer format. If you want millisecond or microsecond resolution, you will want to store the array of times in floating point format. If you then want to format them into strings, you may want to do a few numeric conversions and some string formatting of your own so it will look nice.
0 Kudos
Message 8 of 9
(2,653 Views)
"Matt - In part 3) you mentioned "take the start time and convert it to a number". I'm assuming you mean convert it to seconds to use the Universal Time notation i.e. to use the Date/Time to Seconds and Seconds to Date/Time VIs??"
0 Kudos
Message 7 of 9
(2,652 Views)
Yeap, my thinking also. Thanks for getting my brain in gear! Cheers.
0 Kudos
Message 9 of 9
(2,652 Views)