Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Different Rate for analog input and analog output channels

Hi, all!

I have NI-6229 DAQ board. I am working in MATLAB. The specification is here:

>> daq.getDevices
ans = 
ni: National Instruments PCI-6229 (Device ID: 'Dev2')
   Analog input subsystem supports:
      4 ranges supported
      Rates from 0.1 to 250000.0 scans/sec
      32 channels ('ai0' - 'ai31')
      'Voltage' measurement type
     Analog output subsystem supports:
        -10 to +10 Volts range
        Rates from 0.1 to 833333.3 scans/sec
        4 channels ('ao0','ao1','ao2','ao3')
        'Voltage' measurement type
     Digital subsystem supports:
        Rates from 0.1 to 1000000.0 scans/sec
        48 channels ('port0/line0' - 'port2/line7')
        'InputOnly','OutputOnly','Bidirectional' measurement types
     Counter input subsystem supports:
        Rates from 0.1 to 80000000.0 scans/sec
        2 channels ('ctr0','ctr1')
        'EdgeCount','PulseWidth','Frequency','Position' measurement types
     Counter output subsystem supports:
        Rates from 0.1 to 80000000.0 scans/sec
        2 channels ('ctr0','ctr1')
        'PulseGeneration' measurement type
Properties, Methods, Events
>> 


I whant to use different Rate for input channels (250000.0 scans/sec) and for output (833333.3 scans/sec). How can I setup this?

This code:

mydaq = daq.createSession('ni');
addAnalogOutputChannel(mydaq, 'dev2', 0:1, 'Voltage')
rate = 833333.3;
mydaq.Rate = rate;

setup the Rate for both channels. But I need to set defferent rates for AO and AI channels.

0 Kudos
Message 1 of 2
(3,264 Views)

I'm not familiar with the syntax required, but you'll need to create two separate tasks, as AI and AO cannot share task resources.  You can (and must) set rates separately for each task.  In the snippet of code that you've posted, you've only created the AO task.

0 Kudos
Message 2 of 2
(3,251 Views)