How to add a channel with session based interface?
5 次查看(过去 30 天)
显示 更早的评论
I'm trying to get an analog output with my NI-USB-6501 D/A device to control an other device. I've got the Data Acquisition Toolbox with 64bit Matlab R2011a running on Windows 7 .
First I tried to add or connect the device somehow with Matlab:
daqfind
ans =
[]
what were'n very succesfull. Then I tried:
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.
Next i wanted to add a channel. That's were my problems have started. With the 64bit version i must use the session-based interface, that's propably why this doesn't work
dio=digitalio('nidaq', 'Dev1')
So i tried
s.addAnalogOutputChannel('Dev1','ao2','Voltage')
and
ch=s.addAnalogOutputChannel('Dev1','ao2','Voltage')
but that all doesn't work at all. It answers:
???No appropriate method, property, or field addanalogoutputchannel for class daq.ni.session.
Im not sure wether I used the right deviceID, channelID and measurementType in
s.addAnalogOutputChannel(deviceID, channelID, measurementType)
Thanks in advance! Patrick
0 个评论
采纳的回答
Friedrich
2013-4-23
编辑:Friedrich
2013-4-23
Hi,
it seems more like a programming mistake on your end. MATLAB is Case sensitive. Make sure you use the correct syntax:
>> s.addanalogoutputchannel
No appropriate method, property, or field addanalogoutputchannel for class
daq.ni.Session.
>> s.addAnalogOutputChannel
Adding a channel requires a device ID, a channel ID, and a measurement type.
The first call is most likely what you did (at least thats what the error message you get suggests), which will fail because the method name is wrong.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Acquisition Toolbox Supported Hardware 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!