How to add a channel with session based interface?
4 views (last 30 days)
Show older comments
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 Comments
Accepted Answer
Friedrich
on 23 Apr 2013
Edited: Friedrich
on 23 Apr 2013
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.
More Answers (0)
See Also
Categories
Find more on Data Acquisition Toolbox Supported Hardware in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!