Programming instructions
Table Of Contents
- Programming Guide
- Table of Contents
- 1 Getting Started
- 2 Programming Examples
- Using the Programming Examples
- GPIB Programming Examples
- Before Using the Examples
- Interface Check using Agilent BASIC
- Interface Check Using NI-488.2 and C++
- Interface Check using VISA and C
- Local Lockout Using Agilent BASIC
- Local Lockout Using NI-488.2 and C++
- Queries Using Agilent BASIC
- Queries Using NI-488.2 and C++
- Queries Using VISA and C
- Generating a CW Signal Using VISA and C
- Generating an Externally Applied AC-Coupled FM Signal Using VISA and C
- Generating an Internal AC-Coupled FM Signal Using VISA and C
- Generating a Step-Swept Signal Using VISA and C
- Saving and Recalling States Using VISA and C
- Reading the Data Questionable Status Register Using VISA and C
- Reading the Service Request Interrupt (SRQ) Using VISA and C
- LAN Programming Examples
- RS-232 Programming Examples
- 3 Programming the StatusRegisterSystem
- 4 Command Reference
- Command Reference Information
- SCPI Basics
- IEEE 488.2 Common Commands
- Calibration subsystem
- Communication Subsystem
- Diagnostic Subsystem
- Display Subsystem
- Memory Subsystem
- Mass Memory Subsystem
- Output Subsystem
- Status Subsystem
- :OPERation:CONDition
- :OPERation:ENABle
- :OPERation:NTRansition
- :OPERation:PTRansition
- :OPERation[:EVENt]
- :PRESet
- :QUEStionable:CALibration:CONDition
- :QUEStionable:CALibration:ENABle
- :QUEStionable:CALibration:NTRansition
- :QUEStionable:CALibration:PTRansition
- :QUEStionable:CALibration[:EVENt]
- :QUEStionable:CONDition
- :QUEStionable:ENABle
- :QUEStionable:FREQuency:CONDition
- :QUEStionable:FREQuency:ENABle
- :QUEStionable:FREQuency:NTRansition
- :QUEStionable:FREQuency:PTRansition
- :QUEStionable:FREQuency[:EVENt]
- :QUEStionable:MODulation:CONDition
- :QUEStionable:MODulation:ENABle
- :QUEStionable:MODulation:NTRansition
- :QUEStionable:MODulation:PTRansition
- :QUEStionable:MODulation[:EVENt]
- :QUEStionable:NTRansition
- :QUEStionable:POWer:CONDition
- :QUEStionable:POWer:ENABle
- :QUEStionable:POWer:NTRansition
- :QUEStionable:POWer:PTRansition
- :QUEStionable:POWer[:EVENt]
- :QUEStionable:PTRansition
- :QUEStionable[:EVENt]
- System Subsystem
- Trigger Subsystem
- Unit Subsystem (:UNIT)
- Amplitude Modulation Subsystem
- :AM[1]|2...
- :AM:INTernal:FREQuency:STEP[:INCRement]
- :AM:MODE
- :AM[1]|2:EXTernal[1]|2:COUPling
- :AM[1]|2:EXTernal[1]|2:IMPedance
- :AM[1]|2:INTernal[1]:FREQuency:ALTernate
- :AM[1]|2:INTernal[1]:FREQuency:ALTernate:AMPLitude:PERCent
- :AM[1]|2:INTernal[1]:SWEep:RATE
- :AM[1]|2:INTernal[1]:SWEep:TRIGger
- :AM[1]|2:INTernal[1]|2:FREQuency
- :AM[1]|2:INTernal[1]|2:FUNCtion:NOISe
- :AM[1]|2:INTernal[1]|2:FUNCtion:RAMP
- :AM[1]|2:INTernal[1]|2:FUNCtion:SHAPe
- :AM[1]|2:SOURce
- :AM[1]|2:STATe
- :AM[1]|2:TYPE
- :AM[1]|2[:DEPTh]:EXPonential
- :AM[1]|2[:DEPTh][:LINear]
- :AM[1]|2[:DEPTh][:LINear]:TRACk
- :AM[:DEPTh]:STEP[:INCRement]
- Correction Subsystem ([:SOURce]:CORRection)
- Frequency Subsystem ([:SOURce])
- Frequency Modulation Subsystem ([:SOURce])
- :FM[1]|2...
- :FM:INTernal:FREQuency:STEP
- :FM[1]|2:EXTernal[1]|2:COUPLing
- :FM[1]|2:EXTernal[1]|2:IMPedance
- :FM[1]|2:INTernal[1]:FREQuency:ALTernate
- :FM[1]|2:INTernal[1]:FREQuency:ALTernate:AMPLitude:PERCent
- :FM[1]|2:INTernal[1]:SWEep:RATE
- :FM[1]|2:INTernal[1]:SWEep:TRIGger
- :FM[1]|2:INTernal[1]|2:FREQuency
- :FM[1]|2:INTernal[1]|2:FUNCtion:NOISe
- :FM[1]|2:INTernal[1]|2:FUNCtion:RAMP
- :FM[1]|2:INTernal[1]|2:FUNCtion:SHAPe
- :FM[1]|2:SOURce
- :FM[1]|2:STATe
- :FM[1]|2[:DEViation]
- :FM[1]|2[:DEViation]:TRACk
- List/Sweep subsystem ([:SOURce])
- Low Frequency Output Subsystem ([:SOURce]:LFOutput)
- :AMPLitude
- :FUNCtion[1]:FREQuency:ALTernate
- :FUNCtion[1]:FREQuency:ALTernate:AMPLitude:PERCent
- :FUNCtion[1]:SWEep:RATE
- :FUNCtion[1]:SWEep:TRIGger
- :FUNCtion[1]|2:FREQuency
- :FUNCtion[1]|2:SHAPe
- :FUNCtion:NOISe
- :FUNCtion[1]|2:SHAPe:RAMP
- :SOURce
- LF Out softkeys:LF Out Off On;low frequency output subsystem keys:LF Out Off On
- Phase Modulation subsystem
- :PM[1]|2...
- :PM:INTernal:FREQuency:STEP[:INCRement]
- :PM[1]|2:BANDwidth|BWIDth
- :PM[1]|2:EXTernal[1]|2:COUPling
- :PM[1]|2:EXTernal[1]|2:IMPedance
- :PM[1]|2:INTernal[1]:FREQuency:ALTernate
- :PM[1]|2:INTernal[1]:FREQuency:ALTernate:AMPLitude:PERCent
- :PM[1]|2:INTernal[1]:SWEep:RATE
- :PM[1]|2:INTernal[1]:SWEep:TRIGger
- :PM[1]|2:INTernal[1]|2:FREQuency
- :PM[1]|2:INTernal[1]|2:FUNCtion:NOISe
- :PM[1]|2:INTernal[1]|2:FUNCtion:RAMP
- :PM[1]|2:INTernal[1]|2:FUNCtion:SHAPe
- :PM[1]|2:SOURce
- :PM[1]|2:STATe
- :PM[1]|2[:DEViation]
- :PM[1]|2[:DEViation]:TRACk
- :PM[:DEViation]:STEP[:INCRement]
- Power Subsystem ([:SOURce])
- :POWer:ALC:BANDwidth|BWIDth
- :POWer:ALC:BANDwidth|BWIDth:AUTO
- :POWer:ALC:LEVel
- :POWer:ALC:SEARch
- :POWer:ALC:SOURce
- :POWer:ALC:SOURce:EXTernal:COUPling
- :POWer:ALC[:STATe]
- :POWer:ATTenuation
- :POWer:ATTenuation:AUTO
- :POWer:MODE
- :POWer:REFerence
- :POWer:REFerence:STATe
- :POWer:STARt
- :POWer:STOP
- :POWer[:LEVel][:IMMediate]:OFFSet
- :POWer[:LEVel][:IMMediate][:AMPLitude]
- Pulse Modulation Subsystem ([:SOURce])
- SCPI Command Compatibility
- Index

Programming Examples
GPIB Programming Examples
Chapter 2 41
Queries Using Agilent BASIC
This example demonstrates signal generator query commands. The signal generator can be
queried for conditions and setup parameters. Query commands are identified by the question
mark as in the identify command *IDN?
The following program example is available on the PSG Family Documentation CD-ROM as
basicex3.txt.
10 !********************************************************************************
20 !
30 ! PROGRAM NAME: basicex3.txt
40 !
50 ! PROGRAM DESCRIPTION: In this example, query commands are used with response
60 ! data formats.
70 !
80 ! CLEAR and RESET the controller and RUN the following program:
90 !
100 !********************************************************************************
110 !
120 DIM A$[10],C$[100],D$[10] ! Declares variables to hold string response data
130 INTEGER B ! Declares variable to hold integer response data
140 Sig_gen=719 ! Declares variable to hold signal generator address
150 LOCAL Sig_gen ! Puts signal generator in Local mode
160 CLEAR Sig_gen ! Resets parser and clears any pending output
170 CLEAR SCREEN ! Clears the controller’s display
180 OUTPUT Sig_gen;"*RST" ! Puts signal generator into a defined state
190 OUTPUT Sig_gen;"FREQ:CW?" ! Querys the signal generator CW frequency setting
200 ENTER Sig_gen;F ! Enter the CW frequency setting
210 ! Print frequency setting to the controller display
220 PRINT "Present source CW frequency is: ";F/1.E+6;"MHz"
230 PRINT
240 OUTPUT Sig_gen;"POW:AMPL?" ! Querys the signal generator power level
250 ENTER Sig_gen;W ! Enter the power level
260 ! Print power level to the controller display
270 PRINT "Current power setting is: ";W;"dBM"
280 PRINT
290 OUTPUT Sig_gen;"FREQ:MODE?" ! Querys the signal generator for frequency mode
300 ENTER Sig_gen;A$ ! Enter in the mode: CW, Fixed or List
310 ! Print frequency mode to the controller display
320 PRINT "Source's frequency mode is: ";A$
330 PRINT
340 OUTPUT Sig_gen;"OUTP OFF" ! Turns signal generator RF state off
350 OUTPUT Sig_gen;"OUTP?" ! Querys the operating state of the signal generator
360 ENTER Sig_gen;B ! Enter in the state (0 for off)
370 ! Print the on/off state of the signal generator to the controller display
380 IF B>0 THEN
390 PRINT "Signal Generator output is: on"
400 ELSE
410 PRINT "Signal Generator output is: off"