Agilent Technologies FS2010 Guía de usuario Pagina 72

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 160
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 71
72 Agilent VISA User’s Guide
3 Programming with VISA
This program is installed on your system in the
ProgrammingSamples subdirectory. See the IO Libraries
Suite Online Help for locations of sample programs.
/* srqhdlr.c
This example program illustrates installing an
event handler to be called when an SRQ interrupt
occurs. Note that you may need to change the
address. */
#include <visa.h>
#include <stdio.h>
#if defined (_WIN32)
#include <windows.h> /* for Sleep() */
#define YIELD Sleep( 10 )
#elif defined (_WINDOWS)
#include <io.h> /* for _wyield */
#define YIELD _wyield()
#else
#include <unistd.h>
#define YIELD sleep (1)
#endif
int srqOccurred;
/* trigger event handler */
ViStatus _VI_FUNCH mySrqHdlr(ViSession vi,
ViEventType
eventType, ViEvent ctx, ViAddr userHdlr){
ViUInt16 statusByte;
/* make sure it is an SRQ event */
if(eventType!=VI_EVENT_SERVICE_REQ){
/* Stray event, so ignore */
printf( "\nStray event of type 0x%lx\n",
eventType );
return VI_SUCCESS;
}
Vista de pagina 71
1 2 ... 67 68 69 70 71 72 73 74 75 76 77 ... 159 160

Comentarios a estos manuales

Sin comentarios