Beginning Your Program

Programs should begin with system-level and OSA commands that initialize the system. Three such commands are discussed here: CLEAR, IP, and

CLRDSP.

The CLEAR command is an HP BASIC command that resets a device on HP-IB to a known state. As an example, CLEAR 723 clears the device (the OSA in this case) at address 23 on interface 7. CLEAR erases the OSA's input bu￿er, interrupts most incomplete operations, and prepares the OSA to receive instructions.

The instrument-preset command, IP, sets all of the analog parameters of the OSA to a known state and provides a good starting point for all measurement processes. Refer to IP in Chapter 7, \Language Reference" for complete information on the IP command.

The CLRDSP command clears any graphics from the display screen. Because CLRDSP also erases stored graphics from memory, such as an item or a graphics window, execute CLRDSP discriminately. Chapter 5, \Creating Graphics," gives more information about initializing the analyzer display for graphic presentations.

To initialize the bus and the OSA

￿Place the following commands at the start of your program.

10

CLEAR 723

Initialize the bus .

20

OUTPUT

723;"IP;"

Initialize the OSA.

30

OUTPUT

723;"CLRDSP;"

Clears any user graphics.

1-10