RS-232 Operations with QuickBASIC
This program example uses QuickBASIC and the 82335B
HP-IB Interface Card and command library for IBM® PC compatibles.
CLS
LOCATE 1, 1
DIM cmd$(100), resp$(1000)
’ Set up serial port for 9600 baud, even parity, 7 bits;
’ Ignore Request to Send Carrier Detect; Send line feed;
’ enable parity check, reserve 1000 bytes for input buffer
’
OPEN "com1:9600,e,7,2,rs,cd,lf,pe" FOR RANDOM AS #1 LEN = 1000
’
’ Put the meter into remote operation mode
PRINT #1, "SYST:REM"
’
’ Query the meter’s id string
’ PRINT #1, "*IDN?"
LINE INPUT #1, resp$
PRINT "*IDN? returned: ", resp$
’
’ Get the SCPI revision number
PRINT #1, "SYST:VERS?"
LINE INPUT #1, resp$
PRINT "SYST:VERS returned: ", resp$
’
’ Send a message to the meter’s display
PRINT #1, "DISP:TEXT ’HP 34420A’ "
’
’ Configure the meter for dc voltage measurements, 10 V range,
’ 0.1 V resolution, take 4 readings
PRINT #1, "CONF:VOLT:DC 10, 0.1, ;:SAMP:COUN 4"
’ Trigger the readings and get the results
PRINT #1, "READ?"
LINE INPUT #1, resp$
PRINT "READ? returned: ", resp$
END
6
Chapter 6 Application Programs
RS-232 Operations with QuickBASIC
223
GPIB
Summary of Contents for 34420A
Page 1: ......
Page 2: ......
Page 13: ...1 Quick Start ...
Page 31: ...2 Front Panel Operation ...
Page 55: ...3 Features and Functions ...
Page 117: ...4 Remote Interface Reference ...
Page 200: ...5 Error Messages ...
Page 213: ...6 Application Programs ...
Page 245: ...6 Chapter 6 Application Programs Microsoft Excel Macro Example 245 ...
Page 246: ...Chapter 6 Application Programs Microsoft Excel Macro Example 246 ...
Page 247: ...7 Measurement Tutorial ...
Page 274: ...8 Specifications ...
Page 279: ...Dimensions Chapter 8 Specifications 34420A Nano Volt Micro Ohm Meter 280 ...
Page 294: ......