Programming Guide – 41
The SRQ mask register is cleared by powering up the attenuator, by the CLR command, or by
the universal device clear command (DC1).
SRQ Mask Register
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
self-test
error
n/a
syntax
error
message
available
n/a
settled
n/a
parameter
error
GPIB Programming Examples
This section provides programming examples for controlling the attenuator over the GPIB
interface. The examples were written in MS-DOS Qbasic and run on a personal computer,
equipped with a National Instruments
5
GPIB interface board with National Instruments
Universal Language Interface drivers loaded. The commands that control the GPIB are similar
to Hewlett Packard HP Basic commands. Most other controller board manufacturers provide
basic output and input statements for communicating messages to a GPIB instrument.
Before using any of these examples, ensure that the GPIB address is set to 5, that the active
interface command set is HA9, and that the switch is connected to the computer via a GPIB
cable.
The GPIB commands that appear in this section do not always show a terminating sequence;
however, it is implied.
Sending Commands
This example sets the wavelength to 1300 nm and the attenuation to 20 dB; the commands
demonstrate the use of a variable in the statement that sends the attenuation command:
OPEN "GPIB0" FOR OUTPUT AS #1
OPEN "GPIB0" FOR INPUT AS #2
PRINT #1, "ABORT"
PRINT#1, "GPIBEOS IN CR LF"
PRINT#1, "GPIBEOS OUT CR LF"
PRINT #1, "OUTPUT 05;WVL 1300e-9 m"
atten = 20
PRINT #1, "OUTPUT 05;ATT ";atten; " dB"
END
This example sets the offset to 10, the total attenuation to 30 dB, and the wavelength to
1550 nm:
OPEN "GPIB0" FOR OUTPUT AS #1
OPEN "GPIB0" FOR INPUT AS #2
PRINT #1, "ABORT"
5
National Instruments is a trademark of National Instruments.
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com