Example 3: Switch Position Using The *Opc Command - HP 86060C Series User Manual

Lightwave switches
Table of Contents

Advertisement

Listing
Description

Example 3: Switch position using the *OPC command

This program is identical in functionality to the first two example programs,
except that it uses yet another method for determining when the switch is set-
tled. This settling method sends the *OPC command before the
ROUTE:LAYER:CHANNEL commands and then reads the Standard Event Sta-
tus Register repeatedly until bit 0 is set to one.
10
INTEGER Switch_addr,A_position,B_position,Esr_byte
20
DIM Command$[80],Channel$[80],Error_return$[80],
Config$[80]
30
Switch_addr=711
40
CLEAR SCREEN
41
OUTPUT Switch_addr;"SYSTEM:CONFIG?"
42
ENTER Switch_addr;Config$
43
PRINT "SWITCH CONFIG = "&Config$
50
INPUT "Enter A-port position : ",A_position
60
INPUT "Enter B-port position : ",B_position
70
Channel$="A"&TRIM$(VAL$(A_position))&",B"&TRIM$
(VAL$(B_position))
80
Command$="ROUTE:LAYER1:CHANNEL "&Channel$
81
OUTPUT Switch_addr;"*OPC"
90
OUTPUT Switch_addr;Command$
100
GOSUB Wait_to_settle
110
REPEAT
120
OUTPUT Switch_addr;"SYSTEM:ERROR?"
130
ENTER Switch_addr;Error_return$
140
PRINT Error_return$
150
UNTIL (VAL(Error_return$)=0)
170
GOTO Exit_prog
180
!
190 Wait_to_settle: ! wait for switch to settle
200
REPEAT
210
OUTPUT Switch_addr;"*ESR?"
220
ENTER Switch_addr;Esr_byte
230
UNTIL BIT(Esr_byte,0)
240
RETURN
250
!
260 Exit_prog:!
270
END
Line No.
10 to 170
Same as in Example 1 except for declaration of Esr_byte.
190 to 240
The new Wait_to_settle subroutine.
Example 3: Switch position using the *OPC command
Programming
4-37

Advertisement

Table of Contents
loading

This manual is also suitable for:

86060c86061c86062c

Table of Contents