beautypg.com

GW Instek GDS-800 Series Programming Manual User Manual

Page 82

background image

GDS-806/810/820/840 Programming Manual

81

#define EOTMODE 1 /* Enable the END message */

#define EOSMODE 0 /* Disable the EOS mode */

void Acquire(void);

void Delay(int);

void ShowIbsta(char);

int Dev; /* Device handle */

unsigned char ReadBuffer[201]; /* Read data buffer */

char ErrorMnemonic[21][5] = {"EDVR", "ECIC", "ENOL", "EADR", "EARG",

"ESAC", "EABO", "ENEB", "EDMA", "",

"EOIP", "ECAP", "EFSO", "", "EBUS",

"ESTB", "ESRQ", "", "", "", "ETAB"};

unsigned char WaveBuf[ARRAYSIZE];

int _cdecl main(void)

{

int i, count=0;

unsigned char ch;

Dev = ibdev (BDINDEX, PRIMARY_ADDR_OF_DMM, NO_SECONDARY_ADDR,

TIMEOUT, EOTMODE, EOSMODE);

if(ibsta & ERR)

printf("\n\rUnable to open device");

ibclr (Dev);

if(ibsta & ERR)

printf("\n\rUnable to clear device(ibsta= %x),

(iberr=%x)",ibsta,iberr);

ibwrt (Dev, "*CLS\n", 5L); /*Clear ths status registers and*/

printf("\n\r*CLS\n\r"); /*Output buffer of GDS-806/810/820/840./

if((ibsta&ERR)||(ibsta&TIMO)){

ShowIbsta(1);

return 0;

}