Page 1
E8663B/E8663D PSG RF Analog N5161A/62A/81A/82A MXG RF E8257D/67D PSG Microwave N5183A MXG Microwave Notice: This document contains references to Agilent. Please note that Agilent’s Test and Measurement business has become Keysight Technologies. For more information, go to www.keysight.com. Programming Guide...
Page 2
OF THIS DOCUMENT OR ANY INFORMA- CAUTION notice until the indicated TION CONTAINED HEREIN. SHOULD conditions are fully understood and KEYSIGHT AND THE USER HAVE A SEP- met. ARATE WRITTEN AGREEMENT WITH WARRANTY TERMS COVERING THE MATERIAL IN THIS DOCUMENT THAT...
Page 5
Status Groups ............... . 179 Keysight Signal Generators Programming Guide...
Page 6
Code Algorithm ..............243 Keysight Signal Generators Programming Guide...
Page 7
Configuring the Pulse/RF Blank (Keysight MXG) ........
Page 8
User FIR Filter Coefficient File Download Problems ........383 viii Keysight Signal Generators Programming Guide...
Page 9
Getting Started with Remote Operation CAUTION Keysight does not recommend going backwards in firmware versions (loading older firmware versions into newer instruments) as hardware/firmware conflicts can result. NOTE For the N5161A/62A, the softkey menus and features mentioned in this chapter are only available through the Web- Enabled MXG or through SCPI commands.
Getting Started with Remote Operation Programming and Software/Hard ware Layers Programming and Software/Hardware Layers Keysight MXG, ESG, PSG signal generators support the following interfaces: Instrument Interfaces Supported Keysight MXG GPIB, LAN, and USB 2.0 GPIB, LAN, and ANSI/EIA232 (RS- 232) serial connection...
100 meters (100Base- T and 10Base- T). The Keysight MXG is capable of 100Base- T LAN communication. The ESG, PSG and E8663B are designed to connect with a 10Base- T LAN. Where auto- negotiation is present, the ESG and PSG’s can connect to a 100Base- T LAN, but communicate at...
Before you can communicate and control the signal generator, you must have an IO library installed on your computer. The Keysight IO libraries are included on an Automation- Ready CD with your signal generator and Keysight GPIB interface board,...
Libraries Suite does not support Windows NT. If you are using the Windows NT platform, you must use Keysight IO Libraries version M or earlier. Windows 98 and Windows ME are not supported in the Keysight IO Libraries Suite version 14.1 and higher.
1. Run the VISA Assistant program: Start > All Programs > Keysight IO Libraries Suite > Keysight Connection Expert > Tools > Visa Assistant >. 2. Click on the interface you want to use for sending commands to the signal generator.
Page 15
IO Libraries and Programming Languages Using VISA Configuration (Manual) Use the Keysight IO Libraries Suite 15.0, to perform the following steps to use the Connection Expert and VISA to manually configure an interface. 1. Run the Keysight Connection Expert program: Start > All Programs > Keysight IO Libraries Suite >...
You can use the VISA Assistant, available with the Keysight IO Libraries versions M and earlier, to send commands to the signal generator. If the interface you want to use does not appear in the VISA Assistant then you must manually configure the interface.
Page 17
6. Click the Edit VISA Config... button. 7. Click the Add device button. 8. Enter the GPIB address of the signal generator. 9. Click the OK button in this form and all other forms to exit the IO Config program. Keysight Signal Generators Programming Guide...
LAN interface. The Keysight IO libraries Suite is available on the Automation- Ready CD, which was shipped with your signal generator. The libraries can also be downloaded from the Keysight website. The following is a discussion on these libraries.
The MXG ATE hostname is not changed by pressing the LAN Reset key. For information on using the MXG's USB port to query its IP address, refer to the Keysight Connectivity Guide (E2094- 90009) or to the LAN Connectivity FAQs for details on using the instrument over LAN.
Page 20
SCPI commands. The web page also has links to Keysight’s products, support, manuals, and website. For additional information on memory catalog access (file storing), and FTP, refer to the User’s Guide and “Waveform...
IP address and other parameters. 2. Enter the new settings and click Save. 3. Click Renew LAN Settings to cause the new settings to take effect. Figure 1-2 View & Modify Configuration Keysight Signal Generators Programming Guide...
Javascript or Active Scripts must be enabled to use the web front panel controls. 1. Turn on the Web server as shown below. Keysight MXG Web Server On If necessary, toggle Web Server to For details on each key, use the key help.
Page 23
In some cases the Web- Enabled front panel may appear behind the main browser window, so you must move the browser window to see the Web- Enabled front panel. To control the signal generator, either click the front panel keys or enter SCPI commands. Keysight Signal Generators Programming Guide...
Page 24
The FTP access softkey opens to show the folders containing the signal generator’s memory catalog files. Use the FTP window to drag and drop files from the FTP page to your computer. Keysight Signal Generators Programming Guide...
Page 25
The instrument’s LAN configuration system information can be found on the signal generator’s homepage and on the signal generator. Refer to “Enabling the Signal Generator Web Server” on page 14 and to “Displaying the LAN Configuration Summary (Keysight MXG)” on page 18.
Page 26
The Domain Name defaults to a null field. This information is part of the “Advanced Information about this Web-Enabled <signal generator model number>” Displaying the LAN Configuration Summary (Keysight MXG) Confirm Restore Settings to Factory Defaults: Confirming this action configures the signal generator to its original factory default settings.
“Configuring the Display for Remote Command Setups (MXG)” on page 20 “Configuring the Display for Remote Command Setups (ESG/PSG)” on page 20 “Getting Help (Keysight MXG)” on page 21 “Setting the Help Mode (ESG/PSG)” on page 21 “Setting the Help Mode (ESG/PSG)” on page 21...
In general, the softkeys are not updated until the SCPI command SYST:DISP:GTL is sent. For details on each key, use the Key and Data Field Reference. For additional SCPI command information, refer to the SCPI Command Reference. Keysight Signal Generators Programming Guide...
Cont: Help displays for each key you press and that key’s function activates. To turn off the function, press Help. For additional SCPI command information, refer to the SCPI Command Reference. For details on each key, use the Key and Data Field Reference. Keysight Signal Generators Programming Guide...
• If the diagnostic mode fails to function, refer to the Service Guide. NOTE If the LAN Reset hardkey has been pressed and then the power is cycled on the instrument, the web- server will be enabled after reboot. Keysight Signal Generators Programming Guide...
+0, "No error" On the Keysight MXG, using this SCPI command to read out the error messages clears the display of the ERR annunciator and the error message at the bottom of the screen.
• an unrecognized header was received. These include incorrect device- specific headers and incorrect or unimplemented IEEE 488.2 common commands. Keysight Signal Generators Programming Guide...
Installing the GPIB Interface NOTE You can also connect GPIB instruments to a PC USB port using the Keysight 82357A USB/GPIB Interface Converter, which eliminates the need for a GPIB card. For more information, refer to the table on page 26 or go to http://www.keysight.com/find/gpib.
Page 34
Using IO Interfaces Using GPIB Keysight GPIB interface card and the National Instruments (NI) PCI–GPIB card. Follow the interface card instructions for installing and configuring the card. The following table provide lists on some of the available interface cards. Also, see the Keysight website, http://www.keysight.com for details on GPIB interface cards.
HP BASIC, HP–UX Set Up the GPIB Interface For the Keysight MXG refer to the Figure 2-1 and for the ESG and PSG, Figure 2-2 on page 28. Figure 2-1 Setting the GPIB Address on the Keysight MXG SCPI commands: :SYSTem:COMMunicate:GPIB:ADDRess <number>...
8 meters Verify GPIB Functionality To verify GPIB functionality, use the VISA Assistant, available with the Keysight IO Library or the Getting Started Wizard available with the National Instrument IO Library. These utility programs enable you to communicate with the signal generator and verify its operation over GPIB. For information and instructions on running these programs, refer to the Help menu available in each utility.
• “Interface Check Using NI–488.2 and C++” on page 30 Before Using the GPIB Examples If the Keysight GPIB interface card is used, the Keysight VISA library should be installed along with Keysight SICL. If the National Instruments PCI–GPIB interface card is used, the NI–VISA library along with the NI–488.2 library should be installed.
// 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 Keysight Signal Generators Programming Guide...
Using LAN Using LAN The Keysight MXG is capable of 100Base–T LAN communication. The ESG, PSG, and E8663B are designed to connect with a 10Base–T LAN. Where auto–negotiation is present, the ESG, PSG, and E8663B can connect to a 100Base–T LAN, but communicate at 10Base–T speeds. For more information refer to http://www.ieee.org.
NOTE Verify that the signal generator is connected to the LAN using a 100Base–T LAN or 10Base–T LAN cable. Configuring the VXI–11 for LAN (Keysight MXG) Utility > IO Config NOTE To communicate with the signal generator over the LAN, you must enable the VXI–11 SCPI service. Select VXI–11 until On is highlighted.
Page 41
To remotely access the signal generator from a different LAN subnet, you must also enter the subnet mask and default gateway. See your system administrator for more information. For more information on the manual configuration, refer to “Manually Configuring the Keysight MXG LAN” on page 34 or to “Manually Configuring the ESG/PSG LAN” on page 34.
Page 42
Using IO Interfaces Using LAN Manually Configuring the Keysight MXG LAN Utility > IO Config Your hostname can be up to 20 characters long. SCPI commands: :SYSTem:COMMunicate:LAN:CONFig MANual :SYSTem:COMMunicate:LAN:CONFig? For details on each key, use the key help (described in User’s Guide). For additional SCPI command information, refer to the SCPI Command Reference.
Page 43
IP address. Otherwise, the hostname is not usable. For more information on the DHCP configuration, refer to “Configuring the DHCP LAN (Keysight MXG)” on page 36 or “Configuring the DHCP LAN (ESG/PSG)” on page 36.
Page 44
Using IO Interfaces Using LAN Configuring the DHCP LAN (Keysight MXG) AUTO (DHCP/Auto–IP): Request a new IP address in the following sequence: 1) from the DHCP (server–based LAN), 2) Auto–IP (private network without a network administrator) or if neither is available, 3) Manual setting is selected.
Setting up Private LAN You can connect the Keysight MXG, ESG, or PSG directly to a PC using a crossover cable. To do this, you should either choose to set IP addresses of the PC and signal generator to differ only in the last digit (example: PC’s IP: 1.1.1.1 and Signal generator’s IP: 1.1.1.2);...
Page 46
If you are experiencing problems with the LAN connection on the signal generator, verify the rear panel LAN connector green LED is on. For additional information on troubleshooting your LAN connection, refer to the Help in the Keysight IO Libraries and documentation for LAN connections and problems.
Page 47
The Keysight IO Libraries Suite is supported on all platforms except Windows NT. If you are using Windows NT, refer to the section below on using the VISA Assistant to verify LAN communication. See the section on “Windows NT and Keysight IO Libraries M (and Earlier)” on page 8 for more information. NOTE The following sections are specific to Keysight IO Libraries versions M and earlier and apply only to the Windows NT platform.
Page 48
Using LAN Using VISA Assistant Use the VISA Assistant, available with the Keysight IO Library versions M and earlier, to communicate with the signal generator over the LAN interface. However, you must manually configure the VISA LAN client. Refer to the Help menu for instructions on configuring and running the VISA Assistant program.
Page 49
“Using VISA Assistant” on page 40. 3. Click the Edit button. 4. Click the radio button for AUTO (automatically detect protocol). 5. Click OK, OK to end the IO Config program. Keysight Signal Generators Programming Guide...
(ONC/RPC) interfaces running over TCP/IP. It is intended to provide GPIB capabilities such as SRQ (Service Request), status byte reading, and DCAS (Device Clear State) over a LAN interface. This protocol is a good choice for migrating from GPIB to LAN as it has full Keysight VISA/SICL support. NOTE It is recommended that the VXI–11 protocol be used for instrument communication over the...
Using IO Interfaces Using LAN Figure 2-4 Show Devices Form (Keysight IO Library version J.01.0100) Using Sockets LAN NOTE Users with Windows XP operating systems and newer can use this section to better understand how to use the signal generator with port settings. For more information, refer to the help software of the IO libraries being used.
Telnet SCPI service at port 7777 and sockets SCPI service at port 7778. Ports 7777 and 7778 are disabled on the Keysight MXG. For the MXG, beginning with firmware versions A.01.51 and greater, the default telnet port is 5024.
Page 53
4. Click on the Connect menu then select Remote System. A connection form (Figure 2-5) is displayed. Figure 2-5 Connect Form (Keysight IO Library version J.01.0100) 5. Enter the hostname, port number, and TermType then click Connect. • Host Name−IP address or hostname •...
Page 54
5. At the SCPI> prompt, enter SCPI commands. Refer to commands shown in Figure 2-6 on page 46. 6. To escape from the SCPI> session type Ctrl-]. 7. Type quit at the prompt to end the Telnet session. Keysight Signal Generators Programming Guide...
Page 55
Enter key. To remedy this, change your Telnet connection to character–by–character mode. Escape out of Telnet, and at the telnet> prompt, type mode char. If this does not work, consult your Telnet program's documentation. Keysight Signal Generators Programming Guide...
FTP command, the signal generator’s file structure can be accessed. Figure 2-8 shows the FTP interface and lists the directories in the signal generator’s user level directory. NOTE File access is limited to the signal generator’s /user directory. Keysight Signal Generators Programming Guide...
Page 57
You are now in the signal generator’s user directory. Typing help at the command prompt will show you the FTP commands that are available on your system. 5. Type quit or bye to end your FTP session. 6. Type exit to end the command prompt session. Keysight Signal Generators Programming Guide...
2. Power on the MXA and MXG. 3. Send the following SCPI command to both the MXA and MXG: :LXI:CLOCk:PTP:DOMain 1 This parameter may be any integer between 0 to 127. The default value is 0. Keysight Signal Generators Programming Guide...
Page 59
MXA and MXG. This program is bundled with the Keysight IO Libraries Suite. 1. Open Interactive LXI. From a PC connected to the same subnet as the instrument go to: Start > All Programs > Keysight IO Libraries Suite > Utilities > Interactive LXI. 2. Open the Timing menu.
Page 60
• Press Utility > More > LXI–B > LXI–B Enabled To enable or disable the LXI event subsystem from SCPI: • :LXI:STATe ON|OFF NOTE The LXI Event subsystem state is a persistent instrument state; it is not affected by normal preset operations. Keysight Signal Generators Programming Guide...
Page 61
Peer to peer message transmission can be verified by running LXI Interactive from a PC on the same subnet as the MXA. From a PC connected to the same subnet as the instrument, go to Start > All Programs > Keysight IO Libraries Suite > Utilities > Interactive LXI.
Page 62
Peer to peer message transmission can be verified by running LXI Interactive from a PC on the same subnet as the MXG. 1. Open Interactive LXI. From a PC connected to the same subnet as the instrument, go to Start > All Programs > Keysight IO Libraries Suite > Utilities > Interactive LXI. 2. Choose LAN Event.
Page 63
Once that signal has settled, it prepares to move on to its list's next entry. The MXG's Waiting For Trigger instrument event transitions high, and a LAN0 output event goes onto the LAN with a rising edge. The MXG waits for its next trigger. Keysight Signal Generators Programming Guide...
Page 64
:LIST:TYPE:LIST:INIT:PRES 6. Sets the MXG to expect a list of frequencies: Send the following SCPI command: :FREQ:MODE LIST 7. Sets the MXG to expect a list of powers: Send the following SCPI command: :POW:MODE LIST Keysight Signal Generators Programming Guide...
Page 65
Send the following SCPI command: :LIST:TRIG:SOUR LAN 15. Enable the MXG's LXI LAN Event trigger: Send the following SCPI command: :TRIG:LXI:LAN:ENABled "LAN1",1 16. Enable the MXG's LXI Output LAN Event: Send the following SCPI command: :LXI:EVENt:OUTPut:LAN:ENABled "LAN0",1 Keysight Signal Generators Programming Guide...
Page 66
The MXA will put out signals at these frequencies and in this order. 24. Configure the MXA's list sweep parameters: Send the following SCPI commands: :LIST:ATT 10dB :LIST:BAND:RES:TYPE FLAT :LIST:BAND:RES 300kHz :LIST:BAND:VID 3MHz :LIST:SWE:TIME 1e-6 s :LIST:TRIG:DEL 0 :LIST:DET RMS Keysight Signal Generators Programming Guide...
Page 67
"LAN0" peer to peer message before moving on to the next measurement. 32. Enable the MXA's “LAN1” LXI Output LAN Event: Send the following SCPI commands: :LXI:EVENt:OUTPut:LAN:ENABled "LAN1",1 The "LAN1" peer to peer message is now enabled. Keysight Signal Generators Programming Guide...
Page 68
Using IO Interfaces Using LAN 33. Send the MXG a "LAN1" peer to peer message: Using Interactive LXI or the Keysight IO Libraries TMFramework LXI library: send a "LAN1" peer to peer message to the MXG. This will start the synchronization sequence.
Using IO Interfaces Using RS–232 (ESG and PSG Only) For More Information For more information on using LXI see the Keysight website dedicated to LXI instrumentation: www.keysight.com/find/lxi. Keysight LXI Application Notes: • Using LXI to go beyond GPIB, PXI and VXI (AN 1465–20) •...
NI–488.2 IO libraries can be used to develop applications for the RS–232 interface. See National Instrument’s website for information on NI–488.2. SICL Keysight SICL can be used to develop applications for the RS–232 interface. See Keysight’s website for information on SICL. Keysight Signal Generators Programming Guide...
UNIX workstation or adjust the baud rate settings on your computer to match the baud rate setting of the signal generator. The default baud rate for VISA is 9600. This baud rate can be changed with the “VI_ATTR_ASRL_BAUD” VISA attribute. Keysight Signal Generators Programming Guide...
Page 72
Keysight Part Number Serial RS–232 cable 9–pin (male) to 9–pin (female) 8120–6188 NOTE Any 9 pin (male) to 9 pin (female) straight–through cable that directly wires pins 2, 3, 5, 7, and 8 may be used. Keysight Signal Generators Programming Guide...
HyperTerminal window. The <Ctrl j> is the new line character (on the keyboard press the Cntrl key and the j key simultaneously). The signal generator should return a string similar to the following, depending on model: Keysight Technologies <instrument model name and number>, US40000001,C.02.00 Keysight Signal Generators Programming Guide...
Chapter 3, Programming Examples,, these portions of programming demonstrate the important features to consider when developing programming for use with the RS–232 interface. For RS–232 programming examples, refer to “RS-232 Programming Interface Examples NOTE (ESG/PSG Only)” on page 153. Keysight Signal Generators Programming Guide...
For the full text of this program, refer to “Queries for RS-232 Using VISA and C” on page 158 or to the signal generator’s documentation CD–ROM. status = viOpenDefaultRM(&defaultRM);// Initializes the system // Open communication with Serial Port 2 status = viOpen(defaultRM, "ASRL2::INSTR", VI_NULL, VI_NULL, &instr); Keysight Signal Generators Programming Guide...
The USB interface is available only on the Keysight MXG signal generator. The Keysight MXG’s USB 2.0 interface supports USBTMC or USBTMC–USB488 specifications. For more information on connecting instruments to the USB, refer to the Keysight Connection Expert in the Keysight IO Libraries Help.
Selecting I/O Libraries for USB CAUTION The Keysight MXG’s USB interface requires Keysight IO Libraries Suite 14.1 or newer to run properly. For more information on connecting instruments to the USB, refer to the Keysight Connection Expert in the Keysight IO Libraries Help.
Page 79
For information on verifying your Mini–B 5 pin USB (rear panel) functionality, refer to the Keysight Connection Expert in the Keysight IO Libraries Help. The Keysight IO libraries are included with your signal generator or Keysight GPIB interface board, or they can be downloaded from the Keysight website: http://www.keysight.com.
Page 80
Using IO Interfaces Using USB (Keysight MXG) Keysight Signal Generators Programming Guide...
NOTE The example programs set the signal generator into remote mode; front panel keys, except the Keysight MXG Local/Esc/Cancel or the ESG, and PSG Local key, are disabled. Press the Keysight Signal Generators Programming Guide...
Programming Examples Using the Programming Interface Examples Keysight MXG Local/Esc/Cancel or the ESG, PSG Local key to revert to manual operation. To have the signal generator’s front panel update with changes caused by remote operations, enable the signal generator’s Update in Remote function.
Page 83
Programming Examples Using the Programming Interface Examples MXG)” on page 36 and “Configuring the VXI–11 for LAN (ESG/PSG)” on page 33. Keysight Signal Generators Programming Guide...
To run the example program State_Files.cs on page 366, you must have the .NET framework installed on your computer. You must also have the Keysight IO Libraries installed on your computer. The .NET framework can be downloaded from the Microsoft website. For more information on running C# programs using .NET framework, see Chapter 6.
To communicate with the signal generator over the LAN interface you must enable the VXI- 11 SCPI service. For more information, refer to “Configuring the VXI–11 for LAN (Keysight MXG)” on page 32 and “Configuring the VXI–11 for LAN (ESG/PSG)” on page 33.
To communicate with the signal generator over the LAN interface you must enable the VXI- 11 SCPI service. For more information, refer to “Configuring the VXI–11 for LAN (Keysight MXG)” on page 32 and “Configuring the VXI–11 for LAN (ESG/PSG)” on page 33.
This section describes functions used by different IO libraries. For more information, refer to the NI- 488.2 Function Reference Manual for Windows, Keysight 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.
Page 88
The parameter list describes the interface or device descriptor. SICL The Keysight SICL function puts an instrument, identified by iremote (id) the id parameter, into remote mode and disables the front panel keys. Pressing the Local key on the signal generator front panel restores manual operation.
Page 89
The ud parameter in the parameter list is the interface or device descriptor. SICL The Keysight SICL function puts the signal generator into iloc(id) Local operation; enabling front panel key operation. The id parameter identifies the session.
Page 90
Device Clear (SDC) message to the device described by ud. SICL The Keysight SICL function clears a device or interface. The iclear (id) function also discards data in both the read and write formatted IO buffers. The id parameter identifies the session.
The parameter list includes the instrument address and session id. SICL The Keysight SICL function reads formatted data, converts iscanf (parameter list) it, and stores the results into the argument list. The conversion is done using conversion rules for the format string.
// 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= // Board handle Keysight Signal Generators Programming Guide...
// PROGRAM DESCRIPTION:This example program verifies that the GPIB connections and // and interface are functional. // Turn signal generator power off then on and then run the program //**************************************************************************************** #include <visa.h> #include <stdio.h> #include "StdAfx.h" #include <stdlib.h> void main () Keysight Signal Generators Programming Guide...
Local and Contrast keys. The LOCAL LOCKOUT command will disable the Local key. The LOCAL command, executed from the controller, is then the only way to return the signal generator to front panel, Keysight Signal Generators Programming Guide...
• prompts the user to verify the signal generator is in remote • places the signal generator into local The following program example is available on the signal generator Documentation CD- ROM as niex2.cpp. // ************************************************************************************ Keysight Signal Generators Programming Guide...
Page 96
"including the 'Local' key are disabled (Contrast keys are not affected)"<<endl; cout <<"Press Enter to continue"<<endl; cin.ignore(10000,'\n'); ibloc(sig); // Returns signal generator to local control cout<<endl; cout <<"The signal generator should now be in local mode\n"; return 0;} Keysight Signal Generators Programming Guide...
OUTPUT Sig_gen;"FREQ:MODE?" ! Querys the signal generator for frequency mode ENTER Sig_gen;A$ ! Enter in the mode: CW, Fixed or List ! Print frequency mode to the controller display PRINT "Source's frequency mode is: ";A$ PRINT Keysight Signal Generators Programming Guide...
// PROGRAM DESCRIPTION: This example demonstrates the use of query commands. // The signal generator can be queried for conditions and instrument states. // These commands are of the type "*IDN?" where the question mark indicates Keysight Signal Generators Programming Guide...
Page 99
// Enters in the source frequency mode rdVal[ibcntl] = '\0'; // Null character indicating end of array cout<<"Source frequency mode is "<<rdVal; // Print source frequency mode cout<<"Press any key to continue"<<endl; cin.ignore(10000,'\n'); ibwrt(sig, "OUTP OFF",12); // Turns off RF source Keysight Signal Generators Programming Guide...
// PROGRAM DESCRIPTION:This example demonstrates the use of query commands. The signal // generator can be queried for conditions and instrument states. These commands are of // the type "*IDN?"; the question mark indicates a query. Keysight Signal Generators Programming Guide...
Page 101
"%t", rdBuffer); // Reads the response into rdBuffer // Prints the source power level printf("Source power (dBm) is : %s\n", rdBuffer); printf("Press any key to continue\n"); printf("\n"); // Prints new line character to the display Keysight Signal Generators Programming Guide...
// The RF state of the signal generator is turn on and then the state is queried. The // response will indicate that the RF state is on. The RF state is then turned off and // queried. The response should indicate that the RF state is off. The query results are Keysight Signal Generators Programming Guide...
Page 103
"OUTP:STAT ON\n"); // Turn source RF state on viPrintf(vi, "OUTP?\n"); // Query the signal generator's RF state viScanf(vi, "%1i", &num); // Read the response (integer value) // Print the on/off RF state if (num > 0 ) { Keysight Signal Generators Programming Guide...
• sets carrier frequency to 700 MHz • sets the power level to - 2.5 dBm • turns on frequency modulation and RF output The following program example is available on the signal generator Documentation CD- ROM as visaex5.cpp. //**************************************************************************************** Keysight Signal Generators Programming Guide...
Page 105
"FM:EXT2:COUP AC\n"); // Sets FM path 2 coupling to AC viPrintf(vi, "FM:DEV 20 kHz\n"); // Sets FM path 2 deviation to 20 kHz viPrintf(vi, "FREQ 700 MHz\n"); // Sets carrier frequency to 700 MHz Keysight Signal Generators Programming Guide...
// PROGRAM DESCRIPION:This example generates an internal FM signal at a 900 // MHz carrier frequency and a power level of -15 dBm. The FM rate is 5 kHz and the peak // deviation 100 kHz //**************************************************************************************** #include <visa.h> #include "StdAfx.h" #include <iostream> #include <stdlib.h> Keysight Signal Generators Programming Guide...
Page 107
: -15 dBm\n"); printf("FM state : on\n"); printf("RF output : on\n"); printf("Carrier Frequency : 900 MHZ\n"); printf("Deviation : 100 kHZ\n"); printf("Internal modulation : 5 kHz\n"); printf("\n"); // Print a carrage return // Close the sessions viClose(vi); Keysight Signal Generators Programming Guide...
// for GPIB verifications viStatus=viOpenDefaultRM(&defaultRM); // Initialize VISA session // Open session to GPIB device at address 19 viStatus=viOpen(defaultRM, "GPIB::19::INSTR", VI_NULL, VI_NULL, &vi); if(viStatus){// If problems, then prompt user printf("Could not open ViSession!\n"); printf("Check instruments and connections\n"); Keysight Signal Generators Programming Guide...
• sleep function is used to allow the instrument to complete its sweep operation The following program example is available on the signal generator Documentation CD- ROM as visaex11.cpp. //************************************************************************ // PROGRAM FILE NAME: visaex11.cpp // PROGRAM DESCRIPTION: This program sets up the signal generator to Keysight Signal Generators Programming Guide...
Page 110
// set the start and stop frequency for the sweep stat = viPrintf(inst, "FREQ:START 1GHZ\n"); stat = viPrintf(inst, "FREQ:STOP 2GHZ\n"); // setup dwell per point stat = viPrintf(inst, "SWEEP:DWELL %e\n", dwell); // setup number of points Keysight Signal Generators Programming Guide...
Saving and Recalling States Using VISA and C In this example, instrument settings are saved in the signal generator’s save register. These settings can then be recalled separately; either from the keyboard or from the signal generator’s front panel. Keysight Signal Generators Programming Guide...
Page 112
ViStatus viStatus = 0;// Declares a variable of type ViStatus // for GPIB verifications long lngDone = 0; // Operation complete flag viStatus=viOpenDefaultRM(&defaultRM); // Initialize VISA session // Open session to gpib device at address 19 viStatus=viOpen(defaultRM, "GPIB::19::INSTR", VI_NULL, VI_NULL, &vi); Keysight Signal Generators Programming Guide...
Page 113
// Reset the operation complete flag viPrintf(vi, "*RCL 1\n"); // Recalls stored register #1 state viPrintf(vi, "*OPC?\n"); // Checks for operation complete while (!lngDone) viScanf (vi ,"%d",&lngDone); // Waits for setup to complete // Print user information Keysight Signal Generators Programming Guide...
// questionable status register read. The results are then displayed to the user. // The status questionable register is then setup to monitor a modulation error condition. // The signal generator is set up for a modulation error condition and the data Keysight Signal Generators Programming Guide...
Page 115
Set signal generator output amplitude to +20 dBm\n"); printf("* Set frequency to maximum value\n"); printf("* Turn On signal generator's RF Output\n"); printf("* Check signal generator's display for the UNLEVEL annunciator\n"); printf("\n"); printf("Press Enter when ready\n"); printf("\n"); Keysight Signal Generators Programming Guide...
Page 116
Check signal generator's display for the EXT1 LO annunciator\n"); printf("\n"); printf("Press Enter when ready\n"); printf("\n"); getch(); // Waits for keyboard user input viPrintf(vi, "STAT:QUES:MOD:ENAB 16\n"); // Enables the Data Questionable // Modulation Condition Register Keysight Signal Generators Programming Guide...
Page 117
Generator Modulation 2 Undermod\n"); printf("\n"); break; case 8: printf("Signal Generator Modulation 2 Overmod\n"); printf("\n"); break; case 16: printf("Signal Generator Modulation Uncalibrated\n"); printf("\n"); break; default: printf("No Problems with Modulation\n"); printf("\n"); // Close the sessions viClose(vi); viClose(defaultRM); Keysight Signal Generators Programming Guide...
// generator for a step mode sweep. The program will enter a printing loop which prints // an * character and ends when the sweep has completed and an SRQ received. //****************************************************************************** #include "visa.h" #include <stdio.h> #include "StdAfx.h" #include "windows.h" #include <conio.h> #define MAX_CNT 1024 Keysight Signal Generators Programming Guide...
Page 119
’*’ will be printed while the instrument is sweeping. The end of \n"); printf("sweep will be indicated by an SRQ on the GPIB and the program will end.\n"?; printf("\n"); printf("Press Enter to continue\n"); printf("\n"); getch(); Keysight Signal Generators Programming Guide...
Page 120
// operation for .5 seconds while (sweep==1){ printf("*"); Sleep(500);} printf("\n"); // The following lines of code will stop the // events and close down the session viStatus = viDisableEvent(vi, VI_ALL_ENABLED_EVENTS,VI_ALL_MECH); viStatus = viUninstallHandler(vi, VI_EVENT_SERVICE_REQ, interupt, rdBuffer); viStatus = viClose(vi); Keysight Signal Generators Programming Guide...
Page 121
= viReadSTB(vi, &stb);// Reads the Status Byte sweep=0;// Sets the flag to stop the ’*’ printing printf("\n");// Print user information printf("An SRQ, indicating end of sweep has occurred\n"); viClose(event);// Closes the event return VI_SUCCESS; Keysight Signal Generators Programming Guide...
To send pass- thru commands, set up the equipment as shown in Figure 3-1. Notice that the GPIB cable from the computer is connected to the GPIB interface bus of the 8757D. The GPIB cable from the PSG or E8257N is connected to the system interface bus of the 8757D. Figure 3-1 Keysight Signal Generators Programming Guide...
Page 123
GPIB bus. Example Pass-Thru Program Example 3-1 on page 115 is a sample Keysight BASIC program that switches the 8757D to pass- thru mode, allowing you to send operating commands to the PSG. After the program runs, control is given back to the network analyzer.
Page 124
2. Insert line 55, that sets the sweep- time of the source, :SWE:TIME <val>. 55 OUTPUT 717;”:SWE:TIME .200S” 3. Insert line 56, that saves the state into the register, sequence 0, register 1, *SAV <reg_num>[,<seq_num>], (*SAV 1,0). 56 OUTPUT 717;”*SAV 1,0” Keysight Signal Generators Programming Guide...
The signal generator supports the VXI- 11 standard for instrument communication over the LAN interface. Keysight IO Libraries support the VXI- 11 standard and must be installed on your computer before using the VXI- 11 protocol. Refer to “Using VXI–11” on page 42 for information on configuring and using the VXI- 11 protocol.
VXI-11 Programming Using SICL and C++ The following program uses the VXI- 11 protocol and SICL to control the signal generator. Before running this code, you must set up the interface using the Keysight IO Libraries IO Config utility. vxisicl.cpp performs the following functions: •...
The signal generator is set to a –5 dBm power level and queried for its ID string. Before running this code, you must set up the interface using the Keysight IO Libraries IO Config utility. vxivisa.cpp performs the following functions: •...
Page 128
Programming Examples LAN Programming Interface Examples // NOTE: You must have the Keysight Libraries installed on your computer to run // this program // PROGRAM DESCRIPTION:This example uses the VXI-11 protocol and VISA to query // the signal generator for its ID string. The ID string is then printed to the // screen.
TCP/IP network connection. Once this connection is created, the standard fread() and fwrite() routines are used for network communication. The following steps outline the process: 1. Copy the lanio.c and getopt.c files to your home UNIX directory. For example, /users/mydir/. Keysight Signal Generators Programming Guide...
Page 130
The program will run and output a sequence of SCPI commands to the signal generator. The UNIX display will show a display similar to the following: unix machine: /users/mydir $ ./lanio ID: Keysight Technologies, E4438C, US70000001, C.02.00 Frequency: +2.5000000000000E+09 Power Level: -5.00000000E+000 Sockets on Windows In Windows, the routines send() and recv() must be used, since fread() and fwrite() may not work on sockets.
Page 131
2. Rename the lanio.cpp int main1() function to int main() and the original int main() function to int main1(). 3. Select Rebuild All from Build menu. Then select Execute Lanio.exe. The program will run and display results similar to those shown in Figure 3-2. Figure 3-2 Program Output Screen Keysight Signal Generators Programming Guide...
$Revision: 1.1 $ $Date: 10/24/01 PROGRAM NAME: lanio.c $Description: Functions to talk to an Keysight signal generator via TCP/IP. Uses command-line arguments. A TCP/IP connection to port 5025 is established and the resultant file descriptor is used to "talk" to the instrument using regular socket I/O mechanisms.
Page 133
_HPUX_SOURCE define _HPUX_SOURCE endif #endif #include <stdio.h> /* for fprintf and NULL #include <string.h> /* for memcpy and memset */ #include <stdlib.h> /* for malloc(), atol() */ #include <errno.h> /* for strerror #ifdef WINSOCK Keysight Signal Generators Programming Guide...
Page 135
/* winsock.dll. fprintf(stderr, "Cannot initialize Winsock 1.1.\n"); return -1; return 0; int close_winsock(void) WSACleanup(); return 0; #endif /* WINSOCK */ /*************************************************************************** > $Function: openSocket$ * $Description: open a TCP/IP socket connection to the instrument $ Keysight Signal Generators Programming Guide...
Page 136
'%s'\n", hostname); return INVALID_SOCKET; /*******************/ /* create a socket */ /*******************/ s = socket(AF_INET, SOCK_STREAM, 0); if (s == INVALID_SOCKET) fprintf(stderr,"unable to create socket to '%s': %s\n", hostname, strerror(errno)); return INVALID_SOCKET; Keysight Signal Generators Programming Guide...
Page 137
0 if send fails $ ***************************************************************************/ int commandInstrument(SOCKET sock, const char *command) int count; /* fprintf(stderr, "Sending \"%s\".\n", command); if (strchr(command, '\n') == NULL) { fprintf(stderr, "Warning: missing newline on command %s.\n", command); count = send(sock, command, strlen(command), 0); Keysight Signal Generators Programming Guide...
Page 138
/* If no chars to read, stop. */ if (count < 1) { break; cur_length += count; /* If we hit a newline, stop. */ if (*ptr == '\n') { ptr++; err = 0; break; ptr++; *ptr = '\0'; if (err) { Keysight Signal Generators Programming Guide...
Page 139
(long) ..The number of bytes in result buffer. * $Errors: returns 0 if anything goes wrong. $ ***************************************************************************/ long queryInstrument(SOCKET sock, const char *command, char *result, size_t maxLength) Keysight Signal Generators Programming Guide...
Page 140
= tmp_buf[0]; if ((count < 1) || (ch == EOF)) break; /* End of file */ if (ch < '0' || ch > '9') break; /* unexpected char */ numDigits = ch - '0'; Keysight Signal Generators Programming Guide...
Page 141
/* indefinite block ... dump til we can an extra line feed */ if (recv_line(sock, result, maxLength) == NULL) break; if (strlen(result)==1 && *result == '\n') break; resultBytes += strlen(result); result += strlen(result); } while (1); Keysight Signal Generators Programming Guide...
Page 143
* This kind of command is not a query from our point of view. * The signal generator does the query internally, and uses the result. query++ ; /* bump past '?' */ while (*query) Keysight Signal Generators Programming Guide...
Page 144
*charBuf = (char *) malloc(INPUT_BUF_SIZE); char *basename; int chr; char command[1024]; char *destination; unsigned char quiet = 0; unsigned char show_errs = 0; int number = 0; basename = strrchr(argv[0], '/'); if (basename != NULL) basename++ ; else Keysight Signal Generators Programming Guide...
Page 145
/* <hostname> <command> provided; only one command string */ strcat(command, argv[optind++]); if (optind < argc) { strcat(command, " "); } else { strcat(command, "\n"); else /*Only <hostname> provided; input on <stdin> */ strcpy(command, ""); if (optind > argc) usage(basename); exit(1); else Keysight Signal Generators Programming Guide...
Page 146
/* if the command has a '?' in it, use queryInstrument. */ /* otherwise, simply send the command. /*******************************************************/ if ( isQuery(command) ) long bufBytes; bufBytes = queryInstrument(instSock, command, charBuf, INPUT_BUF_SIZE); if (!quiet) fwrite(charBuf, bufBytes, 1, stdout); fwrite("\n", 1, 1, stdout) ; fflush(stdout); else Keysight Signal Generators Programming Guide...
Page 147
/* Put the query response into the same buffer as the*/ /* command string appended after the null terminator.*/ bufBytes = queryInstrument(instSock, charBuf, charBuf + strlen(charBuf) + 1, INPUT_BUF_SIZE -strlen(charBuf) ); if (!quiet) fwrite(" ", 2, 1, stdout) ; Keysight Signal Generators Programming Guide...
Page 148
Send query results to stdout. $ /* $Return: (int) . . . non-zero if an error occurs /**************************************************************************/ /* Rename this int main1() function to int main(). Re-compile and the /* execute the program /**************************************************************************/ Keysight Signal Generators Programming Guide...
// The signal generator is set for 1 GHz and queried for its id string //************************************************************************** import java.io.*; import java.net.*; class ScpiSockTest public static void main(String[] args) String instrumentName = "xxxxx"; // Put instrument hostname here Keysight Signal Generators Programming Guide...
Page 153
System.out.println("Retrieving instrument ID..."); out.write("*idn?\n"); // Querys the id string out.flush(); String idnResponse = in.readLine(); // Reads the id string // Prints the id string System.out.println("Instrument ID: " + idnResponse); catch (IOException e) System.out.println("Error" + e); Keysight Signal Generators Programming Guide...
# Wait for completion print "Waiting for source to settle...\n"; print $sock "*opc?\n"; my $response = <$sock>; chomp $response; # Removes newline from response if ($response ne "1") die "Bad response to '*OPC?' from instrument!\n"; Keysight Signal Generators Programming Guide...
This example reads out the channel response from a PSA and calculates a correction equalization filter that can be loaded into the MXG. The following program example is available on the signal generator Documentation CD- ROM as loadPsaEQFilterFreq.m. function [corrFilter] = loadPsaEqFilter(psaDev, destRate) Keysight Signal Generators Programming Guide...
Page 156
= linmag.*cos(phaseRad)+j*linmag.*sin(phaseRad); rate = oversample*round(freqStep*length(coeffs)); % frequency range is also rate % we now have a centered frequency domain version of the channel response % invert so that we will cancel the channel response Keysight Signal Generators Programming Guide...
Page 157
% the peak point is assumed to be the center [maxval, index] = max(abs(resampledTime)); center=index; left = center-127; right = left+255; clippedTime=resampledTime((left):(right)); else clippedTime = resampledTime; corrFilter=clippedTime; function array = readArrayOfDoubles(fid) line = fgets(fid); array = sscanf(line, '%g%*c'); Keysight Signal Generators Programming Guide...
Page 158
% convert to time domain (first placing the 0 frequency at the left edge) timeDomain=ifft(ifftshift(invertedFreqDomain)); if (filterStruct.XDomain==1) % frequency % put time domain 0 time in center len=length(timeDomain); if (mod(length(timeDomain), 2)==1) % odd center=ceil(len/2); centeredTime(1:(center-1)) = timeDomain(center+1:end); Keysight Signal Generators Programming Guide...
Page 159
1 if it is missing. rate is assumed % to be 125Mhz if missing. destRate is assumed to be 125Mhz if missing. % maxTaps is the hardware limit of the MXG (256 if not specified). Keysight Signal Generators Programming Guide...
Page 160
(left<1) left=1; right = left+(maxTaps-1); while (right > length(timeDomainFilter)) right = right-1; timeDomainFilter = timeDomainFilter((left):(right)); rateAdjustedFilter = timeDomainFilter; % open tcp connection t=tcpip(host, 5025); t.OutputBufferSize=1024*1024; % plenty big for filters % write file contents Keysight Signal Generators Programming Guide...
The serial interface address for the signal generator in this example is 9. The serial port used is COM1 (Serial A on some computers). Refer to “Using RS–232 (ESG and PSG Only)” on page 61 for more information. Keysight Signal Generators Programming Guide...
• prompts the user to set the power on the signal generator to 0 dBm • error checking • resets the signal generator to power level of –135 dBm The following program example is available on the signal generator Documentation CD- ROM as rs232ex1.cpp. Keysight Signal Generators Programming Guide...
Page 163
// for instrument communication on COM 2 port ViStatus viStatus = 0; // Opens session to RS-232 device at serial port 2 viStatus=viOpenDefaultRM(&defaultRM); viStatus=viOpen(defaultRM, "ASRL2::INSTR", VI_NULL, VI_NULL, &vi); if(viStatus){// If operation fails, prompt user printf("Could not open ViSession!\n"); Keysight Signal Generators Programming Guide...
!******************************************************************************** PROGRAM NAME: rs232ex2.txt PROGRAM DESCRIPTION: In this example, query commands are used to read data from the signal generator. Start HP Basic, type in the following code and then RUN the program. !******************************************************************************** Keysight Signal Generators Programming Guide...
Page 165
OUTPUT 9;"POW:AMPL -5 dbm" ! Sets the the power level to -5 dbm OUTPUT 9;"POW?" ! Querys the power level of the sig gen ENTER 9;Str1$ ! Reads the queried value PRINT "Power = ",Str1$ ! Prints the power level to the screen ! End the program Keysight Signal Generators Programming Guide...
// IMPORTANT: Set the signal generator BAUD rate to 9600 for this test //************************************************************************************ #include <visa.h> #include <stdio.h> #include "StdAfx.h" #include <stdlib.h> #include <conio.h> #define MAX_COUNT 200 int main (void) ViStatusstatus; // Declares a type ViStatus variable Keysight Signal Generators Programming Guide...
Page 167
'\0';// Indicates the end of the string printf("Power level = ");// Prints header to the screen printf(buffer);// Prints the queried power level printf("\n"); status = viClose(instr);// Close down the system status = viClose(defaultRM); return 0; Keysight Signal Generators Programming Guide...
Operation Status Group’s condition register. • You can use the service request (SRQ) interrupt technique to avoid status polling, therefore giving a speed advantage. The signal generator’s instrument status system provides complete SCPI compliant data structures for Keysight Signal Generators Programming Guide...
Page 170
The status register systems use IEEE 488.2 commands (those beginning with *) to access the higher- level summary registers (refer to the SCPI Command Reference). Access Lower- level registers by using STATus commands. Keysight Signal Generators Programming Guide...
• “E4428C/38C: Overall Status Byte Register System (2 of 2)” on page 167 • “E8257N/57D/67D and E8663B/63D: Overall Status Byte Register System (1 of 2)” on page 168 • “E8257N/57D/67D and E8663B/63D: Overall Status Byte Register System (2 of 2)” on page 169 Keysight Signal Generators Programming Guide...
Page 172
Programming the Status Register System Overview Figure 4-1 N5161A/62A/81A/82A/83A: Overall Status Byte Register System (1 of 2) Keysight Signal Generators Programming Guide...
Page 173
Programming the Status Register System Overview Figure 4-2 N5161A/62A/81A/82A/83A: Overall Status Byte Register System (2 of 2) Keysight Signal Generators Programming Guide...
Page 174
Programming the Status Register System Overview Figure 4-3 E4428C/38C: Overall Status Byte Register System (1 of 2) Keysight Signal Generators Programming Guide...
Page 175
Programming the Status Register System Overview Figure 4-4 E4428C/38C: Overall Status Byte Register System (2 of 2) Keysight Signal Generators Programming Guide...
Page 176
Programming the Status Register System Overview Figure 4-5 E8257N/57D/67D and E8663B/63D: Overall Status Byte Register System (1 of 2) Keysight Signal Generators Programming Guide...
Page 177
Programming the Status Register System Overview Figure 4-6 E8257N/57D/67D and E8663B/63D: Overall Status Byte Register System (2 of 2) Keysight Signal Generators Programming Guide...
140. The value represents the decimal values of bit 7, bit 3 and bit 2: 128 + 8 + 4 = 140. Table 4-1 Status Register Bit Decimal Values Decimal Value Bit Number NOTE Bit 15 is not used and is always set to zero. Keysight Signal Generators Programming Guide...
In the polling method, the signal generator has a passive role. It tells the controller that conditions have changed only when the controller asks the right question. This is accomplished by a program loop that continually sends a query. Keysight Signal Generators Programming Guide...
Page 180
For example, to enable bit 7 on the Status Byte Register (so that whenever the Standard Operation Status register summary bit is set to 1, a service request is generated) send the command *SRE 128. Keysight Signal Generators Programming Guide...
You can set and query individual status registers using the commands in the STATus subsystem. *CLS (clear status) clears the Status Byte Register by emptying the error queue and clearing all the event registers. Keysight Signal Generators Programming Guide...
Page 182
Register. *STB? (status byte) queries the value of the status byte register without erasing its contents. :STATus:PRESet presets all transition filters, non- IEEE 488.2 enable registers, and error/event queue enable registers. (Refer to Table 4-2.) Keysight Signal Generators Programming Guide...
Page 183
Table 4-4 on page 178 signal generator, refer to through through Table 4-18 on page 210 Table 4-3 Effects of :STATus:PRESet Register Value after :STATus:PRESet :STATus:OPERation:ENABle :STATus:OPERation:NTRansition :STATus:OPERation:PTRransition 32767 :STATus:QUEStionable:CALibration:ENABle 32767 :STATus:QUEStionable:CALibration:NTRansition 32767 :STATus:QUEStionable:CALibration:PTRansition 32767 :STATus:QUEStionable:ENABle Keysight Signal Generators Programming Guide...
Page 184
Programming the Status Register System Accessing Status Register Information Table 4-3 Effects of :STATus:PRESet Register Value after :STATus:PRESet :STATus:QUEStionable:NTRansition :STATus:QUEStionable:PTRansition 32767 :STATus:QUEStionable:FREQuency:ENABle 32767 :STATus:QUEStionable:FREQuency:NTRansition 32767 :STATus:QUEStionable:FREQuency:PTRansition 32767 :STATus:QUEStionable:MODulation:ENABle 32767 :STATus:QUEStionable:MODulation:NTRansition 32767 :STATus:QUEStionable:MODulation:PTRansition 32767 :STATus:QUEStionable:POWer:ENABle 32767 :STATus:QUEStionable:POWer:NTRansition 32767 :STATus:QUEStionable:POWer:PTRansition 32767 Keysight Signal Generators Programming Guide...
The Status Byte Group includes the Status Byte Register and the Service Request Enable Register. This is the named status register for the E4438C. However, not all signal generator models use all of the shown events (i.e. some use only a subset of the E4438C’s status registers). Keysight Signal Generators Programming Guide...
To enable bits 7 and 5 to trigger a service request when either corresponding status group register summary bit sets to 1, send the command *SRE 160 (128 + 32). Query: *SRE? Response: The decimal value of the sum of the bits previously enabled with the *SRE <data> command. Keysight Signal Generators Programming Guide...
The contents of the event register are logically ANDed with the contents of the enable register and the result is logically ORed to produce a status summary bit in the Status Byte Register. Keysight Signal Generators Programming Guide...
The Standard Event Status Group is used to determine the specific event that set bit 5 in the Status Byte Register. This group consists of the Standard Event Status Register (an event register) and the Standard Event Status Enable Register. Keysight Signal Generators Programming Guide...
Page 189
Programming the Status Register System Status Groups This is the named status register for the E4438C. However, not all signal generator models use all of the shown events (i.e. some use only a subset of the E4438C’s status registers). Keysight Signal Generators Programming Guide...
Page 190
Status summary bit of the Status Byte Register is set to 1. Send the command *ESE 192 (128 + 64). Query: *ESE? Response: Decimal value of the sum of the bits previously enabled with the *ESE <data> command. Keysight Signal Generators Programming Guide...
E8663D, E8663D, and the N5161A/62A/81A/82A/83A, and returns zero when queried. See Table 4-6 on page 184 for more information. The Keysight MXG SCPI command :STAT:OPER:SUPP, can suppress the managing of this status group and save 50 us from the switching time. Refer to the SCPI Command Reference.
Page 192
Always set to 0 if Option UN7 not present (E4438C only). Option 300 is only available on the E4438C. This bit is always set to 0. In the N5161A/81A and N5162A/82A this bit is always set to 0. Keysight Signal Generators Programming Guide...
Page 193
Changes can be positive (0 to 1) or negative (1 to 0). Commands: STATus:OPERation:NTRansition <value> (negative transition), or STATus:OPERation:PTRansition <value> (positive transition), where <value> is the sum of the decimal values of the bits you want to enable. Queries: STATus:OPERation:NTRansition? STATus:OPERation:PTRansition? Keysight Signal Generators Programming Guide...
Page 194
Status summary bit of the Status Byte Register is set to 1. Send the command STAT:OPER:ENAB 520 (512 + 8). Query: STATus:OPERation:ENABle? Response: Decimal value of the sum of the bits previously enabled with the STATus:OPERation:ENABle <value> command. Keysight Signal Generators Programming Guide...
Baseband Operation Event Enable Register. This is the named status register for the E4438C. However, not all signal generator models use all of the shown events (i.e. some use only a subset of the E4438C’s status registers). Keysight Signal Generators Programming Guide...
Page 196
Changes can be positive (0 to 1) or negative (1 to 0). Commands: STATus:OPERation:BASeband:NTRansition <value> (negative transition), or STATus:OPERation:BASeband:PTRansition <value> (positive transition), where <value> is the sum of the decimal values of the bits you want to enable. Queries: STATus:OPERation:BASeband:NTRansition? STATus:OPERation:BASeband:PTRansition? Keysight Signal Generators Programming Guide...
The Data Questionable Status Group is used to determine the specific event that set bit 3 in the Status Byte Register. This group consists of the Data Questionable Condition Register, the Data Questionable Transition Filters (negative and positive), the Data Questionable Event Register, and the Data Questionable Event Enable Register. Keysight Signal Generators Programming Guide...
Page 198
(i.e. some use only a subset of the E4438C’s status registers). Data Questionable Condition Register The Data Questionable Condition Register continuously monitors the hardware and firmware status of the signal generator. Condition registers are read only. Keysight Signal Generators Programming Guide...
Page 199
In the N5162A/82A, this bit applies only to the I/Q calibration. In the N5161A/81A/83A, this bit is unused and always set to 0. In the E8257D, E8663B, and the E8663D, this bit applies only to the DCFM/DCΦM calibration. In the N5161A/81A, N5162A/82A, N5183A, E4428C, E8257D, E8267D, E8663B, and the E8663D, this bit is always set to 0. Keysight Signal Generators Programming Guide...
Page 200
Changes can be positive (0 to 1) or negative (1 to 0). Commands: STATus:QUEStionable:NTRansition <value> (negative transition), or STATus:QUEStionable:PTRansition <value> (positive transition), where <value> is the sum of the decimal values of the bits you want to enable. Keysight Signal Generators Programming Guide...
Page 201
Status Byte Register is set to 1. Send the command STAT:QUES:ENAB 520 (512 + Query: STATus:QUEStionable:ENABle? Response: Decimal value of the sum of the bits previously enabled with the STATus:QUEStionable:ENABle <value> command. Keysight Signal Generators Programming Guide...
Power Event Register, and the Data Questionable Power Event Enable Register. This is the named status register for the E4438C. However, not all signal generator models use all of the shown events (i.e. some use only a subset of the E4438C’s status registers). Keysight Signal Generators Programming Guide...
Page 203
Data Questionable Power Transition Filters (negative and positive) The Data Questionable Power Transition Filters specify which type of bit state changes in the condition register set corresponding bits in the event register. Changes can be positive (0 to 1) or Keysight Signal Generators Programming Guide...
Page 204
The Data Questionable Power Event Register latches transition events from the condition register as specified by the transition filters. Event registers are destructive read- only. Reading data from an event register clears the content of that register. Query: STATus:QUEStionable:POWer[:EVENt]? Keysight Signal Generators Programming Guide...
Page 205
Data Questionable Condition Register is set to 1. Send the command STAT:QUES:POW:ENAB 520 (8 + 4). Query: STATus:QUEStionable:POWer:ENABle? Response: Decimal value of the sum of the bits previously enabled with the STATus:QUEStionable:POWer:ENABle <value> command. Keysight Signal Generators Programming Guide...
Questionable Frequency Event Register, and the Data Questionable Frequency Event Enable Register. This is the named status register for the E4438C. However, not all signal generator models use all of the shown events (i.e. some use only a subset of the E4438C’s status registers). Keysight Signal Generators Programming Guide...
Page 207
Sampler Loop Unlocked. A 1 in this bit position indicates that the sampler loop is unlocked. 6–14 Unused. These bits are always set to 0. Always 0. Query: STATus:QUEStionable:FREQuency:CONDition? Response: The decimal sum of the bits set to 1. Keysight Signal Generators Programming Guide...
Page 208
Data Questionable Frequency Event Register Latches transition events from the condition register as specified by the transition filters. Event registers are destructive read- only. Reading data from an event register clears the content of that register. Query: STATus:QUEStionable:FREQuency[:EVENt]? Keysight Signal Generators Programming Guide...
Page 209
Frequency summary bit of the Data Questionable Condition Register is set to 1. Send the command STAT:QUES:FREQ:ENAB 520 (16 + 8). Query: STATus:QUEStionable:FREQuency:ENABle? Response: Decimal value of the sum of the bits previously enabled with the STATus:QUEStionable:FREQuency:ENABle <value> command. Keysight Signal Generators Programming Guide...
Questionable Modulation Event Register, and the Data Questionable Modulation Event Enable Register. This is the named status register for the E4438C. However, not all signal generator models use all of the shown events (i.e. some use only a subset of the E4438C’s status registers). Keysight Signal Generators Programming Guide...
Page 211
The Data Questionable Modulation Event Register latches transition events from the condition register as specified by the transition filters. Event registers are destructive read- only. Reading data from an event register clears the content of that register. Query: STATus:QUEStionable:MODulation[:EVENt]? Keysight Signal Generators Programming Guide...
Page 212
Modulation summary bit of the Data Questionable Condition Register is set to 1. Send the command STAT:QUES:MOD:ENAB 520 (16 + 8). Query: STATus:QUEStionable:MODulation:ENABle? Response: Decimal value of the sum of the bits previously enabled with the STATus:QUEStionable:MODulation:ENABle <value> command. Keysight Signal Generators Programming Guide...
Questionable Calibration Event Register, and the Data Questionable Calibration Event Enable Register. This is the named status register for the E4438C. However, not all signal generator models use all of the shown events (i.e. some use only a subset of the E4438C’s status registers). Keysight Signal Generators Programming Guide...
Page 214
STATus:QUEStionable:CALibration:PTRansition <value> (positive transition), where <value> is the sum of the decimal values of the bits you want to enable. Queries: STATus:QUEStionable:CALibration:NTRansition? STATus:QUEStionable:CALibration:PTRansition? Data Questionable Calibration Event Register The Data Questionable Calibration Event Register latches transition events from the condition register Keysight Signal Generators Programming Guide...
Page 215
Programming the Status Register System Status Groups as specified by the transition filters. Event registers are destructive read- only. Reading data from an event register clears the content of that register. Query: STATus:QUEStionable:CALibration[:EVENt]? Keysight Signal Generators Programming Guide...
Page 216
Calibration summary bit of the Data Questionable Condition Register is set to 1. Send the command STAT:QUES:CAL:ENAB 520 (2 + 1). Query: STATus:QUEStionable:CALibration:ENABle? Response: Decimal value of the sum of the bits previously enabled with the STATus:QUEStionable:CALibration:ENABle <value> command. Keysight Signal Generators Programming Guide...
Data Questionable Condition Register. The Data Questionable Status group consists of the Data Questionable BERT Condition Register, the Data Questionable BERT Transition Filters (negative and positive), the Data Questionable BERT Event Register, and the Data Questionable BERT Event Enable Register. Keysight Signal Generators Programming Guide...
Page 218
Changes can be positive (0 to 1) or negative (1 to 0). Commands: STATus:QUEStionable:BERT:NTRansition <value> (negative transition), or STATus:QUEStionable:BERT:PTRansition <value> (positive transition), where <value> is the sum of the decimal values of the bits you want to enable. Queries: STATus:QUEStionable:BERT:NTRansition? STATus:QUEStionable:BERT:PTRansition? Keysight Signal Generators Programming Guide...
Page 219
Data Questionable Condition Register is set to 1. Send the command STAT:QUES:BERT:ENAB 520 (2048 + 4). Query: STATus:QUEStionable:BERT:ENABle? Response: Decimal value of the sum of the bits previously enabled with the STATus:QUEStionable:BERT:ENABle <value> command. Keysight Signal Generators Programming Guide...
Page 220
Programming the Status Register System Status Groups Keysight Signal Generators Programming Guide...
Option 001, 002, 601, or 602, and E8267D PSG Vector Signal Generators with Option 601 or 602. On the Keysight MXG, the internal baseband generator speed upgrade Options 670, 671, and 672 are option upgrades that require Option 651 and 652 to have been loaded at the factory (refer to the Data Sheet for more information).
I/Q data. The signal generator lets you extract this type of file unencrypted. After extracting a waveform file, you can download it into another Keysight signal generator that has the same option or software license required to play it. Waveform files consist of three items: 1.
When you use multiple bytes (as required for the waveform data), you must identify their order. This is similar to identifying the order of bits by LSB and MSB. To identify byte order, use the terms little endian and big endian. These terms are used by designers of computer processors. Keysight Signal Generators Programming Guide...
Development platforms include any product that creates and saves waveform data to a file. This includes Keysight Technologies Advanced Design System EDA software, C++, MATLAB, and so forth. The byte order describes how the system processor stores integer values as binary data in memory.
This is commonly referred to as byte swapping. You can swap bytes either programmatically or by using either the Keysight Technologies Intuilink for ESG/PSG/E8257N Signal Generator software, or the Signal Studio Toolkit 2 software. For the signal generator, byte swapping is the method to change the byte order of little endian to big endian.
Page 227
In this section, the words signal generator with or without a model number refer to an N5162A/82A Keysight MXG, E4438C ESG, E8267D PSG. The signal generator input values differ from those of the earlier E443xB ESG models. For the E443xB models, the input values are all positive (unsigned) and the data is contained within 14 bits plus 2 bits for markers.
Page 228
(:RADio:ARB:RSCaling) to an appropriate setting that accounts for the reduced values. To further minimize overshoot problems, use the correct FIR filter for your signal type and adjust your sample rate to accommodate the filter response. Keysight Signal Generators Programming Guide...
I data. This array is then downloaded to the signal generator as a binary file. The interleaved file comprises the waveform data points where each set of data points, one I data point and one Q data point, represents one I/Q waveform point. Keysight Signal Generators Programming Guide...
Page 230
11001010 01110110 11101001 11001010 01110111 00111110 01011110 01110010 Q Data I Data I Data Q Data Interleaved Hex Data Waveform Waveform data point data point CA 76 E9 CA 77 3E 5E 72 I Data Q Data I Data Q Data Keysight Signal Generators Programming Guide...
To check for and turn RF blanking off manually, refer to “Configuring the Pulse/RF Blank (Keysight MXG)” on page 314 and “Configuring the Pulse/RF Blank (ESG/PSG)” on page 314. Marker File The marker file uses one byte per I/Q waveform point to set the state of the four markers either on (1) or off (0) for each I/Q point.
Page 232
I/Q (waveform) file. However, downloading just the I/Q data with the same file name as an existing I/Q file also overwrites the existing marker file setting all bits to zero. Keysight Signal Generators Programming Guide...
Repetitions with abrupt phase changes result in high frequency spectral regrowth. In the case of playing back the sinewave samples, the phase discontinuity produces a noticeable increase in distortion components in addition to the line spectra normally representative of a single sinewave. Keysight Signal Generators Programming Guide...
PCI card for N5110B enabling very large data streams. This eliminates any restrictions associated with waveform memory to correct for repetitive phase discontinuities. Only the memory capacity of the hard drive or the PCI card limits the waveform size. Keysight Signal Generators Programming Guide...
To play back waveforms after cycling the signal generator power, you must load waveforms from non–volatile waveform memory (NVWFM) to volatile waveform memory (WFM1). On the Keysight MXG the non–volatile memory is referred to as internal media and external media. The following file types share this memory: Table 5-2 Signal Generators and Non–Volatile Memory Types...
Page 237
User Data User PRAM – Instrument State Waveform Sequences (multiple I/Q files played together) The following figure on Figure 5-1 on page 230 shows the locations within the signal generator for volatile and non–volatile waveform data. Keysight Signal Generators Programming Guide...
For information on using the E443xB directories, see Keysight MXG uses an optional “USB media” to store non–volatile waveform data. The Keysight MXG internal non–volatile memory is referred to as “internal storage”. NONVOLATILE This directory shows the files with the same extensions as the USB media and is useful with ftp.
Page 239
512 bytes (N5162A/82A) or 256 bytes (E4438C/E8267D). Non–Volatile Memory (Keysight MXG) NOTE If the Keysight MXG’s external USB flash memory port is used, the USB flash memory can provide actual physical storage of non–volatile data in the SECUREWAVE directory versus the “virtual” only data.
(one sample equals five bytes). The ESG and PSG baseband generator (BBG) options (001, 002, 601, or 602) and the Keysight MXG baseband generator (BBG) Option (651, 652, and 654) contain the waveform playback memory. Refer to Table 5-4 on page 233 through Table 5-6 on page 234 for the maximum available memory.
Page 241
67,018,496 Samples The expression [16 + [44 x MaxNumFiles]) has been rounded up to nearest memory block (1024 bytes). (To find the I/Q waveform sample size, this resulting value needs to be divided by 4.) Keysight Signal Generators Programming Guide...
(ESG/PSG only), the resulting waveform data is automatically stored in volatile memory and is available for extraction as an encrypted file. When you download an exported waveform using a Keysight Signal Studio software product, you can use the FTP process and the securewave directory or SCPI commands, to extract the encrypted file to the non–volatile memory on the signal generator.
Encrypted I/Q Files and the Securewave Directory (Keysight MXG) NOTE Header parameters of files stored on the Keysight MXG’s internal or USB media cannot be changed unless the file is copied to the volatile BBG memory. For more information on modifying header parameters, refer to the User’s Guide.
You can download or extract waveform data using the commands and file paths in the following tables: • Table 5-7, “Downloading Unencrypted Files for No Extraction (Extraction allowed on the Keysight MXG Only),” on page 237 • Table 5-8, “Downloading Encrypted Files for No Extraction (Extraction allowed on the Keysight MXG Only),”...
Page 245
Creating and Downloading Waveform Files Commands for Downloading and Extracting Waveform Data Table 5-7 Downloading Unencrypted Files for No Extraction (Extraction allowed on the Keysight MXG Only) Download Method/ Command Syntax Options Memory Type SCPI/volatile memory MMEM:DATA "WFM1:<file_name>",<blockdata> MMEM:DATA "MKR1:<file_name>",<blockdata>...
Page 246
MMEM:DATA? "/user/bbg1/waveform/<file_name>" memory MMEM:DATA? "WFM1:<file_name>" MMEM:DATA? "<file_name>@WFM1" SCPI/non–volatile MMEM:DATA? "/user/waveform/<file_name>" memory MMEM:DATA? "NVWFM:<file_name>" MMEM:DATA? "<file_name>@NVWFM" FTP/volatile get /user/bbg1/waveform/<file_name> get /user/bbg1/markers/<file_name> memory get /user/bbg1/header/<file_name> FTP/non–volatile get /user/waveform/<file_name> get /user/markers/<file_name> memory get /user/header/<file_name> “FTP Procedures” on page 240 Keysight Signal Generators Programming Guide...
Page 247
Download Command Syntax Options Method/Memory Type SCPI/volatile MMEM:DATA? "/user/bbg1/securewave/file_name" memory MMEM:DATA? "SWFM1:file_name" MMEM:DATA? "file_name@SWFM1" SCPI/non–volatile MMEM:DATA? "/user/securewave/file_name" memory MMEM:DATA? "SNVWFM:file_name" MMEM:DATA? "file_name@SNVWFM" FTP/volatile get /user/bbg1/securewave/<file_name> memory FTP/non–volatile get /user/securewave/<file_name> memory “FTP Procedures” on page 240 Keysight Signal Generators Programming Guide...
3. Drag and drop files between the PC and the Internet Explorer window Using the Command Window (PC or UNIX) This procedure downloads to non–volatile memory. To download to volatile memory, change the file path. Keysight Signal Generators Programming Guide...
Page 249
<marker file_name> is the name of the file to download and <file_name1> is the name designator for the file in the signal generator’s /user/markers/ directory. Marker files and the associated I/Q waveform data have the same name. Keysight Signal Generators Programming Guide...
Page 250
6. At the ftp prompt, type: bye 7. At the command prompt, type: exit Using the Signal Generator’s Internal Web Server 1. Enter the signal generator’s hostname or IP address in the URL. http://<host name> or <IP address> Keysight Signal Generators Programming Guide...
You can use various programming environments to create ARB waveform data. Generally there are two types: • Simulation software— this includes MATLAB, Keysight Technologies EESof Advanced Design System (ADS), Signal Processing WorkSystem (SPW), and so forth. • Advanced programming languages—this includes, C++, VB, VEE, MS Visual Studio.Net, Labview, and so forth.
Page 252
Note that we define the array as type short, which represents a 16–bit signed integer in most C++ compilers. Create an array to hold the generated Q values (signed 16–bit integers). Define and set a temporary variable, which is used to calculate the I and Q values. Keysight Signal Generators Programming Guide...
Page 253
Set the scale of the DAC values in the range of −32767 to 32768, where the values −32767 and 32768 — equal full scale negative and positive respectively. This example uses 23000 as the multiplier, “Scaling DAC resulting in approximately 70% scaling. For more information on scaling, see Values” on page 219 Keysight Signal Generators Programming Guide...
Page 254
• Interleaving and byte swapping I and Q data for little endian order • Interleaving I and Q data for big endian order For more information on byte order, see “Little Endian and Big Endian (Byte Order)” on page 216. Keysight Signal Generators Programming Guide...
Page 255
16–bit integer. • Save the current Q data array value to a variable. • Swap the low bytes (bits 0–7) of the data with the high bytes of the data (done for both Keysight Signal Generators Programming Guide...
Page 256
1 1 1 0 0 1 0 1 0 1 1 0 1 0 1 1 Data 1 0 1 1 0 1 1 1 1 1 1 0 1 0 0 1 Q Data I Data Keysight Signal Generators Programming Guide...
In MATLAB however, you can either save data to a .mat file or create a complex array. To facilitate downloading a MATLAB complex data array, Keysight created the Keysight Waveform Download Assistant (one of the free download utilities), which downloads the complex data array from within the MATLAB environment.
To turn off the ARB remotely, send: :SOURce:RADio:ARB:STATe OFF. Using Simulation Software This procedure uses a complex data array created in MATLAB and uses the Keysight Waveform Download Assistant to download the data. To obtain the Keysight Waveform Download Assistant, see “Using the Download Utilities”...
Page 259
Change the GPIB address based on your instrument setting. Send a query to the signal generator to verify the connection. • agt_query() is an Keysight Waveform Download Assistant function that sends a query to the signal generator. • If signal generator receives the query *idn?, status returns zero and query_result returns the signal generator’s model number, serial number, and firmware version.
Download the I/Q waveform data to the signal generator by using the function call (agt_waveformload) from the Keysight Waveform Download Assistant. Some of the arguments are optional as indicated below, but if one is used, you must use all arguments previous to the one you require.
Page 261
“Keysight SICL User’s Guide for Windows.” Open a connection session with the signal generator to download the generated I/Q data. The SICL function iopen() is from the Keysight IO library and creates a session that returns an identifier to •...
Page 262
Send the SCPI command stored in the string cmd to the signal generator, which is represented by the session • iwrite() is a SICL function in Keysight IO library, which writes the data (block data) specified in the string cmd to the signal generator (id).
(WFM1). The file comprises three items: I/Q data, marker file, and file header information. Send one of the following SCPI command to copy the I/Q file, marker file and file header information: :MEMory:COPY:NAME "<NVWFM:file_name>","<WFM1:file_name>" :MEMory:COPY:NAME "<NVMKR:file_name>","<MKR1:file_name>" :MEMory:COPY:NAME "<NVHDR:file_name>”,"<HDR:file_name>" Keysight Signal Generators Programming Guide...
Send the following SCPI command: :MMEMory:CATalog? "WFM1:" 2. Select the waveform from the volatile memory waveform list: Send the following SCPI command: :SOURce:RADio:ARB:WAVeform "WFM1:<file_name>" 3. Play the waveform: Send the following SCPI commands: :SOURce:RADio:ARB:STATe ON :OUTPut:MODulation:STATe ON :OUTPut:STATe ON Keysight Signal Generators Programming Guide...
SCPI commands can be used to generate and work with a waveform sequence. For more information refer to the signal generator’s SCPI Command Reference and User’s Guide. If you would like to verify the waveform sequence, refer to “Verifying the Waveform” on NOTE page 257. Keysight Signal Generators Programming Guide...
:OUTPut:STATe ON Using the Download Utilities Keysight provides free download utilities to download waveform data into the signal generator. The table in this section describes the capabilities of three such utilities. For more information and to install the utilities, refer to the following URLs: •...
Creating and Downloading Waveform Files Downloading E443xB Signal Generator Files NOTE Keysight Intuilink is not available for the Keysight MXG. • Keysight Waveform Download Assistant: http://www.keysight.com/find/downloadassistant This software provides functions for the MATLAB environment to download waveform data. Features Keysight Signal...
• Converts the 14–bit I and Q data into 16–bit data (the format required by the signal generator). Subtract 8192, left shifts the data, and appends two bits (zeros) before the least significant bit (i.e. the offset binary values are converted to 2’s complement values by the signal generator). Keysight Signal Generators Programming Guide...
Page 269
Marker 1 and 2 bits from the E443xB I data Marker 3 and 4 bits • Interleaves the 16–bit I and Q data creating one I/Q file. • Creates a file header with all parameters set to unspecified (factory default file header setting). Keysight Signal Generators Programming Guide...
See Chapter 2 of this programming guide for information on interfaces and IO libraries. The example programs are also available on the signal generator Documentation CD–ROM, which allows you to cut and paste the examples into an editor. Keysight Signal Generators Programming Guide...
// 2.) Save the waveform into the ESG/PSG Internal Arb format This format is for the E4438C, E8267C, E8267D This format will not work with the ESG E443xB or the Keysight MXG N518xA // 3.) Load the internal Arb format file into an array #include <stdio.h>...
Page 272
Maximum negative value of the DAC // The internal arb expects the data bytes to be in Big Endian format. // This is opposite of how short integers are saved on a PC (Little Endian). Keysight Signal Generators Programming Guide...
Page 273
== 0 ) //if( PC ) pChar = (char *)&waveform[0]; // Character pointer to short int data for( i=0; i<2*points; i++ ) buf = *pChar; *pChar = *(pChar+1); *(pChar+1) = buf; pChar+= 2; Keysight Signal Generators Programming Guide...
(out_stream.fail()) cout << "Input file opening failed" << endl; exit(1); //generate the sample data for I and Q. The I channel will have a sine //wave and the Q channel will a cosine wave. Keysight Signal Generators Programming Guide...
// I and Q data, and then downloading the data into the // signal generator as an interleaved I/Q file. // This example uses a sine and cosine wave as the I/Q // data. // Include the standard headers for SICL programming #include <sicl.h> Keysight Signal Generators Programming Guide...
Page 277
// scales to approximately 70% of full scale. idata[index]=23000 * sin((4*3.14*index)/numsamples); qdata[index]=23000 * cos((4*3.14*index)/numsamples); // Print the I and Q values to a text file. View the data // to see if its correct and if needed, plot the data in a Keysight Signal Generators Programming Guide...
Page 278
// Big endian order, uncomment this line iqbuffer[index*2+1] = qdata[index]; // Big endian order, uncomment this line // } // Big endian order, uncomment this line // Open a connection to write to the instrument INST id=iopen(instOpenString); if (!id) Keysight Signal Generators Programming Guide...
Page 279
// You must find and use the correct command for Method 2. iwrite(id, iqbuffer, bytesToSend, 0, 0); // Send a terminating carriage return iwrite(id, “\n”, 1, 1, 0); printf(“Loaded file using the E4438C, E8267C and E8267D format\n”); return 0; Keysight Signal Generators Programming Guide...
// PROGRAM DESCRIPTION:Sample test program to download ARB waveform data. Send a // file in chunks of ascii data to the signal generator. // NOTE: You must have the Keysight IO Libraries installed to run this program. // This example uses the LAN/TCPIP to download a file to the signal generator's // non-volatile memory.
Page 283
"viOpen failed (%s)\n", instOpenString); return -1; FILE* file = fopen(localSrcFile, "rb");// Open local source file for binary reading if (!file) // If any errors display the error and exit the program fprintf(stderr, "Could not open file: %s\n", localSrcFile); Keysight Signal Generators Programming Guide...
Page 284
// Write the command mmem:data and the header.The number lenLen represents the // number of bytes and the actual number of bytes is the variable lenToSend sprintf((char*)s2, "mmem:data \"%s\", #%d%d", instDestFile, lenLen, lenToSend); // Send the command and header to the signal generator Keysight Signal Generators Programming Guide...
Page 285
// Send the terminating newline and EOI viSetAttribute( vi, VI_ATTR_SEND_END_EN, 1 ); char* newLine = "\n"; viWrite(vi, (unsigned char*)newLine, 1, 0); delete [] buf; else fprintf(stderr, "Could not allocate memory for copy buffer\n"); fclose(file); viClose(vi); viClose(defaultRM); return 0; Keysight Signal Generators Programming Guide...
Page 286
// Some compilers will allow ‘/’ in the directory // names. Older compilers might need ‘\\’ in the // directory names. It depends on your operating system // and compiler. char *ifile = “c:\\SignalGenerator\\data\\BurstA1I.bin”; char *qfile = “c:\\SignalGenerator\\data\\BurstA1Q.bin”; Keysight Signal Generators Programming Guide...
Page 287
// data is in some other format, then replace this block // with appropriate code for reading your format. // First read I values done = false; index = 0; infile = fopen(ifile, “rb”); if (infile==NULL) perror (“Error opening file to read”); Keysight Signal Generators Programming Guide...
Page 288
// having trouble, look in the file and see if your I and // Q data looks correct. Plot the data from this file if // that helps you to diagnose the problem. FILE *outfile = fopen(ofile, “w”); Keysight Signal Generators Programming Guide...
Page 289
// iqbuffer will hold the data in the E4438C, E8267C, E8267D // format. In this format, the I and Q data is interleaved. // The data is in the range -32768 to 32767. -32768 gives negative full-scale output Keysight Signal Generators Programming Guide...
Page 290
// so we can use this next section on any of these signal generators. // However the E443xB format only uses 14 bits. bytesToSend = numsamples*2; // calculate the number of bytes sprintf(s, “%d”, bytesToSend); // create a string s with that number of bytes Keysight Signal Generators Programming Guide...
Page 291
The buffer of I+Q is twice as long as the I buffer was. c) The SCPI command uses WFM1 instead of ARBI and ARBQ. bytesToSend = numsamples*4; sprintf(s, “%d”, bytesToSend); sprintf(cmd, “:mem:data \”WFM1:FILE2\”, #%d%d”, strlen(s),bytesToSend); iwrite(id, cmd, strlen(cmd), 0, 0); Keysight Signal Generators Programming Guide...
// a double cannot hold the full number accurately for very long waveforms // This type can handle up to (but not including) 8Gsa. uint64 sum_of_squares_accum = 0; int ival; int qval; Keysight Signal Generators Programming Guide...
• reversal of the data formatting process (byte swapping, interleaving, and normalizing the data) function main % Program name: offset_iq_ml % Using MatLab this example shows how to % 1.) Create a simple IQ waveform Keysight Signal Generators Programming Guide...
Page 294
% This is opposite of how short integers are saved on a PC (Little Endian). % For this reason the data bytes are swapped before being saved. % Interleave the IQ data waveform(1:2:2*points) = Iwave; waveform(2:2:2*points) = Qwave; Keysight Signal Generators Programming Guide...
Page 295
% Swap the bytes as necessary % Convert to signed integers then normalize between +-1 % De-interleave the I/Q Data % Open the file and load the internal format data [FID, message] = fopen(filename,'r');% Open file to read data Keysight Signal Generators Programming Guide...
Page 296
% convert unsigned to signed representation internalWave = double(internalWave); tmp = (internalWave > 32767.0) * 65536; iqWave = (internalWave - tmp) ./ 32767; % and normalize the data % De-Interleave the IQ data IwaveIn = iqWave(1:2:n); QwaveIn = iqWave(2:2:n); Keysight Signal Generators Programming Guide...
Page 297
NOTE This section applies only to the Keysight MXG and the PSG. For the Keysight MXG, the maximum frequency is 6 GHz, and the pulsepat.m program’s SOURce:FREQuency 20000000000 value must be changed as required in the following programs. For more frequency information, refer to the signal generator’s Data Sheet.
Page 298
% verify that communication with the Keysight MXG/PSG has been established [status, status_description, query_result] = agt_query(io,'*idn?'); if (status < 0) return; end % set the carrier frequency and power level on the Keysight MXG/PSG using the Keysight %Waveform Download Assistant Keysight Signal Generators Programming Guide...
Page 299
Matlab (see Figure 5-2 on page 291). To do this, enter plot (i) at the Matlab command prompt. Figure 5-2 Simulated Plot of In–Phase Signal The following additional Matlab M–file pulse programming examples are also available on the Documentation CD–ROM for your Keysight MXG and PSG signal generator: Keysight Signal Generators Programming Guide...
Page 300
This programming example calculates and downloads an arbitrary waveform file that simulates a single tone FM signal with a rate of 6 KHz, deviation of =/– 14.3 KHz, Bessel null of dev/rate=2.404 to the Keysight MXG/PSG vector signal generator. nchirp.m This programming example calculates and downloads an arbitrary waveform file that simulates a simple compressed pulse RADAR signal using non–linear FM...
Page 301
Programming Examples % Copyright 2009 Keysight Technologies Inc. % This function downloads a waveform and markers to an Keysight ESG-C, % PSG-C/D, or MXG Vector Signal Generator. markers is a two dimentional % array that contains 4 markers. The header contains the sample rate, the % waveform rms voltage, and the marker routings to the pulse modulator and % the ALC hold.
Page 302
= tcpip(tcpipAddress, 5025); t.OutputBufferSize = bufSize; % Order dependency on download. 1:Waveform, 2:Markers, 3:Header fopen(t); fprintf(t,'%s',wfmCmd); %fwrite(t,iqData,'int16'); % Use loop to prevent the need for a buffer as big as waveform WriteData(t,iqData,2,bufSize); fprintf(t,'\n'); fprintf(t,'syst:err?'); fgets(t) fprintf(t,'%s',mkrCmd); %fwrite(t,mkrData,'int8'); Keysight Signal Generators Programming Guide...
Page 304
% in this order M4 M3 M2 M1 [c,d] = size(markers); if c>d markers = markers'; [c,d] = size(markers); mkr = (markers(1,:)~=0); if c>1 mkr = mkr + 2*(markers(2,:)~=0); if c>2 mkr = mkr + 4*(markers(3,:)~=0); if c>3 Keysight Signal Generators Programming Guide...
Page 305
= header.sampleRate; if isfield(header,'rms') hdr.rms = header.rms; if isfield(header,'peak') hdr.peak = header.peak; if isfield(header,'runtimeScaling') hdr.runtimeScaling = header.runtimeScaling; if isfield(header,'pulse') hdr.pulse = header.pulse; if isfield(header,'alcHold') hdr.alcHold = header.alcHold; if isfield(header,'description') hdr.description = header.description; Keysight Signal Generators Programming Guide...
Page 306
On the documentation CD, this programming example’s name is “PlayWaveform.m.” This MATLAB programming example performs the following functions: • plays a waveform that has been downloaded function PlayWaveform( tcpipAddress, name ) % PlayWaveform( tcpipAddress, name ); Keysight Signal Generators Programming Guide...
Page 307
Creating and Downloading Waveform Files Programming Examples % Copyright 2009 Keysight Technologies Inc. % Play the waveform in the Signal Generator % INPUT PARAMETERS: tcpipAddress - '141.121.148.188' Whatever works for your signal Generator! name - Waveform name - 21 characters max % EXAMPLE: name = 'My_Test';...
Dim FileHandle As Integer Dim data As Byte Dim iq_data() As Byte Dim strFilename As String strFilename = "C:\IQ_DataVB" Const SAMPLES = 200 ' Number of sample PAIRS of I and Q integers for the waveform Keysight Signal Generators Programming Guide...
Page 309
'Now write the data to the file FileHandle = FreeFile() 'Get a file number numPoints = UBound(iq_data) 'Get the number of bytes in the file Open strFilename For Binary Access Write As #FileHandle Len = numPoints + 1 Keysight Signal Generators Programming Guide...
Page 310
'******************************************************************************* ' Program Name: Download_File ' Program Description: This program uses Microsoft Visual Basic 6.0 and the Keysight ' VISA COM I/O Library to download a waveform file to the signal generator. ' The program downloads a file (the previously created ‘IQ_DataVB’ file) to the signal ' generator.
Page 311
' " /USER/WAVEFORM/IQ_DataVB". For volatile memory(WFM1) download to the ' " /USER/BBG1/WAVEFORM/IQ_DataVB" directory. ' You must reference the Keysight VISA COM Resource Manager and VISA COM 1.0 Type ' Library in your Visual Basic project in the Project/References menu. ' The VISA COM 1.0 Type Library, corresponds to VISACOM.tlb and the Keysight ' VISA COM Resource Manager, corresponds to AgtRM.DLL.
Page 312
'Signal generator reponse to the OPC? query Call MsgBox("Data downloaded to the signal generator", vbOKOnly, "Download") Exit Sub errorhandler: MsgBox Err.Description, vbExclamation, "Error Occurred", Err.HelpFile, Err.HelpContext Exit Sub file_error: Call MsgBox(Err.Description, vbOKOnly) 'Display any error message Close #FileHandle End Sub Keysight Signal Generators Programming Guide...
NEXT I FOR I=2 TO Num_points*2 STEP 2 Int_array(I)=INT(32767*(COS(I*360/Num_points))) NEXT I PRINT "Data Generated" Nbytes=4*Num_points ASSIGN @PSG TO 719 ASSIGN @PSGb TO 719;FORMAT MSB FIRST Nbytes$=VAL$(Nbytes) Ndigits=LEN(Nbytes$) Ndigits$=VAL$(Ndigits) WAIT 1 OUTPUT @PSG USING "#,K";":MMEM:DATA ""WFM1:data_file"",#" Keysight Signal Generators Programming Guide...
Page 314
The name, data_file, will appear in the signal generator’s memory catalog. 200 to 210: Sends the rest of the ASCII header. 230: Sends the binary data. Note that PSGb is the binary IO path. 240: Sends an End–of–Line to terminate the transmission. Keysight Signal Generators Programming Guide...
Page 315
PRINT "Data generated " Nbytes=4*Num_points ASSIGN @PSG TO 719;FORMAT ON ASSIGN @PSGb TO 719;FORMAT OFF Nbytes$=VAL$(Nbytes) Ndigits=LEN(Nbytes$) Ndigits$=VAL$(Ndigits) WAIT 1 OUTPUT @PSG USING "#,K";":MMEM:DATA ""WFM1:data_file"",#" OUTPUT @PSG USING "#,K";Ndigits$ OUTPUT @PSG USING "#,K";Nbytes$ WAIT 1 OUTPUT @PSGb;Int_array(*) Keysight Signal Generators Programming Guide...
Page 316
230: Sends the binary data. Note that PSGb is the binary IO path. 240: Sends an End–of–Line to terminate the transmission. 250 to 260: Closes the connections to the signal generator. 290: End the program. Keysight Signal Generators Programming Guide...
Page 317
Nbytes$=VAL$(Nbytes) Ndigits=LEN(Nbytes$) Ndigits$=VAL$(Ndigits) OUTPUT @Esg USING "#,K";":MMEM:DATA ""ARBI:file_name_1"",#" OUTPUT @Esg USING "#,K";Ndigits$ OUTPUT @Esg USING "#,K";Nbytes$ OUTPUT @Esgb;Iwfm_data(*) OUTPUT @Esg;END OUTPUT @Esg USING "#,K";":MMEM:DATA ""ARBQ:file_name_1"",#" OUTPUT @Esg USING "#,K";Ndigits$ OUTPUT @Esg USING "#,K";Nbytes$ OUTPUT @Esgb;Qwfm_data(*) Keysight Signal Generators Programming Guide...
Page 318
EOL (End of Line) output. This allows multiple output commands to be concatenated as if they were a single output. The “K” instructs HP BASIC to output the following numbers or strings in the default format. Keysight Signal Generators Programming Guide...
Page 319
Defines arrays for I and Q waveform points. Sets them to be integer arrays. Sets HP BASIC to use degrees for cosine and sine functions. Sets up loop to calculate waveform points. Calculates I waveform points. Calculates Q waveform points. Keysight Signal Generators Programming Guide...
Page 320
Creating and Downloading Waveform Files Programming Examples Program Comments (Continued) End of loop. 160 and 210: The I and Q waveform files have the same name table on page 308 90 to 300 See the for program comments. Keysight Signal Generators Programming Guide...
To solve the problem, scale or reduce the DAC input values. For more information, “DAC Input Values” on page 218 On the Keysight MXG, this error can occur if an encrypted file (.SECUREWAVE) is being downloaded to the signal generator from a PC or USB Media with a different suffix (i.e.
“Marker File” on page 223 SCPI commands: [:SOURce]:RADio[1]:ARB:MDEStination:PULSe NONE|M1|M2|M3|M4 [:SOURce]:RADio[1]:ARB:MDEStination:PULSe? “Getting Help (Keysight MXG)” on page 21 For details on each key, use the key help. Refer to and the User’s Guide. For additional SCPI command information, refer to the SCPI Command Reference.
Option 601 or 602. These exceptions are indicated in the sections. On the Keysight MXG, the internal baseband generator speed upgrade Options 670, 671, and 672 are option upgrades that require Option 651 and 652 to have been loaded at the factory (refer to the Data Sheet for more information).
This file type lets the user store amplitude corrections for frequency. Prior to creating and downloading files, you need to take into consideration the file size and the amount of remaining signal generator memory. For more information, see “Signal Generator Memory” on page 317 Keysight Signal Generators Programming Guide...
Waveform sequences are always in non–volatile memory. Non–volatile Storage memory where files survive cycling of the signal generator power. Files remain until overwritten or deleted. Refer to Table 6-2 on page 318 for the file types that share this memory: Keysight Signal Generators Programming Guide...
Page 326
– User FIR – Instrument State Waveform Sequences – (multiple I/Q files played together) N5161A, N5181A, N5183A, E8663B/63D, E4428C, and the E8257D. The following figure shows the signal generator’s directory structure for the user–data files. Keysight Signal Generators Programming Guide...
User–data blocks consist of 1024 bytes of memory. Each user–data file has a file header that uses 512 bytes for the Keysight MXG, or 256 bytes for the ESG/PSG in the first data block for each user–data file.
4KB clusters. For example, a file that has 21,538 bytes consumes 6 memory clusters (24,000 bytes). On the Keysight MXG the non–volatile memory is also referred to as internal storage and USB media. The Internal and USB media files /USERS/NONVOLATILE Directory contains file names with full extensions (i.e.
002, 601, or 602, and the E8267D with Option 601 or 602. The FIR filter, (file) types only apply to the N5162A and N5182A with Option 651, 652, or 654, E4438C with Option 001, 002, 601, or 602, and the E8267D with Option 601 or 602. Keysight Signal Generators Programming Guide...
Page 330
To accurately determine the available memory, you must calculate the number of blocks of memory used by the files. For more information on memory block allocation, see “Memory Allocation” on page 319. Keysight Signal Generators Programming Guide...
To accomplish this, you may have to remove or add bytes. If there are not enough bits remaining in the file to fill a frame or timeslot, the signal generator truncates the data causing a discontinuity in the data pattern. Keysight Signal Generators Programming Guide...
The example in the figure shows the bit data SCPI command formatted to download three bytes of data, but only 23 bits of the three bytes are designated as the bits of interest. (For more information Keysight Signal Generators Programming Guide...
Page 333
To view a downloaded bit file with an external hex editor program, FTP the file to your PC/UNIX workstation. For information on how to FTP a file, see “FTP Procedures” on page 339. Keysight Signal Generators Programming Guide...
Page 334
24. As seen with the hex editor program, the signal generator does not actually change the three bytes of data in the downloaded file. For information on editing a file after downloading, see “Modifying User File Data” on page 338. Keysight Signal Generators Programming Guide...
1 0 1 1 0 1 1 0 1 1 0 0 1 1 0 0 1 0 1 1 0 1 1 0 1 1 0 0 1 1 0 0 Data repeats Symbol Symbol Symbol Symbol Symbol Symbol Symbol Symbol Keysight Signal Generators Programming Guide...
Arb–based waveforms. For user data files, volatile memory is commonly referred to as pattern ram memory (PRAM). Because the Custom and TDMA user files use volatile memory, their maximum file size depends on the baseband generator (BBG) option and the amount of available Keysight Signal Generators Programming Guide...
Use the following procedures to calculate the required amount of volatile memory for both framed and unframed TDMA signals: • “Calculating Volatile Memory (PRAM) Usage for Unframed Data” on page 330 • “Calculating Volatile Memory (PRAM) Usage for Framed Data” on page 330 Keysight Signal Generators Programming Guide...
Page 338
For example, if a file contains enough data to fill a timeslot three times, the signal produces three new frames before the frames repeat. Each new frame increases the Keysight Signal Generators Programming Guide...
Page 339
5000 4 x 5000 = 20000 bytes 7. Calculate the number of memory blocks that the AUTOGEN_PRAM_1 file will occupy: Volatile memory allocates memory in blocks of 1024 bytes. 20000 / 1024 = 19.5 blocks Keysight Signal Generators Programming Guide...
<"file_name"> the data file path and name indicates the start of the block data the number of decimal digits present in B a decimal number specifying the number of data bytes to follow in C Keysight Signal Generators Programming Guide...
Page 341
0, 0); iwrite(id, databuffer, bytesToSend, 0, 0); iwrite(id, "\n", 1, 1, 0); Line Code Description—Download User File Data Define an integer variable (bytesToSend) to store the number of bytes to send to the signal generator. Keysight Signal Generators Programming Guide...
Page 342
Send the SCPI command stored in the string cmd to the signal generator contained in the variable id. • iwrite() is a SICL function in Keysight IO library, which writes the data (block data) specified in the string cmd to the signal generator. •...
Since this command is file specific (BIT), there is no need to add the file path to the file name. After execution of this command, the signal generator creates a file in the bit directory (memory catalog) named “new_file” that contains 27 bytes. Remember that the signal generator adds a Keysight Signal Generators Programming Guide...
There are three ways to format the file name, which must also include the file path: • "BIN:file_name" • "file_name@BIN" • "/user/BIN/file_name" Command Syntax Example The following command downloads a file that contains 34 bytes: :MEM:DATA "BIN:new_file",#2347^%S!4&07#8g*Y9@7.?:*Ru[+@y3#_^,>l Keysight Signal Generators Programming Guide...
To find the data selection commands for both framed and unframed data for the different modulation formats, see the signal generator’s SCPI Command Reference. 1. For TDMA formats, select either framed or unframed data: :RADio:GSM:BURSt ON|OFF|1|0 ON(1) = framed OFF(0) = unframed Keysight Signal Generators Programming Guide...
For information on using FTP, see FTP Procedures. Ensure that you use binary file transfers during FTP operations. 2. Modify the file using a hex editor program. 3. FTP the file to the signal generator’s BIN memory catalog (directory). Keysight Signal Generators Programming Guide...
Page 347
If you are remotely FTPing files and need to verify the completion of the FTP process, then query the instrument by using SCPI commands such as: ':MEM:DATA:', ':MEM:CAT', '*STB?', 'FREQ?', '*IDN?', 'OUTP:STAT?'. Refer to the SCPI Command Reference. Keysight Signal Generators Programming Guide...
Page 348
<file_name> /user/<directory>/<file_name1> • <file_name1> is the name of the file as it appears in the signal generator’s directory. • <file_name> is the name of the file as it appears in the PC/UNIX current directory. Keysight Signal Generators Programming Guide...
In the last byte that contains the last user file data bit, the signal generator sets the Pattern Reset bit to 1. This causes the user file data pattern to repeat in the next frame. NOTE The data in PRAM is static. Firmware writes to PRAM once for the configuration selected Keysight Signal Generators Programming Guide...
Page 351
GSM standard (42 bits) & 1 (on) remaining bits of user file 2 through 6 1562 - 2342 0/1 (don’t care) 0 (off) 2343 - 2499 0/1 (don’t care) 1 (1 in offset 2499 only) Keysight Signal Generators Programming Guide...
Page 352
For the total PRAM memory usage, be sure to add the number of PRAM blocks that the user file occupies to the PRAM file size. For more information, see “Calculating Volatile Memory (PRAM) Usage for Framed Data” on page 330. Keysight Signal Generators Programming Guide...
The only external effect of the parallel mode is in the EVENT 1 output signal. In serial and parallel mode, the signal generator outputs a narrow pulse at the EVENT 1 connector. But in parallel mode, the output pulse width increases by a factor of bits–per–symbol wide, as shown in the following figure. Keysight Signal Generators Programming Guide...
PRAM data downloads apply to only real–time Custom and TDMA modulation formats. In the TDMA formats, PRAM files are available only while using the unframed data selection. The following table on page 347 shows which signal generator models support these formats. Keysight Signal Generators Programming Guide...
SCPI commands. Understanding PRAM Files The term PRAM file comes from earlier Keysight products, the E443xB ESGs. PRAM is another term for waveform memory (WFM1), which is also known as volatile memory. This means that PRAM files and waveform files occupy the same memory location.
Page 356
Because a PRAM byte has only four bits that can change states, there are only 15 possible byte patterns as shown in Table 6-10. The table also shows the decimal value for each pattern, which is needed for downloading data using the list format shown on page 352. Keysight Signal Generators Programming Guide...
Page 357
There is approximately a 12–symbol delay between a state change in the burst bit and the corresponding effect at the RF out. This delay varies with symbol rate and filter settings, and requires compensation to advance the burst bit in the downloaded PRAM file. Keysight Signal Generators Programming Guide...
Because the file downloads one fourth of the translated 32–bit word, another method to calculate the file size is to multiply the downloaded file size by four: 89 bytes × 4 = 356 bytes See also “Signal Generator Memory” on page 317 and “Checking Available Memory” on page 321. Keysight Signal Generators Programming Guide...
Page 359
280 bytes. This equates to a 70 byte file. 14 bytes × 5 = 70 bytes 70 + [(70 × 24) / 8] = 280 bytes 56 bytes × 5 = 280 bytes File size increases by a factor of 5 Keysight Signal Generators Programming Guide...
(see page 352), because it does not have to parse the data. When creating the data, remember that the signal generator requires a minimum of 60 bytes. For more information on file size limits, see “PRAM File Size” on page 350. Keysight Signal Generators Programming Guide...
Page 361
WFM1 (waveform) memory catalog. This program assumes that there is a char array, databuffer, that contains the 240 bytes of PRAM data and that the variable numbytes stores the length of the array. Keysight Signal Generators Programming Guide...
Page 362
Send the SCPI command stored in the string cmd to the signal generator contained in the variable id. • iwrite() is a SICL function in Keysight IO library, which writes the data (block data) specified in the string cmd to the signal generator. •...
:RADio:GSM:DATA PRAM 3. Select the PRAM file: :RADio:GSM:DATA:PRAM <"file_name"> Because the command is file specific (PRAM), there is no need to include the file path with the file name. 4. Configure the remaining signal parameters. Keysight Signal Generators Programming Guide...
There are three ways to format the file_name variable to include the file path: Volatile Memory to Non–Volatile Memory :MEMory:COPY "WFM1:file_name","NVWFM:file_name" :MEMory:COPY "file_name@WFM1","file_name@NVWFM" :MEMory:COPY "/user/bbg1/waveform/file_name","/user/waveform/file_name" Non–Volatile Memory to Volatile Memory :MEMory:COPY "NVWFM:file_name","WFM1:file_name" :MEMory:COPY "file_name@NVWFM","file_name@WFM1" :MEMory:COPY "/user/waveform/file_name","/user/bbg1/waveform/file_name" Keysight Signal Generators Programming Guide...
If you use this command, the signal generator will treat the file as a new PRAM file and translate the LSB of each byte into a 32–bit word, corrupting the file data. Keysight Signal Generators Programming Guide...
Page 366
Extraction Command Syntax Options Method/Memory Type SCPI/volatile memory :MEM:DATA? "WFM1:file_name" :MEM:DATA? "file_name@WFM1" :MEM:DATA? "/user/bbg1/waveform/file_name" SCPI/non–volatile :MEM:DATA? "NVWFM:file_name" memory :MEM:DATA? "file_name@NVWFM" :MEM:DATA? "/user/waveform/file_name" get /user/bbg1/waveform/file_name FTP/volatile memory FTP/non–volatile get /user/waveform/file_name memory “FTP Procedures” on page 339 Keysight Signal Generators Programming Guide...
The signal generator does not support viewing and editing PRAM file contents. Because the signal generator translates the data bit into a 32–bit word, the file contents are not recognizable, and therefore not editable using a hex editor program, as shown in the following figure. Keysight Signal Generators Programming Guide...
The signal generator processes FIR filter coefficients as floating point numbers. 2. Data must be in List format. FIR filter coefficient data is processed as a list by the signal generator’s firmware. See Sample Command Line. Keysight Signal Generators Programming Guide...
The filter may be sampled to a higher or lower OSR. The filter will be decimated to a 16 or lower OSR depending on the symbol rate. Keysight Signal Generators Programming Guide...
This command selects the user FIR filter, specified by the file name, as the active filter for the TDMA modulation format. After selecting the file, activate the TDMA format with the following command: :RADio:<desired format>:STATe On Keysight Signal Generators Programming Guide...
Page 371
RF output. 1. Set the carrier frequency to 2.5 GHz: :FREQuency:FIXed 2.5GHZ 2. Set the carrier power to –10.0 dBm: :POWer:LEVel -10.0DBM 3. Activate the modulation: :OUTPut:MODulation:STATe ON 4. Activate the RF output: :OUTPut:STATe ON Keysight Signal Generators Programming Guide...
The samples are treated as complex (I + jQ) and convolved with the filter coefficients which are specified as (I + jQ) in the time domain. The equalization filter can be turned on and off. Keysight Signal Generators Programming Guide...
On the N5162A, N5182A, E4438C, and E8267D, if a saved instrument state contains a reference to a waveform file, ensure that the waveform file resides in volatile memory before recalling the instrument state. For more information, see the User’s Guide. Keysight Signal Generators Programming Guide...
The Quit selection exists the program. The figure below shows the console interface and the results obtained after selecting the Restore State Files operation. The program uses VISA library functions. Refer to the Keysight VISA User’s Manual available on Keysight’s website: http:\\www.keysight.com for more information on VISA functions.
Page 375
// instrument state files are written to the local computer directory computer where the // State_Files.exe is located. This is a console application that uses DLL importing to // allow for calls to the unmanaged Keysight IO Library VISA DLL. Keysight Signal Generators Programming Guide...
Page 376
Creating and Downloading User–Data Files Save and Recall Instrument State Files // The Keysight VISA library must be installed on your computer for this example to run. // Important: Replace the visaOpenString with the IP address for your signal generator.
Page 377
VisaInterop.Close(device);// Close the device else Console.WriteLine("Unable to open " + visaOpenString); VisaInterop.Close(defaultRM); // Close the default resource manager else Console.WriteLine("Unable to open the VISA resource manager"); /* This method restores all the sequence/register state files located in Keysight Signal Generators Programming Guide...
Page 378
/* This method reads out all the sequence/register state files from the signal generator and stores them in your computer's local directory with a ".STA" extension */ static public void BackupInstrumentState(uint device) // Get the memory catalog for the state directory WriteDevice(device, "MEM:CAT:STAT?\n", false); Keysight Signal Generators Programming Guide...
Page 379
VisaInterop.SetAttribute(device, VisaAttribute.SendEndEnable, 0); uint retCount; VisaInterop.Write(device, buf, (uint)buf.Length, out retCount); if (!sendEnd) // Set the bool sendEnd true. VisaInterop.SetAttribute(device, VisaAttribute.SendEndEnable, 1); // This method reads an ASCII string from the specified device static public string ReadDevice(uint device) Keysight Signal Generators Programming Guide...
Page 380
0, (int)retCount); bytesRemaining -= retCount; // Done with file fs.Close(); /* The following method writes the contents of the specified file to the specified file in the form of a SCPI definite block. A newline is Keysight Signal Generators Programming Guide...
Page 381
VisaInterop.SetAttribute(device, VisaAttribute.SendEndEnable, 1); // Done with file fs.Close(); else // Send an empty definite block WriteDevice(device, "#10", false); // Declaration of VISA device access constants public enum VisaAccessMode NoLock = 0, ExclusiveLock = 1, SharedLock = 2, Keysight Signal Generators Programming Guide...
Page 382
VisaAttribute SendEndEnable = 0x3FFF0016, TimeoutValue = 0x3FFF001A // This class provides a way to call the unmanaged Keysight IO Library VISA C // functions from the C# application public class VisaInterop [DllImport("agvisa32.dll", EntryPoint="viClear")] public static extern int Clear(uint session);...
Page 383
SetAttribute(uint vi, VisaAttribute attribute, uint attrState); [DllImport("agvisa32.dll", EntryPoint="viStatusDesc")] public static extern int StatusDesc(uint vi, int status, byte[] desc); [DllImport("agvisa32.dll", EntryPoint="viWrite")] public static extern int Write( uint session, byte[] buf, uint count, out uint retCount); Keysight Signal Generators Programming Guide...
Figure 6-3 FlatCal Console Application The program uses VISA library functions. The non–formatted viWrite VISA function is used to output data to the signal generator. Refer to the Keysight VISA User’s Manual available on Keysight’s website: http:\\www.keysight.com for more information on VISA functions.
Page 385
// PROGRAM DESCRIPTION:C++ Console application to input frequency and amplitude // pairs and then download them to the signal generator. // NOTE: You must have the Keysight IO Libraries installed to run this program. // This example uses the LAN/TCPIP interface to download frequency and amplitude // correction pairs to the signal generator.
Page 386
//initialize the signal generator's user flatness table sprintf((char*)str,":corr:flat:pres\n"); //write to buffer viWrite(vi, str,strlen((char*str),0); //write to PSG char c = ',';//comma separator for SCPI command for (int j=0; j< num; j++) //download pairs to the PSG Keysight Signal Generators Programming Guide...
Page 387
//write command to the PSG //turn on corrections sprintf((char*)str, ":corr on\n"); viWrite(vi,str,strlen((char*)str),0"); printf("\nFlatness Corrections Enabled\n\n"); for (int k=0; k< lenArray; k++) delete [] pairsList[k];//free up memory delete [] pairsList;//free up memory viClose(vi);//close the sessions viClose(defaultRM); return 0; Keysight Signal Generators Programming Guide...
• The user file must be a multiple of 8 bits, so that it can be represented in ASCII characters. • Available volatile memory must be large enough to support both the data field bits and the framing bits. Keysight Signal Generators Programming Guide...
Possible Cause Pattern reset bit not set. The transmitted pattern is interspersed Insure that the pattern reset bit (bit 7, value 128) is set on the last byte of your with random, unwanted data. downloaded data. Keysight Signal Generators Programming Guide...
Page 390
1 = end of memory and restart memory playback. This bit is set to 0 for all bytes except the last byte of PRAM. To restart the pattern, set the last byte of PRAM to 1. Keysight Signal Generators Programming Guide...
• Downloads must be in list format. • Filters containing more symbols than the hardware allows (32 for real- time modulation filters, 512 for Arb Custom Modulation filters, and 256 for Equalization filters) will not be selectable for the configuration. Keysight Signal Generators Programming Guide...
Page 392
Creating and Downloading User–Data Files Data Transfer Troubleshooting (N5162A, N5182A, E4438C and E8267D Only) Keysight Signal Generators Programming Guide...
Page 393
Index Symbols status, monitoring 171 values 170 bits and bytes 215 .NET framework 365 byte order byte swapping 217 Numerics changing byte order 217 2’s complement data format 221 interleaving I/Q data 246 8757d GPIB addresses 115 pass-thru commands 114, 115 AC-coupled FM signals generating externally applied 96 abort function 79...
Page 394
FTP procedures 339 unencrypted files for extraction 359 DAC input values 218 IntuiLink for signal generators 214 data Keysight Signal Studio, Toolkit 214 binary, framed 328, 327 Waveform Download Assistant 214 encryption 235 waveform data format, e443xb signal generator 260...
Page 395
238, 239 filters I/Q files 235 See transition filters securewave directory esg 235 filter data Keysight mxg (only) 235 CDMA modulation 363 psg 235 custom modulation 363 waveform data 234 TDMA format 362 enter function 83 W-CDMA modulation 363...
Page 402
Keysight psg 319 securewave directory 235 memory, volatile (WFM1) 235 verifying waveforms 255 Version M types, signal generators 317 IO Libraries, Keysight 8 waveform 228 version M volatile memory available, SCPI query 322 IO Libraries, Keysight 5 VXI-11 117 viPrintf 82...
Page 403
257 verifying 255, 349 W-CDMA modulation data, FIR filter See FIR web server communicating with 11 esg 14 internal 340 Keysight mxg 14 Windows 2000 46, 6 98 5 ME 5 NT 5, 8 Vista Business 6 XP 6, 46...
Need help?
Do you have a question about the E4428C ESG RF and is the answer not in the manual?
Questions and answers