Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

How can i use the NI USB-6501 digital I/O with matlab?

I want to use the  NI USB-6501 digital I/O with data acquisition toolbox in matlab?

0 Kudos
Message 1 of 4
(5,661 Views)

The USB-6501 is supported by Data Acquisition Toolbox in MATLAB releases R14SP3+ and later.

The full list of National Instruments devices supported by Data Acquisition Toolbox is here:

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

 

Begin to learn how to use digital input and output here:

http://www.mathworks.com/access/helpdesk/help/toolbox/daq/f11-17944.html

 

Inside MATLAB you can view demos in the documentation.

To see two digital demos you can type these commands at the MATLAB command line:

 

>> showdemo('demodio_intro')
>> showdemo('demodio_line')

 

Best regards,

Sherryl

Sherryl Radbil
Data Acquisition Engineer
The MathWorks
Message 2 of 4
(5,653 Views)

If you managed to read in from the NI USB-6501, I would be extremely thankfull, if you would be willing to share some code!

 

Best!

0 Kudos
Message 3 of 4
(5,068 Views)

Titoschmi,

 

All of the commands, as well as additional tips, can be found here: http://www.mathworks.com/help/daq/

 

Please be aware that each of the most recent versions of Matlab has added additional functionality to the session-based DAQ interface. For example, R2012a only supports counter channels (P2.7 on the USB-6501), R2012b also supports non-counter, non-clocked digital I/O, and R2013a also supports non-counter, clocked digital I/O.

 

Here is an example of how to read a non-counter, non-clocked digital input:

 

s = daq.createSession('ni');
s.addDigitalChannel('Dev1','port1/line0','InputOnly');

s.inputSingleScan()

0 Kudos
Message 4 of 4
(5,022 Views)