Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there any way to query the AO buffer status in DAQMx Base?

Hello,

 

I've been using custom M-series drivers, derived using the MHDDK, to manage AI and AO within my Mac OS X application, but we've determined that it would be useful to adapt the application so that it is compatible with other NI boards (e.g. the USB-6211), and so I am attempting to replicate my custom driver functionality as best I can using the DAQmx Base API.

 

So far I've been able to satisfactarily replicate the AI functionality of the old driver, but I'm having issues with the AO, mostly relating to performance. Without going into too many details, I have a seperate thread that fills up the AO buffer, sleeps for a little while, then repeats the process. With the MHDDK, it was possible to add a samples to the AO FIFO until the full status was triggered, at which point the thread could sleep, and then wake up in time to start refilling the buffer before it emptied.

 

The problem with DAQmx Base is that I don't seem to have any means to query the status of the AO buffer. I can manage to enable or disable regeneration by accessing DAQmx_Write_RegenMode, but all the other write attributes don't seem to be accessible. If I could access any of DAQmx_Write_CurrWritePos, DAQmx_Write_SpaceAvail or DAQmx_Write_TotalSampPerChanGenerated, I would probably be able to come up with a solution, but this doesn't seem to be possible with DAQmx Base.

 

As it stands, I can simply continue feeding samples into the buffer with DAQmxBaseWriteAnalogF64 in order to keep up with generation, but this seems to be extremely CPU intensive, basically to an unnacceptable level. It doesn't make much of a difference what size I make the buffer updates, and when I introduce a sleep period into the loop, I either run the risk of a buffer underrun, or I'm still using more cycles than I can really afford.

 

So my question is, is there any information at all I can dervive about the AO buffer status with DAQMx Base? Am I missing anything obvious?

 

I should mention that my application needs to support dual channel AO and needs to make close to real-time adjustments to the output signals.

0 Kudos
Message 1 of 1
(3,023 Views)