HP VXI manual Deverrmask Qryerrmask

Page 20

(QRY_ERR_MASK == (esr & QRY_ERR_MASK )) )

{

/* an error occurred, read the error queue to get the error */ errnum = -1;

while( errnum != 0)

{

ipromptf( id, "SYST:ERR?\n", "%d,%t", &errnum, errmsg); if( errnum != 0)

printf("%d,%s", errnum, errmsg);

}

}

}

}

void main()

{

INST id;

char addr[80]; char cmd[255]; int opc;

int idx;

printf("This program provides an interactive environment for SCPI \n"); printf("compatible instruments. \n\n");

printf("Enter the SICL address of the instrument to open.\n"); printf("for example: iscpi,24)\n");

gets(addr);

/* install error handler */ ionerror( I_ERROR_EXIT);

/* open the

instrument specified by the user */

id

= iopen(addr);

 

itimeout(

id,

20000);

/* 20 second timeout */

/*

set up

SRQ

handler */

 

ionsrq( id,

srq_hdlr);

 

/* enable MAV (bit 4) and Standard Event Status Summary (bit 5) * in status byte to cause an SRQ */

iprintf( id, "*SRE %d\n", MAV_MASK ESR_MASK);

/* enable ERROR Bits to generate a ESR summary message */ iprintf( id, "*ESE %d\n", CMD_ERR_MASK EXE_ERR_MASK

DEV_ERR_MASK QRY_ERR_MASK);

/* make sure *SRE and *ESE finished */

 

ipromptf( id, "*OPC?\n", "%d", &opc);

/* opc value not used */

printf("\nEnter SCPI Commands/Queries to Instrument at %s\n", addr); printf(" (press return to exit)\n\n");

while(1)

 

 

{

 

 

while(0 == gets(cmd));

 

if( 0

== strlen(cmd))

 

 

break;

/* quit sending SCPI Commands */

20 Programming the Status System

Chapter 2

Image 20
Contents Contents Comments Example QUEStionableEVENt? Printing History This Page Intentionally Left Blank Introduction Introduction Chapter About this Chapter General Status Register ModelCondition Register Transition Filter Event Register An Example SequencePage Required Status Groups Status Byte Register Standard Event Group Status Byte Bit DefinitionsStandard Operation Status Group Questionable Data Group Handling SRQs Using MAV to Determine When Data is Available Status System Programming ExamplesExample Program SRQ Icloseid Example Program Deverrmask Qryerrmask Chapter Programming the Status System Programming the Status System Chapter Command Reference OPERation CONDition? OPERationENABleSTATus OPERationENABle? PRESetOPERationEVENt? QUEStionable CONDition?QUEStionableEVENt? QUEStionableENABleQUEStionableENABle? STATQUESEVEN? Common Command Reference CLSEMC? ESE maskESE? ESR?LRN? IDN?LMC? OPC OPC?PMC RSTSRE mask SRE?STB? TST?WAI Command Reference Chapter