Agilent Technologies E2094S Guide de l'utilisateur Page 62

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 146
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 61
62 Agilent VISA User’s Guide
3 Programming with VISA
/* Send a bogus command to the message-based
device to cause an SRQ. Note: 'IDN' causes the
error -- 'IDN?' is the correct syntax */
viPrintf( vi, "IDN\n" );
/* 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.
Vue de la page 61
1 2 ... 57 58 59 60 61 62 63 64 65 66 67 ... 145 146

Commentaires sur ces manuels

Pas de commentaire