Chapter 6 Application Programs
Using the Low-Level Commands
134
QuickBASIC / GPIB (Program 2)
REM $INCLUDE: 'QBSETUP'
'
' This program uses low-level SCPI commands to program the power
' supply to output 3 volts/0.5 amps for +6V output, 20 volts/0.9 amps
' for +25V output, and 10 volts/0.5 amps for -25V output. This program
' also shows the use of a trigger received over the GPIB interface to
' initiate a single trigger. The program is written in QuickBASIC and
' uses Agilent 82335 GPIB card and GPIB command library.
'
ISC& = 7 ' GPIB select code is "7"
Dev& = 705 ' Assign I/O path to address 705
Timeout = 5 ' Configure device library for a 5 second timeout
CALL IOTIMEOUT(ISC&, Timeout)
IF PCIB.ERR <> NOERR THEN ERROR PCIB.BASERR
CALL IORESET(ISC&) ' Reset the Agilent 82335 GPIB card
IF PCIB.ERR <> NOERR THEN ERROR PCIB.BASERR
CALL IOCLEAR(Dev&) ' Send a device clear to the power supply
IF PCIB.ERR <> NOERR THEN ERROR PCIB.BASERR
CALL IOREMOTE(Dev&) ' Place the power supply in the remote mode
IF PCIB.ERR <> NOERR THEN ERROR PCIB.BASERR
Info1$ = "*RST" ' Reset the power supply
Length1% = LEN(Info1$)
CALL IOOUTPUTS(Dev&, Info1$, Length1%)
IF PCIB.ERR <> NOERR THEN ERROR PCIB.BASERR
Info1$ = "INST:COUP:TRIG ALL" ' Couple three outputs
Length1% = LEN(Info1$)
CALL IOOUTPUTS(Dev&, Info1$, Length1%)
IF PCIB.ERR <> NOERR THEN ERROR PCIB.BASERR
Info1$ = "TRIG:SOUR BUS" ' Trigger source is "bus"
Length1% = LEN(Info1$)
CALL IOOUTPUTS(Dev&, Info1$, Length1%)
IF PCIB.ERR <> NOERR THEN ERROR PCIB.BASERR
Info1$ = "TRIG:DEL 30" ' Set 30 seconds of time time delay
Length1% = LEN(Info1$)
CALL IOOUTPUTS(Dev&, Info1$, Length1%)
IF PCIB.ERR <> NOERR THEN ERROR PCIB.BASERR