Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Problems with accessing my analog input from NIDAQ with MATLAB

I am having problems with creating a device object in MATLAB. I am using the Ni PCI6014, and would like to acquire analog input data from the board using MATLAB. At present I do not have any signals hooked up to the screw terminals (which interface with the DAQ board). I am just writing the MATLAB code, however, whenever I try to create an analog input object it gives me an error. I was not under the impression that I had to configure all the channels; The programme suggests I run the NI-DAQ Configuation Utility to determine the valid IDs.

Any ideas would be appreciated, thanks.
Onyinye
0 Kudos
Message 1 of 2
(2,880 Views)
Onyinye,

I performed a search on The MathWorks' web site regarding your issue. First, make sure that you have the correct driver, NI-DAQ 6.9.3, installed on your machine. Then, launch the test panels in the Measurement & Automation Explorer (MAX) to verify operation of the board.

After you have verified the board is working, check the following in your code. To create a device object for an NI DAQ board, use this code:

AI = analoginput('nidaq',#);

where # is the device number - as listed in MAX.

For your channels, use:

ch = addchannel(AI,0); for single channel
ch = addchannel(AI,0:2); for multiple channels (in this case 3 channels)

Remember that DAQ channels for NI boards are indexed from 0.

If you need additional Data Acquisitio
n Toolbox programming assistance, refer ot the toolbox manual on The MathWorks' web site.

Have a great day.
0 Kudos
Message 2 of 2
(2,879 Views)