User`s manual
INST addr; // GPIB Address identifier
//**********************************************************************
void main(void) // Run the program
{
#if defined(__BORLANDC__) && !defined(__WIN_32)
_InitEasyWin(); // Required for Borland EasyWin program
#endif
// Enable communication path to the module
addr=iopen(DEV_ADDR);
if (!addr)
{
printf("\n\tUnable to communicate with the module");
printf("\n\nClose the window or press Alt-F4 to exit");
exit(1);
}
// Set GPIB Timeout to 10 seconds
if(itimeout(addr, 10000))
time_out("main - send timeout command");
rst_clr(); // Reset the AFG
gen_seg(); // Generate segment list and output sequence
run_query(); // Query segment and segment/sequence memory
// Close communication
iclose(addr);
// Release SICL resource allocation; not needed for Windows NT
_siclcleanup();
printf("\n\nClose the window or press Alt-F4 to exit");
exit(0);
}
//**********************************************************************
void gen_seg(void)
{
char *set_commands[] = // Use "set_commands" to setup the AFG
{
"SOUR:LIST1:SSEQ:DEL:ALL", // Clear sequence memory
"SOUR:LIST1:SEGM:DEL:ALL", // Clear segment memory
"SOUR:ROSC:SOUR INT1;" // Select the Ref. Oscillator
":TRIG:STAR:SOUR INT1;" // Select the sample source
":SOUR:FREQ1:FIX 100E3;" // Set the sample frequency
":SOUR:FUNC:SHAP USER;" // Command to select the user function
Continued on Next Page
42 Getting Started Chapter 1