update_caldac( setup, dac, x );
DPRINT(0,"caldac[%d] set to %d\n",dac,x);
+ if( x >= setup->caldacs[dac].maxdata || x <= 0 )
+ DPRINT(0,"WARNING: caldac[%d] pegged!\n", dac );
if(verbose>=3){
measure_observable( setup, obs);
}
x = x2;
update_caldac( setup, dac, x );
DPRINT(0,"caldac[%d] set to %d\n",dac,x);
+ if( x >= setup->caldacs[dac].maxdata || x <= 0 )
+ DPRINT(0,"WARNING: caldac[%d] pegged!\n", dac );
if(verbose>=3){
preobserve( setup, obs1);
measure_observable( setup, obs1);
x = x2;
update_caldac( setup, dac, x );
DPRINT(0,"caldac[%d] set to %d\n",dac,x);
+ if( x >= setup->caldacs[dac].maxdata || x <= 0 )
+ DPRINT(0,"WARNING: caldac[%d] pegged!\n", dac );
if(verbose>=3){
preobserve( setup, obs1);
measure_observable( setup, obs1);
check_gain_chan_x(&l,CR_PACK(adc,range,AREF_OTHER),cdac);
offset=linear_fit_func_y(&l,caldacs[cdac].current);
gain=l.slope;
-
+
a=caldacs[cdac].current+(target-offset)/gain;
update_caldac( setup, cdac, rint(a));