Agilent Technologies FS2010 Podręcznik Użytkownika Strona 71

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 160
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 70
Programming with VISA 3
Agilent VISA User’s Guide 71
return VI_SUCCESS;
}
void main(){
ViSession defaultRM,vi;
/* open session to VXI device */
viOpenDefaultRM(&defaultRM);
viOpen(defaultRM, "VXI0::24::INSTR", VI_NULL,
VI_NULL, &vi);
/* select trigger line TTL0 */
viSetAttribute(vi, VI_ATTR_TRIG_ID,
VI_TRIG_TTL0);
/* install the handler and enable it */
viInstallHandler(vi, VI_EVENT_TRIG, myHdlr,
(ViAddr)10);
viEnableEvent(vi, VI_EVENT_TRIG, VI_HNDLR,
VI_NULL);
/* fire trigger line, twice */
viAssertTrigger(vi, VI_TRIG_PROT_SYNC);
viAssertTrigger(vi, VI_TRIG_PROT_SYNC);
/* unenable and uninstall the handler */
viDisableEvent(vi, VI_EVENT_TRIG, VI_HNDLR);
viUninstallHandler(vi, VI_EVENT_TRIG, myHdlr,
(ViAddr)10);
/* close the sessions */
viClose(vi);
viClose(defaultRM);
}
Sample: SRQ Callback
This program installs an event handler and enables an SRQ
event. When the event occurs, the installed event handler is
called. This sample program is intended to show specific
VISA functionality and does not include error trapping.
Error trapping, however, is good programming practice and
is recommended in your VISA applications. See “Trapping
Errors” in this chapter for more information.
Przeglądanie stron 70
1 2 ... 66 67 68 69 70 71 72 73 74 75 76 ... 159 160

Komentarze do niniejszej Instrukcji

Brak uwag