User`s guide
4-33
Programming
Programming Examples
the form appropriate for the
ROUTE:LAYER:CHANNEL
GPIB command. For example, if
A_position=1
and
B_position=3
, then
Channel$
would equal
"A1,B3"
.
80 Set
Command$
to represent the full GPIB command to set
the desired switch position, appending
Channel$
. For the
example
Channel$
given above,
Command$
would equal
"ROUTE:LAYER1:CHANNEL A1,B3"
.
90 Send
Command$
to the Agilent 8606X Optical Switch via
the GPIB interface.
100 Call the subroutine
Wait_to_settle
.
110 to 150 These lines implement a
REPEAT-UNTIL
loop that
continuously queries the Agilent 8606X for error status.
The returned error message(s) are printed to the screen.
This loop exits when the numeric value of the error string
equals 0. This will occur when the error message
"+0, no
error"
is returned.
170 Go to the end of the program.
190 to 230 The
wait_for_settle
subroutine.
200 Output the *WAI command to the Agilent 8606X Optical
Switch. This command will prevent the switch from
executing any further commands until the previous
command (that is, the switch setting command) has
completed. When the program continues after the
completion of the command, the switches are guaranteed
to have settled.
210 Output system configuration query to switch.
220 Read back switch configuration. Since this query was
preceded by the *WAI command, the switch movement
must be settled before the query is responded to.
230 Return execution to the line after call to subroutine
(line 110).