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 236
Interface Check Using NI-488.2 and C++
This example uses the NI-488.2 library to verify that the GPIB connections and interface are
functional. Launch Microsoft Visual C++ 6.0, add the required files, and enter the following
code into your .cpp source file.
The following program example is available on the PSG Family Documentation CD-ROM as
niex1.cpp.
// ***************************************************************************************
//
// PROGRAM NAME: niex1.cpp
//
// PROGRAM DESCRIPTION: This program verifies that the GPIB connections and
// interface are functional.
//
// Connect a GPIB cable from the PC GPIB card to the signal generator
// Enter the following code into the source .cpp file and execute the program
//
// ***************************************************************************************
#include "stdafx.h"
#include <iostream>
#include "windows.h"
#include "Decl-32.h"
using namespace std;
int GPIB0= 0; // Board handle
Addr4882_t Address[31]; // Declares an array of type Addr4882_t
int main(void)
{
int sig; // Declares a device descriptor variable
sig = ibdev(0, 19, 0, 13, 1, 0); // Aquires a device descriptor
ibclr(sig); // Sends device clear message to signal generator
ibwrt(sig, "*RST", 4); // Places the signal generator into a defined state
// Print data to the output window
cout << "The signal generator should now be in REMOTE. The remote indicator"<<endl;
cout <<"annunciator R should appear on the signal generator display"<<endl;
return 0;
}