From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

6221 analog i/o

I have a PCI 6221 DAQ and am trying to write code to all me to simultaneously read and write analog voltages.

 

I have reviewed available samples with no success in finding something close.

 

Does anyone have any ideas for a sample program demonstrating this?

 

Thanks.  

0 Kudos
Message 1 of 2
(2,339 Views)

Hello John,

Thanks for Contacting National Instruments.  I am assuming you are using LabVIEW to write your application. 

Getting Started with DAQmx provides some excellent resources for both LabVIEW and text based programming of National Instruments data acquisition products.  See the advanced link for more information on synchronization of your device. 

There are several options for simultaneous analog input and output.  The simplest utilizes the inherent parallelism available in LabVIEW.  All that is required is to create, configure, and then start an analog in and an analog out task.  The DAQmx driver allows for one analog in and one analog out task to be executed at the same time on a DAQ card.  If you choose to setup your application in this manner, the two tasks will execute independently of one another.  This will allow you to generate and acquire at different rates. 

The next option is to use the same sample clock for both the analog input and analog output which will cause the two tasks to be synchronized to the same sample clock.  This example shows how to do this using LabVIEW.  The shipping example titled Multi-Function-Synch AI-AO can be found using the NI example finder also shows how to generate and read continuously at the same time.  This shipping example is also provided for text based DAQ programming and can be found in the default example path for your language and will be in the folder

Example Folder Path\Synchronization\Multi-Function\SyncAIAO_DigStart

This method specifies the source of the sample clock for one task (analog out) to be the sample clock of the other task (analog in).  This method will ensure that there is no jitter between the two clocks and that acquisition and generation start at the exact same time. 

Please post back if you have any questions. 

Regards,
Browning G
FlexRIO R&D
0 Kudos
Message 2 of 2
(2,312 Views)