
72
Agilent VISA User’s Guide
3
Programming with VISA
handler must be installed and exception events
enabled on all sessions where the exception
handler is used.*/
#include <stdio.h>
#include <visa.h>
ViStatus __stdcall myExceptionHandler (
ViSession vi,
ViEventType eventType,
ViEvent context,
ViAddr usrHandle
) {
ViStatus exceptionErrNbr;
char nameBuffer[256];
ViString functionName = nameBuffer;
char errStrBuffer[256];
/* Get the error value from the exception
context */
viGetAttribute( context, VI_ATTR_STATUS,
&exceptionErrNbr );
/* Get the function name from the exception
context */
viGetAttribute( context, VI_ATTR_OPER_NAME,
functionName );
errStrBuffer[0] = 0;
viStatusDesc( vi, exceptionErrNbr,
errStrBuffer );
printf("ERROR: Exception Handler reports\n"
"(%s)\n","VISA function '%s' failed with
error 0x%lx\n", "functionName,
exceptionErrNbr, errStrBuffer );
return VI_SUCCESS;
}
void main(){
ViStatus status;
ViSession drm;
ViSession vi;
ViAddr myUserHandle = 0;
Содержание E2094S
Страница 6: ...6 Agilent VISA User s Guide ...
Страница 116: ...116 Agilent VISA User s Guide 4 Programming via GPIB and VXI ...
Страница 126: ...126 Agilent VISA User s Guide 5 Programming via LAN ...
Страница 143: ...Glossary Agilent VISA User s Guide 143 Windows notification area See notification area ...
Страница 144: ...144 Agilent VISA User s Guide Glossary ...