Cannot add channels to DAQ device

13 次查看(过去 30 天)
Adam
Adam 2014-6-23
回答: Akshay 2014-7-7
I am using NI DAQ USB-6501 (which is listed as supported) on a Win7 x64 machine. I have to use a session-based connection but cannot add a channel...
The card is clearly found and working:
devices = daq.getDevices
devices =
ni Dev1: National Instruments USB-6501
Counter input subsystem supports:
Rates from 0.0 to 0.0 scans/sec
1 channel
'EdgeCount' measurement type
daq.getVendors
ans =
Data acquisition vendor 'National Instruments':
ID: 'ni'
FullName: 'National Instruments'
AdaptorVersion: '3.0 (R2011b)'
DriverVersion: '9.6.0 NI-DAQmx'
IsOperational: true
but no luck when I try to add a connection:
s=daq.createSession('ni');
s =
Data acquisition session using National Instruments hardware:
Will run for 1 second (1000 scans) at 1000 scans/second.
No channels have been added.
>> s.addAnalogOutputChannel('Dev1','ai0','Voltage')
The requested subsystem 'AnalogOutput' does not exist on this device.
s.addCounterOutputChannel('Dev1',0,'EdgeCount')
The requested subsystem 'CounterOutput' does not exist on this device.
Help? Any idea how I'm supposed to add an output channel to this?

回答(1 个)

Akshay
Akshay 2014-7-7
The spec sheet for NI DAQ USB 6501 device shows that it belongs to the Digital I/O product family. The data sheet for the device indicates no analog Input/Output channels.
To see the supported subsystem for your device on your release of MATLAB, you can check in the report generated by executing the following command
>> daqsupport
When I execute the above mentioned command for R2011b (your specified version of MATLAB) I can see that this release of MATLAB supports only “CounterInput” subsystem.
You can add Counter Input channels using the following commands:
>> s=daq.createSession('ni');
>> s.addCounterInputChannel('Dev1','ctr0','EdgeCount')
To add Digital Channels to your device, upgrade to the latest release of MATLAB (any release beyond R2012a). You can then use the same device and add digital input/output channels as well.
ni: National Instruments USB-6501 (Device ID: 'Dev1')
Digital subsystem supports:
24 channels ('port0/line0' - 'port2/line7')
'InputOnly','OutputOnly','Bidirectional' measurement types
Counter input subsystem supports:
1 channel ('ctr0')
'EdgeCount' measurement type
Then you can try executing the following commands to add digital channels to your device.
>> s=daq.createSession('ni');
>> s.addDigitalChannel('Dev1','port0/line0','Bidirectional')
Please refer the link for more information on addDigitalChannel function

类别

Help CenterFile Exchange 中查找有关 Hardware Discovery and Setup 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by