Agilent Technologies 66311A User Manual page 142

Table of Contents

Advertisement

1225
'
1230
'Clear status circuit
1235
CODES$="*CLS"
1240
FOR I=1 TO 50
1245
'
1250
'Disable output and save present state to location 2
1255
CODES$ = "OUTPUT OFF;*SAV 2"
1260
END
1265
'
2000 'Send command to dc source
2005
CALL IBWRT(PS%,CODES$)
2010
IF IBSTAT%
2015
RETURN
1250
'Disable output and save present state to location 2
1255
CODES$ = "OUTPUT OFF;*SAV 2"
1260
END
1265
'
2000 'Send command to dc source
2005
CALL IBWRT(PS%,CODES$)
2010
IF IBSTAT%
2015
RETURN
2020
'
2100
'Error detection routine
2105
PRINT "GPIB error. IBSTAT% = HEX$(IBSTAT%)
2110
PRINT "
2115
STOP
2120
'
3000
'Get data from dc source
3005
CALL IBRD(PS%,OUTPUT$)
3010
IF IBSTA%
3015
I=1
3020
X=1
3025
C=INSTR(I,OUTPUT$,";")
3030
WHILE C <> 0
3035
D$=MID$(OUTPUT$,I,C-I)
3040
OUTPUT(X)=VAL(D$)
3045
I=C+1
3050
C=INSTR(I,OUTPUT$,";")
3055
X=X+1
3060
WEND
3065
D$=RIGHT$(OUTPUT$,LEN(OUTPUT$)-(I-1))
3070
OUTPUT(X)=VAL(D$)
3075
OUTPUT$=SPACE$(40)
3080
RETURN
:GOSUB 2000
:NEXT I
:GOSUB 2000
:GOSUB 2000
IBERR%
=
";IBERR%" in line ";ERL
Example Programs - D
'Wait for supply to clear
'Parse data string
'Get values
'Clear string
139

Advertisement

Table of Contents
loading

Table of Contents