Programming Examples

9

if (id == 0)

{

printf ("Oscilloscope iopen failed!\n");

}

else

{

printf ("Oscilloscope session initialized!\n");

/* Set the I/O timeout value for this session to 5 seconds. */ itimeout(id, TIMEOUT);

/* Clear the interface. */ iclear(id); iremote(id);

}

initialize();

/* The extras function contains miscellaneous commands that do not

*need to be executed for the proper operation of this example.

*The commands in the extras function are shown for reference

*purposes only.

*/

/* extra(); */ /* <-- Uncomment to execute the extra function */

capture();

analyze();

/* Close the device session to the instrument. */ iclose(id);

printf ("Program execution is complete...\n");

/* For WIN16 programs, call _siclcleanup before exiting to release

*resources allocated by SICL for this application. This call is

*a no-op for WIN32 programs.

*/

_siclcleanup();

}

/*

*initialize

*------------------------------------------------------------------

*This function initializes both the interface and the oscilloscope

*to a known state.

*/

void initialize (void)

{

/* RESET - This command puts the oscilloscope in a known state.

*Without this command, the oscilloscope settings are unknown.

*This command is very important for program control.

*

*Many of the following initialization commands are initialized

*by this command. It is not necessary to reinitialize them

*unless you want to change the default setting.

*/

Agilent InfiniiVision 5000 Series Oscilloscopes Programmer's Reference

551

Page 551
Image 551
Agilent Technologies 5000 Series manual Programming Examples