Technical data

78 Agilent Signal Generators Programming Guide
Programming Examples
GPIB Programming Interface Examples
GPIB Programming Interface Examples
“Interface Check using HP Basic and GPIB” on page 82
“Interface Check Using NI- 488.2 and C++” on page 83
Interface Check for GPIB Using VISA and C on page 84
“Local Lockout Using HP Basic and GPIB” on page 85
“Local Lockout Using NI- 488.2 and C++” on page 86
“Queries Using HP Basic and GPIB” on page 88
“Queries Using NI- 488.2 and Visual C++” on page 89
“Queries for GPIB Using VISA and C” on page 91
“Generating a CW Signal Using VISA and C” on page 93
“Generating an Externally Applied AC- Coupled FM Signal Using VISA and C” on page 95
Generating an Internal FM Signal Using VISA and C on page 97
“Generating a Step- Swept Signal Using VISA and C++” on page 99
“Generating a Swept Signal Using VISA and Visual C++” on page 100
“Saving and Recalling States Using VISA and C” on page 102
“Reading the Data Questionable Status Register Using VISA and C” on page 105
“Reading the Service Request Interrupt (SRQ) Using VISA and C” on page 109
“Using 8757D Pass- Thru Commands (PSG with Option 007 Only)” on page 113
Before Using the GPIB Examples
HP 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.
GPIB Function Statements (Command Messages)
Function statements are the basis for GPIB programming and instrument control. These function
statements, combined with SCPI, provide management and data communication for the GPIB interface
and the signal generator.
This section describes functions used by different IO libraries. For more information, refer to the
NI- 488.2 Function Reference Manual for Windows, Agilent Standard Instrument Control Library
reference manual, and Microsoft Visual C++ 6.0 documentation.
Abort Function
The HP Basic function ABORT and the other listed IO library functions terminate listener/talker
activity on the GPIB and prepare the signal generator to receive a new command from the computer.
Typically, this is an initialization command used to place the GPIB in a known starting condition.
Library Function Statement Initialization Command
HP Basic The ABORT function stops all GPIB activity. 10 ABORT 7
VISA Library In VISA, the viTerminate command requests a VISA session
to terminate normal execution of an asynchronous operation.
The parameter list describes the session and job id.
viTerminate (parameter list)
NI- 488.2 The NI- 488.2 library function aborts any asynchronous read,
write, or command operation that is in progress. The
parameter ud is the interface or device descriptor.
ibstop(int ud)