Agilent Technologies FS2010 Uživatelská příručka Strana 78

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 160
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 77
78 Agilent VISA User’s Guide
3 Programming with VISA
/* evntqueu.c
This sample program illustrates enabling an
event queue using viWaitOnEvent. Note that you
must change the device address. */
#include <visa.h>
#include <stdio.h>
void main(){
ViSession defaultRM,vi;
ViEventType eventType;
ViEvent eventVi;
ViStatus err;
ViInt16 trigId;
/* 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);
/* enable the event */
viEnableEvent(vi, VI_EVENT_TRIG, VI_QUEUE,
VI_NULL);
/* fire trigger line, twice */
viAssertTrigger(vi, VI_TRIG_PROT_SYNC);
viAssertTrigger(vi, VI_TRIG_PROT_SYNC);
/* Wait for the event to occur */
err=viWaitOnEvent(vi, VI_EVENT_TRIG, 10000,
&eventType, &eventVi);
if(err==VI_ERROR_TMO){
printf("Timeout Occurred! Event not
received.\n");
return;
}
Zobrazit stránku 77
1 2 ... 73 74 75 76 77 78 79 80 81 82 83 ... 159 160

Komentáře k této Příručce

Žádné komentáře