Agilent Technologies E2094S Podręcznik Użytkownika Strona 72

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 146
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 71
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;
Przeglądanie stron 71
1 2 ... 67 68 69 70 71 72 73 74 75 76 77 ... 145 146

Komentarze do niniejszej Instrukcji

Brak uwag