Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!m44g2000hsc.googlegroups.com!not-for-mail
From: Daniel <499953@unizar.es>
Newsgroups: comp.soft-sys.matlab
Subject: Addchannel Problem
Date: Mon, 10 Mar 2008 06:19:56 -0700 (PDT)
Organization: http://groups.google.com
Lines: 38
Message-ID: <9303fc02-0805-4974-b612-a5d07f7479b9@m44g2000hsc.googlegroups.com>
NNTP-Posting-Host: 155.210.26.201
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Trace: posting.google.com 1205155196 8299 127.0.0.1 (10 Mar 2008 13:19:56 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Mon, 10 Mar 2008 13:19:56 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: m44g2000hsc.googlegroups.com; posting-host=155.210.26.201; 
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.1.6) 
Xref: news.mathworks.com comp.soft-sys.matlab:456328



Hi, I d like to know if somebody could help me to solve a problem with
my Data Acquisition Card. I have got a National Instruments Lab-
PC-1200 DAQ with a BNC-2081 board and I d like to work just with the
channels 2 and 4 (in differential input mode). My Matlab code is the
following:

       ai = analoginput('nidaq',1);
       chans = addchannel(ai,[4 2]);

%measuring to get the offset
%INPUT
        t=3;
%setting the SampleRate (half of maximum possible)
        temp = propinfo(ai,'SampleRate');
        aiSR = temp.ConstraintValue(2)*0.50; %100000
        act_aiSR = setverify(ai,'SampleRate',aiSR);
%setting SamplesPerTriegguer for t seconds
        samples=floor(t*act_aiSR);
        set(ai,'SamplesPerTrigger',samples)
%set(ai,'Timeout',10)
        start(ai);
        pause(t+1);
%getting the signals
        [inputdata,tai]=getdata(ai,samples);
        stop(ai);
        offset=mean(inputdata);

But the programm takes channels 2 and 0

and if I use

chans = addchannel(ai,[4 2 0]);

An error occurs at line:  "start(ai);"

Some suggestion?

Thank you very much