static int init_observables_1xxx( calibration_setup_t *setup );
static struct board_struct boards[]={
- { "pci-das1000", STATUS_GUESS, setup_cb_pci_1xxx },
+ { "pci-das1000", STATUS_SOME, setup_cb_pci_1xxx },
{ "pci-das1001", STATUS_GUESS, setup_cb_pci_1xxx },
{ "pci-das1002", STATUS_GUESS, setup_cb_pci_1xxx },
{ "pci-das1200", STATUS_DONE, setup_cb_pci_1xxx },
*voltage = eeprom8_to_source( byte );
}else
{
- fprintf( stderr, "%s: maxdata = 0x%x invalid\n",
- __FUNCTION__, max_data );
+ fprintf( stderr, "%s: maxdata = 0x%x invalid for subdevice %i, channel %i\n",
+ __FUNCTION__, max_data, subdevice, eeprom_channel);
return -1;
}
comedi_range *range;
range = comedi_get_range( setup->dev, setup->ad_subdev, 0, range_index );
- if( range == NULL ) return -1;
-
+ if( range == NULL )
+ {
+ fprintf(stderr, "%s: failed to get range\n", __FUNCTION__);
+ return -1;
+ }
if( range->max > 7.0 )
return EEPROM_7V_CHAN;
else if( range->max > 3.5 )
comedi_range *range;
range = comedi_get_range( setup->dev, setup->ad_subdev, 0, range_index );
- if( range == NULL ) return -1;
-
+ if( range == NULL )
+ {
+ fprintf(stderr, "%s: failed to get range\n", __FUNCTION__);
+ return -1;
+ }
if( range->min > -0.001 )
return CS_64XX_8600uV;
else
comedi_range *range;
range = comedi_get_range( setup->dev, setup->ad_subdev, 0, range_index );
- if( range == NULL ) return -1;
-
+ if( range == NULL )
+ {
+ fprintf(stderr, "%s: failed to get range\n", __FUNCTION__);
+ return -1;
+ }
if( range->max > 7.0 )
return CS_64XX_7V;
else if( range->max > 3.5 )
comedi_range *range;
range = comedi_get_range( setup->dev, setup->da_subdev, 0, range_index );
- if( range == NULL ) return -1;
-
+ if( range == NULL )
+ {
+ fprintf(stderr, "%s: failed to get range\n", __FUNCTION__);
+ return -1;
+ }
target = range->max * 0.9;
set_target( setup, obs, target );
return 0;
tmpl.subdev = setup->ad_subdev;
num_ai_ranges = comedi_get_n_ranges( setup->dev, setup->ad_subdev, 0 );
- if( num_ai_ranges < 0 ) return -1;
-
+ if( num_ai_ranges < 0 )
+ {
+ fprintf(stderr, "%s: failed to get number of ai ranges\n", __FUNCTION__);
+ return -1;
+ }
setup->n_observables = 0;
for( range = 0; range < num_ai_ranges; range++ )
po_tmpl.subdev = setup->da_subdev;
num_ao_ranges = comedi_get_n_ranges( setup->dev, setup->da_subdev, 0 );
- if( num_ao_ranges < 0 ) return -1;
+ if( num_ao_ranges < 0 )
+ {
+ fprintf(stderr, "%s: failed to get number of ao ranges\n", __FUNCTION__);
+ return -1;
+ }
for( range = 0; range < num_ao_ranges; range++ )
{
comedi_range *range;
range = comedi_get_range( setup->dev, setup->ad_subdev, 0, ai_range );
- if( range == NULL ) return -1;
-
+ if( range == NULL )
+ {
+ fprintf(stderr, "%s: failed to get range\n", __FUNCTION__);
+ return -1;
+ }
if( range->max > 9.999 )
return CS_60XX_10V;
else if( range->max > 4.999 )
setup->n_observables = 0;
num_ranges = comedi_get_n_ranges( setup->dev, setup->ad_subdev, 0 );
- if( num_ranges < 0 ) return -1;
-
+ if( num_ranges < 0 )
+ {
+ fprintf(stderr, "%s: failed to get number of ai ranges\n", __FUNCTION__);
+ return -1;
+ }
for( i = 0; i < num_ranges; i++ )
{
+fprintf(stderr, "setting up ai observables for range %i out of %i\n", i, num_ranges);
o = setup->observables + ai_ground_observable_index_60xx( setup, 0, i );
o->reference_source = CAL_SRC_GROUND;
assert( o->name == NULL );
po_tmpl.subdev = setup->da_subdev;
num_ranges = comedi_get_n_ranges( setup->dev, setup->da_subdev, 0 );
- if( num_ranges < 0 ) return -1;
+ if( num_ranges < 0 )
+ {
+ fprintf(stderr, "%s: failed to get number of ao ranges\n", __FUNCTION__);
+ return -1;
+ }
for( i = 0; i < num_ranges; i++ )
{
comedi_range *range;
range = comedi_get_range( setup->dev, setup->ad_subdev, 0, ai_range );
- if( range == NULL ) return -1;
-
+ if( range == NULL )
+ {
+ fprintf(stderr, "%s: failed to get range\n", __FUNCTION__);
+ return -1;
+ }
if( range->max > 4.4 )
return CS_4020_4375mV;
else if( range->max > 0.7 )
comedi_range *range;
range = comedi_get_range( setup->dev, setup->ad_subdev, 0, range_index );
- if( range == NULL ) return -1;
-
+ if( range == NULL )
+ {
+ fprintf(stderr, "%s: failed to get range\n", __FUNCTION__);
+ return -1;
+ }
if( range->max > 4.4 )
return EEPROM_4375mV_CHAN;
else if( range->max > 0.7 )
tmpl.subdev = setup->ad_subdev;
num_ranges = comedi_get_n_ranges( setup->dev, setup->ad_subdev, 0 );
- if( num_ranges < 0 ) return -1;
+ if( num_ranges < 0 )
+ {
+ fprintf(stderr, "%s: failed to get number of ai ranges\n", __FUNCTION__);
+ return -1;
+ }
num_channels = comedi_get_n_channels( setup->dev, setup->ad_subdev );
- if( num_channels < 0 ) return -1;
+ if( num_channels < 0 )
+ {
+ fprintf(stderr, "%s: failed to get number of ai channels\n", __FUNCTION__);
+ return -1;
+ }
setup->n_observables = 0;