Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

For USB-9263 DAQmxGetWriteTotalSampPerChanGenerated() returns incorrect value

Using NI-DAQmx 9.0 and a USB-9263 in a USB-9162 carrier the values returned by DAQmxGetWriteTotalSampPerChanGenerated() are not correct based on the amount of time elapsed.

The attached program TotalSampPerChanGeneratedProblem.c fills the buffer then starts the task generating 1000 samples per second.

Using a PCI-6251, USB-6218, USB-6255 and Simulated USB-9263 the number of samples generated matches up very well with time passed. That is, after 101 milliseconds DAQmxGetWriteTotalSampPerChanGenerated() returns 101 samples generated.

But the USB-9263 tells me that it has output 512 samples immediately on task start. This number stays constant until 400ms have elapsed then the device report 768 samples output.

It seems that there is something wrong with DAQmxGetWriteTotalSampPerChanGenerated() when used with a USB-9263.

I know that data transfers to USB devices are done in large blocks which explains why the space available in the buffer goes to 512 immediately, but this number also behaves differently on the USB-9263.

If this is intended behavior please let me know how to query the actual number of samples generated by the USB-9263.

See the example output in the attached file TotalSampGenerated_USB-9263_ExampleOutput.txt.
Sherryl Radbil
Data Acquisition Engineer
The MathWorks
0 Kudos
Message 1 of 2
(2,696 Views)

Hello Sherryl,

 

Thank you for using NI forums.  I recently tested this out myself and received the same behavior as you did (512 samples loaded on the front end).  The reasoning for this is that the USB-9162 doesn't have an output FIFO, and so it just used the USB endpoint buffer.  There isn't really a way to query the number of samples generated with this device, so we just query the data sent across USB.  I hope this helps.

 

Regards,

0 Kudos
Message 2 of 2
(2,648 Views)