Determining Instrument Communication
Use the * IDN? command to determine if the computer can communicate with the instrument. Send the
command using the Secondary GPIB address (i.e., Logical Address / 8) of the instrument. The following
IBASIC sends to command to an instrument at Logical Address 24 (Secondary GPIB address of 03)::
DIM A$[128] ! Dim variable for returned data
OUTPUT 80903;"* IDN?" ! Send *IDN? command to instrument at Logical Address 24
ENTER 80903;A$ ! Enter returned data
PRINT A$ ! Print returned data
Program Message Terminator
All command sequences must end with a proper program message terminator. This could be a Line Feed
(LF), a Line Feed with an EOI statement, or an EOI statement. Programs like BASIC/IBASIC, or the
functions/subroutines of the GPIB Command Library automatically provides a Line Feed at the end of an
OUTPUT or IOOUTPUTS statement, respectively. For the functions/subroutines of the Agilent Standard
Instrument Control Library (SICL), the program must supply the terminator.
Step 2: Reset Each Instrument at the Start of the Program
After a power-on occurs (i.e., mainframe is turned on), each instrument in the mainframe is fully reset.
Since after using an instrument, it may be in a different state than when first turned on. The only way to
reset to its power-on condition, is to go through the following three stages of reset.
1. Issue an IEEE 488 Interface Clear command. This command opens any handshaking between the
computer and all instruments on the bus selected by the GPIB Select Code. The following lists the
Interface Clear command for several languages:
a.
ABORT < select code> - BASIC/IBASIC
b.
IOABORT (< select code> ) - QuickBASIC using the GPIB Command Library
c.
IOABORT (< select code> ) - C/C+ + using the GPIB Command Library
2. Issue an IEEE 488 (or GPIB) Selected Device Clear. This command terminates instrument activity
and clears input/output buffers to prepare to receive ASCI commands The following lists the
Interface Clear command for several languages:
a.
CLEAR < GPIB address> - BASIC/IBASIC
b.
IOCLEAR(< device_address> ) - C using the GPIB Command Library
c.
iclear(< device_session_id> ) - using the Standard Instrument Control Library (SICL)
3. Reset all features of each instrument and wait for its completion, shown as follows using an
IBASIC program:
OUTPUT 80900;"* RST;*CLS;* ESE 0;* SRE 0;*OPC?"
ENTER 80900;A
The * CLS;* ESE 0 ;* SRE 0 resets the instrument status system that is defined by IEEE 488.2.
Debugging VXI SCPI Programs C-3