Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Slow Analog Outputs on cDAQ-9178

Solved!
Go to solution

My C language control application calls the DAQmx API 200 times a second to update some AOs, using the following call:

DAQmxWriteAnalogF64(taskHandle,

1, TRUE, 0.0, DAQmx_Val_GroupByScanNumber, data, NULL, NULL);

 

On a system with a single cDAQ-9178 chassis and two NI 9264 AO modules, it works correctly with a task of up to 4 channels. If I add channels to the AO task, the output rate slows down below 200 Hz (5 ms). Here are the timings:

chans   ms

8          6.8

16        13.4

32        26.9

 

How can I write 1 sample per channel, over 32 channels, every 5 ms? It is a control app which responds to inputs, so I cannot write multiple samples per call.

 

Thanks.

0 Kudos
Message 1 of 18
(5,548 Views)

More info:

 

I'm using DAQmx V 9.1 .

 

The task was built in MAX to generate voltages, and the Generation Mode is 1 Sample (On Demand).

0 Kudos
Message 2 of 18
(5,546 Views)

Hi Claus,

 

I did some quick measurements and my performance numbers pretty much match yours.  The problem is that the data for each channel is being sent separately for static AO tasks, as seen in your data.  It's something that could definetly be optimized.  I'd recommend filing a feature request (which puts it on NI's radar), but that doesn't help you right now.

 

Normally I would tell you to configure a hardware timed analog output task at 200Hz, disable write regeneration, and write your output values as you calculate them.  Unfortunately, you will not be able to sustain your task at that rate without underflowing.  cDAQ is not really setup for hardware timed single point.

 

Short of future optimizations, I do not think it is currently possible to achieve what you want with 32 channels at 200Hz.

0 Kudos
Message 3 of 18
(5,539 Views)

Thanks for the reply.

 

I was afraid of that. Have you tried the Ethernet cDAQ-9188? Is it any better than that?

0 Kudos
Message 4 of 18
(5,537 Views)

Hello ClausB,

 

I'm afraid the latency on ethernet is worse than USB and thus would make it even less likely to achieve what you are trying to do.  For hardware-timed single point applications, I would highly recommend looking at the PCI / PXI / PCIe / PXIe busses.  In addition, for faster rates, you will likely require a real-time operating system.

 

Regards,

Paul C.

0 Kudos
Message 5 of 18
(5,521 Views)

I'm only asking for 200 Hz! Sending 32 16-bit values every 5 ms requires a throughput of 100 kbps. That's much less than 1% of the capacity of Ethernet or USB. I find it hard to believe that the most modern NI technologies could not achieve this, if the driver writers only tried.

0 Kudos
Message 6 of 18
(5,473 Views)