Agilent Technologies FS2010 Guide de l'utilisateur Page 74

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 160
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 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.
Vue de la page 73
1 2 ... 69 70 71 72 73 74 75 76 77 78 79 ... 159 160

Commentaires sur ces manuels

Pas de commentaire