Agilent Technologies FS2010 Podręcznik Użytkownika Strona 85

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 160
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 84
Programming with VISA 3
Agilent VISA User’s Guide 85
/* 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;
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 ) {
Przeglądanie stron 84
1 2 ... 80 81 82 83 84 85 86 87 88 89 90 ... 159 160

Komentarze do niniejszej Instrukcji

Brak uwag