
Programming with VISA
3
Agilent VISA User’s Guide
73
status = viOpenDefaultRM( &drm );
if ( status < VI_SUCCESS ) {
printf( "ERROR: viOpenDefaultRM failed with
error = 0x%lx\n", status );
return;
}
/* Install the exception handler and enable
events for it */
status = viInstallHandler(drm,
VI_EVENT_EXCEPTION, myExceptionHandler,
myUserHandle);
if ( status < VI_SUCCESS )
{
printf( "ERROR: viInstallHandler failed
with error 0x%lx\n", status );
}
status = viEnableEvent(drm, VI_EVENT_EXCEPTION,
VI_HNDLR, VI_NULL);
if ( status < VI_SUCCESS ) {
printf( "ERROR: viEnableEvent failed with
error 0x%lx\n", status );
}
/* Generate an error to demonstrate that the
handler will be called */
status = viOpen( drm, "badVisaName", NULL,
NULL, &vi );
if ( status < VI_SUCCESS ) {
printf("ERROR: viOpen failed with error
0x%lx\n"
"Exception Handler should have been
called\n"
"before this message was printed.\n",status
);
}
}
Содержание 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 ...