30 Chapter 2
Programming Examples
GPIB Programming Examples
GPIB Programming Examples
• “Interface Check using Agilent BASIC” on page 31
• “Interface Check Using NI-488.2 and C++” on page 32
• “Interface Check using VISA and C” on page 33
• “Local Lockout Using Agilent BASIC” on page 34
• “Local Lockout Using NI-488.2 and C++” on page 36
• “Queries Using Agilent BASIC” on page 37
• “Queries Using NI-488.2 and C++” on page 39
• “Queries Using VISA and C” on page 42
• “Generating a CW Signal Using VISA and C” on page 44
• “Generating an Externally Applied AC-Coupled FM Signal Using VISA and C” on page 46
• “Generating an Internal AC-Coupled FM Signal Using VISA and C” on page 49
• “Generating a Step-Swept Signal Using VISA and C” on page 51
• “Saving and Recalling States Using VISA and C” on page 52
• “Reading the Data Questionable Status Register Using VISA and C” on page 55
• “Reading the Service Request Interrupt (SRQ) Using VISA and C” on page 60
• “Using 8757D Pass-Thru Commands” on page 65
Before Using the Examples
If the Agilent GPIB interface card is used, then the Agilent VISA library should be installed along with
Agilent SICL. If the National Instruments PCI-GPIB interface card is used, the NI-VISA library along with
the NI-488.2 library should be installed. Refer to “2. Selecting IO Libraries for GPIB” on page 6 and the
documentation for your GPIB interface card for details.
NOTE Agilent BASIC addresses the signal generator at 719. The GPIB card is addressed at 7 and
the signal generator at 19. The GPIB address designator for other libraries is typically
GPIB0 or GPIB1.