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!