Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Slow read and write operations on DAQmx

I am trying to build up a feedback control system using PCI-6052E and PCI-6722 cards, so that the computation of the control algorithm is performed on computer's CPU. I am trying to reach sampling period of 1kHz. It turns out that the bottleneck of my system are the read and write operations from and to cards that consume lot of processor time.
An example code (C#) that shows how the reads and writes are implemented is as attachment. On my tests the example code produces a read-time of 1000 samples on 6 channels 7.58s and a write-time of 4.69s. Is there any way to improve the performance?
The program is running on Windows XP on 1000Mhz processor.
0 Kudos
Message 1 of 2
(2,327 Views)
Petteri,

I don't have the hardware to reproduce this, but I have a few ideas. For analog output, are you creating a task, starting it, and calling write repeatedly, or are you simply calling write? While an AO Task will auto start on write, it will also go through the process of stopping when the write is complete. Which means next time you call write, the task will need to start again. It will be much more effecient if you explicitly call start on the task once, perform as many writes as required, and stop/clear the task when you are done. This same principle applies to you analog input reads as well.

I hope this helps,
Dan
Message 2 of 2
(2,327 Views)