From: Frank Mori Hess Date: Mon, 29 Mar 2004 01:34:15 +0000 (+0000) Subject: added daqcard 6036e support X-Git-Tag: r0_7_22~60 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=96cfcf95364d5290d549485c0f4a37814ba64eeb;p=comedilib.git added daqcard 6036e support --- diff --git a/comedi_calibrate/comedi_calibrate.c b/comedi_calibrate/comedi_calibrate.c index 54cf1e1..cf44471 100644 --- a/comedi_calibrate/comedi_calibrate.c +++ b/comedi_calibrate/comedi_calibrate.c @@ -925,7 +925,8 @@ void setup_caldacs( calibration_setup_t *setup, int caldac_subdev ) for(i = 0; i < n_chan; i++){ setup->caldacs[ setup->n_caldacs + i ].subdev = caldac_subdev; setup->caldacs[ setup->n_caldacs + i ].chan = i; - setup->caldacs[ setup->n_caldacs + i ].maxdata = comedi_get_maxdata( setup->dev, caldac_subdev, i); + setup->caldacs[ setup->n_caldacs + i ].maxdata = comedi_get_maxdata(setup->dev, caldac_subdev, i); + assert(setup->caldacs[ setup->n_caldacs + i ].maxdata > 0); setup->caldacs[ setup->n_caldacs + i ].current=0; } diff --git a/comedi_calibrate/ni.c b/comedi_calibrate/ni.c index 0675694..fe9309e 100644 --- a/comedi_calibrate/ni.c +++ b/comedi_calibrate/ni.c @@ -71,6 +71,7 @@ static int cal_ni_pci_611x(calibration_setup_t *setup); static int cal_ni_pci_mio_16e_4(calibration_setup_t *setup); static int cal_ni_daqcard_6062e(calibration_setup_t *setup); static int cal_ni_daqcard_6024e(calibration_setup_t *setup); +static int cal_ni_daqcard_6036e(calibration_setup_t *setup); static int cal_ni_pci_6711(calibration_setup_t *setup); static double ni_get_reference( calibration_setup_t *setup, int lsb_loc,int msb_loc); @@ -86,7 +87,7 @@ static struct board_struct boards[]={ { "DAQCard-ai-16e-4", STATUS_DONE, cal_ni_daqcard_ai_16e_4, ni_setup_observables, 0x1b5, 0x1b6 }, { "DAQCard-ai-16xe-50", STATUS_DONE, cal_ni_daqcard_ai_16xe_50, ni_setup_observables, 0x1be, 0x1bf }, { "DAQCard-6024E", STATUS_SOME, cal_ni_daqcard_6024e, ni_setup_observables, -1, -1 }, - { "DAQCard-6036E", STATUS_UNKNOWN, NULL, ni_setup_observables, -1, -1 }, + { "DAQCard-6036E", STATUS_SOME, cal_ni_daqcard_6036e, ni_setup_observables, -1, -1 }, { "DAQCard-6062E", STATUS_DONE, cal_ni_daqcard_6062e, ni_setup_observables, 0x1a9, 0x1aa }, { "pci-mio-16e-1", STATUS_DONE, cal_ni_pci_mio_16e_1, ni_setup_observables, 0x1a9, 0x1aa }, { "pci-mio-16e-4", STATUS_SOME, cal_ni_pci_mio_16e_4, ni_setup_observables, 0x1a9, 0x1aa }, @@ -1124,6 +1125,33 @@ static int cal_ni_daqcard_6024e( calibration_setup_t *setup ) return cal_ni_generic( setup, &layout ); } +static int cal_ni_daqcard_6036e( calibration_setup_t *setup ) +{ + ni_caldac_layout_t layout; + + if( comedi_get_version_code( setup->dev ) <= COMEDI_VERSION_CODE( 0, 7, 68 ) ) + { + DPRINT(0, "WARNING: you need comedi driver version 0.7.69 or later\n" + "for this calibration to work properly\n" ); + } + + init_ni_caldac_layout( &layout ); + + layout.adc_pregain_offset = 0; + layout.adc_postgain_offset = 4; + layout.adc_gain = 2; + + layout.dac_offset[ 0 ] = 6; + layout.dac_gain[ 0 ] = 7; +// layout.dac_gain_fine[ 0 ] = XXX; + + layout.dac_offset[ 1 ] = 1; + layout.dac_gain[ 1 ] = 3; + layout.dac_gain_fine[ 1 ] = 5; + + return cal_ni_generic( setup, &layout ); +} + static void prep_adc_caldacs_generic( calibration_setup_t *setup, const ni_caldac_layout_t *layout, unsigned int range ) {