/* START LIBRARY DESCRIPTION ********************************************* ERRCHK.LIB Copyright (c) 2006, Avtech Electrosystems Ltd. DESCRIPTION: Error-checking and reporting functions. SUPPORT LIB'S: END DESCRIPTION **********************************************************/ /*** BeginHeader Error_check */ #include #include #include "globals.h" #include "dummy_functions.h" /*** EndHeader */ int Error_Screen=NO; void set_gpib_error_flags (int error_num); void set_gpib_error_flags (int error_num) { if (error_num == OK) { return; } /* set the error flags in the GPIB ESR register right away */ switch (error_num) { case AsyncModeDisabled: case Unrecognized: case SyntaxError: case UnknownUnits: case InvalidChannel: GPIB_Set_Command_Error(); break; case query_error_interrupted: case query_error_unterminated: GPIB_Set_Query_Error(); break; case Overload_Detected: case Overtemp_Detected: case Overvolt_Detected: case Device_Specific_Aux_Error_Detected: case queue_overflow: case CalibrationPercentError: case CalibrationZeroError: case CalibrationMinMaxError: case CalibrationClosenessError: case CalibrationRangeError: case CalibrationPolarityError: case Soft_Limit_Exceeded: case SelfCalError: GPIB_Set_Device_Dependent_Error(); break; default: GPIB_Set_Execution_Error(); break; } return; } void queue_error(int error_num); void queue_error(int error_num) { if (error_num == OK) { return; } set_gpib_error_flags (error_num); if (globals.number_of_errors 0, ampl+offset must be > 0, if ampl < 0, ampl+offset must be < 0."); break; case PW_Distort_Error: format_error_text(response,-240,"Not possible with the current PW distortion settings."); break; case burst_duty_error: format_error_text(response,-222,"Duty cycle inside burst is too high."); break; case min_burst_period_error: format_error_text(response,-222,"Time between consecutive rising edges inside burst is too low."); break; case max_burst_count_error: format_error_text(response,-222,"Too many pulses per burst."); break; case min_burst_gap_error: format_error_text(response,-222,"Pulse separation too low."); break; case max_burst_gap_error: format_error_text(response,-222,"Pulse separation too high."); break; case Burst_Exceeds_Period: format_error_text(response,-222,"Burst width can not exceed period."); break; case password_change_error: format_error_text(response,-222,"Incorrect old password, or new password is too long or short. "); break; default: format_error_text(response,-200,"Specific problem unknown."); } }