Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

General error handling question (_error_query vs _GetError)

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
0 Kudos
Message 1 of 2
(3,303 Views)

Hi Mcfischer,

 

I think your understanding of this topic is good.  Please take a look at the Status Reporting by LabWindows/CVI Instrument Drivers section in the CVI help to see if helps answer your questions and/or reaffirm your understanding.  Let me know if you have further questions.

0 Kudos
Message 2 of 2
(3,251 Views)