Additional Information
USB DAQ devices can only transfer data when addressed by the host controller driver, which is different from how a PCI/PCIe device operates.
The DAQmx USB data transfer driver requests 32 KB of data from the USB DAQ by default. The driver can only publish the data when one of the following criteria is met:
- All 32 KB of the chunk has been acquired.
- The USB DAQ device explicitly sends a "short packet" across the USB bus.
- The "short packet" allows the driver to access a buffer smaller than the requested USB data transfer size.
If the user requests 0 samples to read (that is connecting a value of 0 to the
DAQmx Read Number of Samples per Channel input), no "short packet" is requested. In this case, data will only be published when the full 32 KB chunk has been acquired.
When the
AvailSampPerChan property is queried, any data that has accumulated on the USB DAQ's onboard buffer is immediately flushed across the USB bus with a "short packet". This causes the data to be published as soon as it's received at the host PC. However, a race condition occurs between when the data arrives at the host PC, and when the driver checks the buffer for available samples.
In knowing that the driver does not wait for USB data to arrive at the host, and that modern host PCs are fast in comparison to USB buses, it is expected that
AvailSampPerChan will return 0 on the first iteration.
These race conditions and latency issues affect Ethernet cDAQs in a similar way.