From c4bef70db042beb6744b3dd30c71bc23f91d066b Mon Sep 17 00:00:00 2001 From: Frank Mori Hess Date: Sun, 24 Nov 2002 15:16:49 +0000 Subject: [PATCH] 611x documentation was wrong, calibration sources do not correspond to those from other boards. Guessing at index for 5V positive 0V negative calibration source. --- comedi_calibrate/ni.c | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/comedi_calibrate/ni.c b/comedi_calibrate/ni.c index 5072bf7..88153ed 100644 --- a/comedi_calibrate/ni.c +++ b/comedi_calibrate/ni.c @@ -146,6 +146,14 @@ enum reference_sources { REF_DAC1_5V = 7, }; +// 611x documentation wrong, this was determined from hardware behaviour +enum reference_sources_611x { + REF_GND_GND_611x = 0, + REF_5V_0V_611x = 1, + REF_DAC0_0V_611x = 2, + REF_DAC1_0V_611x = 3, +}; + int ni_setup( calibration_setup_t *setup , const char *device_name ) { ni_setup_board( setup, device_name ); @@ -341,7 +349,7 @@ void ni_setup_observables_611x( calibration_setup_t *setup ) o->observe_insn = tmpl; o->observe_insn.chanspec = CR_PACK(ai_chan, range, AREF_DIFF) | CR_ALT_SOURCE | CR_ALT_FILTER; - o->reference_source = REF_GND_GND; + o->reference_source = REF_GND_GND_611x; o->target = 0.0; /* voltage reference */ @@ -350,8 +358,8 @@ void ni_setup_observables_611x( calibration_setup_t *setup ) o->observe_insn = tmpl; o->observe_insn.chanspec = CR_PACK(ai_chan, range, AREF_DIFF) | CR_ALT_SOURCE | CR_ALT_FILTER; - o->reference_source = REF_5V_5V; - o->target = 0.0; + o->reference_source = REF_5V_0V_611x; + o->target = 5.0; } memset(&po_tmpl,0,sizeof(po_tmpl)); @@ -370,7 +378,7 @@ void ni_setup_observables_611x( calibration_setup_t *setup ) o->observe_insn = tmpl; o->observe_insn.chanspec = CR_PACK( 0, ai_range_for_ao, AREF_DIFF ) | CR_ALT_SOURCE | CR_ALT_FILTER; - o->reference_source = REF_DAC0_0V; + o->reference_source = REF_DAC0_0V_611x; set_target( setup, ni_ao0_zero_offset_611x, 0.0 ); /* ao 0, gain */ @@ -382,9 +390,8 @@ void ni_setup_observables_611x( calibration_setup_t *setup ) o->observe_insn = tmpl; o->observe_insn.chanspec = CR_PACK( 0, ai_range_for_ao, AREF_DIFF ) | CR_ALT_SOURCE | CR_ALT_FILTER; - o->reference_source = REF_DAC0_5V; + o->reference_source = REF_DAC0_0V_611x; set_target( setup, ni_ao0_reference_611x, 5.0 ); - o->target -= voltage_reference; /* ao 1, zero offset */ o = setup->observables + ni_ao1_zero_offset_611x; @@ -395,7 +402,7 @@ void ni_setup_observables_611x( calibration_setup_t *setup ) o->observe_insn = tmpl; o->observe_insn.chanspec = CR_PACK( 0, ai_range_for_ao, AREF_DIFF) | CR_ALT_SOURCE | CR_ALT_FILTER; - o->reference_source = REF_DAC1_0V; + o->reference_source = REF_DAC1_0V_611x; set_target( setup, ni_ao1_zero_offset_611x, 0.0 ); /* ao 1, gain */ @@ -407,9 +414,8 @@ void ni_setup_observables_611x( calibration_setup_t *setup ) o->observe_insn = tmpl; o->observe_insn.chanspec = CR_PACK( 0, ai_range_for_ao, AREF_DIFF ) | CR_ALT_SOURCE | CR_ALT_FILTER; - o->reference_source = REF_DAC1_5V; + o->reference_source = REF_DAC1_0V_611x; set_target( setup, ni_ao1_reference_611x, 5.0 ); - o->target -= voltage_reference; setup->n_observables = ni_ao1_reference_611x + 1; } -- 2.26.2