Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQ card help needed in MATLAB

My research group is having trouble getting our new DAQ card to work with out machine. It seems to be some sort of driver issue within MATLAB, but we have the latest driver installed. Can anyone help?
 
National Instruments DAQ card PCI-6250.
 
National Instruments NI-DAQmx Device Driver 8.1Of1
       located in C:\Program Files\National Instruments\NI-DAQ
 
Matlab release R2006a
 
Matlab Data Acquisition Toolbox Version 2.8.1 (R2006a) 03-Feb-2006
[This version of the Toolbox is supposed to support the PCI-6250
card.]
 
The Toolbox command
 
ai = analoginput('nidaq')
 
produces the error
 
??? Error using ==> analoginput.analoginput
Error using =>
analoginput.analoginput>localCreateAnalogInputObject
Failure to find requested data acquisition device: nidaqmx
0 Kudos
Message 1 of 8
(7,841 Views)
Hi Jeremy-
 
National Instruments does not support or develop and has not tested with the Matlab Data Acquisition Toolbox.  If you have questions regarding that Toolbox, I would encourage you to contact The Mathworks for support.
 
Thanks-
Tom W
National Instruments
0 Kudos
Message 2 of 8
(7,835 Views)
Jeremy,

I'm not sure about MATLAB R2006a, but previous versions of MATLAB did not support the DAQmx drivers.  You should download the Traditional DAQ drivers and then try your code.

Good Luck, Scott
0 Kudos
Message 3 of 8
(7,832 Views)

Hi Scott-

Actually, I have heard from several users that the most recent version of Matlab's DAQ Toolbox does in fact support NI-DAQmx.  Again, to verify this I would check with The Mathworks.

Thanks-

Tom W
National Instruments
0 Kudos
Message 4 of 8
(7,827 Views)
R2006a supports DAQmax . However u will need Data acquisition toolbox 2.8 or 2.8.1
Try this out.
 
Then register ur device using 'daqregister' command.
 
But I am having problem with USB 9215A BNC.
Even though 2.8.1 supports it and registers it, but I am not able to
 create AI channel, same as ur problem.
 
 It gives error that hardware can be added.
 It is added thru one dll file in NI daq dll folder.
 
 
0 Kudos
Message 5 of 8
(7,748 Views)
Hi all!

I can confirm that DAQ 2.8.1 works with NIDAQmx. I have had similar error messages before I updated the NIDAQmx drivers to the newest version. Not sure whether this explains your problems, too.

If that fails, you might be able to access the NiDAQmx dll directly from Matlab. I compiled a bit of sample code here:
http://www.jr-worldwi.de/work/matlab/index.html

Best of Luck!
Jens

0 Kudos
Message 6 of 8
(7,697 Views)

Hi all,

 Following worked for me :   enjoy!

Summary
National Instruments USB-9215A not supported

Description
When I attempt to use analoginput with my National Instruments USB-9215A, I
get an error, even though the device is listed as supported:



AI = analoginput('nidaq','Dev1');
??? Error using ==> analoginput.analoginput
Error using ==>
analoginput.analoginput>localCreateAnalogInputObject
This device is not recognized by the toolbox. However, many times,
support for new hardware can be added. Visit The Mathworks web site and
search on the name of your device for more information.
Workaround
To work around this issue, perform these steps to add support for this
device:


  1.. Check to see if the NIDAQmx 8.0 or later drivers are installed on your
machine. For more information on verifying this, see the following link:
  http://www.mathworks.com/access/helpdesk/help/toolbox/daq/f0-11021.html
  2.. Quit MATLAB.
  3.. Find the following file :
  $MATLAB\toolbox\daq\daq\private\mwnidaqmx.ini
  where $MATLAB is the MATLAB root installation directory obtained by
issuing:
  matlabroot
  at the MATLAB Command Prompt.
  4.. Make a copy of this file and rename it to mwnidaqmx.ini.old.
  5.. Open the file mwnidaqmx.ini in a text editor, and add the following
lines at the end of the file:

[USB-9215A]
hasAnalogInput = true
numAIChannels = 4
hasAnalogOutput = false
hasDigitalIO = false

[USB-9215A (BNC)]
hasAnalogInput = true
numAIChannels = 4
hasAnalogOutput = false
hasDigitalIO = false6.. Save the file mwnidaqmx.ini and restart MATLAB.

0 Kudos
Message 7 of 8
(7,670 Views)

Jeremy,

 

I have confirmed that Matlab supports NIDAQmx since I have used it myself.  Here is the list of supported NI hardware from the Matlab web site:

http://www.mathworks.com/products/daq/supportedio5871.html

 

Matlab supports the PCI-6250 according to this website starting in Data Acquisition Toolbox V2.8.  It looks like it supports NI-DAQmx for this board.

 

It looks like you are having trouble because you forgot to provide the resource name … Don’t use:

ai = analoginput('nidaq')

 

Instead, use something like this so that you provide the resource name:

ai = analoginput('nidaq',’Dev1’)

 

If you don’t know the resource name, use this to find out:

daqhwinfo(‘nidaq’)

 

Here is a Matlab code example using NIDAQmx that is probably useful to you:

http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=12052

 

Tom
0 Kudos
Message 8 of 8
(7,601 Views)