03-23-2006 04:56 PM
03-24-2006 02:45 PM
Hello Nick,
The difference between how data is transferred over the two different buses
(PCI and USB) is ultimately why you are seeing this performance
difference. A PCI device typically transfers data to system memory using
DMA transfers. DMA transfers allow the PCI bus to bypass the operating
system and directly transfer data to system memory. A USB device on the
other hand, transfers data using interrupts, where for each data transfer, the
device must request and be granted access to system memory from the operating
system. The result is that the speed at which interrupt-driven data
transfers can occur are much more system dependant than DMA transfers.
A buffer overflow error indicates that LabVIEW is not emptying data from system
memory before it is overwritten by data transferred from the device. When
you specify a 'number of samples per channel' to read in a DAQmx Read VI,
LabVIEW waits until that amount of data is available in the system memory
buffer, and pulls that data out for processing/displaying. I think that
what might be happening is that the operating system is busy servicing
interrupts for your USB device, and LabVIEW is not being given enough processor
time to empty data from your system memory. You might be able to avoid a
buffer overflow error by increasing the buffer size in system memory, maybe two
or three times as much as it currently is. Therefore, if LabVIEW is
unable to empty the samples from memory for a few milliseconds, the data can
just accumulate in the buffer and LabVIEW can process it a few milliseconds
later when it has the processor time. You can trick the DAQmx driver into
allocating a larger buffer size by increasing the 'samples per channel' input
of the DAQmx Timing VI or the 'samples to read' in the Task Timing
settings of your DAQmx task, but keeping the 'number of samples per channel'
setting of your DAQmx Read VI the same. You can also manually set the
size of the buffer in number of samples using the DAQmx Configure Input Buffer
VI, located in the DAQmx Advanced Task Options palette. Another option
would be to set the 'number of samples per channel' setting of the DAQmx Read
VI to -1. This will cause the LabVIEW to grab all available samples from
system memory every time the DAQmx Read VI is called. Of course, this
will probably require you to reprogram your application to handle a variable
number of samples for processing.
I hope this information helps, and let us know if you have any further
questions.
Regards,
Travis G.
Applications Engineering
03-27-2006 10:19 AM
03-28-2006 12:51 PM - edited 03-28-2006 12:51 PM
Hello Nick,
I understand your concern regarding buffer depth and test duration. Maybe
you could use the method I stated above of setting the 'number of samples to
read' of the DAQmx Read VI to -1. This will allow the DAQmx Read VI to
pull all available samples sitting in the buffer when it is called. This
method will give the advantages of having a hardware timed buffered
acquisition, and allow the DAQmx Read to fully empty the buffer when it is
given the needed processor time. This
will help to avoid a gradually increasing number of samples sitting in the
buffer. The only disadvantage is that you will have to modify any
post-acquisition analysis in your program to handle a dynamically changing
number of samples.
Regarding the performance difference of using a USB 2.0 host card as opposed to
USB 1.1, you will not see a performance increase. The USB-9215A is a USB
Full Speed Device, as noted in the bus interface specification of the USB-9215 Operating Instructions. Full speed devices, while compatible with USB 2.0,
also work with USB 1.1 without any decrease in transfer rate. This is
because a full speed device is limited to a transfer rate of 12 Mb/s, which also is the maximum transfer rate of a USB 1.1
port. Take a look at the following KB for information about this:
KB 3P882LCC: NI USB DAQ Compatibility with USB 1.1 and USB 2.0
Also, changing the interrupt level of your USB interface most likely wont increase performance. Rather than altering these settings, I would recommend reworking your program to perform analysis and file logging tasks post-acquisition, and playing with the number of samples to read parameter as I have described above.
I hope this helps.
Travis G.
Message Edited by Travis G. on 03-28-2006 12:51 PM
Message Edited by Travis G. on 03-28-2006 12:52 PM
03-28-2006 04:34 PM
03-28-2006 07:26 PM
03-29-2006 06:37 PM
03-30-2006 09:57 AM