Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Need NI-DAQmx double buffer input and output example.

I need an example showing how to use double buffering for continous output and input of digital data.  Specifically, I am using a PCI-6534 and need to output continous bytes of data utilizing an internal clock.  Simultaneously, I need to input continous bytes of data utilizing an external clock.  Since the clock rates are relatively fast I need to double buffer both the output and input data.  I have tried to figure this out myself but must be doing something wrong (the pointers are all incorrect and no data is output).  There are no examples provided with NI-DAQmx that show double buffering.  The only examples I have been able to find utilize traditional NI-DAQ which is useless.  I will appreciate any help I can get on this.
Thanks,
0 Kudos
Message 1 of 2
(4,927 Views)
Hello Chris. 
 
In Traditional DAQ, double buffering was typically left up to the user's programming skills.  However, in DAQmx, double buffering is automatically done for you.  The following is from a webpage about general functionality of NI-DAQ (Answers to Frequently Asked Questions about NI-DAQmx and Traditional NI-DAQ (Legacy): http://zone.ni.com/devzone/cda/tut/p/id/3021)
 
"If you are doing double-buffered I/O, you would most likely be polling the buffers to continuously acquire data. In NI-DAQmx, you can achieve this simply by using the NI-DAQmx timing function and setting the Sample Mode parameter to Continuous.

NI-DAQmx uses circular buffers. For input operations, portions of data are read from the buffer while the buffer is filled. Likewise for output operations, portions of the buffer can be written to while the buffer is emptied. Using a circular buffer, you can set up your device to continuously acquire data in the background while NI-DAQmx retrieves the acquired data.

Figure 12. NI-DAQmx simplifies double-buffered data acquisition."
 
Please refer to the following website under the heading "Optimization for Continuous and Single-Point Operations" for more information on this issue.
 
Waveform and Single-Point I/O in NI-DAQ 7
 
If you have any other questions, please let us know.  We would be glad to help!
 
Brian F
Applications Engineer
National Instruments
0 Kudos
Message 2 of 2
(4,911 Views)