Agilent Technologies FS2010 Guia do Utilizador Página 74

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 160
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 73
74 Agilent VISA User’s Guide
3 Programming with VISA
/* Wait a while for the SRQ to be generated and
for the handler to be called. Print something
while we wait */
printf("Waiting for an SRQ to be generated.");
for (count = 0 ; (count < 10) &&
(srqOccurred == 0);count++) {
long count2 = 0;
printf( "." );
while ( (count2++ < 100) && (srqOccurred ==0)
){YIELD;
}
}
printf( "\n" );
/* disable and uninstall the handler */
viDisableEvent(vi, VI_EVENT_SERVICE_REQ,
VI_HNDLR);
viUninstallHandler(vi, VI_EVENT_SERVICE_REQ,
mySrqHdlr, (ViAddr)10);
/* Clean up - do not leave device in error
state */
viPrintf( vi, "*CLS\n" );
/* close the sessions */
viClose(vi);
viClose(defaultRM);
printf( "End of program\n" );}
Using the Queuing Method
The queuing method is generally used when an immediate
response from your application is not needed. To use the
queuing method for receiving notification that an event has
occurred, you must do the following:
Enable one or several events with the viEnableEvent
function.
When ready to query, use the viWaitOnEvent function to
check for queued events.
Vista de página 73
1 2 ... 69 70 71 72 73 74 75 76 77 78 79 ... 159 160

Comentários a estes Manuais

Sem comentários