Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Setting Sample and Scan rate on PCI-6052E w/ NI-DAQ

I am trying to output two channels of analog output while reading two or more channels of analog input. I have adapted code from the NI-DAQ C examples, using the appropriate WFM and SCAN routines.

The analog output is being triggered by the analog input start trigger and is sync'ed to the analog input clock.

My problem is that my application works so long as the update rate (scan rate) is below 10,000 S/sec. However, I need to output and acquire the signals at a minimum rate of 40,000 S/sec. This should be well within the capability of the board (besides, I can do this within LabView without trouble!). However, I get errors stating that the sample rate is too high. Also, I need to set the sample clock such th
at the analog input channels are sampled as close to simultaneously as possible.

Again, I have been able to do all these things in LabView. However, my current application requires the use of C.

Thank you for any suggestions.
0 Kudos
Message 1 of 3
(2,800 Views)
What specific error are you receiving? Is it a buffer associated error (-10846) or is it soley based on hardware (-10694). If it involves the software buffer you might want to increase the size of the buffer.

Also, have you tried running example programs that use the NI-DAQ C function calls or are you running a program that you wrote from scratch? Here is a link to an example written in C that synchronizes analog input and output and uses the analog input clock. Try this example and see if you still receive the error. I hope this helps.

Synchronizing Analog Input and Output
http://venus.ni.com/stage/we/niepd_web_display.DISPLAY_EPD4?p_guid=B45EACE3E72F56A4E034080020E74861&p_node=DZ52337&p_submitted=N&p_rank=&p_answer=&p_source=Internal
0 Kudos
Message 2 of 3
(2,800 Views)
I was receiving a memory error from Windows. Turns out that I had to dynamically allocate the input and output buffers once they got to be larger than 25,000 or so elements per channel. Not sure why this is so (I mostly program in Linux), but it seems to be working now.

Thanks
0 Kudos
Message 3 of 3
(2,800 Views)