Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

I can not use some matlab functions for ni device

Solved!
Go to solution

I am not sure I should post this question here.

finally, daqhwinfo in matlab can check usb-6251.

but when I wrote program, I found some functions are not available for my device.

for example, matlab often uses daq.createSession, addAnalogInputChannel,daq.getDevice and so on.

but the errors appear: Undefined variable "daq" or class "daq.createSession".or Undefined function or variable 'daq'.

what's the problem? some setting is not correct?

but I can use analoginput('nidaq','Dev1'), and addchannel (AI,1) is not available either.

I am confused on them

please help me, I appreciate it!

thank you

0 Kudos
Message 1 of 3
(6,013 Views)
Solution
Accepted by Mike_Wu

Hi Mike,

 

I  would recommend asking MATLAB specific question in our forums - MATLAB Answers and make sure you select the right product.

 

For now, I believe you are confusing the two interfaces offered by the MathWorks - Legacy Interface and Session-based interface. Session-based interface is the new interface released in R2010b. Since you have R2010a, you would not have access to the Session-based interface.Commands like daq.createSession, daq.getDevices belong to Session-based interface.

 

Session-based interface offers advantages over the legacy interface:

- works with 64-bit MATLAB. So you would not need to install 32-bit MATLAB on your 64-bit Machine. ( in R2011a )

- supports NI CompactDAQ instruments

- supports specialized measurements

 

For your specific case, since you are using R2010b  and your device is supported by legacy interface, I would recommend using the Legacy-based interface. If you can have a valid license, you can upgrade to the latest version of MATLAB to try our new Session-based interface.

 

Regards,

Manisha Singh

The MathWorks

0 Kudos
Message 2 of 3
(6,001 Views)

I am using a USB 6008 with Windows 7, 64 bit, with Matlab R2011b, MatlabData Acquisition Toolbox 3.0.

 

I know that I will need to use a session based interface with Matlab.  (Legacy does not work on 64 bit).  

 

My question in this regard is:  Is not there a loss of functionality for the USB now due to the fact that I cannot create a DIO object?    My current code generates a DIO object and controls direction of a motor using the digital port.  

 

 

 

 

 

 

0 Kudos
Message 3 of 3
(5,660 Views)