Search code examples
daq-mx

DAQmxConfigurLogging C API


I use the NI-PCI 6225 card.

I want to read the 1000 samples with the time of each sample. I used

DAQmxConfigurLogging C API, but in the TDMS file that was generated, there was no time for each sample.

What should I do to achieve this?


Solution

  • It sounds like you're using a continuous or finite acquisition. If that's the case, the TDMS file will store a waveform, which has three properties:

    • The start time (t0) -- this is the wall-time of the first sample
    • The sample period (delta_t) -- this is the time between each sample
    • The array of samples -- these are measured values

    To get a time for each sample, use this formula:

    time_at_sample_n = t0 + (n * delta_t)