Clear Filters
Clear Filters

USB 6009 Add Analog Input, Error 200077

7 views (last 30 days)
Donald Bucci
Donald Bucci on 17 May 2012
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
Donald Bucci
Donald Bucci on 17 May 2012
--proecsm
That's sort of correct. The channel limits of the USB 6009 are -10 to 10V in single ended mode. Hence when it's in differential mode...these translate to a min and max of -20 and 20V respectively. It's basically trying to set the thing in differential mode and the error happens when it tries to set the corresponding range that goes along with differential.
Donald Bucci
Donald Bucci on 23 May 2012
Anyone else have any ideas? I know there must be a way to work around this, other than just downgrading to the legacy code.

Sign in to comment.

Answers (3)

Donald Bucci
Donald Bucci on 1 Jun 2012
Figured this out. I am using MATLAB 64 bit. Downgrading to 32 bit and performing the original tasks don't present this issue. Is there some way I can forward this to MATLAB's bug department?

Walter Roberson
Walter Roberson on 17 May 2012
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
Donald Bucci on 17 May 2012
So in doing this, here is my output:
>> s = daq.createSession('ni'); s.addAnalogInputChannel('Dev2',0:3,'Voltage')
ans =
Data acquisition session using National Instruments hardware:
Will run for 1 second (1000 scans) at 1000 scans/second.
Number of channels: 4
index Type Device Channel MeasurementType Range Name
----- ---- ------ ------- --------------- ---------------- ----
1 ai Dev2 ai0 Voltage (Diff) -20 to +20 Volts
2 ai Dev2 ai1 Voltage (Diff) -20 to +20 Volts
3 ai Dev2 ai2 Voltage (Diff) -20 to +20 Volts
4 ai Dev2 ai3 Voltage (Diff) -20 to +20 Volts
>> set(s.Channels,'InputType','SingleEnded')
>> set(s.Channels,'Range',[-10 10])
Viewing s.Channels yields:
Number of channels: 4
index Type Device Channel MeasurementType Range Name
----- ---- ------ ------- ------------------- ---------------- ----
1 ai Dev2 ai0 Voltage (SingleEnd) -10 to +10 Volts
2 ai Dev2 ai1 Voltage (SingleEnd) -10 to +10 Volts
3 ai Dev2 ai2 Voltage (SingleEnd) -10 to +10 Volts
4 ai Dev2 ai3 Voltage (SingleEnd) -10 to +10 Volts
Which seems right, however I then go to add the other channels and the same error results:
>> s.addAnalogInputChannel('Dev2',4: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: Dev2/ai4
Task Name: _unnamedTask<2C>
Status Code: -200077
Walter Roberson
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...

Sign in to comment.


Manisha
Manisha on 14 Jun 2012
Look at this bug report for this issue.
Thanks,
Manisha

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!