Why DAQmx Once Mode Takes Longer Time than None and Every Sample Mode?

Updated May 13, 2024

Reported In

Hardware

  • PXIe-4309

Driver

  • NI-DAQmx

Issue Details

I have one PXIe-4309 module used on trim process. Now I find if I run the module in AutoZeroMode Once, it takes too much longer time than Every Sample mode. After debugging, I found the DAQmx Start Task VI takes about 27ms in Once mode and 2.54ms in Every Sample mode.

Code and result:

d7f84ba8-c1f2-46ad-b2e9-5e1123694c27 (1).png
0c615022-c72f-4698-8272-d1102ce59292.png

Solution

We can see information from Auto Zero Once,  with Auto Zero set to Once, the offset error is measured when the acquisition task starts. The offset error measurement introduces a delay from start to the first sample clock. You can query the start delay with the DAQmx Trigger Property Node (Start » More » Delay). The start delay is in units of 100 MHz timebase ticks by default. For example, Ticks/100MHz is time, so 101k ticks is 1.01ms. That's just the hardware impact, software also does more stuff when doing Auto Zero Once.
With Auto Zero set to Every Sample, the offset error is measured at the beginning of every sample period.