How to add a channel with session based interface?
2 ビュー (過去 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!