72 Keysight CXG, EXG, and MXG X-Series Signal Generators Programming Guide
Programming Examples
GPIB Programming Interface Examples
Enter Function
The HP Basic function ENTER reads formatted data from the signal generator.
Other IO libraries use similar functions to read data from the signal generator.
Interface Check using HP Basic and GPIB
This simple program causes the signal generator to perform an instrument
reset. The SCPI command *RST places the signal generator into a pre-defined
state and the remote annunciator (R) appears on the front panel display.
The following program example is available on the signal generator
Documentation CD-ROM as basicex1.txt.
10
!******************************************************************
20 !
30 ! PROGRAM NAME: basicex1.txt
40 !
50 ! PROGRAM DESCRIPTION: This program verifies that the GPIB
connections and
60 ! interface are functional.
70 !
80 ! Connect a controller to the signal generator using a GPIB
cable.
90 !
Library Function Statement Initialization Command
HP Basic The function ENTER 719 puts the signal generator into
remote mode, makes it a talker, and assigns data or status
information to a designated variable.
10 ENTER 719;
VISA Library The VISA library uses the viScanf function and an associated
parameter list to receive data. This function receives data from
the instrument, formats it using the format string, and stores
the data in the argument list. The parameter list includes the
session id and string argument.
viScanf (parameter
list)
NI-488.2 The NI-488.2 library function addresses the GPIB, reads data
bytes from the signal generator, and stores the data into a
specified buffer. The parameter list includes the instrument
address and session id.
ibrd (parameter
list)
SICL The Keysight SICL function reads formatted data, converts it,
and stores the results into the argument list. The conversion is
done using conversion rules for the format string. The
parameter list includes the instrument address, formatted
data to read, and so forth.
iscanf (parameter
list)