Errors¶
This section documents error codes returned by BenHW SDK functions.
Exception class¶
In object-oriented (OOP) target languages (currently only available in Python), exceptions are thrown by the SDK wrapper methods. Thus each error code in this reference is represented by an equivalent OOP exception.
In the Python SDK, the exceptions are organized in the exceptions module.
Error Codes¶
BI_error¶
Value: -1
Equivalent Exception Class: BenHWException
Function call failed. Use BI_report_error to get detailed hardware error code.
BI_invalid_token¶
Value: -2
Equivalent Exception Class: InvalidTokenException
The function was passed an invalid attribute token that is not recognized.
BI_invalid_component¶
Value: -3
Equivalent Exception Class: InvalidComponentException
The function was passed a component identifier that does not exist in the system model.
BI_invalid_attribute¶
Value: -4
Equivalent Exception Class: InvalidAttributeException
The function was passed an attribute token referring to an attribute that does not exist or is inaccessible for the specified component.
BI_no_setup_window¶
Value: -5
Equivalent Exception Class: NoSetupWindowException
No setup window is available for the specified component.
BI_PMC_timeout¶
Value: 1
Equivalent Exception Class: PmcTimeoutException
PMC (Power & Motor Controller) is not responding to commands.
BI_MSC_timeout¶
Value: 2
Equivalent Exception Class: MscTimeoutException
MSC1 (Motor & Stepper Controller) is not responding to commands.
BI_MSD_timeout¶
Value: 3
Equivalent Exception Class: MsdTimeoutException
MSD (Motor & Stepper Driver) is not responding to commands.
BI_MAC_timeout¶
Value: 4
Equivalent Exception Class: MacTimeoutException
MAC (Motor & Accessory Controller) is not responding to commands.
BI_MAC_invalid_cmd¶
Value: 5
Equivalent Exception Class: MacInvalidCmdException
Error in communication with MAC - invalid command was sent or received.
BI_225_dead¶
Value: 10
Equivalent Exception Class: Amp225DeadException
225 lock-in amplifier is not responding to commands.
BI_265_dead¶
Value: 11
Equivalent Exception Class: Amp265DeadException
265 DC amplifier is not responding to commands.
BI_267_dead¶
Value: 12
Equivalent Exception Class: Amp267DeadException
267 amplifier is not responding to commands.
BI_277_dead¶
Value: 13
Equivalent Exception Class: Amp277DeadException
277 amplifier is not responding to commands.
BI_262_dead¶
Value: 14
Equivalent Exception Class: Relay262DeadException
262 relay unit is not responding to commands.
BI_ADC_read_error¶
Value: 20
Equivalent Exception Class: AdcReadErrorException
Analogue-digital Converter (ADC) is not responding or failed to complete a read operation.
BI_ADC_invalid_reading¶
Value: 21
Equivalent Exception Class: AdcInvalidReadingException
Could not obtain a valid reading from the Analogue-digital Converter (ADC). The reading may be out of range or corrupted.
BI_ADC_Overload¶
Value: 22
Equivalent Exception Class: AdcOverloadException
Analogue-digital Converter (ADC) overload detected - the input signal is too strong for the current range setting.
BI_AMP_invalid_channel¶
Value: 30
Equivalent Exception Class: AmpInvalidChannelException
Invalid amplifier channel specified. Check the channel number is valid for your amplifier model.
BI_AMP_invalid_wavelength¶
Value: 31
Equivalent Exception Class: AmpInvalidWavelengthException
Invalid wavelength specified for amplifier operation. The wavelength may be outside the valid range.
BI_SAM_invalid_wavelength¶
Value: 32
Equivalent Exception Class: SamInvalidWavelengthException
Invalid wavelength specified for Swing Away Mirror (SAM) operation.
BI_turret_invalid_wavelength¶
Value: 33
Equivalent Exception Class: TurretInvalidWavelengthException
Attempt to send monochromator beyond its valid wavelength range for the current grating.
BI_turret_incorrect_pos¶
Value: 34
Equivalent Exception Class: TurretIncorrectPosException
Turret is not in the expected position. Error in communication with MAC or mechanical fault.
BI_MVSS_invalid_width¶
Value: 35
Equivalent Exception Class: MvssInvalidWidthException
Invalid slit width specified for Motorised Variable Slits (MVSS). Width must be in valid range.
BI_Comms_TX_error¶
Value: 40
Equivalent Exception Class: CommsTxErrorException
Communication transmission error occurred during data transfer to hardware.
BI_Action_Timeout¶
Value: 50
Equivalent Exception Class: ActionTimeoutException
Hardware action timed out before completing. The operation took longer than the maximum allowed time.
BI_Invalid_Command_error¶
Value: 60
Equivalent Exception Class: InvalidCommandErrorException
Invalid command was sent to the hardware or received an unexpected response.
BI_External_Driver_error¶
Value: 61
Equivalent Exception Class: ExternalDriverErrorException
Error occurred in external driver or DLL used to communicate with hardware.
BI_undefined_error¶
Value: 100
Equivalent Exception Class: UndefinedErrorException
An undefined error occurred. The error code is not recognized or has not been categorized.
Error Handling Tips¶
Use
BI_report_error()orreport_error()to get detailed error information after failures