Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
This Document is not yet Rated  Rate this Document

Why do I have a Time Drift in my Synchronized DAQ-CAN Application?

Primary Software: Driver Software>>NI-CAN
Primary Software Version: 2.3.2
Primary Software Fixed Version: N/A
Secondary Software: Driver Software>>NI-DAQ
Hardware: Industrial Communications>>CAN, Legacy DAQ Devices>>Multifunction DAQ, Multifunction DAQ (MIO)>>E Series, Multifunction DAQ (MIO)>>M Series

Problem:
If you are using the standard examples for synchronization between a DAQ and a CAN board, sometimes there are drifts between the signals, so it seems that the synchronization does not work correctly. This behavior is related to the DAQ timebase which is used as the master timebase for both boards. Because we are using the 20 MHz onboard clock, the DAQ driver has to check any used sample rate for usability. The driver can only work with integer multiples of 20 MHz. This leads to an internal calculation of an actual sample rate which is used then by the DAQ driver.

So, for the example given: 24000 Hz

20 MHz / 24000 Hz = 833.333

20 MHz / 833 = 24009.60 Hz

Thus 24009.60 Hz is the actual scan rate used by the DAQ driver.

The NI-CAN driver does not have this limitation, so it works different and uses the original sample rate, specified in the frontpanel control. (e.g. 24000Hz)
So in this case both drivers are working with different sample rates and this leads to a drift over the time which you may see in your data.

Solution:
The workaround to avoid the drift is to use the same sample rate for both drivers.
Therefore you can use a DAQmx property node to determine the actual sample rate calculated by the DAQ driver and use this sample rate with CAN too.

See the attached Link to find another KnowledgeBase article related to this problem and the attached VI to have an example.

Related Links: KnowledgeBase 39BCDJMV: Determining the Actual Sample Rate of an Acquisition in NI-DAQmx

Attachments:


CAN Waveform Input and DAQmx Waveform Input_calculate_sample_rate.vi - CAN Waveform Input and DAQmx Waveform Input_calculate_sample_rate.vi



Report Date: 02/14/2006
Last Updated: 05/02/2007
Document ID: 3UD9D3JL

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit