Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Getting timestamp for analog acquisition with NI6110.

When I use the AI Read VI to get a waveform containing a sequence of scans, the waveform has a timestamp that presumably represents the absolute time of acquisition of the first scan as measured using the system clock. (I can't find any documentation on this, by the way. Where is this documented?) I notice that the AI Read VI can alternatively be used to return a "binary" array of measurements. For various reasons, I prefer to use this form of the AI Read VI, but I'd also like to get the timestamp that would be included in waveform returned by the waveform version. However, I don't want to call the AI Read VI twice, one time to get the binary array and a second time to get the whole waveform just so that I can g
et the timestamp. Is there a way to get this timestamp without getting the whole waveform?

Thanks,
Neal.
0 Kudos
Message 1 of 8
(3,357 Views)
Neal,

The waveform datatype is a cluster of 3 elements. t0 is the initial time, dt (delta t) is the time interval between data points in the waveform, and Y is an array of the waveform's data values. If you choose not to use the waveform data type then your data array will have no timing associated with it. In the case of scaled or binary arrays t0 will be 0 and dt will be 1. Additionally, you are correct when you state that all timing and timestamps are in reference to or generated by the system clock.

If you want to have the AI Read VI output Binary Array data, but still want timestamps, then I suggest referring to the following Knowledge Base article which describes how this can be done.

How Can I Plot My Acquired Data Versus A Timestamp in La
bVIEW?
http://digital.ni.com/public.nsf/websearch/EE0668C8F6CE617686256C920065EC52?OpenDocument

Regards,
Justin Britten

Applications Engineer
National Instruments
0 Kudos
Message 2 of 8
(3,357 Views)
Thanks for replying.

I'm performing digitally triggered, buffered data acquisition with my 6110E, with the possibility of pretrigger sampling. The data I'm acquiring may extend several second before and after the trigger. Furthermore, my application may call the AI READ VI at some unpredictable time several seconds after data acquisition is complete. I'm assuming that the timestamp that would be returned as part of the waveform by the AI READ VI (whose exact nature appears to be undocumented) is calculated from the system clock at the time at which the digital trigger occurs, and wouldn't depend on when the AI READ VI was called. The article you referenced doesn't tell me how to do what I want. I want to get EXACTLY the timestamp that the AI READ
VI would include with waveform data, were it asked to return waveform data, but I want to use it to only return binary data. To the best of my understanding, the method described by the article for a obtaining a timestamp when binary data is retrieved provides no guarantee that the timestamp obtained will be the same one that would be returned as part of a waveform by the AI READ VI. Indeed, using the "Get Date/Time In Seconds" VI would seem, under the circumstances in which I would use it, to produce a timestamp that differs unpredictably from the time of the trigger by seconds.

Thanks,
Neal.
0 Kudos
Message 3 of 8
(3,357 Views)
Neal,

I see what you mean in that the work-around I suggested provides no guarantee that the timestamp is as accurate as that provided by the driver in AI Read. If you want the exact timestamp then you will have to return a Waveform Datatype from AI Read. If you ask for Binary Data you will not get to leverage the timestamp features of the Waveform Datatype. My only suggestion is to return the Waveform Datatype since it seems more important to you and to convert the Y array into binary data in software.

As for the undocumented nature of AI Read regarding how the timestamp is performed, I agree. I will definitely look into how this can be better documented.

Regards,
Justin
0 Kudos
Message 4 of 8
(3,357 Views)
>My only suggestion is to return the Waveform Datatype since it seems more important to you and to convert the Y array into binary data in software.

That's a possibility, but one I want to avoid. It can result in considerable memory and processing overhead if I start manipuating multiple channels at several megasamples per channel. Instead, I'm looking into other possibilities, including calling AI Read twice in succession. With one call, I'd get the whole acquisition as binary data and the second time, I'd get just a few points, possibly near the point at the trigger time, as waveform data to get the timestamp.

>As for the undocumented nature of AI Read regarding how the timestamp is performed, I agree.  I will definitely lo
ok into how this can be better documented.

If you're taking requests, you might look into providing a way to get the timestamp from AI Read or some other AI VI without getting waveform data.

Thanks,
Neal.
0 Kudos
Message 5 of 8
(3,357 Views)
This question was posted again and answered at:

http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101&RPAGEID=135&HOID=506500000008000000A4840000&UCATEGORY_0=_30_%24_12_&UCATEGORY_S=0
0 Kudos
Message 6 of 8
(3,357 Views)
I followed the link. I can see that the question was posted (by me, actually), but I don't see an answer. Am I missing something?

Neal.
0 Kudos
Message 7 of 8
(3,357 Views)
Sorry, it took me a while to update it.

Hope it helps,
0 Kudos
Message 8 of 8
(3,357 Views)