diff options
author | Mike <mjc@avtechpulse.com> | 2000-01-01 00:03:25 +0900 |
---|---|---|
committer | Mike <mjc@avtechpulse.com> | 2000-01-01 00:03:25 +0900 |
commit | 82da255c8a0c4ab78cc131f829e68e27ea5bb6f6 (patch) | |
tree | bdd21175049bb0555b929b97565ad8c16ac4c4f3 | |
parent | e04c556d14aaef9a49dc0635f5cffa4afc4887c5 (diff) |
extended delay when switching attenuators in -LV units
-rw-r--r-- | device-functions.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/device-functions.c b/device-functions.c index 37ad978..5fd8a98 100644 --- a/device-functions.c +++ b/device-functions.c @@ -439,9 +439,14 @@ int Set_Amplitude(int check_possible_only,int pol_override,int override_on,int w I2C_Write(PCF8574+Octal_Relay_Driver, atten_ctl); } - if ( (globals.Registers.last_relay_driver_settings[3+channel] != atten_ctl)) { - globals.Registers.last_relay_driver_settings[3+channel] = atten_ctl; + if ( (globals.Registers.last_relay_driver_settings[3+channel] != pwl_struct[parameter][channel].atten_range)) { + // allow cap banks time to discharge if switching attenuators globals.Flags.force_output_fully_off=YES; + if (pwl_struct[parameter][channel].atten_range < globals.Registers.last_relay_driver_settings[3+channel]) { + // allow time for HV cap banks to fall + globals.Timers.Relay_Switching_Delay_in_Milliseconds=(long) (1000L * globals.Flash.extended_relay_delay_in_sec); + } + globals.Registers.last_relay_driver_settings[3+channel] = pwl_struct[parameter][channel].atten_range; } debug_new_parameter (channel, parameter, requested_ampl); @@ -4741,7 +4746,7 @@ void Main_update_shift_registers() I2C_Write(PCF8574+Extra_DACs_Addr_Port, addr + 8); // latch into AD7839 } - /* keep trigger suppressed for a time (normally 5ms) after a relay update */ + /* keep trigger suppressed for a time (normally 0.5s) after a relay update */ if ( globals.Registers.last_relay_driver_settings[0]!=globals.Registers.shift_reg_out[2] || globals.Registers.last_relay_driver_settings[1]!=globals.Registers.shift_reg_out[3] || globals.Flags.force_output_fully_off==YES) { |