High-Speed Digitizers

cancel
Showing results for 
Search instead for 
Did you mean: 

Can I get the time/date from the absoluteInitialX field of the niScope_wfmInfo structure?

Hello,

Is there a way to convert the absoluteInitialX field of the niScope_wfmInfo structure to the date/time that the waveform was acquired? Or is it only for comparing the time between different waveforms?

-N
0 Kudos
Message 1 of 4
(6,862 Views)
The intent of the absoluteInitialX field of the data structure is to allow highly accurate relative timing of different waveforms.  Its primary use case was originally multi-record acquisitions.  The actual implementation varies by hardware, usually being some sort of on board timer started when the board is powered up or initializes - thus it is not a true absolute standard.  Since the introduction of absoluteInitialX, the waveform datatype has been introduced and implemented in the NI-SCOPE API.  The t0 of the waveform, which is functionally the same as the absoluteInitialX, but linked to actual time, can be used to easily get a time/date.

Note that the waveform datatype is an array of doubles, which causes a huge increase in the size of your data.  This is not a problem if you only have a few thousand points, but can be a serious issue if you have several million.  You can fetch one point of your waveform using the waveform datatype, then fetch the entire waveform using I8/I16/I32, thus getting both the absolute t0 and "relative" absoluteInitialX.  After you have done this once, you have the relationship and should be able to convert easily enough.

Note that the waveform t0 is a 128 bit fixed point with 64 bits of integer and 64 bits of fraction.  As such, it has far more resolution than even a double.

Let us know if you need more information.
Message 2 of 4
(6,856 Views)
Thank you for the information. If I understand you correctly, I can get the date/time then?

I am using the "niScope_Fetch" function in C to grab scaled data from a 5124 High Speed Digitizer card. Is there a C function to convert the absoluteInitialX field to of the niScope_wfmInfo structure to a date/time string?

For my current application, getting the scaled waveform is fast enough, but I might switch in the future. I had assumed that I would need to switch to "niScope_FetchBinary8" or "niScope_FetchBinary16" to increase the speed. Those function also fill a niScope_wfmInfo structure...can they get the date/time in the same way? Are there faster methods?

My apologies if these questions are documented somewhere. I've looked but can't find this information.

-N
0 Kudos
Message 3 of 4
(6,834 Views)
To my knowledge, there is no C function to convert absoluteInitialX to time/date.  I made the erroneous assumption that you were using LabVIEW, so I can see why you would be confused.  I don't use the C API, so you are outside my bounds of competence.  I looked at what is installed on my machine and it appears that a fetch using the waveform datatype is not supported under C.  At this point, I can only offer speculation, since I have never done this.  Your solution depends on how accurately you need to know the absolute time.  Relative time is easy.  If you need absolute accuracy of a few milliseconds, record the system time when you take your first waveform.  Subtract the absoluteInitialX value from the system time and use this as your zero point time.  To get absolute time/date, add this zero point time to subsequent absoluteInitialX values.  You can then use the system functions to get time/date strings.  You may run into resolution issues and be forced to write your own function.

When I was paying attention to NI-SCOPE benchmarks a couple of years ago, the scaled and unscaled fetches were just about as fast.  This is because the actual fetch was done in native resolution and the scaling done in a highly optimized fashion on the host.  The host can usually keep up with the PCI bus maximum speed.  The main issue is just the data size.  If you are streaming to disk, this directly relates to speed, but is otherwise not too much of an issue.  Things may be different now, since the optimization never stops.

The niScope_wfInfo structure is identical in all the fetch types, so you will need to convert it as I mentioned above.

Hopefully this has been somewhat helpful, even though I didn't really answer your question.  I will send a query to a couple of our C guys and see if they can give you a better answer.
0 Kudos
Message 4 of 4
(6,823 Views)