Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

data acquisition with pci-4454

I acquire data with NI DAQ PCI-4454 with 4 channels, but I encounter a problem when using Matlab, because it recognizes only channel 0 and channel 1: when i declare the channels with the "addchannel" function for channel 2 and 3 it tells me the error "the hardware ID is invalid for DIFFERENTIAL inputs"; no problems with channel 0 and 1.
Someone can help me?
Thank you
Davide B.
0 Kudos
Message 1 of 6
(3,909 Views)
Hi,

By default, Data Acquisition Toolbox for MATLAB would choose "differential" for you.  You'll need to set the "InputType" property on your analog input object to single ended.  Then, you should have access to all 4 channels.

If you object name is "ai", then set(ai,'InputType') will list the possible values you can set.

-Rob
-----
Rob Purser
Manager, Test and Measurement
MathWorks
rob.purser@mathworks.com
0 Kudos
Message 2 of 6
(3,904 Views)
Thank you for your answer, but the problem is different. It is the same as Sébastien Ségura - 19 Apr 2004, published on

http://www.mathkb.com/Uwe/Forum.aspx/matlab/7435/problem-with-DAQ

Matlab does not accept the channels to be declared single ended, nor I can find my board in the .ini Matlab library file.
Thank you
Davide
0 Kudos
Message 3 of 6
(3,892 Views)
Hi,

OK, now I see what's going on.  OK, you'll need to do a similar fix, but for the PCI-4454.  Thanks for quoting me back to myself!

I don't have a PCI-4454, so I'd greatly appreciate feedback on whether this
resolves the problem.

1.    Quit MATLAB
2.    Locate the file <matlab>\toolbox\daq\daq\private\mwnidaq.ini where
<matlab> is the
      directory you installed MATLAB to.
3.    Back up this file
4.    Open the file with a text editor, and search for "[board321]" (no
quotes)
5.    This block of text is the configuration information for the PCI 4454.
Look for the line
       "DIInputIDs=" (no quotes) and change it to "DIInputIDs=0,1,2,3" (no
quotes)
6.    Save this and restart MATLAB

Repeat the earlier test:

   ai = analoginput('nidaq',1);   % modify this to match your hardware
   daqhwinfo(ai)

The property "DifferentialIDs", should now read [0 1 2 3] -- You should now
have 4 channels, and your code should work.

-----
Rob Purser
Manager, Test and Measurement
MathWorks
rob.purser@mathworks.com
0 Kudos
Message 4 of 6
(3,866 Views)
Thank you, it seems it works!
I admit I could manage to do it on my own, I just made a bad search for my booard in the .ini file.
Now the error is another one, could you please tell me the correct sintax for the set command to define the channels as "single ended" or "non referenced single ended"? I use this lines:

instrreset
daqreset
ai=analoginput('nidaq','1');
set(ai,'InputType','SingleEnded');
addchannel(ai,0:3);

and it tells me this error:


??? Error using ==> daqdevice.set
Bad value for analoginput property: 'InputType'.

Sorry, but I don't know Matlab almost at all, the program has been made by another person who does not work here anymore.
Thank you for your help.
Davide B.
0 Kudos
Message 5 of 6
(3,857 Views)
hello,
i recently formatted my computer and installed again matlab. I changed the mwnidaq.ini file as I did last time (a you suggested) but this time it doesn't work.
When executing the line "ai=analoginput('nidaq','1') it stops and tells me "the device is not registered" and I have no idea of what it means.
Please, help me!
Davide
0 Kudos
Message 6 of 6
(3,645 Views)