Re: Simultaneous data read from two channels

Eric Hudson wrote:
>
> Hello,
>
>  
>
> I get the same values for chan0 and chan1 while trying to acquire data 
> from both chans. I am doing the following"
>
>  
>
> For(;;){
>
> Read_chan0();
>
> Sleep(1);
>
> Read_chan1();
>
> }
>
>  
>
> Inside each read_chan() I have the necessary bits to read from chan, 
> i.e, comedi_data_read().
>
>  
>
> To test this I have connected 3VDC supply to chan0 and 5VDC supply to 
> chan1 when I run my program I get 5VDC for chan0 and chan1. If I 
> comment out either of the read_chan()'s I get the correct voltage for 
> the channel. What is causing this?
>
>  
>
> Thanks,
>
>  
>
> Eric.
>
>  
>
Eric,

This is just a guess since you haven't given enough info for a real 
diagnosis.  But if you are using a card with a single adc and a mux 
(which most cards are), you may not be allowing enough settleing time.  
To test this theory, add a sleep after Read_chan1().  If effect, this 
gives some settling time between the chan1 read and the next chan0 read.

Steve

Received on 2006-04-13Z21:11:58