summaryrefslogtreecommitdiff
path: root/device-functions.c
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 /device-functions.c
parentc587cacfa55a7d3c4e24cc398594a4412bb36ee3 (diff)
when using attenuators, do not go to very top of raw ampl rangeINSTRUMENT_5_0_2
Diffstat (limited to 'device-functions.c')
-rw-r--r--device-functions.c12
1 files changed, 12 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 */