I'm trying to understand the standard error handling approach for instrument drivers. The IVI compliant drivers that I looked at seem to have 2 different error reporting mechanisms:
1.) Instrument-specific errors that are reported directly by the instrument (via e.g. :SYST:ERR? queries, or via numerical status codes that need to be assigned some useful descriptions). These need to be retrieved through the driver by calling the Prefix_error_query command.
2.) IVI / VISA-level errors (attribute checking, GPIB read/write errors etc) and the generic error set by the Prefix_CheckStatusCallback function. These need to be retrieved through the driver by calling the Prefix_GetError command.
So here's my confusion: From this it would seem that one has to call the _GetError function first and check the output. If the output is an IVI_ERROR_INSTR_SPECIFIC error, one would then have to call _error_query to figure out the details. Is this correct? Is there no unified way to get to both types of errors? Would it be o.k. for the Prefix_CheckStatusCallback to call the error_query function and write the results in the IVI error queue to pick them up via GetError?
Is there some kind of tutorial on error handling (the Instrument Developers Guide does not explain _GetError at all)?
Thanks,
Martin