How can I add multiple single-ended analog input channels on MATLAB?

Hi guys, I have a national instruments NI USB-6009 device connected to the computer and I trying to import 3 single-ended input channels and a common ground on MATLAB (for it to create a voltage graph.)
I tried importing ai0 and making that single ended, which worked, but then when i tried to import ai1, I got this error:
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/ai1
Task Name: _unnamedTask<63>
Status Code: -200077
Also, when I tried importing them all at once, but I'm not sure how to make all 3 channels single-ended. Is there another way to do this? OR will it work if I just add the first three channels without making them single-ended but using one ground? Won't the computer assume that ground is ground? Thanks!

5 commentaires

Which MATLAB version are you using? Are you using legacy or session-based ?
I seem to recall a similar error on an 8-channel NI device on which the first 4 channels were fixed endian and the second 4 were switchable (possibly as a group, I do not recall); the problem in that case occurred upon adding the 5th channel (the first one that was switchable.
Session-based, I believe. Hmmm, okay. I think MATLAB only reads the differential channels for some reason, because it can only import 1 through 7, which are the differential channels.
All I want to do is have three positive input channels with a common ground and I want all three to be single-ended. How can I do this?
Thank you very much for all your help
Are you able to set it to single-ended channel for all the channels using NI-Max?
I'm not sure what that is
You can test the configuration of the device using NI Measurement and Automation Explorer. A detailed explanation is available here: http://digital.ni.com/public.nsf/allkb/71544521BDE34FFB86256FCF005F4FB6. You can connect the device and test the desired configuration. If it works in the NI MAX and not in MATLAB, then its a programming issue. Else, it would mean the device cannot be set to the desired configuration.

Connectez-vous pour commenter.

 Réponse acceptée

Z
Z le 28 Juin 2013
I got it. You use the single-ended command with multiple channels in brackets.

1 commentaire

Hello, I know this is over 10 years later, but can you expand upon what you mean by using the single-ended command with multiple channels in brackets? I'm also using session based and TerminalConfig doesn't seem to work for session based. Thanks

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by