Manual background

/* Set the output amplitude to be set for 50 ohm load. */ err=viPrintf(funcgen, "OUTPut:LOAD 50\n");

if(err != VI_SUCCESS) err_handler(funcgen, err);

/* configure the E1441A to output a 5 Vp-p, 5 kHz sine wave */

/* with a 2.5V offset*/ err=viPrintf(funcgen, "SOURce:APPLy:SIN 5000, 2, 2.5\n"); if(err != VI_SUCCESS) err_handler(funcgen, err);

/* set

the burst

modulation source,

set 10,000

burst cycles,

*/

/* a 270

degree starting phase,

a 1

Hz burst rate, enable

*/

/*

the

burst state,

and output the burst when a negative

*/

/*

going

trigger

is

received on

"EXT TRIG" BNC

connector

*/

err=viPrintf(funcgen, "SOURce:BM:SOURce INTernal\n"); /* counted burst mode */ if(err != VI_SUCCESS) err_handler(funcgen, err);

err=viPrintf(funcgen, "SOURce:BM:NCYCles 10000\n"); /* 10000 cycle bursts */ if(err != VI_SUCCESS) err_handler(funcgen, err);

err=viPrintf(funcgen, "SOURce:BM:PHASe 270\n"); /* 270 degree phase */ if(err != VI_SUCCESS) err_handler(funcgen, err);

err=viPrintf(funcgen, "TRIGger:SOURce EXTernal\n"); /* "EXT" trig BNC */ if(err != VI_SUCCESS) err_handler(funcgen, err);

err=viPrintf(funcgen, "TRIGger:SLOPe NEG\n"); /* "trigger on negative edge */ if(err != VI_SUCCESS) err_handler(funcgen, err);

err=viPrintf(funcgen, "SOURce:BM:STATe ON\n"); /* enable burst mode */ if(err != VI_SUCCESS) err_handler(funcgen, err);

/* Now short "EXT TRIG" BNC connector to start 2 second burst */

/* Check for system errors. */ err=viQueryf(funcgen, "syst:err?\n", "%t", buf); if(err != VI_SUCCESS) err_handler(funcgen, err); printf("System error response = %s\n\n", buf);

/* close the device session */ viClose(funcgen);

} /* end of main */

/*** Error handling function ***/

void err_handler(ViSession funcgen, ViStatus err)

{

char buf[1024] = {0}; viStatusDesc(funcgen, err, buf); printf("ERROR = %s\n", buf); return;

}

Chapter 2

Agilent E1441A Application Information 59

Page 59
Image 59
Agilent Technologies Chapter, Agilent E1441A Application Information, iferr != VI_SUCCESS err_handlerfuncgen, err