LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Skipping of Time in millisecond in while loop

One you do hardware timed continuous acquisition, the samples will be spaced exactly and the timestamp for any point can be calculated from the index and the start time. Using the PC timestamp is a very poor choice to begin with.

0 Kudos
Message 11 of 13
(363 Views)

@msabah38 wrote:

I am acquiring Data from PXI based DAQ card which is an RT based system at a rate of 1kHz, (1ms).

 

Once the data is received at the Host PC (Windows), I am saving the data using binary write operation along with windows timestamp.

 

For Time stamp I am using Windows PC timestamp (HOST side), hence the data is being skipped, since PC timing is not real time.

 

Is there any way in which the timing also comes from RT NI DAQMx (RT program), so that I can utilize the same time.


How about this:

  1. Get the time you start acquiring data (t0)
  2. You know your sample rate (Dt)
  3. You can calculate the each samples' timestamp by using those two numbers.
  4. Timestamp = t0+(Dt*sample#)
========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 12 of 13
(348 Views)

Can you use the waveform instance of DAQmx Read? The waveform(s) will contain the correct timing information.

Doug
NI Sound and Vibration
0 Kudos
Message 13 of 13
(313 Views)