summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorroot <root@avtech.domain.avtechpulse.com>1999-12-31 19:00:31 -0500
committerroot <root@avtech.domain.avtechpulse.com>1999-12-31 19:00:31 -0500
commitdc99289acd9644a365bbe662deaac2fef1b3035f (patch)
treea84626cacbd1bf059fb8fb96b847002201a86f79
parentc587cacfa55a7d3c4e24cc398594a4412bb36ee3 (diff)
when using attenuators, do not go to very top of raw ampl rangeINSTRUMENT_5_0_2
-rw-r--r--device-functions.c12
-rw-r--r--flash.c2
-rw-r--r--globals.h4
3 files changed, 18 insertions, 0 deletions
diff --git a/device-functions.c b/device-functions.c
index 464079c..203af45 100644
--- a/device-functions.c
+++ b/device-functions.c
@@ -2715,6 +2715,18 @@ int Set_VI_Control(int parameter,int channel,float new_ampl,int *point_found,int
} else {
use_atten = globals.Flash.attenuators[channel][*atten_range];
}
+
+ // Limit max voltage in attenuator mode to 93% of full maximum,
+ // to avoid the region in AVPs where PW shifts at high amplitudes
+ float max1 = fabs(globals.Flash.min_ampl[channel]);
+ float max2 = fabs(globals.Flash.max_ampl[channel]);
+ if (max2 > max1) {
+ max1 = max2;
+ }
+ if ((use_ampl * use_atten) >
+ (globals.Flash.atten_percent_max_ampl[channel] * max1)) {
+ continue;
+ }
}
for (range_i=starting_range; (range_i<max_ranges) && (!*point_found || top_range_only); ++range_i) { /* use non-all-zero ranges */
diff --git a/flash.c b/flash.c
index 8f0154b..1282eff 100644
--- a/flash.c
+++ b/flash.c
@@ -773,6 +773,8 @@ static void initFlashValues(FlashStruct *mem)
for (j=0;j<max_attens;j++) {
mem->attenuators[i][j] = 0.0;
}
+
+ mem->atten_percent_max_ampl[i] = 0.93;
}
mem->relay_delay_in_sec=0.5;
diff --git a/globals.h b/globals.h
index e703617..ca50fdf 100644
--- a/globals.h
+++ b/globals.h
@@ -707,6 +707,10 @@ typedef struct {
// for 15 dB, use 5.62
// for 10 dB, use 3.16
+ float atten_percent_max_ampl[max_channels]; // addr 10134 - normally 0.93
+ // don't use higher ampls in AVPs,
+ // where PW shifts near max ampl
+
char spare_end;
char flash_end;