Agilent Technologies FS2010 Guía de usuario Pagina 70

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 160
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 69
70 Agilent VISA User’s Guide
3 Programming with VISA
This sample program is installed on your system in the
ProgrammingSamples subdirectory. See the IO Libraries
Suite Online Help for locations of sample programs.
/* evnthdlr.c
This example program illustrates installing an
event handler to be called when a trigger
interrupt occurs. Note that you may need to
change the address. */
#include <visa.h>
#include <stdio.h>
/* trigger event handler */
ViStatus _VI_FUNCH myHdlr(ViSession vi,
ViEventType eventType, ViEvent ctx, ViAddr
userHdlr){
ViInt16 trigId;
/* make sure it is a trigger event */
if(eventType!=VI_EVENT_TRIG){
/* Stray event, so ignore */
return VI_SUCCESS;
}
/* print the event information */
printf("Trigger Event Occurred!\n");
printf("...Original Device Session = %ld\n",
vi);
/* get the trigger that fired */
viGetAttribute(ctx, VI_ATTR_RECV_TRIG_ID,
&trigId);
printf("Trigger that fired: ");
switch(trigId){
case VI_TRIG_TTL0:
printf("TTL0");
break;
default:
printf("<other 0x%x>", trigId);
break;
}
printf("\n");
Vista de pagina 69
1 2 ... 65 66 67 68 69 70 71 72 73 74 75 ... 159 160

Comentarios a estos manuales

Sin comentarios