diff options
Diffstat (limited to 'error_utils.c')
-rw-r--r-- | error_utils.c | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/error_utils.c b/error_utils.c index 6361065..9965b23 100644 --- a/error_utils.c +++ b/error_utils.c @@ -43,6 +43,7 @@ void set_gpib_error_flags (int error_num) case ThisShouldntHappen: case obsolete_feature: case zero_equiv_ampl_too_large: + case zero_equiv_ampl_negative: GPIB_Set_Command_Error(); break; case query_error_interrupted: @@ -377,6 +378,10 @@ void get_error_text(gchar **response, int error_num) format_error_text(response,-222,"Amplitude too high."); break; + case amplitude_gap: + format_error_text(response,-222,"Amplitude magnitude too low."); + break; + case peak_power_limit: format_error_text(response,-222,"Peak power too high."); break; @@ -553,6 +558,10 @@ void get_error_text(gchar **response, int error_num) format_error_text(response,-200,"Ampl zero equivalent is too high. Reprogram it."); break; + case zero_equiv_ampl_negative: + format_error_text(response,-200,"Ampl zero equivalent can't be negative."); + break; + default: format_error_text(response,-200,"Specific problem unknown."); } @@ -708,10 +717,14 @@ int Error_check(ChannelStruct ChannelStateToTest[max_channels]) break; } - if (fabs(globals.Flash.ampl_zero_equiv[i] > 200.0)) { + if (fabs(globals.Flash.ampl_zero_equiv[i] > 2000.0)) { report_error = zero_equiv_ampl_too_large; } + if (globals.Flash.ampl_zero_equiv[i] < 0.0) { + report_error = zero_equiv_ampl_negative; + } + /* calculate maximum duty cycle based on amplitude and load, for later use */ max_duty_high_ampl=globals.Flash.max_duty_high[i]; @@ -1088,6 +1101,18 @@ int Error_check(ChannelStruct ChannelStateToTest[max_channels]) } /* ------------------------------- */ + + /* --- check gaps in ampl range, AVRQ -AHV/-XHV ---- */ + if (non_zero_first_ampl_point(i)) { + if (fabs(ChannelStateToTest[i].amplitude) < globals.Flash.ampl_zero_equiv[i]) { + report_error=amplitude_gap; + } + } + + /* ------------------------------------------------- */ + + + /* --- check minimum amplitude --- */ if (uses_fixed_ampl && (min_fixed_ampl > globals.Flash.min_ampl[i])) { |