Open Communication Path
Use the iopen subproutine to open the communication path between the instrument and Visual BASIC. The
command requires the complete GPIB address.
Sending SCPI Commands
The following shows how to send SCPI commands to an instrument using the iwrite subroutine from the
Agilent Standard Instrument Control Library (SICL).
Receiving Data
The following shows how to use the iread subroutine from the Agilent Standard Instrument Library to
receive string data from an instrument.
Open the I/O Session
Addr = iopen("hpib7,9,0")
Session Identifier
Opens I/O Session
I/O Address (e.g., GPIB Address)
I/O Interface (i.e., GPIB Card)
Sending SCPI Commands
Call iwrite(Addr, ByVal ā ABORtā + Chr$(10), 6, 1, Actual)
Sub Call
Session ID
Program Control
Returned Length of the Command
End Indicator
Length of SCPI Command
SCPI Command plus Line Feed
Receiving String Data
Call iread(Addr, ByVal RdMsg, Length, 0, Actual)
Sub Call
Session ID
Program Control
Get length of the Returned Data
Reason for Termination
Set length of the Returned Data
String Variable that Receives Data
Sending SCPI Commands 2-3