Agilent Technologies E4356A Operating & Programming Manual page 60

Telecommunications dc power supply
Table of Contents

Advertisement

1130
'Enable Status Byte OPER summary bit
1135
CODES$ = "*SRE 128"
1140
'
1146
'Arm trigger circuit and send trigger to power supply
1150
CODES$ = "INITIATE;TRIGGER"
1160
'Wait for unit to respond to trigger
1165
FOR I= 1 to 100 :NEXT I
1170
'
1175
'Poll for interrupt caused by change to CC mode and print to screen
1180
SPOL%=O
1186
CALL IBRSP(PS%,SPOL%)
1190
IF (SPOL% AND 128) = 128 THEN POLL = 1 'Set interrupt flag on OPER bit
1195
IF POLL < > 1 THEN GOTO 1230
1200
"CODES$ = "STAT:OPER:EVEN?" :GOSUB 2000
1205
CALL IBRD(PS%,OEVENT$)
1210
IF IBSTA% <0 THEN GOTO 21OO
1215
OEVENT=VAL(OEVENT$)
1220
IF (OEVENT AND 1024) = 1024 THEN PRINT "Unit switched to CC mode."
1225
'
1230
'Clear status circuit
1235
CODES$="*CLS"
1240
FOR I=1 TO 50 :NEXT I
1245
'
1250
'Disable output and save present state to location 2
1255
CODES$ = "OUTPUT OFF;*SAV 2" :GOSUB 2000
1260
END
1265
'
2000
'Send command to power supply
2005
CALL IBWRT(PS%,CODES$)
2010
IF IBSTAT% < 0 THEN GOTO 2100
2015
RETURN
1250
'Disable output and save present state to location 2
1255
CODES$ = "OUTPUT OFF;*SAV 2" :GOSUB 2000
1260
END
1265
'
2000
'Send command to power supply
2005
CALL IBWRT(PS%,CODES$)
2010
IF IBSTAT% < 0 THEN GOTO 2100
2015
RETURN
2020
'
2100
'Error detection routine
2105
PRINT "GPIB error. IBSTAT%. = &H";HEX$(IBSTAT%)
2110
PRINT "
2115
STOP
2120
'
3000
'Get data from power supply
3005
CALL IBRD(PS%,OUTPUT$)
3010
IF IBSTA% < 0 THEN GOTO 2100
3015
I=1
'
3020
X=1
3025
C=INSTR(I,OUTPUT$,";")
60
Remote Programming
Programming Some Power supply Functions (continued)
:GOSUB 2000
:GOSUB 2000
IBERR% = ";IBERR%" in line ";ERL
:GOSUB 2000
'No interrupt to service
'Query status oper register
'Read back event bit
'Wait for unit to clear
'Error detected
'Error detected
'Parse data string

Advertisement

Table of Contents
loading

Table of Contents