
Chapter 6 Application Programs
RS-232 Operation Using QuickBASIC
135
6
RS-232 Operation Using QuickBASIC
The following example shows how to send command instruction and receive
command responses over the RS-232 interface using QuickBASIC.
RS-232 Operation Using QuickBASIC (Program 4)
CLS
LOCATE 1, 1
DIM cmd$(100), resp$(100)
' Set up serial port for 9600 baud, none parity, 8 bits;
' Ignore Request to Send and Carrier Detect; Send line feed,
' enable parity check, reserve 1000 bytes for input buffer
OPEN "com1:9600,n,8,2,rs,cd,lf,pe" FOR RANDOM AS #1 LEN = 1000
'
' Put the power supply into the remote operation mode
PRINT #1, "SYST:REM"
'
'Reset and clear the power supply
PRINT #1, "*RST;*CLS"
'
' Query the power supply's id string
PRINT #1, "*IDN?"
LINE INPUT #1, resp$
PRINT "*IDN? returned: ", resp$
'
' Ask what revision of SCPI the power supply conforms to
PRINT #1, "SYST:VERS?"
LINE INPUT #1, resp$
PRINT "SYST:VERS? returned: ", resp$
'
' Generate a beep
PRINT #1, "SYST:BEEP"
'
' Set the +6V outputs to 3 V, 3 A
PRINT #1, "APPL P6V, 3.0, 3.0"
'
' Enable the outputs
PRINT #1, "OUTP ON"
'
' Query the output voltage for +6V output
PRINT #1, "MEAS:VOLT? P6V"
LINE INPUT #1, resp $
PRINT "MEAS:VOLT? P6V returned: ", resp$
END
End of Program 4
Содержание E3631-90002
Страница 9: ...8...
Страница 14: ...1 1 General Information...
Страница 25: ...24...
Страница 26: ...2 2 Initial Operation...
Страница 34: ...3 3 Front Panel Operation...
Страница 64: ...4 4 Remote Interface Reference...
Страница 113: ...112...
Страница 114: ...5 5 Error Messages...
Страница 124: ...6 6 Application Programs...
Страница 137: ...136...
Страница 138: ...7 7 Tutorial...
Страница 153: ...152...
Страница 154: ...8 8 Specifications...
Страница 160: ...Chapter 8 Specifications Supplemental Characteristics 159 8 Figure 8 1 Dimensions of Agilent E3631A Power Supply...
Страница 161: ...160...