82 Keysight CXG, EXG, and MXG X-Series Signal Generators Programming Guide
Programming Examples
GPIB Programming Interface Examples
410 PRINT "Signal Generator output is: off"
420 END IF
430 OUTPUT Sig_gen;"*IDN?" ! Querys for signal generator ID
440 ENTER Sig_gen;C$ ! Enter in the signal generator ID
450 ! Print the signal generator ID to the controller display
460 PRINT
470 PRINT "This signal generator is a ";C$
480 PRINT
490 ! The next command is a query for the signal generator's GPIB
address
500 OUTPUT Sig_gen;"SYST:COMM:GPIB:ADDR?"
510 ENTER Sig_gen;D$ ! Enter in the signal generator's
address
520 ! Print the signal generator's GPIB address to the controllers
display
530 PRINT "The GPIB address is ";D$
540 PRINT
550 ! Print user prompts to the controller's display
560 PRINT "The signal generator is now under local control"
570 PRINT "or Press RUN to start again."
580 END
Queries Using NI-488.2 and Visual C++
This example uses the NI-488.2 library to query different instrument states and
conditions. Launch Microsoft Visual C++ 6.0, add the required files, and enter
the following code into your .cpp source file.
niex3.cpp
performs the
following functions:
— resets the signal generator
— queries the signal generator for various settings
— reads the various settings
The following program example is available on the signal generator
Documentation CD-ROM as
niex3.cpp
.
//*****************************************************************
// PROGRAM NAME: niex3.cpp
//
// PROGRAM DESCRIPTION: This example demonstrates the use of query
commands.
Summary of Contents for X-Series
Page 4: ...4 ...
Page 10: ...10 Contents ...