- From: Eric Hudson <ehudson_at_midlandhome.net>
- Date: Mon, 11 Sep 2006 20:12:29 -0500
I believe there is a problem with the cb_pcidas64 driver. I have two devices
that output a +/- 500mV signal and I have one connected to chan0 and the
other to chan1. When I run my program to measure the channels my values are
not consistent, they float and go everywhere. I contacted the manufacturer
about this and we did the following using their windows based program:
Ensured my equipment was connected properly to the PCI-DAS6034 board
Set program to differential mode
Set the following variables in their program: scan rate = 1000Hz and
Sample/Channel = 1024
Set the program to run continuously
The results of the test were great the values for both channels were
identical to what my digital multimeter showed. They then confirmed that
their board was working and the problem must lie within comedi (which they
do not support). From this test I know now that my connection from my
equipment to the board is connected properly.
Here is a bit about how I'm using comedi:
int ADCCHAN = 0;
int ADCCHAN2 = 1;
int ADCSUBDEV = 0;
int ADCRANGE = 2;
int ADC_AREF = AREF_DIFF;
comedi_t *device;
int maxdata;
comedi_range *cr;
device = comedi_open("/dev/comedi0");
for(;;){
read_chan0();
usleep(100000);
read_chan1();
usleep(100000);
}
read_chan0(){
float var = 0;
maxdata = comedi_get_maxdata(device, ADCSUBDEV, ADCCHAN);
cr = comedi_get_range(device, ADCSUBDEV, ADCCHAN, ADCRANGE);
comedi_data_read_delayed(device, ADCSUBDEV, ADCCHAN, ADCRANGE,
ADC_AREF, &adc1,5);
var = comedi_to_phys(adc1, cr, maxdata);
printf("chan0 = %.2f\n",var1);
}
read_chan1(){
float var2 = 0;
maxdata = comedi_get_maxdata(device, ADCSUBDEV, ADCCHAN);
cr = comedi_get_range(device, ADCSUBDEV, ADCCHAN, ADCRANGE);
comedi_data_read_delayed(device, ADCSUBDEV, ADCCHAN, ADCRANGE,
ADC_AREF, &adc1,5);
var2 = comedi_to_phys(adc1, cr, maxdata);
printf("chan1 = %.2f\n",var2);
}
Hopefully you all can help me figure this problem out.
Thanks,
Eric.
Received on 2006-09-12Z00:12:29