Read All Available Samples Function Does Not Return All of the Samples for a USB Device Hardware: Multifunction DAQ (MIO)>>Portable
Problem: I would like to read all of the samples that are sitting in the buffer from my USB DAQ card. When I call the appropriate DAQ function to read all available samples, it only returns a set number of samples instead of all of them. The number of samples returned also seems to follow a pattern where only an integer multiple of samples are returned that varies as I change the sampling rate. Why is this happening? Solution: The reason for this behavior lies in the mechanics of USB data transfer. USB uses interrupts to transfer samples from the onboard buffer in the USB DAQ card to the memory in the computer. The actual interrupt process takes some time because it is requesting for permission to access the computer memory. Instead of interrupting the processor for every sample that is to be transferred, the data is bundled into packets to improve performance. The size of the packets are determined by the sampling rate of the acquisition. Therefore, when a request is made to return all of the samples, the samples are progressively bundled into packets and transferred across USB when each interrupt is ready. Any remainder samples that cannot fill the predetermined packet size stay in the onboard buffer until the next request to retrieve samples is made . Related Links: USB Homepage Attachments:
Report Date: 06/02/2006 Last Updated: 06/09/2006 Document ID: 3Y18HFBE |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
