Code covered by the BSD License  

Highlights from
MATLAB Code Example- 24 bit Digital Output using NI USB-6501

5.0

5.0 | 1 rating Rate this file 33 Downloads (last 30 days) File Size: 1.64 KB File ID: #26319
image thumbnail

MATLAB Code Example- 24 bit Digital Output using NI USB-6501

by

 

08 Jan 2010 (Updated )

Controlling Digital Output from MATLAB

| Watch this File

File Information
Description

MATLAB supports digital input/output devices with the Data Acquisition Toolbox.

This MATLAB code example shows you how to set the output voltages of a data acquisition device capable of digital output.
This example was tested on National Instruments™ USB-6255 device. The example also applies to NI USB-6501 and other devices. This example assumes that the vendor board driver (NI-DAQmx ) is installed.

For a complete list of supported boards:
http://www.mathworks.com/products/daq/supportedio.html

Learn more about using the Data Acquistion Toolbox:
http://www.mathworks.com/products/daq

Required Products Data Acquisition Toolbox
MATLAB release MATLAB 7.9 (R2009b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (1)
27 Jul 2010 aplha zeta

I Am Using NI-USB6501.

I am trying to get an output pulse of 100Hz and 5V form USB-6501.
The maximum I am getting is 10Hz.

I changed the output of a pin in a continuous for loop from 0 to 5v (without any delays) and the maximum freq I get is 10Hz.

I tried precise timming by using the timer function and I toggeled the output pin after every 0.001 sec and still the output was 10Hz. Even if I decrease the time period for the timer fcn still I dont get above 10.5Hz.

the code is:

dio=digitalio('nidaq', 'Dev1');
addline(dio, 0:23, 'out');

for i=0:500
putvalue(dio.Line(9:16), [1 1 1 1 1 1 1 0])
putvalue(dio.Line(9:16), [1 1 1 1 1 1 1 1])
end

and by using other method i.e timers

t = timer('TimerFcn',{@abctimer, dio}, 'Period', 0.001,'TasksToExecute', 500,'ExecutionMode', 'fixedRate');

and I toggle the pin in abctimer fcn.
its the same...doesn't go above 10Hz..
I tried both fixedrate and fixeddelay...but no change

Updates
08 Jan 2010

Updated description.

Contact us