Sending Commands

The commands listed in Chapter 7 are sent to the OSA as ASCII strings. The method used depends on the programming language and environment. The examples in this book use the HP-BASIC language with an HP 9000 Series 300 technical computer. Using HP-BASIC, the following example shows an output statement to send a command to the OSA:

10 OUTPUT 723;"CENTERWL 1300NM;"

Set the center wavelength.

Be sure to place a semicolon between commands and at the end of any command string.

Using an HP Vectra computer with the HP-IB Interface and Command Library (and programming in C), the same command could be sent as follows:

IOOUTPUTS(723L,"CENTERWL 1300NM;",15);

Most analyzer commands ￿rst activate a function, then enter a number followed by a units code and a command terminator:

The number within the quote ￿eld must be a string of decimal numbers plus an optional decimal point and may be preceded by a minus or plus sign. Either ￿xed- or ￿oating-point notation may be used. For example, \12.3E3", \1.23E4", and \12300" each enter the same number. A units code follows a data entry.

1-11