USB 6009 Add Analog Input, Error 200077
Show older comments
Hey everyone,
I am using the Data Acq Toolbox version 3.1 (r2012a) with a NI USB-6009 running DAQmx 9.5 drivers. The device has 8 analog inputs if used in single ended mode, and 4 analog inputs if used in differential mode.
I am programming through the session based interface. If I attempt to create a session and add channels however, I am only able to add the first 4 channels since they by default are added as differential. If I try to add a 5th channel, I get error message 200077.
See the code below:
>> daq.getDevices
ans =
ni: National Instruments USB-6009 (Device ID: 'Dev1')
Analog input subsystem supports:
8 ranges supported
Rates from 0.1 to 48000.0 scans/sec
8 channels ('ai0','ai1','ai2','ai3','ai4','ai5','ai6','ai7')
'Voltage' measurement type
Analog output subsystem supports:
0 to +5.0 Volts range
Rates from 0.0 to 0.0 scans/sec
2 channels ('ao0','ao1')
'Voltage' measurement type
Counter input subsystem supports:
Rates from 0.0 to 0.0 scans/sec
1 channel ('ctr0')
'EdgeCount' measurement type
So I know that MATLAB recognizes all 8 channels of the DAQ. However, when I create the session and attemp to add all the channels, I get this:
>> s=daq.createSession('ni'); s.addAnalogInputChannel('Dev1',0:7,'Voltage')
NI Error -200077:
Requested value is not a supported value for this property. The property value may be invalid because it conflicts
with another property.
Property: DAQmx_AI_Min
Requested Value: -20.0
Valid Values Begin with: -10.0
Valid Values End with: 10.0
Channel Name: Dev1/ai4
Task Name: _unnamedTask<44>
Status Code: -200077
I understand why it's giving me the error...mainly because it's trying to add all 8 channels as differential inputs. Is there any way to specify when creating channels in the session based interfaced to add them as SingleEnded? I know I could modify the InputType subproperty of the Channels property, but that is only possible after the channel has been added
4 Comments
bym
on 17 May 2012
I don't have the data acquisition toolbox, but it appears you are trying to add a channel (Dev1/ai4) who's minimum is -20 volts where only ± 10 volts are supported
Walter Roberson
on 17 May 2012
No, Donald just requests "Voltage". Which is a valid property for both analog channels and differential channels. Donald does not specify a voltage range, and has no access to the voltage range setting until the channel object is constructed.
The channel being complained about is ai4, the fifth channel -- a channel that only exists when the devices are in single-ended mode. But Donald cannot switch them into single-ended mode until the object is already created...
Donald Bucci
on 17 May 2012
Donald Bucci
on 23 May 2012
Answers (3)
Donald Bucci
on 1 Jun 2012
1 vote
Walter Roberson
on 17 May 2012
0 votes
This is a hack, but...
Construct the object with channels 0:3. set() the single-ended property of the resulting object. Now channels 4-7 should come into existence, so add-channel those in as well.
2 Comments
Donald Bucci
on 17 May 2012
Walter Roberson
on 23 May 2012
Sorry, just saw your response now.
Unfortunately I do not have any suggestions at this point (other than asking support)
Some day I'll get the DAQ toolbox and a system to run it on and some devices to connect to it...
Manisha
on 14 Jun 2012
0 votes
Categories
Find more on Hardware Discovery and Setup in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!