Agilent Technologies N5181A Programming Manual

Agilent Technologies N5181A Programming Manual

Signal generators
Hide thumbs Also See for N5181A:
Table of Contents

Advertisement

(With Remote Operation and File Downloads)
This guide applies to the following signal generator models:
N5181A/82A MXG RF Signal Generators
E4428C/38C ESG RF Signal Generators
E8257D/67D PSG Microwave Signal Generators
Due to our continuing efforts to improve our products through firmware and hardware revisions, signal generator design
and operation may vary from descriptions in this guide. We recommend that you use the latest revision of this guide to
ensure you have up-to-date product information. Compare the print date of this guide (see bottom of page) with the latest
revision, which can be downloaded from the following websites:
http://www.agilent.com/find/mxg
http://www.agilent.com/find/psg
Programming Guide
Agilent Technologies
Signal Generators
Manufacturing Part Number: E8251- 90355
Printed in USA
February 2008
© Copyright 2006- 2008 Agilent Technologies, Inc.
N5183A MXG Microwave Analog Signal Generator
E8663B RF Analog Signal Generator
http://www.agilent.com/find/esg
http://www.agilent.com/find/e8663b

Advertisement

Table of Contents
loading

Summary of Contents for Agilent Technologies N5181A

  • Page 1 Compare the print date of this guide (see bottom of page) with the latest revision, which can be downloaded from the following websites: http://www.agilent.com/find/mxg http://www.agilent.com/find/esg http://www.agilent.com/find/psg http://www.agilent.com/find/e8663b Manufacturing Part Number: E8251- 90355 Printed in USA February 2008 © Copyright 2006- 2008 Agilent Technologies, Inc.
  • Page 2 Notice The material contained in this document is provided “as is”, and is subject to being changed, without notice, in future editions. Further, to the maximum extent permitted by applicable law, Agilent disclaims all warranties, either express or implied with regard to this manual and to any of the Agilent products to which it pertains, including but not limited to the implied warranties of merchantability and fitness for a particular purpose.
  • Page 3: Table Of Contents

    Contents Getting Started with Remote Operation Programming and Software/Hardware Layers........2 Interfaces .
  • Page 4 Contents Selecting IO Libraries for RS- 232 ........45 Setting Up the RS- 232 Interface .
  • Page 5 Contents Generating a Swept Signal Using VISA and Visual C++ ......84 Saving and Recalling States Using VISA and C......88 Reading the Data Questionable Status Register Using VISA and C .
  • Page 6 Contents Data Questionable Modulation Status Group ......174 Data Questionable Calibration Status Group ......177 Data Questionable BERT Status Group .
  • Page 7 Contents Verifying the Waveform ..........226 Building and Playing Waveform Sequences .
  • Page 8 Contents SCPI Command for a Block Data Download ......315 Selecting a Downloaded PRAM File as the Data Source..... . . 318 Modulating and Activating the Carrier .
  • Page 9 Documentation Overview Installation Guide • Safety Information • Receiving the Instrument • Environmental & Electrical Requirements • Basic Setup • Accessories • Operation Verification • Regulatory Information User’s Guide • Instrument Overview • Front Panel Operation • Security • Basic Troubleshooting Programming Guide •...
  • Page 10 Agilent N518xA, E8663B, E44x8C, and E82x7D Signal Generators Programming Guide...
  • Page 11 Getting Started with Remote Operation • “Programming and Software/Hardware Layers” on page 2 • “Interfaces” on page 3 • “IO Libraries and Programming Languages” on page 5 • “Using the Web Browser” on page 10 • “Preferences” on page 16 •...
  • Page 12: Getting Started With Remote Operation

    Getting Started with Remote Operation Programming and Software/Hardware Layers Programming and Software/Hardware Layers Agilent MXG, ESG, PSG, and E8663B signal generators support the following interfaces: Instrument Interfaces Supported Agilent MXG GPIB, LAN, and USB 2.0 , and ANSI/EIA232 (RS- 232) serial GPIB, LAN Agilent E8663B connection...
  • Page 13: Interfaces

    Getting Started with Remote Operation Interfaces Figure 1-1 Software/Hardware Layers Interfaces GPIB GPIB is used extensively when a dedicated computer is available for remote control of each instrument or system. Data transfer is fast because GPIB handles information in bytes with data transfer rates of up to 8 MBps. GPIB is physically restricted by the location and distance between the instrument/system and the computer;...
  • Page 14 Getting Started with Remote Operation Interfaces Data transfer using the LAN is fast as the LAN handles packets of data. The single cable distance between a computer and the signal generator is limited to 100 meters (100Base- T and 10Base- T). The Agilent MXG is capable of 100Base- T LAN communication.
  • Page 15: Io Libraries And Programming Languages

    Getting Started with Remote Operation IO Libraries and Programming Languages IO Libraries and Programming Languages The IO libraries is a collection of functions used by a programming language to send instrument commands and receive instrument data. Before you can communicate and control the signal generator, you must have an IO library installed on your computer.
  • Page 16: Windows Nt And Agilent Io Libraries M (And Earlier)

    Getting Started with Remote Operation IO Libraries and Programming Languages NOTE Before setting the LAN interface, the signal generator must be configured for VXI- 11 SCPI. Refer to “Configuring the VXI- 11 for LAN (Agilent MXG)” on page 29 “Configuring the VXI- 11 for LAN (ESG/PSG/E8663B)”...
  • Page 17: Selecting Io Libraries For Gpib

    IO libraries. The following is a discussion on these libraries. CAUTION Because of the potential for portability problems, running Agilent SICL without the VISA overlay is not recommended by Agilent Technologies. Agilent N518xA, E8663B, E44x8C, and E82x7D Signal Generators Programming Guide...
  • Page 18: Selecting Io Libraries For Lan

    Getting Started with Remote Operation IO Libraries and Programming Languages VISA VISA is an IO library used to develop IO applications and instrument drivers that comply with industry standards. It is recommended that the VISA library be used for programming the signal generator. The NI- VISA and Agilent VISA libraries are similar implementations of VISA and have the same commands, syntax, and functions.
  • Page 19: Programming Languages

    Getting Started with Remote Operation IO Libraries and Programming Languages Programming Languages Along with Standard Commands for Programming Instructions (SCPI) and IO library functions, you use a programming language to remotely control the signal generator. Common programming languages include: • C/C++ •...
  • Page 20: Using The Web Browser

    Getting Started with Remote Operation Using the Web Browser Using the Web Browser The instrument can be accessed through a standard web browser, when it is connected to the LAN. To access through the web browser, enter the instrument IP address as the URL in your browser.
  • Page 21: Enabling The Signal Generator Web Server

    Getting Started with Remote Operation Using the Web Browser Enabling the Signal Generator Web Server NOTE Javascript or Active Scripts must be enabled to use the web front panel controls. 1. Turn on the Web server as shown below. Agilent MXG Web Server On If necessary toggle Web Server to For details on each key, use the key help.
  • Page 22 Getting Started with Remote Operation Using the Web Browser 2. Launch the PC or workstation web browser. 3. In the web browser address field, enter the signal generator’s IP address. For example, http://101.101.101.101 (where 101.101.101.101 is the signal generator’s IP address). The IP (internet protocol) address can change depending on the LAN configuration (see “Using LAN”...
  • Page 23 Getting Started with Remote Operation Using the Web Browser FTP enables the transfer of files between the instrument and a computer. The FTP access button provides drag- and- drop file capability. The FTP access softkey opens to show the folders containing the signal generator’s memory catalog files.
  • Page 24 Getting Started with Remote Operation Using the Web Browser LAN Configuration System Defaults (Agilent MXG) NOTE 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”...
  • Page 25 Getting Started with Remote Operation Using the Web Browser Table 1-1 LAN Configuration Summary Values Parameter Default TCP Keep Alive: <empty> Domain Name: TCP Keep Alive Timeout: 1800.0 sec Signal Generator Web Server Interface Description: Agilent <model_number>(<serial_number>) gpib0 SICL Interface Name Web Password: agilent a.The Domain Name defaults to a null field.
  • Page 26: Preferences

    Getting Started with Remote Operation Preferences Preferences The following commonly- used manual command sections are included here: “Configuring the Display for Remote Command Setups (Agilent MXG)” on page 17 “Configuring the Display for Remote Command Setups (ESG/PSG/E8663B)” on page 17 “Getting Help (Agilent MXG)”...
  • Page 27: Configuring The Display For Remote Command Setups (Agilent Mxg)

    Getting Started with Remote Operation Preferences Configuring the Display for Remote Command Setups (Agilent MXG) Select Update in Remote until On is highlighted. SCPI commands: :DISPlay:REMote ON|OFF|1|0 :DISPlay:REMote? For details on each key, use the key help (described in User’s Guide). Configuring the Display for Remote Command Setups (ESG/PSG/E8663B) SCPI commands: :DISPlay:REMote ON|OFF|1|0...
  • Page 28: Getting Help (Agilent Mxg)

    Getting Started with Remote Operation Preferences Getting Help (Agilent MXG) When you press Help: Help displays for the next key you press. Use the cursor keys, Page Up, Page Down, and the RPG knob to scroll the help text. Then press Cancel to close the help window or press any other key to close the help window and execute that key.
  • Page 29: Error Messages

    Getting Started with Remote Operation Error Messages Error Messages If an error condition occurs in the signal generator, it is reported to both the SCPI (remote interface) error queue and the front panel display error queue. These two queues are viewed and managed separately;...
  • Page 30: Error Message Types

    Getting Started with Remote Operation Error Messages Error Message Types Events generate only one type of error. For example, an event that generates a query error will not generate a device- specific, execution, or command error. Query Errors (–499 to –400) indicate that the instrument’s output queue control has detected a problem with the message exchange protocol described in IEEE 488.2, Chapter 6.
  • Page 31 Using IO Interfaces Using the programming examples with GPIB, LAN, RS- 232, and USB interfaces: • “Using GPIB” on page 22 • “Using LAN” on page 28 • “Using RS- 232 (ESG, PSG, and E8663B Only)” on page 45 • “Using USB (Agilent MXG)”...
  • Page 32: Using Io Interfaces

    Using IO Interfaces Using GPIB Using GPIB GPIB enables instruments to be connected together and controlled by a computer. GPIB and its associated interface operations are defined in the ANSI/IEEE Standard 488.1- 1987 and ANSI/IEEE Standard 488.2- 1992. See the IEEE website, http://www.ieee.org, for details on these standards. The following sections contain information for installing a GPIB interface card or NI- GPIB interface card for your PC or UNIX- based system.
  • Page 33 Using IO Interfaces Using GPIB Interface Operating IO Library Languages Backplane/ Max IO Buffering Type System (kB/sec) Agilent USB/GPIB Interface Converter for PC- Based Systems Agilent 82350B Windows VISA / SICL C/C++, Visual PCI 32 bit > 900 Built- in for PCI bus 98(SE)/ME/2000 Basic, Agilent...
  • Page 34: Set Up The Gpib Interface

    Using IO Interfaces Using GPIB Set Up the GPIB Interface For the Agilent MXG refer to Figure 2- 1 and for the ESG, PSG, and E8663B, Figure 2- 2 on page Figure 2-1 Setting the GPIB Address on the Agilent MXG SCPI commands: :SYSTem:COMMunicate:GPIB:ADDRess <number>...
  • Page 35: Verify Gpib Functionality

    Using IO Interfaces Using GPIB Connect a GPIB interface cable between the signal generator and the computer. (The following table lists cable part numbers.) Model 10833A 10833B 10833C 10833D 10833F 10833G Length 1 meter 2 meters 4 meters .5 meter 6 meters 8 meters Verify GPIB Functionality...
  • Page 36: Gpib Programming Interface Examples

    Using IO Interfaces GPIB Programming Interface Examples GPIB Programming Interface Examples NOTE The portions of the programming examples discussed in this section are taken from the full text of these programs that can be found in Chapter 3, “Programming Examples.” •...
  • Page 37 Using IO Interfaces GPIB Programming Interface Examples #include "stdafx.h" #include <iostream> #include "windows.h" #include "Decl-32.h" using namespace std; int GPIB0= // Board handle Addr4882_t Address[31]; // Declares an array of type Addr4882_t int main(void) int sig; // Declares a device descriptor variable sig = ibdev(0, 19, 0, 13, 1, 0);...
  • Page 38: Using Lan

    Using IO Interfaces Using LAN Using LAN The Agilent 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.
  • Page 39: Setting Up The Lan Interface

    Using IO Interfaces Using LAN Setting Up the LAN Interface For LAN operation, the signal generator must be connected to the LAN, and an IP address must be assigned to the signal generator either manually or by using DHCP client service. Your system administrator can tell you which method to use.
  • Page 40 Using IO Interfaces Using LAN Configuring the VXI-11 for LAN (ESG/PSG/E8663B) Utility > GPIB/RS-232 For details on each key, use the Key and Data Field Reference. For additional SCPI command information, refer to the SCPI Command Reference. 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. (Default condition is On.) Use a 10Base-T LAN cable to connect the signal generator to the LAN.Where auto-negotiation is present, the ESG, PSG, or E8663B can connect to 100Base-T LAN, but will communicate at 10Base-T speeds.
  • Page 41 Using IO Interfaces Using LAN Manually Configuring the Agilent 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 42 Using IO Interfaces Using LAN DHCP Configuration If the DHCP server uses dynamic DNS to link the hostname with the assigned IP address, the hostname may be used in place of the IP address. Otherwise, the hostname is not usable. For more information on the DHCP configuration, refer to “Configuring the DHCP LAN (Agilent MXG)”...
  • Page 43 Using IO Interfaces Using LAN Configuring the DHCP LAN (Agilent 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.
  • Page 44: Setting Up Private Lan

    Using IO Interfaces Using LAN Setting up Private LAN You can connect the Agilent MXG, ESG, PSG or E8663B 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 45 Using IO Interfaces Using LAN For additional information on troubleshooting your LAN connection, refer to the Help in the Agilent IO Libraries and documentation for LAN connections and problems. Table 2-1 Ping Responses Normal Response for UNIX A normal response to the ping command will be a total of 9 or 10 packets received with a minimal average round- trip time.
  • Page 46 Using IO Interfaces Using LAN NOTE The following sections are specific to Agilent IO Libraries versions M and earlier and apply only to the Windows NT platform. Using VISA Assistant Use the VISA Assistant, available with the Agilent IO Library versions M and earlier, to communicate with the signal generator over the LAN interface.
  • Page 47: Using Vxi-11

    Using IO Interfaces Using LAN Figure 2-3 IO Config Form (Windows NT) Check to see that the Default Protocol is set to Automatic. 1. Run the IO Config program 2. Click on TCPIP in the Configured Interfaces text box. If there is no TCPIP0 in the box, follow the steps shown in the section “Using VISA Assistant”...
  • Page 48 Using IO Interfaces Using LAN Configuring for VXI-11 The Agilent IO library has a program, IO Config, that is used to setup the computer/signal generator interface for the VXI- 11 protocol. Download the latest version of the Agilent IO library from the Agilent website.
  • Page 49: Using Sockets Lan

    Using IO Interfaces Using LAN 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. Sockets LAN is a method used to communicate with the signal generator over the LAN interface using the Transmission Control Protocol/Internet Protocol (TCP/IP).
  • Page 50 Using IO Interfaces Using LAN NOTE The Windows 2000 operating systems use a command prompt style interface for the Telnet client. Refer to the Figure 2- 7 on page 42 for an example of this interface. Windows XP operating systems and newer can use this section to better understand how to use the signal generator with port settings.
  • Page 51 Using IO Interfaces Using LAN Using Telnet On a PC With a Host/Port Setting Menu GUI 1. On your PC, click Start > Run. 2. Type telnet then click the OK button. The Telnet connection screen will be displayed. 3. Click on the Connect menu then select Remote System. A connection form is displayed. See Figure 4.
  • Page 52 Using IO Interfaces Using LAN Figure 2-7 Telnet 2000 Window The Standard UNIX Telnet Command Synopsis telnet [host [port]] Description This command is used to communicate with another host using the Telnet protocol. When the command telnet is invoked with host or port arguments, a connection is opened to the host, and input is sent from the user to the host.
  • Page 53: Using Ftp

    For example, Ctrl-],where the control key and the ] are pressed at the same time. The following example shows Telnet commands: $ telnet myinstrument 5023 Trying..Connected to signal generator Escape character is ‘^]’. Agilent Technologies, E44xx SN-US00000001 Firmware: Hostname: your instrument IP :xxx.xx.xxx.xxx SCPI> Using FTP FTP allows users to transfer files between the signal generator and any computer connected to the LAN.
  • Page 54 Using IO Interfaces Using LAN Figure 2-8 FTP Screen The following steps outline a sample FTP session from the MS- DOS Command Prompt: 1. On the PC click Start > Programs > Command Prompt. 2. At the command prompt enter: ftp <...
  • Page 55: Using Rs-232 (Esg, Psg, And E8663B Only)

    Agilent’s website, http://www.agilent.com. The following is a discussion on these libraries. CAUTION Because of the potential for portability problems, running Agilent SICL without the VISA overlay is not recommended by Agilent Technologies. HP Basic The HP Basic language has an extensive IO library that can be used to control the signal generator over the RS- 232 interface.
  • Page 56: Setting Up The Rs-232 Interface

    Using IO Interfaces Using RS-232 (ESG, PSG, and E8663B Only) SICL Agilent SICL can be used to develop applications for the RS- 232 interface. See Agilent’s website for information on SICL. Setting Up the RS-232 Interface 1. Setting the RS- 232 Interface Baud Rate (ESG/PSG/E8663B) Select a baud rate of 9600.
  • Page 57 Using IO Interfaces Using RS-232 (ESG, PSG, and E8663B Only) 2. Setting the RS- 232 Echo Softkey Toggle RS-232 Echo Off On until Off is highlighted. Selecting On echoes or returns characters sent to the signal generator and prints them to the display. SCPI commands: :SYSTem:COMMunicate:SERial:ECHO ON|OFF :SYSTem:COMMunicate:SERial:ECHO?
  • Page 58: Verifying Rs-232 Functionality

    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: Agilent Technologies <instrument model name and number>, US40000001,C.02.00 Agilent N518xA, E8663B, E44x8C, and E82x7D Signal Generators Programming Guide...
  • Page 59: Character Format Parameters

    Using IO Interfaces Using RS-232 (ESG, PSG, and E8663B Only) Character Format Parameters The signal generator uses the following character format parameters when communicating via RS- 232: • Character Length: Eight data bits are used for each character, excluding start, stop, and parity bits.
  • Page 60: Rs-232 Programming Interface Examples

    Using IO Interfaces RS-232 Programming Interface Examples RS-232 Programming Interface Examples NOTE The portions of the programming examples discussed in this section are taken from the full text of these programs that can be found in Chapter 3, “Programming Examples.” •...
  • Page 61: Interface Check Using Visa And C

    Using IO Interfaces RS-232 Programming Interface Examples Interface Check Using VISA and C This portion of the example program “Interface Check Using VISA and C” on page 51, uses VISA library functions to communicate with the signal generator. The program verifies that the RS- 232 connections and interface are functional.
  • Page 62: Queries For Rs-232 Using Visa And C

    Using IO Interfaces RS-232 Programming Interface Examples Queries for RS-232 Using VISA and C This portion of the example program “Queries for RS- 232 Using VISA and C” on page 52, uses VISA library functions to communicate with the signal generator. The program verifies that the RS- 232 connections and interface are functional.
  • Page 63: Using Usb (Agilent Mxg)

    Expert in the Agilent IO Libraries Help. USB 2.0 connectors can be used to communicate with the signal generator. The N5181A/82A is equipped with a Mini- B 5 pin rear panel connector (device USB). Use a Type- A to Mini- USB 5 pin cable to connect the signal generator to the computer (Refer to “Setting Up the USB Interface”...
  • Page 64: Selecting I/O Libraries For Usb

    Agilent SICL can be used to develop applications for the USB interface. See Agilent’s website for information on SICL. CAUTION Because of the potential for portability problems, running Agilent SICL without the VISA overlay is not recommended by Agilent Technologies. Agilent N518xA, E8663B, E44x8C, and E82x7D Signal Generators Programming Guide...
  • Page 65: Setting Up The Usb Interface

    Using IO Interfaces Using USB (Agilent MXG) Setting Up the USB Interface Rear Panel Interface (Mini–B 5 pin) To use USB, connect the USB cable (Refer to Table 2- 3, “USB Interface Cable,” on page 55, for USB cable information.) between the computer and the signal generator’s rear panel Mini- B 5- pin USB connector.
  • Page 66 Using IO Interfaces Using USB (Agilent MXG) Verifying USB Functionality Mini-B 5 Pin Rear Panel Connector NOTE For information on verifying your Mini- B 5 pin USB (rear panel) functionality, refer to the Agilent Connection Expert in the Agilent IO Libraries Help. The Agilent IO libraries are included with your signal generator or Agilent GPIB interface board, or they can be downloaded from the Agilent website: http://www.agilent.com.
  • Page 67: Programming Examples

    Programming Examples • “Using the Programming Interface Examples” on page 58 • “GPIB Programming Interface Examples” on page 62 • “LAN Programming Interface Examples” on page 101 • “RS- 232 Programming Interface Examples (ESG/PSG/E8663B Only)” on page 131 Agilent N518xA, E8663B, E44x8C, and E82x7D Signal Generators Programming Guide...
  • Page 68: Using The Programming Interface Examples

    Programming Examples Using the Programming Interface Examples Using the Programming Interface Examples The programming examples for remote control of the signal generator use the GPIB, LAN, and RS- 232 interfaces and demonstrate instrument control using different IO libraries and programming languages.
  • Page 69: Running C++ Programs

    Programming Examples Using the Programming Interface Examples Running C++ Programs When using Microsoft Visual C++ 6.0 to run the example programs, include the following files in your project. When using the VISA library: • add the visa32.lib file to the Resource Files •...
  • Page 70: Running C# Examples

    Programming Examples Using the Programming Interface Examples Running C# Examples To run the example program State_Files.cs on page 326, you must have the .NET framework installed on your computer. You must also have the Agilent IO Libraries installed on your computer. The .NET framework can be downloaded from the Microsoft website.
  • Page 71: Running Java Examples

    Programming Examples Using the Programming Interface Examples You can start a new Standard EXE project and add the required references. Once the required references are included, you can copy the example programs into your project and add a command button to Form1 that will call the program. The example Visual Basic 6.0 programs are available on the signal generator Documentation CD- ROM, enabling you to cut and paste the examples into your project.
  • Page 72: Using Gpib

    Programming Examples Using GPIB Using GPIB GPIB enables instruments to be connected together and controlled by a computer. GPIB and its associated interface operations are defined in the ANSI/IEEE Standard 488.1- 1987 and ANSI/IEEE Standard 488.2- 1992. See the IEEE website, http://www.ieee.org, for details on these standards. The following sections contain information for installing a GPIB interface card or NI- GPIB interface card for your PC or UNIX- based system.
  • Page 73: Gpib Function Statements (Command Messages)

    Programming Examples GPIB Programming Interface Examples GPIB Function Statements (Command Messages) Function statements are the basis for GPIB programming and instrument control. These function statements, combined with SCPI, provide management and data communication for the GPIB interface and the signal generator. This section describes functions used by different IO libraries.
  • Page 74 Programming Examples GPIB Programming Interface Examples Library Function Statement Initialization Command SICL The Agilent 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 75 Programming Examples GPIB Programming Interface Examples Library Function Statement Initialization Command NI- 488.2 The NI- 488.2 library function places the interface in local ibloc (int ud) mode and allows operation of the signal generator’s front panel keys. The ud parameter in the parameter list is the interface or device descriptor.
  • Page 76: Interface Check Using Hp Basic And Gpib

    Programming Examples GPIB Programming Interface Examples Library Function Statement Initialization Command NI- 488.2 The NI- 488.2 library function addresses the GPIB and writes ibwrt(parameter list) data to the signal generator. The parameter list includes the instrument address, session id, and the data to send. SICL The Agilent SICL function converts data using the format iprintf (parameter...
  • Page 77: Interface Check Using Ni-488.2 And C

    Programming Examples GPIB Programming Interface Examples PROGRAM NAME: basicex1.txt PROGRAM DESCRIPTION: This program verifies that the GPIB connections and interface are functional. Connect a controller to the signal generator using a GPIB cable. CLEAR and RESET the controller and type in the following commands and then RUN the program: !****************************************************************************** Sig_gen=719...
  • Page 78: Interface Check For Gpib Using Visa And C

    Programming Examples GPIB Programming Interface Examples // 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"...
  • Page 79: Local Lockout Using Hp Basic And Gpib

    Programming Examples GPIB Programming Interface Examples // 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"...
  • Page 80 Programming Examples GPIB Programming Interface Examples The following program example is available on the signal generator Documentation CD- ROM as basicex2.txt. !************************************************************************* PROGRAM NAME: basicex2.txt PROGRAM DESCRIPTION: In REMOTE mode, access to the signal generators functional front panel keys are disabled except for the Local and Contrast keys.
  • Page 81: Local Lockout Using Ni-488.2 And C

    Programming Examples GPIB Programming Interface Examples Local Lockout Using NI-488.2 and C++ This example uses the NI- 488.2 library to set the signal generator local lockout mode. Launch Microsoft Visual C++ 6.0, add the required files, and enter the following code into your .cpp source file.
  • Page 82: Queries Using Hp Basic And Gpib

    Programming Examples GPIB Programming Interface Examples SetRWLS(GPIB0, Address); // Places device in Remote with Lockout State. cout<< "The signal generator should now be in LOCAL LOCKOUT. Verify that all keys"<<endl; cout<< "including the 'Local' key are disabled (Contrast keys are not affected)"<<endl;...
  • Page 83: Queries Using Ni-488.2 And Visual C

    Programming Examples GPIB Programming Interface Examples PRINT "Present source CW frequency is: ";F/1.E+6;"MHz" PRINT OUTPUT Sig_gen;"POW:AMPL?" ! Querys the signal generator power level ENTER Sig_gen;W ! Enter the power level ! Print power level to the controller display PRINT "Current power setting is: ";W;"dBM" PRINT OUTPUT Sig_gen;"FREQ:MODE?"...
  • Page 84 Programming Examples GPIB Programming Interface Examples • resets the signal generator • queries the signal generator for various settings • reads the various settings The following program example is available on the signal generator Documentation CD- ROM as niex3.cpp. //************************************************************************************* // PROGRAM NAME: niex3.cpp // PROGRAM DESCRIPTION: This example demonstrates the use of query commands.
  • Page 85: Queries For Gpib Using Visa And C

    Programming Examples GPIB Programming Interface Examples rdVal[ibcntl] = '\0'; // Null character indicating end of array // Prints signal generator power level cout<<"Source power (dBm) is : "<<rdVal; cout<<"Press any key to continue"<<endl; cin.ignore(10000,'\n'); ibwrt(sig, ":FREQ:MODE?",11); // Querys source frequency mode ibrd(sig, rdVal,100);...
  • Page 86 Programming Examples GPIB Programming Interface Examples • resets the signal generator • queries the instrument (CW frequency, power level, frequency mode, and RF state) • reads responses into the rdBuffer (CW frequency, power level, and frequency mode) • turns signal generator RF state off •...
  • Page 87: Generating A Cw Signal Using Visa And C

    Programming Examples GPIB Programming Interface Examples viScanf(vi, "%t", rdBuffer); // Reads response into rdBuffer // Prints the source frequency printf("Source CW frequency is : %s\n", rdBuffer); printf("Press any key to continue\n"); printf("\n"); // Prints new line character to the display getch();...
  • Page 88 Programming Examples GPIB Programming Interface Examples • turns signal generator RF state off • verifies RF state off The following program example is available on the signal generator Documentation CD- ROM as visaex4.cpp. //**************************************************************************************** // PROGRAM FILE NAME: visaex4.cpp // PROGRAM DESCRIPTION: This example demonstrates query commands. The signal generator // frequency and power level.
  • Page 89: Generating An Externally Applied Ac-Coupled Fm Signal Using Visa And C

    Programming Examples GPIB Programming Interface Examples viPrintf(vi, "FREQ:CW?\n"); // Query the CW frequency viScanf(vi, "%t", rdBuffer); // Read signal generator response printf("Source CW frequency is : %s\n", rdBuffer); // Print the frequency viPrintf(vi, "POW:AMPL -2.3 dBm\n"); // Set the power level to -2.3 dBm viPrintf(vi, "POW:AMPL?\n");...
  • Page 90 Programming Examples GPIB Programming Interface Examples Launch Microsoft Visual C++ 6.0, add the required files, and enter the code into your .cpp source file. visaex5.cpp performs the following functions: • error checking • resets the signal generator • sets up the EXT 2 connector on the signal generator for FM •...
  • Page 91: Generating An Internal Fm Signal Using Visa And C

    Programming Examples GPIB Programming Interface Examples printf("Example program to set up the signal generator\n"); printf("for an AC-coupled FM signal\n"); printf("Press any key to continue\n"); printf("\n"); getch(); printf("\n"); viPrintf(vi, "*RST\n"); // Resets the signal generator viPrintf(vi, "FM:SOUR EXT2\n"); // Sets EXT 2 source for FM viPrintf(vi, "FM:EXT2:COUP AC\n");...
  • Page 92 Programming Examples GPIB Programming Interface Examples // PROGRAM FILE NAME:visaex6.cpp // 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>...
  • Page 93: Generating A Step-Swept Signal Using Visa And C

    Programming Examples GPIB Programming Interface Examples viPrintf(vi, "OUTP:STAT ON\n"); // Turns on RF output printf("\n"); // Prints a carriage return // Print user information printf("Power level : -15 dBm\n"); printf("FM state : on\n"); printf("RF output : on\n"); printf("Carrier Frequency : 900 MHZ\n"); printf("Deviation : 100 kHZ\n");...
  • Page 94: Generating A Swept Signal Using Visa And Visual C

    Programming Examples GPIB Programming Interface Examples ViSession defaultRM, vi;// Declares variables of type ViSession // vi establishes instrument communication ViStatus viStatus = 0;// Declares a variable of type ViStatus // 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);...
  • Page 95 Programming Examples GPIB Programming Interface Examples and a .01 second dwell period for each point. A loop is used to generator 5 sweep operations. The signal generator triggers each sweep with the :INIT command. There is a wait introduced in the loop to allow the signal generator to complete all operations such as set up and retrace before the next sweep is generated.
  • Page 96 Programming Examples GPIB Programming Interface Examples 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 // sweep from 1-2 GHz. A loop and counter are used to generate 5 sweeps. // Each sweep consists of 101 points with a .01 second dwell at each point.
  • Page 97 Programming Examples GPIB Programming Interface Examples // 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 stat = viPrintf(inst, "SWEEP:POINTS %d\n", npoints);...
  • Page 98: Saving And Recalling States Using Visa And C

    Programming Examples GPIB Programming Interface Examples 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. Launch Microsoft Visual C++ 6.0, add the required files, and enter the following code into your .cpp source file.
  • Page 99 Programming Examples GPIB Programming Interface Examples // 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); if(viStatus){// If problems, then prompt user printf("Could not open ViSession!\n");...
  • Page 100: Reading The Data Questionable Status Register Using Visa And C

    Programming Examples GPIB Programming Interface Examples lngDone=0; // 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 printf("The signal generator has been returned to it's Register #1 state\n");...
  • Page 101 Programming Examples GPIB Programming Interface Examples // PROGRAM DESCRIPTION:In this example, the data questionable status register is read. // The data questionable status register is enabled to read an unleveled condition. // The signal generator is then set up for an unleveled condition and the data // questionable status register read.
  • Page 102 Programming Examples GPIB Programming Interface Examples 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"); getch(); // Waits for keyboard user input viPrintf(vi, "STAT:QUES:POW:ENAB 2\n");...
  • Page 103 Programming Examples GPIB Programming Interface Examples 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 // bits '0','1','2','3' and viPrintf(vi, "STAT:QUES:MOD:COND?\n"); // Querys the register for any // set bits viScanf(vi, "%s", rdBuffer);...
  • Page 104: Reading The Service Request Interrupt (Srq) Using Visa And C

    Programming Examples GPIB Programming Interface Examples Reading the Service Request Interrupt (SRQ) Using VISA and C This example demonstrates use of the Service Request (SRQ) interrupt. By using the SRQ, the computer can attend to other tasks while the signal generator is busy performing a function or operation.
  • Page 105 Programming Examples GPIB Programming Interface Examples #include "windows.h" #include <conio.h> #define MAX_CNT 1024 int sweep=1; // End of sweep flag /* Prototypes */ ViStatus _VI_FUNCH interupt(ViSession vi, ViEventType eventType, ViEvent event, ViAddr addr); int main () ViSession defaultRM, vi;// Declares variables of type ViSession // for instrument communication ViStatus viStatus = 0;// Declares a variable of type ViStatus // for GPIB verifications...
  • Page 106 Programming Examples GPIB Programming Interface Examples printf("Press Enter to continue\n"); printf("\n"); getch(); viPrintf(vi, "*CLS\n");// Clears signal generator status byte viPrintf(vi, "STAT:OPER:NTR 8\n");// Sets the Operation Status Group // Negative Transition Filter to indicate a // negative transition in Bit 3 (Sweeping) // which will set a corresponding event in // the Operation Event Register.
  • Page 107 Programming Examples GPIB Programming Interface Examples viStatus = viDisableEvent(vi, VI_ALL_ENABLED_EVENTS,VI_ALL_MECH); viStatus = viUninstallHandler(vi, VI_EVENT_SERVICE_REQ, interupt, rdBuffer); viStatus = viClose(vi); viStatus = viClose(defaultRM); return 0; // The following function is called when an SRQ event occurs. Code specific to your // requirements would be entered in the body of the function. ViStatus _VI_FUNCH interupt(ViSession vi, ViEventType eventType, ViEvent event, ViAddr addr) ViStatus status;...
  • Page 108: Using 8757D Pass-Thru Commands (Psg With Option 007 Only)

    Programming Examples GPIB Programming Interface Examples Using 8757D Pass-Thru Commands (PSG with Option 007 Only) Pass- thru commands enable you to send operating instructions to a PSG that is connected to a 8757D scalar analyzer system. This section provides setup information and an example program for using pass- thru commands in a ramp sweep system.
  • Page 109 Programming Examples GPIB Programming Interface Examples GPIB Address Assignments Figure 3- 1 describes how GPIB addresses should be assigned for sending pass- thru commands. These are the same addresses used in Example 3- Table 3-1 Instrument GPIB Key Presses/Description Address Press Utility >...
  • Page 110 Programming Examples GPIB Programming Interface Examples 40 OUTPUT 717;"SYST:LANG SCPI";END 50 WAIT .5 60 OUTPUT 717;"OUTP:STAT OFF" 70 OUTPUT 717;"*OPC?" 80 ENTER 717; Reply 90 OUTPUT 717;"SYST:LANG COMP";END 100 WAIT .5 110 OUTPUT 716;"C2" 120 END Setting the PSG Sweep Time Requirements (PSG with Firmware ≥4.92) By default, the PSG sweep time is automatically adjusted to the fastest possible sweep when exiting Pass- Thru mode.
  • Page 111: Lan Programming Interface Examples

    Programming Examples LAN Programming Interface Examples 115 OUTPUT 717;”RC1” LAN Programming Interface Examples NOTE The LAN programming examples in this section demonstrate the use of VXI- 11 and Sockets LAN to control the signal generator. To use these programming examples you must change references to the IP address and hostname to match the IP address and hostname of your signal generator.
  • Page 112: Vxi-11 Programming Using Sicl And C

    Programming Examples LAN Programming Interface Examples 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 Agilent IO Libraries IO Config utility. vxisicl.cpp performs the following functions: •...
  • Page 113: Vxi-11 Programming Using Visa And C

    Programming Examples LAN Programming Interface Examples // Open SICL instrument handle using VXI-11 protocol sprintf(instNameBuf, "lan[%s]:inst0", instrumentName); id = iopen(instNameBuf);// Open instrument session itimeout(id, 1000);// Set 1 second timeout for operations printf("Setting frequency to 1 Ghz...\n"); iprintf(id, "freq 1 GHz\n");// Set frequency to 1 GHz printf("Waiting for source to settle...\n");...
  • Page 114 Programming Examples LAN Programming Interface Examples // NOTE: You must have the Agilent 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.
  • Page 115: Sockets Lan Programming And C

    Programming Examples LAN Programming Interface Examples status = viWrite(instr, (ViBuf)"*IDN?\n", 6, &retCount); // Read the sig gen response status = viRead(instr, (ViBuf)buffer, MAX_COUNT, &retCount); buffer[retCount]= '\0'; // Indicate the end of the string printf("Signal Generator ID = "); // Print header for ID printf(buffer);...
  • Page 116 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: Agilent 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 117: Queries For Lan Using Sockets

    Programming Examples LAN Programming Interface Examples 5. After you cd to the directory where the lanio.exe file is located, type in the following command at the command prompt: lanio xxxxx “*IDN?”. For example: C:\SocketIO\Lanio\Debug>lanio xxxxx “*IDN?” where the xxxxx is the hostname of your signal generator.
  • Page 118 Programming Examples LAN Programming Interface Examples • error checks • queries signal generator for ID • sets frequency on signal generator to 2.5 GHz • sets power on signal generator to –5 dBm • gets option letter from argument vector and checks for end of file (EOF) The following programming examples are available on the signal generator Documentation CD- ROM as lanio.c and getopt.c.
  • Page 119 Programming Examples LAN Programming Interface Examples - Windows 95, using Microsoft Visual C++ 4.0 Standard Edition - Windows NT 3.51, using Microsoft Visual C++ 4.0 + Be sure to add WSOCK32.LIB to your list of libraries! + Compile both lanio.c and getopt.c + Consider re-naming the files to lanio.cpp and getopt.cpp Considerations: - On UNIX systems, file I/O can be used on network sockets.
  • Page 120 Programming Examples LAN Programming Interface Examples #else /* UNIX with BSD sockets */ include <sys/socket.h> /* for connect and socket*/ include <netinet/in.h> /* for sockaddr_in include <netdb.h> /* for gethostbyname define SOCKET_ERROR (-1) define INVALID_SOCKET (-1) typedef int SOCKET; #endif /* WINSOCK */ #ifdef WINSOCK /* Declared in getopt.c.
  • Page 121 Programming Examples LAN Programming Interface Examples #ifdef WINSOCK int init_winsock(void) WORD wVersionRequested; WSADATA wsaData; int err; wVersionRequested = MAKEWORD(1, 1); wVersionRequested = MAKEWORD(2, 0); err = WSAStartup(wVersionRequested, &wsaData); if (err != 0) { /* Tell the user that we couldn't find a useable */ /* winsock.dll.
  • Page 122 Programming Examples LAN Programming Interface Examples * $Return: (int) ..A file descriptor similar to open(1).$ * $Errors: returns -1 if anything goes wrong $ ***************************************************************************/ SOCKET openSocket(const char *hostname, int portNumber) struct hostent *hostPtr; struct sockaddr_in peeraddr_in;...
  • Page 123 Programming Examples LAN Programming Interface Examples fprintf(stderr,"unable to create socket to '%s': %s\n", hostname, strerror(errno)); return INVALID_SOCKET; return s; /*************************************************************************** > $Function: commandInstrument$ * $Description: send a SCPI command to the instrument.$ * $Parameters: (FILE *) ..file pointer associated with TCP/IP socket. (const char *command) .
  • Page 124 Programming Examples LAN Programming Interface Examples /************************************************************************** * recv_line(): similar to fgets(), but uses recv() **************************************************************************/ char * recv_line(SOCKET sock, char * result, int maxLength) #ifdef WINSOCK int cur_length = 0; int count; char * ptr = result; int err = 1; while (cur_length <...
  • Page 125 Programming Examples LAN Programming Interface Examples * Simpler UNIX version, using file I/O. recv() version works too. * This demonstrates how to use file I/O on sockets, in UNIX. ***********************************************************************/ FILE * instFile; instFile = fdopen(sock, "r+"); if (instFile == NULL) fprintf(stderr, "Unable to create FILE * structure : %s\n", strerror(errno));...
  • Page 126 Programming Examples LAN Programming Interface Examples /********************************************************* * Send command to signal generator *********************************************************/ command_err = commandInstrument(sock, command); if (command_err) return COMMAND_ERROR; /********************************************************* * Read response from signal generator ********************************************************/ count = recv(sock, tmp_buf, 1, 0); /* read 1 char */ ch = tmp_buf[0];...
  • Page 127 Programming Examples LAN Programming Interface Examples numBytes = atol(result); if (numBytes) resultBytes = 0; /* Loop until we get all the bytes we requested. */ /* Each call seems to return up to 1457 bytes, on HP-UX 9.05 */ do { int rcount;...
  • Page 128 Programming Examples LAN Programming Interface Examples if (recv_line(sock, result+1, maxLength-1) == NULL) return 0; /* REMOVE trailing newline, if present. And terminate string. */ resultBytes = strlen(result); if (result[resultBytes-1] == '\n') resultBytes -= 1; result[resultBytes] = '\0'; } while (0); return resultBytes;...
  • Page 129 Programming Examples LAN Programming Interface Examples puts(result_str); } while (1); /*************************************************************************** > $Function: isQuery$ * $Description: Test current SCPI command to see if it a query. $ * $Return: (unsigned char) . . . non-zero if command is a query. 0 if not.
  • Page 130 Programming Examples LAN Programming Interface Examples if ( *query != ')' ) q = 1 ; return q ; /*************************************************************************** > $Function: main$ * $Description: Read command line arguments, and talk to signal generator. Send query results to stdout. $ * $Return: (int) .
  • Page 131 Programming Examples LAN Programming Interface Examples case 'n': number = 1; break ; case 'e': show_errs = 1; break ; case 'u': case '?': usage(basename); exit(1) ; /* now look for hostname and optional <command>*/ if (optind < argc) destination = argv[optind++] ; strcpy(command, "");...
  • Page 132 Programming Examples LAN Programming Interface Examples /****************************************************** /* open a socket connection to the instrument /******************************************************/ #ifdef WINSOCK if (init_winsock() != 0) { exit(1); #endif /* WINSOCK */ instSock = openSocket(destination, SCPI_PORT); if (instSock == INVALID_SOCKET) { fprintf(stderr, "Unable to open socket.\n"); return 1;...
  • Page 133 Programming Examples LAN Programming Interface Examples /* read a line from <stdin> */ while ( gets(charBuf) != NULL ) if ( !strlen(charBuf) ) continue ; if ( *charBuf == '#' || *charBuf == '!' ) continue ; strcat(charBuf, "\n"); if (!quiet) if (number) char num[10];...
  • Page 134 Programming Examples LAN Programming Interface Examples commandInstrument(instSock, charBuf); if (number) number++; if (show_errs) { showErrors(instSock); #ifdef WINSOCK closesocket(instSock); close_winsock(); #else close(instSock); #endif /* WINSOCK */ return 0; /* End of lanio.cpp /**************************************************************************/ /* $Function: main1$ /* $Description: Output a series of SCPI commands to the signal generator */ Send query results to stdout.
  • Page 135 Programming Examples LAN Programming Interface Examples char *charBuf = (char *) malloc(INPUT_BUF_SIZE); /*********************************************/ /* open a socket connection to the instrument*/ /*********************************************/ #ifdef WINSOCK if (init_winsock() != 0) { exit(1); #endif /* WINSOCK */ instSock = openSocket("xxxxxx", SCPI_PORT); /* Put your hostname here */ if (instSock == INVALID_SOCKET) { fprintf(stderr, "Unable to open socket.\n");...
  • Page 136 Programming Examples LAN Programming Interface Examples getopt(3C) getopt(3C) PROGRAM FILE NAME: getopt.c getopt - get option letter from argument vector SYNOPSIS int getopt(int argc, char * const argv[], const char *optstring); extern char *optarg; extern int optind, opterr, optopt; PRORGAM DESCRIPTION: getopt returns the next option letter in argv (starting from argv[1]) that matches a letter in optstring.
  • Page 137 Programming Examples LAN Programming Interface Examples optarg = NULL; if (scan == NULL || *scan == '\0') { if (optind == 0) optind++; if (optind >= argc || argv[optind][0] != '-' || argv[optind][1] == '\0') return(EOF); if (strcmp(argv[optind], "--")==0) { optind++;...
  • Page 138: Sockets Lan Programming Using Java

    Programming Examples LAN Programming Interface Examples Sockets LAN Programming Using Java In this example the Java program connects to the signal generator via sockets LAN. This program requires Java version 1.1 or later be installed on your PC. To run the program perform the following steps: 1.
  • Page 139 Programming Examples LAN Programming Interface Examples new OutputStreamWriter(t.getOutputStream())); BufferedReader in = new BufferedReader( new InputStreamReader(t.getInputStream())); System.out.println("Setting frequency to 1 GHz..."); out.write("freq 1GHz\n"); // Sets frequency out.flush(); System.out.println("Waiting for source to settle..."); out.write("*opc?\n"); // Waits for completion out.flush(); String opcResponse = in.readLine(); if (!opcResponse.equals("1")) System.err.println("Invalid response to '*OPC?'!");...
  • Page 140: Sockets Lan Programming Using Perl

    Programming Examples LAN Programming Interface Examples Sockets LAN Programming Using PERL This example uses PERL to control the signal generator over the sockets LAN interface. The signal generator frequency is set to 1 GHz, queried for operation complete and then queried for it’s identify string.
  • Page 141: Programming Interface Examples (Esg/Psg/E8663B Only)

    Programming Examples RS-232 Programming Interface Examples (ESG/PSG/E8663B Only) # Send identification query print $sock "*IDN?\n"; $response = <$sock>; chomp $response; print "Instrument ID: $response\n"; RS-232 Programming Interface Examples (ESG/PSG/E8663B Only) • “Interface Check Using HP BASIC” on page 131 • “Interface Check Using VISA and C”...
  • Page 142: Interface Check Using Visa And C

    Programming Examples RS-232 Programming Interface Examples (ESG/PSG/E8663B Only) Run HP BASIC, type in the following commands and then RUN the program !****************************************************************************** INTEGER Num CONTROL 9,0;1 ! Resets the RS-232 interface CONTROL 9,3;9600 ! Sets the baud rate to match the sig gen STATUS 9,4;Stat ! Reads the value of register 4 Num=BINAND(Stat,7)
  • Page 143 Programming Examples RS-232 Programming Interface Examples (ESG/PSG/E8663B Only) #include "StdAfx.h" #include <stdlib.h> #include <conio.h> void main () int baud=9600;// Set baud rate to 9600 printf("Manually set the signal generator power level to 0 dBm\n"); printf("\n"); printf("Press any key to continue\n"); getch();...
  • Page 144: Queries Using Hp Basic And Rs- 232

    Programming Examples RS-232 Programming Interface Examples (ESG/PSG/E8663B Only) Queries Using HP Basic and RS-232 This example program demonstrates signal generator query commands over RS- 232. Query commands are of the type *IDN? and are identified by the question mark that follows the mnemonic. rs232ex2.txt performs the following functions: •...
  • Page 145: Queries For Rs-232 Using Visa And C

    Programming Examples RS-232 Programming Interface Examples (ESG/PSG/E8663B Only) Queries for RS-232 Using VISA and C This example uses VISA library functions to communicate with the signal generator. The program verifies that the RS- 232 connections and interface are functional. Launch Microsoft Visual C++, add the required files, and enter the following code into your .cpp source file.
  • Page 146 Programming Examples RS-232 Programming Interface Examples (ESG/PSG/E8663B Only) ViSessiondefaultRM, instr;// Declares type ViSession variables ViUInt32retCount; // Return count for string I/O ViCharbuffer[MAX_COUNT];// Buffer for string I/O status = viOpenDefaultRM(&defaultRM);// Initializes the system // Open communication with Serial Port 2 status = viOpen(defaultRM, "ASRL2::INSTR", VI_NULL, VI_NULL, &instr); if(status){// If problems, then prompt user printf("Could not open ViSession!\n");...
  • Page 147: Programming The Status Register System

    Programming the Status Register System This chapter provides the following major sections: • “Overview” on page 138 • “Status Register Bit Values” on page 148 • “Accessing Status Register Information” on page 149 • “Status Byte Group” on page 154 •...
  • Page 148: Overview

    Programming the Status Register System Overview Overview NOTE Some of the status bits and register groups only apply to select signal generators with certain options. For more specific information on each exception, refer to the following: • Standard Operation Condition Register bits (see Table 4- 5 on page 160) •...
  • Page 149: Overall Status Byte Register Systems

    Programming the Status Register System Overview Overall Status Byte Register Systems • “N5181A/82A/83A: Overall Status Byte Register System (1 of 2)” on page 140 • “N5 181A/82A/83A: Overall Status Byte Register System (2 of 2)” on page 141 • “E8663B: Overall Status Byte Register System (1 of 2)” on page 142 •...
  • Page 150 Programming the Status Register System Overview Figure 4-1 N5181A/82A/83A: Overall Status Byte Register System (1 of 2) Agilent N518xA, E8663B, E44x8C, and E82x7D Signal Generators Programming Guide...
  • Page 151 Programming the Status Register System Overview Figure 4-2 N5181A/82A/83A: Overall Status Byte Register System (2 of 2) Agilent N518xA, E8663B, E44x8C, and E82x7D Signal Generators Programming Guide...
  • Page 152 Programming the Status Register System Overview Figure 4-3 E8663B: Overall Status Byte Register System (1 of 2) Agilent N518xA, E8663B, E44x8C, and E82x7D Signal Generators Programming Guide...
  • Page 153 Programming the Status Register System Overview Figure 4-4 E8663B: Overall Status Byte Register System (2 of 2) Agilent N518xA, E8663B, E44x8C, and E82x7D Signal Generators Programming Guide...
  • Page 154 Programming the Status Register System Overview Figure 4-5 E4428C/38C: Overall Status Byte Register System (1 of 2) Agilent N518xA, E8663B, E44x8C, and E82x7D Signal Generators Programming Guide...
  • Page 155 Programming the Status Register System Overview Figure 4-6 E4428C/38C: Overall Status Byte Register System (2 of 2) Agilent N518xA, E8663B, E44x8C, and E82x7D Signal Generators Programming Guide...
  • Page 156 Programming the Status Register System Overview Figure 4-7 E8257D/67D: Overall Status Byte Register System (1 of 2) Agilent N518xA, E8663B, E44x8C, and E82x7D Signal Generators Programming Guide...
  • Page 157 Programming the Status Register System Overview Figure 4-8 E8257D/67D: Overall Status Byte Register System (2 of 2) Agilent N518xA, E8663B, E44x8C, and E82x7D Signal Generators Programming Guide...
  • Page 158: Status Register Bit Values

    Programming the Status Register System Status Register Bit Values Status Register Bit Values Each bit in a register is represented by a decimal value based on its location in the register (see Table 4- • To enable a particular bit in a register, send its value with the SCPI command. Refer to the signal generator’s SCPI command listing for more information.
  • Page 159: Accessing Status Register Information

    Programming the Status Register System Accessing Status Register Information Accessing Status Register Information 1. Determine which register contains the bit that reports the condition. Refer to Figure 4- 1 on page 140 through Figure 4- 8 on page 147 for register location and names. 2.
  • Page 160 Programming the Status Register System Accessing Status Register Information The polling method works well if you do not need to know about changes the moment they occur. Use polling in the following situations: — when you use a programming language/development environment or IO interface that does not support SRQ interrupts —...
  • Page 161: Status Register Scpi Commands

    Programming the Status Register System Accessing Status Register Information The query command *SRE? returns the decimal value of the sum of the bits previously enabled with the *SRE <num> command. To query the Status Byte Register, send the command *STB?. The response will be the decimal sum of the bits which are set to 1.
  • Page 162 Programming the Status Register System Accessing Status Register Information *ESR? (event status register) queries and clears the Standard Event Status Register which is part of the Standard Event Status Group. *OPC, *OPC? (operation complete) sets bit #0 in the Standard Event Status Register to 1 when all commands have completed.
  • Page 163 Programming the Status Register System Accessing Status Register Information Table 4-2 Effects of :STATus:PRESet Value after Register :STATus:PRESet :STATus:OPERation:ENABle :STATus:OPERation:NTRansition :STATus:OPERation:PTRransition 32767 :STATus:OPERation:BASeband:ENABle :STATus:OPERation:BASeband:NTRansition :STATus:OPERation:BASeband:PTRransition 32767 :STATus:QUEStionable:CALibration:ENABle 32767 :STATus:QUEStionable:CALibration:NTRansition 32767 :STATus:QUEStionable:CALibration:PTRansition 32767 :STATus:QUEStionable:ENABle :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...
  • Page 164: Status Byte Group

    Programming the Status Register System Status Byte Group Status Byte Group 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.
  • Page 165: Status Byte Register

    Programming the Status Register System Status Byte Group Status Byte Register Table 4-3 Status Byte Register Bits Description Unused. These bits are always set to 0. Error/Event Queue Summary Bit. A 1 in this bit position indicates that the SCPI error queue is not empty. The SCPI error queue contains at least one error message.
  • Page 166: Status Groups

    Programming the Status Register System Status Groups Status Groups Standard Operation Status Group and the Data Questionable Status Group consist of the registers listed below. The Standard Event Status Group is similar but does not have negative or positive transition filters or a condition register. Condition Register A condition register continuously monitors the hardware and firmware status of...
  • Page 167: Standard Event Status Group

    Programming the Status Register System Status Groups Standard Event Status Group 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.
  • Page 168 Programming the Status Register System Status Groups Standard Event Status Register Table 4-4 Standard Event Status Register Bits Description Operation Complete. A 1 in this bit position indicates that all pending signal generator operations were completed following execution of the *OPC command. Request Control.
  • Page 169: Standard Operation Status Group

    Standard Operation Status Group NOTE Some of the bits in this status group do not apply to the E4428C, E8257D, E8267D, E8663B, and the N5181A/82A/83A, and returns zero when queried. See Table 4- 5 on page 160 more information. The Agilent MXG SCPI command :STAT:OPER:SUPP, can suppress the managing of this status group and save 50 us from the switching time.
  • Page 170 Unused. These bits are always set to 0. Always 0. a.In the N5181A, E4428C, E8257D, and E8663B, this bit is always set to 0. b.Always set to 0 if Option UN7 not present (E4438C only). c. Option 300 is only available on the E4438C.
  • Page 171 Programming the Status Register System Status Groups Standard Operation Transition Filters (negative and positive) The Standard Operation Transition Filters specify which types of bit state changes in the condition register set corresponding bits in the event register. Changes can be positive (0 to 1) or negative (1 to 0).
  • Page 172: Baseband Operation Status Group

    Table 4- 6 on page 163 for more information. This status group does not apply to the N5181A/82A/83A. (If queried, the signal generator will not respond.) The Baseband Operation Status Group is used to determine the specific event that set bit 10 in the Standard Operation Status Group.
  • Page 173 Programming the Status Register System Status Groups Baseband Operation Condition Register The Baseband Operation Condition Register continuously monitors the hardware and firmware status of the signal generator. Condition registers are read only. Table 4-6 Baseband Operation Condition Register Bits Description Baseband 1 Busy.
  • Page 174 Programming the Status Register System Status Groups Baseband Operation Event Register The Baseband Operation 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:OPERation:BASeband[:EVENt]? Baseband Operation Event Enable Register...
  • Page 175: Data Questionable Status Group

    Data Questionable Status Group NOTE Some of the bits in this status group do not apply to the E4428C, E8257D, E8267D, E8663B, and the N5181A/82A/83A, and returns zero when queried. Other bits have changed state content. See Table 4- 7 on page 166 for more information.
  • Page 176 Unused. These bits are always set to 0. Always 0. a.In the N5182A, this bit applies only to the I/Q calibration. In the N5181A/83A, this bit is unused and always set to 0. b.In the E8257D, and the E8663B this bit applies only to the DCFM/DCΦM calibration.
  • Page 177 Programming the Status Register System Status Groups Response: The decimal sum of the bits set to 1 Example: The decimal value 520 is returned. The decimal sum = 512 (bit 9) + 8 (bit 3). Data Questionable Transition Filters (negative and positive) The Data Questionable Transition Filters specify which type of bit state changes in the condition register set corresponding bits in the event register.
  • Page 178: Data Questionable Power Status Group

    Data Questionable Power Status Group NOTE Some of the bits in this status group do not apply to the E4428C, E8257D, E8267D, E8663B, and the N5181A/82A/83A, and returns zero when queried. See Table 4- 8 on page 169 more information.
  • Page 179 Unused. These bits are always set to 0. Always 0. a.In the N5181A/82A with Option 506, the N5183A, and the E4428C/38C with Option 506, this bit is set to 0. b.In the N5181A/82A/83A, E4428C, E8257D/67D, and E8663B, this bit is set to 0.
  • Page 180 Programming the Status Register System Status Groups Data Questionable Power Event Enable Register The Data Questionable Power Event Enable Register lets you choose which bits in the Data Questionable Power Event Register set the summary bit (bit 3 of the Data Questionable Condition Register) to 1.
  • Page 181: Data Questionable Frequency Status Group

    Status Groups Data Questionable Frequency Status Group NOTE Some bits in this status group do not apply to the N5181A/82A/83A, E4428C, E8257D, and the E8663B and returns zero when queried. See Table 4- 9 on page 172 for more information.
  • Page 182 Unused. These bits are always set to 0. Always 0. a.In the N5181A and N5182A these bits are always set to 0. b.In the N5181A/82A/83A, E4428C, E8257D, and the E8663B, this bit is always set to 0. Query: STATus:QUEStionable:FREQuency:CONDition? Response: The decimal sum of the bits set to 1.
  • Page 183 Programming the Status Register System Status Groups Data Questionable Frequency Event Enable Register Lets you choose which bits in the Data Questionable Frequency Event Register set the summary bit (bit 5 of the Data Questionable Condition Register) to 1. Command: STATus:QUEStionable:FREQuency:ENABle <value>, where <value>...
  • Page 184: Data Questionable Modulation Status Group

    Programming the Status Register System Status Groups Data Questionable Modulation Status Group NOTE This status group does not apply to the N5181A and the N5182A, and returns zero when queried. See Table 4- 10 on page 175 for more information.
  • Page 185 Programming the Status Register System Status Groups Data Questionable Modulation Condition Register The Data Questionable Modulation Condition Register continuously monitors the hardware and firmware status of the signal generator. Condition registers are read- only. Table 4-10 Data Questionable Modulation Condition Register Bits Description Modulation 1 Undermod.
  • Page 186 Programming the Status Register System Status Groups Data Questionable Modulation Event Enable Register The Data Questionable Modulation Event Enable Register lets you choose which bits in the Data Questionable Modulation Event Register set the summary bit (bit 7 of the Data Questionable Condition Register) to 1.
  • Page 187: Data Questionable Calibration Status Group

    Programming the Status Register System Status Groups Data Questionable Calibration Status Group NOTE Some bits in this status group do not apply to the N5181A/82A/83A, E4428C, E8257D, and the E8663B, and return zero when queried. See Table 4- 11 on page 178 for more information.
  • Page 188 This is a critical error. The output of the source has no validity until the condition of this bit is 0. 2−14 Unused. These bits are always set to 0. Always 0. a.In the N5181A, E4428C, E8257D, and the E8663B, this bit is set to 0. b.In the N5181A and N5182A, this bit is set to 0. Query: STATus:QUEStionable:CALibration:CONDition? Response: The decimal sum of the bits set to 1.
  • Page 189 Programming the Status Register System Status Groups Data Questionable Calibration Event Enable Register The Data Questionable Calibration Event Enable Register lets you choose which bits in the Data Questionable Calibration Event Register set the summary bit (bit 8 of the Data Questionable Condition register) to 1.
  • Page 190: Data Questionable Bert Status Group

    Programming the Status Register System Status Groups Data Questionable BERT Status Group NOTE This status group applies only to the E4438C with Option UN7. The Data Questionable BERT Status Group is used to determine the specific event that set bit 12 in the Data Questionable Condition Register.
  • Page 191 Programming the Status Register System Status Groups Data Questionable BERT Condition Register The Data Questionable BERT Condition Register continuously monitors the hardware and firmware status of the signal generator. Condition registers are read only. Table 4-12 Data Questionable BERT Condition Register Bits Description No Clock.
  • Page 192 Programming the Status Register System Status Groups Data Questionable BERT Transition Filters (negative and positive) The Data Questionable BERT 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 negative (1 to 0).
  • Page 193: 5 Creating And Downloading Waveform Files

    “Using the Download Utilities” on page 227 • “Downloading E443xB Signal Generator Files” on page 228 • “Programming Examples” on page 231 • “Troubleshooting Waveform Files” on page 276 N5181A/82A Agilent N518xA, E8663B, E44x8C, and E82x7D Signal Generators Programming Guide...
  • Page 194: Overview Of Downloading And Extracting Waveform Files

    (no settings saved) and sets all markers to zero (off). There are three ways to download waveform files: FTP, programmatically or using one of three available free download utilities created by Agilent Technologies: • N7622A Signal Studio Toolkit 2 http://www.agilent.com/find/signalstudio...
  • Page 195: Waveform Data Requirements

    Creating and Downloading Waveform Files Understanding Waveform Data Waveform Data Requirements To be successful in downloading files, you must first create the data in the required format. • Signed 2’s complement • 2- byte integer values • Input data range of −32768 to 32767 •...
  • Page 196: Lsb And Msb (Bit Order)

    Creating and Downloading Waveform Files Understanding Waveform Data −1), but you can use multiple The maximum value for a single unsigned byte is 255 (11111111 or 2 bytes to represent larger values. The following shows two bytes and the resulting integer value: 01101110 10110011= 28339 (decimal value) The maximum value for two unsigned bytes is 65535.
  • Page 197 Development platforms include any product that creates and saves waveform data to a file. This includes Agilent 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.
  • Page 198: Byte Swapping

    This is commonly referred to as byte swapping. You can swap bytes either programmatically or by using either the Agilent Technologies Intuilink for ESG/PSG 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 199 Creating and Downloading Waveform Files Understanding Waveform Data DAC Range Input Range Binary Data Hex Data Voltage Vmax 65535 01111111 11111111 7FFF 32767 00000000 00000001 32768 0001 0 Volts 32767 00000000 00000000 0000 32766 11111111 11111111 FFFF 10000000 00000000 Vmin -32768 8000 Notice that it takes only 15 bits (2...
  • Page 200 Creating and Downloading Waveform Files Understanding Waveform Data NOTE Whenever you interchange files between signal generator models, ensure that all scaling is adequate for that signal generator’s waveform. Interpolation Interpolation 32767 Max input value Scaling effect DAC over-range No over-range -32768 There is no single scaling value that is optimal for all waveforms.
  • Page 201: 2'S Complement Data Format

    Creating and Downloading Waveform Files Understanding Waveform Data NOTE FIR filter capability is only available on the N5182A with Option 651, 652, or 654, the E4438C with Option 001, 002, 601, or 602, and on the E8267D with Option 601 or 602. 2’s Complement Data Format The signal generator requires signed values for the input data.
  • Page 202 Creating and Downloading Waveform Files Understanding Waveform Data NOTE The signal generator can accept separate I and Q files created for the earlier E443xB ESG models. For more information on downloading E443xB files, see “Downloading E443xB Signal Generator Files” on page 228.
  • Page 203: Waveform Structure

    Creating and Downloading Waveform Files Waveform Structure Waveform Structure To play back waveforms, the signal generator uses data from the following three files: • File header • Marker file • I/Q file All three files have the same name, the name of the I/Q data file, but the signal generator stores each file in its respective directory (headers, markers, and waveform).
  • Page 204: I/Q File

    Creating and Downloading Waveform Files Waveform Structure 4 3 2 1 Marker Number Position Marker Byte 0000 1 0 1 1 Reserved Example of Setting a Marker Byte Binary 0000 0101 Sets markers 1 and 3 on for a waveform point The following example shows a marker binary file (all values in hex) for a waveform with 200 points.
  • Page 205: Waveform

    Creating and Downloading Waveform Files Waveform Phase Continuity NOTE If you download I/Q data using a file name that currently resides on the signal generator, it also overwrites the existing marker file setting all bits to zero and the file header setting all parameters to unspecified.
  • Page 206: Avoiding Phase Discontinuities

    Creating and Downloading Waveform Files Waveform Phase Continuity Sampled Sinewave with Phase Discontinuity Phase discontinuity Waveform length Avoiding Phase Discontinuities You can easily avoid phase discontinuities for periodic waveforms by simulating an integer number of cycles when you create your waveform segment. NOTE If there are N samples in a complete cycle, only the first N- 1 samples are stored in the waveform segment.
  • Page 207 Creating and Downloading Waveform Files Waveform Phase Continuity Sampled Sinewave with No Discontinuity Added sample Waveform length The following figures illustrate the influence a single sample can have. The generated 3- tone test signal requires 100 samples in the waveform to maintain periodicity for all three tones. The measurement on the left shows the effect of using the first 99 samples rather than all 100 samples.
  • Page 208: Waveform Memory

    Creating and Downloading Waveform Files Waveform Memory Waveform Memory The signal generator provides two types of memory, volatile and non- volatile. You can download files to either memory type. Volatile Random access memory that does not survive cycling of the signal generator power.
  • Page 209 Creating and Downloading Waveform Files Waveform Memory Table 5-2 Signal Generators and Non-Volatile Memory Types Non- Volatile Memory Type Model of Signal Generator N5182A with E4438C with E8267D Option Option 651, Option 001, 601 or 602 652, or 654 002, 601, or User PRAM –...
  • Page 210: Memory Allocation

    Creating and Downloading Waveform Files Waveform Memory Figure 5-1 Root directory Agilent MXG (Only): USER E443xB Volatile NONVOLATILE E443xB Non-volatile waveform data waveform data MXG (only) USB media: 1, 2 File listing with extensions ARBQ NVARBI NVARBQ ARBI Non-volatile Waveform sequences 1, 3 Non-volatile waveform data (internal storage HEADER...
  • Page 211 Creating and Downloading Waveform Files Waveform Memory As shown in the examples, waveforms can cause the signal generator to allocate more memory than what is actually used, which decreases the amount of available memory. NOTE In the first block of data of volatile memory that is allocated for each waveform file, the file header requires 512 bytes (N5182A) or 256 bytes (E4438C/E8267D).
  • Page 212: Memory Size

    Creating and Downloading Waveform Files Waveform Memory For more information on default cluster sizes for FAT file structures, refer to Table 5- 3 on page 202 and to http://support.microsoft.com/. Table 5-3 Drive Size (logical volume) Drive Size (logical volume) Cluster Size (Bytes) (Minimum Allocation Size) 0 MB - 15 MB 16 MB - 127 MB...
  • Page 213 Creating and Downloading Waveform Files Waveform Memory Volatile and Non-Volatile Memory (N5182A) Table 5-4 N5182A Volatile (BBG) and Non-Volatile (Internal Storage and USB Media) Memory Volatile (BBG) Memory Non- Volatile (Internal Storage and USB Media) Memory Option Size Option Size N5182A 651/652/654 (BBG) 8 MSa (40 MB)
  • Page 214: Commands For Downloading And Extracting Waveform Data

    Creating and Downloading Waveform Files Commands for Downloading and Extracting Waveform Data Table 5-6 E4438C and E8267D Non-Volatile (NVWFM) Memory Non- Volatile (NVWFM) Memory Option Size E4438C and E8267D Standard 3 MSa (15 MB) 005 (Hard disk) 1.2 GSa (6 GB) Commands for Downloading and Extracting Waveform Data You can download I/Q data, the associated file header, and marker file information (collectively called waveform data) into volatile or non- volatile memory.
  • Page 215: File Transfer Methods

    Creating and Downloading Waveform Files Commands for Downloading and Extracting Waveform Data Encrypted I/Q Files and the Securewave Directory The signal generator uses the securewave directory to perform file encryption (extraction) and decryption (downloads). The securewave directory is not an actual storage directory, but rather a portal for the encryption and decryption process.
  • Page 216: Commands And File Paths For Downloading And Extracting Waveform Data

    Creating and Downloading Waveform Files Commands for Downloading and Extracting Waveform Data command for downloading waveform data (#ABC represents the block data): :MMEM:DATA "<file_name>",#ABC "<file_name>" the I/Q file name and file path within the signal generator indicates the start of the data block the number of decimal digits present in B a decimal number specifying the number of data bytes to follow in C the actual binary waveform data...
  • Page 217 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 Agilent MXG Only) Download Method/ Command Syntax Options Memory Type SCPI/volatile memory MMEM:DATA "WFM1:<file_name>",<blockdata> MMEM:DATA "MKR1:<file_name>",<blockdata> MMEM:DATA "HDR1:<file_name>",<blockdata>...
  • Page 218 Creating and Downloading Waveform Files Commands for Downloading and Extracting Waveform Data Table 5-9 Downloading Unencrypted Files for Extraction Download Method/ Command Syntax Options Memory Type SCPI/non- volatile MEM:DATA:UNPRotected "/user/waveform/file_name",<blockdata> MEM:DATA:UNPRotected "/user/markers/file_name",<blockdata> memory MEM:DATA:UNPRotected "/user/header/file_name",<blockdata> MEM:DATA:UNPRotected "NVWFM:file_name",<blockdata> MEM:DATA:UNPRotected "NVMKR:file_name",<blockdata> MEM:DATA:UNPRotected "NVHDR:file_name",<blockdata> MEM:DATA:UNPRotected "file_name@NVWFM",<blockdata>...
  • Page 219 Creating and Downloading Waveform Files Commands for Downloading and Extracting Waveform Data Table 5-11 Downloading Encrypted Files for Extraction Download Command Syntax Options Method/Memory Type MEM:DATA:UNPRotected "/user/bbg1/securewave/file_name",<blockdata> SCPI/volatile MEM:DATA:UNPRotected "SWFM1:file_name",<blockdata> memory MEM:DATA:UNPRotected "file_name@SWFM1",<blockdata> SCPI/non- volatile MEM:DATA:UNPRotected "/user/securewave/file_name",<blockdata> MEM:DATA:UNPRotected "SNVWFM:file_name",<blockdata> memory MEM:DATA:UNPRotected "file_name@SNVWFM",<blockdata>...
  • Page 220: Ftp Procedures

    Creating and Downloading Waveform Files Commands for Downloading and Extracting Waveform Data FTP Procedures There are three ways to FTP files: • use Microsoft’s® Internet Explorer FTP feature • use the PC’s or UNIX command window • use the signal generator’s internal web server following the firmware requirements in the table below Signal Generator Firmware Version (Required...
  • Page 221 Creating and Downloading Waveform Files Commands for Downloading and Extracting Waveform Data 2. From the PC command prompt or UNIX command line, type ftp <instrument name>. Where instrument name is the signal generator’s hostname or IP address. 3. At the User: prompt in the ftp window, press Enter (no entry is required). 4.
  • Page 222: Creating Waveform Data

    You can use various programming environments to create ARB waveform data. Generally there are two types: • Simulation software— this includes MATLAB, Agilent 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 223: Code Algorithm

    Creating and Downloading Waveform Files Creating Waveform Data Code Algorithm This section uses code from the C++ programming example “Importing, Byte Swapping, Interleaving, and Downloading I and Q Data—Big and Little Endian Order” on page 249 to demonstrate how to create and scale waveform data.
  • Page 224 Creating and Downloading Waveform Files Creating Waveform Data Line Code Description—Create I and Q data 7–11 Create a loop to do the following: • Generate and scale the I data (DAC values). This example uses a simple sine equation, where 2*3.14 equals one waveform cycle.
  • Page 225 Creating and Downloading Waveform Files Creating Waveform Data 2. Save the I/Q data to a text file to review. The following lines of code export the I and Q data to a text file for validation. After exporting the data, open the file using Microsoft Excel or a similar spreadsheet program, and verify that the I and Q data are correct.
  • Page 226 Creating and Downloading Waveform Files Creating Waveform Data Line Code—Interleaving and Byte Swapping for Little Endian Order char iqbuffer[NUMSAMPLES*4]; for(index=0; index<numsamples; index++) short ivalue = idata[index]; short qvalue = qdata[index]; iqbuffer[index*4] = (ivalue >> 8) & 0xFF; iqbuffer[index*4+1] = ivalue & 0xFF; iqbuffer[index*4+2] = (qvalue >>...
  • Page 227 Creating and Downloading Waveform Files Creating Waveform Data Line Code Description—Interleaving and Byte Swapping for Little Endian Order 21–29 the I and Q data), and interleave the I and Q data. — shift the data pointer right 8 bits to the beginning of the high byte (ivalue >> 8) Little Endian Order Bit Position 15 14 13 12 11 10...
  • Page 228: Downloading Waveform Data

    Creating and Downloading Waveform Files Downloading Waveform Data Line Code—Interleaving I and Q data for Big Endian Order short iqbuffer[NUMSAMPLES*2]; for(index=0; index<numsamples; index++) iqbuffer[index*2] = idata[index]; iqbuffer[index*2+1] = qdata[index]; return 0; Line Code Description—Interleaving I and Q data for Big Endian Order Define a 16- bit integer (short) array to store the interleaved I and Q data.
  • Page 229: Using Simulation Software

    Creating and Downloading Waveform Files Downloading Waveform Data For advanced programming languages, this section closely examines the code algorithm for downloading I/Q waveform data by breaking the programming examples into functional parts and explaining the code in generic terms. This is done to help you understand the code algorithm in downloading the interleaved I/Q data, so you can leverage the concept into your programming environment.
  • Page 230 Creating and Downloading Waveform Files Downloading Waveform Data Line Code Description—Open a Connection Session with the Signal Generator Sets up a structure (indicated above by io) used by subsequent function calls to establish a LAN connection to the signal generator. •...
  • Page 231: Using Advanced Programming Languages

    Creating and Downloading Waveform Files Downloading Waveform Data Line Code Description—Download the I/Q data Download the I/Q waveform data to the signal generator by using the function call (agt_waveformload) from the Agilent 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 232 Creating and Downloading Waveform Files Downloading Waveform Data Line Code Description—Open a Connection Session Assign the signal generator’s LAN hostname, IP address, or GPIB address to a character string. • This example uses the Agilent IO library’s iopen() SICL function to establish a LAN connection with the signal generator.
  • Page 233 Creating and Downloading Waveform Files Downloading Waveform Data Line Code Description—Download the I/Q data Calculate the total number of bytes, and store the value in the integer variable defined in line 8. In this code, numsamples contains the number of waveform points, not the number of bytes. Because it takes four bytes of data, two I bytes and two Q bytes, to create one waveform point, we have to multiply numsamples by four.
  • Page 234: Loading, Playing, And Verifying A Downloaded Waveform

    Creating and Downloading Waveform Files Loading, Playing, and Verifying a Downloaded Waveform Line Code Description—Download the I/Q data Send the generated waveform data stored in the I/Q array (iqbuffer) to the signal generator. • iwrite() sends the data specified in iqbuffer to the signal generator (session identifier specified in id). •...
  • Page 235: Playing The Waveform

    Creating and Downloading Waveform Files Loading, Playing, and Verifying a Downloaded Waveform NOTE When you copy a waveform file, marker file, or header file information from volatile or non- volatile memory, the waveform and associated marker and header files are all copied. Conversely, when you delete an I/Q file, the associated marker and header files are deleted.
  • Page 236: Verifying The Waveform

    Creating and Downloading Waveform Files Loading, Playing, and Verifying a Downloaded Waveform Verifying the Waveform Perform this procedure after completing the steps in the previous procedure, “Playing the Waveform” on page 225. 1. Connect the signal generator to an oscilloscope as shown in the figure. 2.
  • Page 237: Using The Download Utilities

    Creating and Downloading Waveform Files Using the Download Utilities Send the following SCPI command: :MMEMory:CATalog? "WFM1:" 2. Select the waveform segment file(s) from the volatile memory waveform list: Send the following SCPI command: :SOURce:RADio:ARB:WAVeform "WFM1:<file_name>" 3. Save the waveform segment(s) (“<waveform1>”, “<waveform2>”, ...), to non- volatile memory as a waveform sequence (“<file_name>”), define the number of repetitions (<reps>), each waveform segment plays, and enable/disable markers (M1|M2|M3|M4|...), for each waveform segment: Send the following SCPI command:...
  • Page 238: Downloading E443Xb Signal Generator Files

    Creating and Downloading Waveform Files Downloading E443xB Signal Generator Files • Agilent Waveform Download Assistant: http://www.agilent.com/find/downloadassistant This software provides functions for the MATLAB environment to download waveform data. Features Agilent Signal Agilent Agilent Studio Toolkit 2 Waveform IntuiLink Download Assistant Downloads encrypted waveform files Downloads complex MATLAB waveform data Downloads MATLAB files (.mat)
  • Page 239: Storage Locations For E443Xb Arb Files

    Creating and Downloading Waveform Files Downloading E443xB Signal Generator Files Storage Locations for E443xB ARB files Place waveforms in either volatile memory or non- volatile memory. The signal generator supports the E443xB directory structure for waveform file downloads (i.e. “ARBI:”, “ARBQ:”, “NVARBI:”, and “NVARBQ:”, see also “SCPI Commands”...
  • Page 240 Creating and Downloading Waveform Files Downloading E443xB Signal Generator Files E443xB 14-Bit Data I data Q data 1100110110111001 0000100111011001 Marker bits Reserved bits 14 data bits 14 data bits Subtracts 8192, Left Shifts, and Adds Zeros—Removes Marker and Reserved Bits (16-Bit Data Format) 16-bit I data 16-bit Q data...
  • Page 241: Scpi Commands

    Creating and Downloading Waveform Files Programming Examples SCPI Commands Use the following commands to download E443xB waveform files into the signal generator. NOTE To avoid overwriting the current waveform in volatile memory, before downloading files into volatile memory (WFM1), change the file name or turn off the ARB. For more information, on manually turning off the ARB, refer to the User’s Guide.
  • Page 242: C++ Programming Examples

    Creating and Downloading Waveform Files Programming Examples C++ Programming Examples This section contains the following programming examples: • “Creating and Storing Offset I/Q Data—Big and Little Endian Order” on page 232 • “Creating and Storing I/Q Data—Little Endian Order” on page 236 •...
  • Page 243 Creating and Downloading Waveform Files Programming Examples // 1.) Create Simple IQ Signal ***************************************** // This signal is a single tone on the upper // side of the carrier and is usually refered to as // a Single Side Band Suppressed Carrier (SSBSC) signal. // It is nothing more than a cosine wavefomm in I // and a sine waveform in Q.
  • Page 244 Creating and Downloading Waveform Files Programming Examples // Find the Maximum amplitude in I and Q to normalize the data between +-1 maxAmp = Iwave[0]; minAmp = Iwave[0]; for( i=0; i<points; i++) if( maxAmp < Iwave[i] ) maxAmp = Iwave[i]; else if( minAmp >...
  • Page 245 Creating and Downloading Waveform Files Programming Examples // signal generator char *filename = “C:\\Temp\\PSGTestFile”; FILE *stream = NULL; stream = fopen(filename, “w+b”);// Open the file if (stream==NULL) perror (“Cannot Open File”); int numwritten = fwrite( (void *)waveform, sizeof( short ), points*2, stream ); fclose(stream);// Close the file // 3.) Load the internal Arb format file ********************************* // This process is just the reverse of saving the waveform...
  • Page 246 Creating and Downloading Waveform Files Programming Examples Creating and Storing I/Q Data—Little Endian Order On the documentation CD, this programming example’s name is “CreateStore_Data_c++.txt.” This C++ programming example (compiled using Metrowerks CodeWarrior 3.0) performs the following functions: • error checking •...
  • Page 247 Creating and Downloading Waveform Files Programming Examples for (int i=0; i<SAMPLES; ++i) iqData[2*i] = AMPLITUDE * sin(two_pi*i/(float)SAMPLES); iqData[2*i+1] = AMPLITUDE * cos(two_pi*i/(float)SAMPLES); // make sure bytes are in the order MSB(most significant byte) first. (PC only). char* cptr = (char*)iqData;// cast the integer values to characters for (int i=0;...
  • Page 248 Creating and Downloading Waveform Files Programming Examples Creating and Downloading I/Q Data—Big and Little Endian Order On the documentation CD, this programming example’s name is “CreateDwnLd_Data_c++.txt.” This C++ programming example (compiled using Microsoft Visual C++ 6.0) performs the following functions: •...
  • Page 249 Creating and Downloading Waveform Files Programming Examples // Create arrays to hold the I and Q data int idata[NUMSAMPLES]; int qdata[NUMSAMPLES]; // save the number of sampes into numsamples int numsamples = NUMSAMPLES; // Fill the I and Q buffers with the sample data for(int index=0;...
  • Page 250 Creating and Downloading Waveform Files Programming Examples int ivalue = idata[index]; int qvalue = qdata[index]; iqbuffer[index*4] = (ivalue >> 8) & 0xFF; // high byte of i iqbuffer[index*4+1] = ivalue & 0xFF; // low byte of i iqbuffer[index*4+2] = (qvalue >> 8) & 0xFF; // high byte of q iqbuffer[index*4+3] = qvalue &...
  • Page 251 Creating and Downloading Waveform Files Programming Examples // Send parts 1, 2, and 3 iwrite(id, cmd, strlen(cmd), 0, 0); // Send part 4. Be careful to use the correct command here. In many // programming languages, there are two methods to send SCPI commands: Method 1 = stop at the first ‘0’...
  • Page 252 Creating and Downloading Waveform Files Programming Examples Importing and Downloading I/Q Data—Big Endian Order On the documentation CD, this programming example’s name is “impDwnLd_c++.txt.” This C++ programming example (compiled using Metrowerks CodeWarrier 3.0) assumes that the data is in big endian order and performs the following functions: •...
  • Page 253 Creating and Downloading Waveform Files Programming Examples if( fseek( file, 0, SEEK_END ) < 0 ) fprintf(stderr,"Cannot seek to the end of file.\n" ); return 0; long lenToSend = ftell(file); printf("File size = %d\n", lenToSend); if (fseek(file, 0, SEEK_SET) < 0) fprintf(stderr,"Cannot seek to the start of file.\n");...
  • Page 254 Creating and Downloading Waveform Files Programming Examples fprintf(stderr, "Could not allocate memory for copy buffer\n"); fclose(file); iclose(id); return 0; Agilent N518xA, E8663B, E44x8C, and E82x7D Signal Generators Programming Guide...
  • Page 255 Creating and Downloading Waveform Files Programming Examples Importing and Downloading Using VISA—Big Endian Order On the documentation CD, this programming example’s name is “DownLoad_Visa_c++.txt.” This C++ programming example (compiled using Microsoft Visual C++ 6.0) assumes that the data is in big endian order and performs the following functions: •...
  • Page 256 Creating and Downloading Waveform Files Programming Examples // IMPORTANT: Configure the following three lines correctly before compiling and running char* instOpenString ="TCPIP0::xxx.xxx.xxx.xxx::INSTR"; // your instrument's IP address const char* localSrcFile = "\\Files\\IQ_DataC"; const char* instDestFile = "/USER/WAVEFORM/IQ_DataC"; const int BUFFER_SIZE = 100*1024;// Size of the copy buffer int main(int argc, char* argv[]) ViSession defaultRM, vi;...
  • Page 257 Creating and Downloading Waveform Files Programming Examples long lenToSend = ftell(file);// Number of bytes in the file printf("File size = %d\n", lenToSend); if (fseek(file, 0, SEEK_SET) < 0) fprintf(stderr,"Cannot lseek to the start of file.\n"); return 0; unsigned char* buf = new unsigned char[BUFFER_SIZE]; // Allocate char buffer memory if (buf &&...
  • Page 258 Creating and Downloading Waveform Files Programming Examples numRead = fread(buf, sizeof(char), BUFFER_SIZE, file); viWrite(vi, buf, numRead, 0); } while (numRead == BUFFER_SIZE); // 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;...
  • Page 259 Creating and Downloading Waveform Files Programming Examples Importing, Byte Swapping, Interleaving, and Downloading I and Q Data—Big and Little Endian Order On the documentation CD, this programming example’s name is “impDwnLd2_c++.txt.” This C++ programming example (compiled using Microsoft Visual C++ 6.0) performs the following functions: •...
  • Page 260 Creating and Downloading Waveform Files Programming Examples // This is a text file to which we will write the // I and Q data just for debugging purposes. It is // a good programming practice to check your data // in this way before attempting to write it to // the instrument.
  • Page 261 Creating and Downloading Waveform Files Programming Examples while(!done) i1 = fgetc(infile); // read the first byte if(i1==EOF) break; i2 = fgetc(infile); // read the next byte if(i2==EOF) break; ivalue=i1+i2*256; // put the two bytes together // note that the above format is for a little endian // processor such as Intel.
  • Page 262 Creating and Downloading Waveform Files Programming Examples if (outfile==NULL) perror (“Error opening file to write”); for(index=0; index<numsamples; index++) fprintf(outfile, “%d, %d\n”, idata[index], qdata[index]); fclose(outfile); // The E443xB, E4438C, E8267C or E8267D all use big-endian // processors. If your software is running on a little-endian // processor such as Intel, then you will need to swap the // bytes in the data before sending it to the signal generator.
  • Page 263 Creating and Downloading Waveform Files Programming Examples 0 gives 0 V output 32767 gives positive full-scale output // From these ranges, it appears you should offset the // data by 8192 and scale it by 4. However, due to the // interpolators in these products, it is better to scale // the data by a number less than four.
  • Page 264 Creating and Downloading Waveform Files Programming Examples // The SCPI command has four parts. Part 1 = :MEM:DATA “filename”, Part 2 = length of Part 3 when written to a string Part 3 = length of the data in bytes. This is in s from above.
  • Page 265: Matlab Programming Examples

    Creating and Downloading Waveform Files Programming Examples iwrite(id, iqbuffer, bytesToSend, 0, 0); iwrite(id, “\n”, 1, 1, 0); printf(“Loaded FILE2 using the E4438C, E8267C and E8267D format\n”); return 0; MATLAB Programming Examples This section contains the following programming examples: • “Creating and Storing I/Q Data” on page 255 •...
  • Page 266 Creating and Downloading Waveform Files Programming Examples phaseInc = 2*pi*cycles/points; phase = phaseInc * [0:points-1]; Iwave = cos(phase); Qwave = sin(phase); % 2.) Save waveform in internal format ********************************* % Convert the I and Q data into the internal arb format % The internal arb format is a single waveform containing interleaved IQ % data.
  • Page 267 Creating and Downloading Waveform Files Programming Examples % Save the data to a file % Note: The waveform is saved as unsigned short integers. However, the acual bit pattern is that of signed short integers and that is how the Agilent MXG/ESG/PSG interprets them. filename = ‘C:\Temp\PSGTestFile’;...
  • Page 268 Creating and Downloading Waveform Files Programming Examples Creating and Downloading a Pulse NOTE This section applies only to the Agilent MXG and the PSG. For the Agilent 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.
  • Page 269 Creating and Downloading Waveform Files Programming Examples % arrange the i- samples and scale the amplitude to simulate an antenna scan % pattern comprised of 10 pulses i = .707*[rise on fall off... [.9*[rise on fall off]]... [.8*[rise on fall off]]... [.7*[rise on fall off]]...
  • Page 270 Creating and Downloading Waveform Files Programming Examples [status, status_description] = agt_sendcommand(io, 'SOURce:FREQuency 20000000000'); [status, status_description] = agt_sendcommand(io, 'POWer 0'); % define the ARB sample clock for playback sampclk = 40000000; % download the iq waveform to the PSG baseband generator for playback [status, status_description] = agt_waveformload(io, IQData, 'pulsepat', sampclk, 'play', 'no_normscale', Markers);...
  • Page 271 Creating and Downloading Waveform Files Programming Examples NOTE For the Agilent MXG, the SOURce:FREQuency 20000000000 value must be changed as required in the following programs. For more information, refer to the Data Sheet. barker.m This programming example calculates and downloads an arbitrary waveform file that simulates a simple 7–bit barker RADAR signal to the PSG vector signal generator.
  • Page 272: Visual Basic Programming Examples

    Creating and Downloading Waveform Files Programming Examples Visual Basic Programming Examples Creating I/Q Data—Little Endian Order On the documentation CD, this programming example’s name is “Create_IQData_vb.txt.” This Visual Basic programming example, using Microsoft Visual Basic 6.0, uses little endian order data, and performs the following functions: •...
  • Page 273 Creating and Downloading Waveform Files Programming Examples AMPLITUDE = 32767 ' Scale the amplitude for full range of the signal generators ' I/Q modulator DAC pi = 3.141592 Dim intIQ_Data(0 To 2 * SAMPLES - 1) 'Array for I and Q integers: 400 ReDim iq_data(0 To (4 * SAMPLES - 1)) 'Need MSB and LSB bytes for each integer value: 800 'Create an integer array of I/Q pairs For index = 0 To (SAMPLES - 1)
  • Page 274 Creating and Downloading Waveform Files Programming Examples On Error GoTo file_error For index = 0 To (numPoints) data = iq_data(index) Put #FileHandle, index + 1, data 'Write the I/Q data to the file Next index Close #FileHandle Call MsgBox("Data written to file " & strFilename, vbOKOnly, "Download") Exit Sub file_error: MsgBox Err.Description...
  • Page 275 Creating and Downloading Waveform Files Programming Examples Downloading I/Q Data On the signal generator’s documentation CD, this programming example’s name is “Download_File_vb.txt.” This Visual Basic programming example, using Microsoft Visual Basic 6.0, downloads the file created “Creating I/Q Data—Little Endian Order” on page 262 into non- volatile memory using a LAN connection.
  • Page 276 Creating and Downloading Waveform Files Programming Examples Private Sub Download_File() ' The following four lines declare IO objects and instantiate them. Dim rm As VisaComLib.ResourceManager Set rm = New AgilentRMLib.SRMCls Dim SigGen As VisaComLib.FormattedIO488 Set SigGen = New VisaComLib.FormattedIO488 ' NOTE: Use the IP address of your signal generator in the rm.Open declaration Set SigGen.IO = rm.Open("TCPIP0::000.000.000.000") Dim data As Byte Dim iq_data() As Byte...
  • Page 277: Hp Basic Programming Examples

    Creating and Downloading Waveform Files Programming Examples Get #FileHandle, index + 1, data '(index+1) is the record number iq_data(index) = data Next index Close #FileHandle 'Close the file 'Write the command to the Header string. NOTE: syntax Header = "MEM:DATA ""/USER/WAVEFORM/IQ_DataVB""," 'Now write the data to the signal generator's non-volatile memory (NVWFM) SigGen.WriteIEEEBlock Header, iq_data SigGen.WriteString "*OPC?"...
  • Page 278 Creating and Downloading Waveform Files Programming Examples As discussed at the beginning of this section, I and Q waveform data is interleaved into one file in 2’s compliment form and a marker file is associated with this I/Q waveform file. In the Output commands, USING “#,K”...
  • Page 279 Creating and Downloading Waveform Files Programming Examples Program Comments (Continued) Sets the number of points in the waveform. Allocates integer data array for I and Q waveform points. Sets HP BASIC to use degrees for cosine and sine functions. Sets up first loop for I waveform points. Calculate and interleave I waveform points.
  • Page 280 Creating and Downloading Waveform Files Programming Examples Creating and Downloading Waveform Data Using HP BASIC for UNIX On the documentation CD, this programming example’s name is “hpbasicUx.txt.” The following program shows you how to download waveforms using HP Basic for UNIX. The code is similar to that shown for HP BASIC for Windows, but there is a formatting difference in line 130 and line 140.
  • Page 281 Creating and Downloading Waveform Files Programming Examples Program Comments Program file name Sets the number of points in the waveform. Allocates integer data array for I and Q waveform points. Sets HP BASIC to use degrees for cosine and sine functions. Sets up first loop for I waveform points.
  • Page 282 Creating and Downloading Waveform Files Programming Examples Creating and Downloading E443xB Waveform Data Using HP BASIC for Windows On the documentation CD, this programming example’s name is “e443xb_hpbasicWin2.txt.” The following program shows you how to download waveforms using HP Basic for Windows into volatile ARB memory.
  • Page 283 Creating and Downloading Waveform Files Programming Examples OUTPUT @Esg;END ASSIGN @Esg TO * ASSIGN @Esgb TO * PRINT PRINT "*END*" Program Comments Program file name. Sets the number of points in the waveform. 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.
  • Page 284 Creating and Downloading Waveform Files Programming Examples Creating and Downloading E443xB Waveform Data Using HP Basic for UNIX On the documentation CD, this programming example’s name is “e443xb_hpbasicUx2.txt.” The following program shows you how to download waveforms using HP BASIC for UNIX. It is similar to the previous program example.
  • Page 285 Creating and Downloading Waveform Files Programming Examples Program Comments Program file name. Sets the number of points in the waveform. 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.
  • Page 286: Troubleshooting Waveform Files

    Creating and Downloading Waveform Files Troubleshooting Waveform Files Troubleshooting Waveform Files Symptom Possible Cause Attempting to download a waveform that has the same name as the waveform currently being played by the signal generator. ERROR 224, Text file busy To solve the problem, either change the name of the waveform being downloaded or turn off the ARB.
  • Page 287: Configuring The Pulse/Rf Blank (Agilent Mxg)

    Creating and Downloading Waveform Files Troubleshooting Waveform Files Configuring the Pulse/RF Blank (Agilent MXG) If the default marker is used, toggle the Pulse/RF Blank (None) softkey to None. For more information on markers, refer to “Marker File” on page 193. SCPI commands: [:SOURce]:RADio[1]:ARB:MDEStination:PULSe NONE|M1|M2|M3|M4 [:SOURce]:RADio[1]:ARB:MDEStination:PULSe?
  • Page 288 Creating and Downloading Waveform Files Troubleshooting Waveform Files Agilent N518xA, E8663B, E44x8C, and E82x7D Signal Generators Programming Guide...
  • Page 289: Creating And Downloading User-Data Files

    Creating and Downloading User-Data Files NOTE Some features apply to only the E4438C with Option 001, 002, 601, or 602 and E8267D with Option 601 or 602. These exceptions are indicated in the sections. On the Agilent 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).
  • Page 290: Overview

    Creating and Downloading User-Data Files Overview Overview User data is a generic term for various data types created by the user and stored in the signal generator. This includes the following data (file) types: This file type lets the user download payload data for use in streaming or framed signals.
  • Page 291: Signal Generator Memory

    – Waveform Sequences – (multiple I/Q files played together) a.N5181A, N5183A, E8663B, E4428C, and the E8257D. b.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...
  • Page 292 Instrument State Waveform Sequences – (multiple I/Q files played together) a.N5181A, N5183A, E8663B, E4428C, and the E8257D. The following figure shows the signal generator’s directory structure for the user- data files. Agilent N518xA, E8663B, E44x8C, and E82x7D Signal Generators Programming Guide...
  • Page 293: Memory Allocation

    Creating and Downloading User-Data Files Signal Generator Memory Root directory Agilent MXG (Only): Internal Storage media Volatile memory directory USER (i.e. Nonvolatile memory) BBG1 STATE USERFLAT WAVEFORM Volatile memory data MXG (only) USB media: (WFM1) File listing with extensions WAVEFORM/PRAM Agilent MXG Agilent ESG, PSG, and E8663B (Only): NONVOLATILE...
  • Page 294: Memory Size

    Creating and Downloading User-Data Files Signal Generator Memory (see table on page 284). For example, referring to table on page 284, if the drive size is 15 MB and if the file is less than or equal to 4k bytes, the file uses only one 4 KB cluster of memory. For files larger than 4 KB, and with a drive size of 15 MB, the signal generator allocates additional memory in multiples of 4KB clusters.
  • Page 295: Checking Available Memory

    Creating and Downloading User-Data Files Signal Generator Memory Table 8 Maximum Signal Generator Memory Volatile (WFM1/PRAM) Non- Volatile (NVWFM) Memory Memory Option Size Option Size N5182A 40 MB Standard 512 MB 651, 652, 654 (BBG) USB memory stick user determined 320 MB E4438C and E8267D 001, 601...
  • Page 296: User File Data (Bit/Binary) Downloads (E4438C And E8267D)

    Creating and Downloading User-Data Files User File Data (Bit/Binary) Downloads (E4438C and E8267D) Table 8-1 User-Data File Memory Location User- Data File Download Access Type Memory Memory PRAM Volatile Volatile Instrument Non- volatile Non- volatile State Non- volatile Non- volatile Flatness Non- volatile Non- volatile...
  • Page 297 Creating and Downloading User-Data Files User File Data (Bit/Binary) Downloads (E4438C and E8267D) The signal generator accepts externally created and downloaded user file data for real- time modulation formats that have user file as a data selection (shown as <“file_name”> in the data selection SCPI command).
  • Page 298: User File Bit Order (Lsb And Msb)

    Creating and Downloading User-Data Files User File Data (Bit/Binary) Downloads (E4438C and E8267D) timeslots/frames User File Bit Order (LSB and MSB) The signal generator views the data from the most significant bit (MSB) to the least significant bit (LSB). When you create your user file data, it is important that you organize the data in this manner. Within groups (strings) of bits, a bit’s value (significance) is determined by its location in the string.
  • Page 299 Creating and Downloading User-Data Files User File Data (Bit/Binary) Downloads (E4438C and E8267D) SCPI Command :MEM:DATA:BIT <"file_name">,<bit_interest>,<datablock> :MEM:DATA:BIT "3byte",23, # 1 3 Z&x ASCII representation of the data (3 bytes) Start block data number of bytes number of decimal digits Bits of interest Downloaded Data: 0 1 0 1 1 0 1 0 0 0 1 0 0 1 1 0 0 1 1 1 1 0 0 0...
  • Page 300 Creating and Downloading User-Data Files User File Data (Bit/Binary) Downloads (E4438C and E8267D) more 4- bit nibbles. To make the last nibble, the signal generator adds bits with a value of zero. The signal generator does not show the added bits in the bit editor and ignores the added bits when it modulates the data onto the signal, but these added bits do appear in the hex value displayed in the bit file editor.
  • Page 301: Binary File Type Data

    Creating and Downloading User-Data Files User File Data (Bit/Binary) Downloads (E4438C and E8267D) Binary File Type Data With the Binary file type, the signal generator sees all of the bytes within the downloaded file and attempts to use all of the data bits. When using this file type, the biggest challenge is creating the data, so that the signal generator uses all of the bits (bytes) contained within the file.
  • Page 302: User File Size

    Creating and Downloading User-Data Files User File Data (Bit/Binary) Downloads (E4438C and E8267D) Framed Binary Data When using framed data, ensure that you use an even number of bytes and that the bytes contain enough bits to fill the data fields within a timeslot or frame. When there are not enough bits to fill a single timeslot or frame, the signal generator replicates the data pattern until it fills the timeslot/frame.
  • Page 303: Determining Memory Usage For Custom And Tdma User File Data

    Creating and Downloading User-Data Files User File Data (Bit/Binary) Downloads (E4438C and E8267D) PRAM. (Volatile memory resides on the BBG.) Table 8- 2 shows the maximum file sizes by modulation format and baseband generator option. Table 8-2 Maximum User File Size Baseband Generator Option Modulation Format...
  • Page 304 Creating and Downloading User-Data Files User File Data (Bit/Binary) Downloads (E4438C and E8267D) Calculating Volatile Memory (PRAM) Usage for Unframed Data Use this procedure to calculate the memory size for either a bit or binary file. To properly demonstrate this process, the procedure employs a user file that contains 70 bytes (560 bits), with the bit file using only 557 bits.
  • Page 305 Creating and Downloading User-Data Files User File Data (Bit/Binary) Downloads (E4438C and E8267D) AUTOGEN_PRAM_1 file size. If you select different user files for the timeslots within a frame, the user file that produces the largest number of frames determines the size of the AUTOGEN_PRAM_1 file.
  • Page 306: Downloading User Files

    Creating and Downloading User-Data Files User File Data (Bit/Binary) Downloads (E4438C and E8267D) 8. Round the memory block value up to the next highest integer value. For this example, the AUTOGEN_PRAM_1 file will use 20 blocks of memory for a total of 20480 bytes.
  • Page 307 Creating and Downloading User-Data Files User File Data (Bit/Binary) Downloads (E4438C and E8267D) the file data in bytes :MEM:DATA “bin:my_file”,#324012%S!4&07#8g*Y9@7... file location file_name the location of the file within the signal generator file system bin: my_file the data file name as it will appear in the signal generator’s memory catalog indicates the start of the block data B has three decimal digits...
  • Page 308 Creating and Downloading User-Data Files User File Data (Bit/Binary) Downloads (E4438C and E8267D) Line Code Description—Download User File Data Define an integer variable (bytesToSend) to store the number of bytes to send to the signal generator. Calculate the total number of bytes, and store the value in the integer variable defined in line 1. Create a string large enough to hold the bytesToSend value as characters.
  • Page 309: Command For Bit File Downloads

    Creating and Downloading User-Data Files User File Data (Bit/Binary) Downloads (E4438C and E8267D) Line Code Description—Download User File Data Send the user file data stored in the array (databuffer) to the signal generator. • iwrite() sends the data specified in databuffer to the signal generator (session identifier specified in id).
  • Page 310: Commands For Binary File Downloads

    Creating and Downloading User-Data Files User File Data (Bit/Binary) Downloads (E4438C and E8267D) Table 8-3 Bit File Type SCPI Commands Type Command Syntax Query :MEM:DATA:BIT? <"file_name"> Within the context of a program this query extracts the user file data. Executing the query in a command window causes it to return the following information: <bit_count>,<block_data>.
  • Page 311: Selecting A Downloaded User File As The Data Source

    Creating and Downloading User-Data Files User File Data (Bit/Binary) Downloads (E4438C and E8267D) Table 8-4 Binary File Type Commands Command Command Syntax Type Query :MEM:DATA? "bin:file_name" This returns information on the named file: <bit_count>,<block_data>. Within the context of a program, this query extracts the user file, provided it was download with the proper command.
  • Page 312: Modulating And Activating The Carrier

    Creating and Downloading User-Data Files User File Data (Bit/Binary) Downloads (E4438C and E8267D) :RADio:CUSTom:DATA "BIT:file_name" :RADio:CUSTom:DATA "BIN:file_name" Framed Data :RADio:GSM:SLOT0|1|2|3|4|5|6|7:NORMal:ENCRyption "BIT:file_name" :RADio:GSM:SLOT0|1|2|3|4|5|6|7:NORMal:ENCRyption "BIN:file_name" 3. Configure the remaining signal parameters. 4. Turn the modulation format on: :RADio:CUSTom:STATe On Modulating and Activating the Carrier Use the following commands to modulate the carrier and turn on the RF output.
  • Page 313 Creating and Downloading User-Data Files User File Data (Bit/Binary) Downloads (E4438C and E8267D) Modifying a Bit File with a Hex Editor 1. FTP the file to your PC/UNIX. For information on using FTP, see Procedures. Ensure that you use binary file transfers during FTP operations.
  • Page 314: Understanding Framed Transmission For Real-Time Tdma

    Creating and Downloading User-Data Files User File Data (Bit/Binary) Downloads (E4438C and E8267D) 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> 2. Click the Signal Generator FTP Access button located on the left side of the window. The signal generator files appear in the web browser’s window.
  • Page 315 Creating and Downloading User-Data Files User File Data (Bit/Binary) Downloads (E4438C and E8267D) Figure 8-1 GSM Multiframe Transmission When you select a user file as the data source for a framed transmission, the signal generator’s firmware loads PRAM with the framing protocol of the active TDMA format. This creates a file named AUTOGEN_PRAM_1 in addition to a copy of the user file.
  • Page 316 Creating and Downloading User-Data Files User File Data (Bit/Binary) Downloads (E4438C and E8267D) Figure 8-2 Mapping User File Data to a Single Timeslot NOTE Compliant with the GSM standard, which specifies 156.25- bit timeslots, the signal generator uses 156- bit timeslots and adds an extra guard bit to every fourth timeslot. For this protocol configuration, the signal generator’s firmware loads PRAM with the bits defined in the following table.
  • Page 317: Real-Time Custom High Data Rates

    Creating and Downloading User-Data Files User File Data (Bit/Binary) Downloads (E4438C and E8267D) Event 1 output is set to 0 or 1 depending on the sync out selection, which enables the EVENT 1 output at either the beginning of the frame, beginning of a specific timeslot, or at all timeslots (SCPI command, :RADio:GSM:SOUT FRAME|SLOT|ALL).
  • Page 318 Creating and Downloading User-Data Files User File Data (Bit/Binary) Downloads (E4438C and E8267D) continuous data stream. This means that it does not apply to a downloaded PRAM file type (covered later in this chapter). In parallel mode, for a 256QAM modulation scheme, Custom has the capability to reach a data rate of up to 400 Mbps.
  • Page 319: Pattern Ram (Pram) Data Downloads (E4438C And E8267D)

    Creating and Downloading User-Data Files Pattern RAM (PRAM) Data Downloads (E4438C and E8267D) 32QAM (5 bits per symbol) bit rate = bits per symbol x symbol rate 10 Msps 10.000001 Msps 20 ns 100 ns NOTE: The pulse widths values are only for example purposes. The actual width may vary from the above values. Pattern RAM (PRAM) Data Downloads (E4438C and E8267D) NOTE This section applies only to the E4438C with Option 001, 002, 601, or 602, and the E8267D...
  • Page 320: Understanding Pram Files

    Creating and Downloading User-Data Files Pattern RAM (PRAM) Data Downloads (E4438C and E8267D) E4438C ESG E2867D PSG Custom TDMA Custom a. For ESG, requires Option 001, 002, 601, or 602, for PSG requires Option 601 or 602. b. Real-time TDMA modulation formats require Option 402 and include EDGE, GSM, NADC, PDC, PHS, DECT, and TETRA.
  • Page 321 Creating and Downloading User-Data Files Pattern RAM (PRAM) Data Downloads (E4438C and E8267D) Table 8-5 PRAM Data Byte Function Value Comments Reserved Always 0 Burst 1 = RF on 0 = RF off For non- bursted, non- TDMA systems, to have a continuous signal, set this bit to 1 for all bytes.
  • Page 322 Creating and Downloading User-Data Files Pattern RAM (PRAM) Data Downloads (E4438C and E8267D) Table 8-6 PRAM Byte Patterns and Bit Positions Bit Function Pattern Decimal Value Bit Position - - - Bit Pattern Viewing the PRAM Waveform After the waveform data is written to PRAM, the data pattern can be viewed using an oscilloscope. There is approximately a 12- symbol delay between a state change in the burst bit and the corresponding effect at the RF out.
  • Page 323: Pram File Size

    Creating and Downloading User-Data Files Pattern RAM (PRAM) Data Downloads (E4438C and E8267D) PRAM File Size Because volatile memory resides on the baseband generator (BBG), the maximum PRAM file size depends on the installed baseband generator option, as shown in Table 8- Table 8-7 Maximum PRAM User File Size (Payload Bits Only) Baseband Generator Option...
  • Page 324: Scpi Command For A List Format Download

    Creating and Downloading User-Data Files Pattern RAM (PRAM) Data Downloads (E4438C and E8267D) Minimum File Size A PRAM file requires a minimum of 60 bytes to create a signal. If the downloaded file contains less than 60 bytes, the signal generator replicates the file until the file size meets the 60 byte minimum. This replication process occurs after you select the file and turn the modulation format on.
  • Page 325: Scpi Command For A Block Data Download

    Creating and Downloading User-Data Files Pattern RAM (PRAM) Data Downloads (E4438C and E8267D) Command Syntax :MEMory:DATA:PRAM:FILE:LIST <"file_name">,<uint8>[,<uint8>,<...>] The decimal equivalent of an unsigned 8- bit integer value. For a list of usable uint8 decimal values and their meaning with respect to the generated signal, see Table 8- 6 on page 312.
  • Page 326 Creating and Downloading User-Data Files Pattern RAM (PRAM) Data Downloads (E4438C and E8267D) :MEMory:DATA:PRAM:FILE:BLOCk <"file_name">,#ABC the file name as it will appear in the signal generator <"file_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 the PRAM file data in bytes :MEMory:DATA:PRAM:FILE:BLOCk “my_file”,#324012%S!4&07#8g*Y9@7...
  • Page 327 Creating and Downloading User-Data Files Pattern RAM (PRAM) Data Downloads (E4438C and E8267D) Line Code Description—Download PRAM File Data Define an integer variable (bytesToSend) to store the number of bytes to send to the signal generator. Store the total number of PRAM bytes in the integer variable defined in line 1. numbytes contains the length of the databuffer array referenced in line 8.
  • Page 328: Selecting A Downloaded Pram File As The Data Source

    Creating and Downloading User-Data Files Pattern RAM (PRAM) Data Downloads (E4438C and E8267D) Line Code Description—Download PRAM File Data Send the PRAM file data stored in the array, databuffer, to the signal generator. • iwrite() sends the data specified in databuffer (PRAM data) to the signal generator (session identifier specified in id).
  • Page 329: Modulating And Activating The Carrier

    Creating and Downloading User-Data Files Pattern RAM (PRAM) Data Downloads (E4438C and E8267D) :RADio:GSM:STATe On Modulating and Activating the Carrier Use the following commands to modulate the carrier and turn on the RF output. For a complete listing of SPCI commands, refer to the SCPI Command Reference. :FREQuency:FIXed 1.8GHZ :POWer:LEVel -10.0DBM :OUTPut:MODulation:STATe ON...
  • Page 330 Creating and Downloading User-Data Files Pattern RAM (PRAM) Data Downloads (E4438C and E8267D) CAUTION Ensure that you do not use the :MEMory:DATA:PRAM:FILE:BLOCk command to download an extracted file. 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.
  • Page 331: Modifying Pram Files

    Creating and Downloading User-Data Files Pattern RAM (PRAM) Data Downloads (E4438C and E8267D) Table 8-10 Downloading a File for Extraction Download Method/ Command Syntax Options Memory Type SCPI/non- volatile :MEM:DATA:UNPRotected "NVWFM:file_name",<blockdata> memory :MEM:DATA:UNPRotected "file_name@NVWFM",<blockdata> :MEM:DATA:UNPRotected "/user/waveform/file_name",<blockdata> put <file_name> /user/bbg1/waveform/file_name FTP/volatile memory FTP/non- volatile put <file_name>...
  • Page 332: Fir Filter Coefficient Downloads (N5182A, E4438C And E8267D)

    Creating and Downloading User-Data Files FIR Filter Coefficient Downloads (N5182A, E4438C and E8267D) 60 byte PRAM file prior to downloading 60 byte PRAM file after downloading FIR Filter Coefficient Downloads (N5182A, E4438C and E8267D) NOTE If you encounter problems with this section, refer to “Data Transfer Troubleshooting (N5182A, E4438C and E8267D Only)”...
  • Page 333: Downloading Fir Filter Coefficient Data

    Creating and Downloading User-Data Files FIR Filter Coefficient Downloads (N5182A, E4438C and E8267D) The sampling period (Δt) is equal to the inverse of the sampling rate (FS). The sampling rate is equal to the symbol rate multiplied by the oversample ratio. For example, the GSM symbol rate is 270.83 ksps.
  • Page 334 Creating and Downloading User-Data Files FIR Filter Coefficient Downloads (N5182A, E4438C and E8267D) FIR Filter Data for Custom Modulation The following remote command selects user FIR filter data as the active filter for a custom modulation format. :RADio:CUSTom:FILTer <"file_name"> This command selects the user FIR filter, specified by the file name, as the active filter for the custom modulation format.
  • Page 335: Save And Recall Instrument State Files

    Creating and Downloading User-Data Files Save and Recall Instrument State Files Save and Recall Instrument State Files NOTE References to waveform files and some of the other data file types mentioned in the following sections are not available for all models and options of signal generator. Refer to the instrument’s Data Sheet for the signal generator and options being used.
  • Page 336: Save And Recall Programming Example Using Visa And C

    Creating and Downloading User-Data Files Save and Recall Instrument State Files The recall function recalls a saved instrument state. If there is a data file associated with the instrument state, the file will be loaded along with the instrument state. The following command recalls the instrument state saved in register 01, sequence 1.
  • Page 337 Creating and Downloading User-Data Files Save and Recall Instrument State Files Perform the following steps to run the State_Files program. 1. Copy the State_Files.cs file from the CD–ROM programming examples section to the directory where the .NET Framework is installed. 2.
  • Page 338 Creating and Downloading User-Data Files Save and Recall Instrument State Files // The Agilent 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. //**************************************************************************************** using System;...
  • Page 339 Creating and Downloading User-Data Files Save and Recall Instrument State Files bool quit = false; while (!quit)// Get user input Console.Write("1) Backup state files\n" + "2) Restore state files\n" + "3) Quit\nEnter 1,2,or 3. Your choice: "); string choice = Console.ReadLine(); switch (choice) case "1": BackupInstrumentState(device);...
  • Page 340 Creating and Downloading User-Data Files Save and Recall Instrument State Files the local directory (identified by a ".STA" file name extension) to the signal generator.*/ static public void RestoreInstrumentState(uint device) DirectoryInfo di = new DirectoryInfo(".");// Instantiate object class FileInfo[] rgFiles = di.GetFiles("*.STA"); // Get the state files foreach(FileInfo fi in rgFiles) Match m = Regex.Match(fi.Name, @"^(\d)_(\d\d)");...
  • Page 341 Creating and Downloading User-Data Files Save and Recall Instrument State Files string catalog = ReadDevice(device); /* Match the catalog listing for state files which are named (sequence#)_(register#) e.g. 0_01, 1_01, 2_05*/ Match m = Regex.Match(catalog, "\"(\\d_\\d\\d),"); while (m.Success) // Grab the matched filename from the regular expresssion string nextFile = m.Groups[1].ToString();...
  • Page 342 Creating and Downloading User-Data Files Save and Recall Instrument State Files string retValue = ""; byte[] buf = new byte[MAX_READ_DEVICE_STRING]; // 1024 bytes maximum read uint retCount; if (VisaInterop.Read(device, buf, (uint)buf.Length -1, out retCount) == 0) retValue = Encoding.ASCII.GetString(buf, 0, (int)retCount); return retValue;...
  • Page 343 Creating and Downloading User-Data Files Save and Recall Instrument State Files NOT appended to the block and END is not sent at the conclusion of the write.*/ static public void WriteFileBlock(uint device, string fileName) // Make sure that the file exists, otherwise sends a null block if (File.Exists(fileName)) FileStream fs = new FileStream(fileName, FileMode.Open);...
  • Page 344 Creating and Downloading User-Data Files Save and Recall Instrument State Files LoadConfig = 4 // Declaration of VISA attribute constants public enum VisaAttribute SendEndEnable = 0x3FFF0016, TimeoutValue = 0x3FFF001A // This class provides a way to call the unmanaged Agilent IO Library VISA C // functions from the C# application public class VisaInterop [DllImport("agvisa32.dll", EntryPoint="viClear")]...
  • Page 345 Creating and Downloading User-Data Files Save and Recall Instrument State Files [DllImport("agvisa32.dll", EntryPoint="viOpenDefaultRM")] public static extern int OpenDefaultRM(out uint session); [DllImport("agvisa32.dll", EntryPoint="viRead")] public static extern int Read( uint session, byte[] buf, uint count, out uint retCount); [DllImport("agvisa32.dll", EntryPoint="viSetAttribute")] public static extern int SetAttribute(uint vi, VisaAttribute attribute, uint attrState); [DllImport("agvisa32.dll", EntryPoint="viStatusDesc")] public static extern int StatusDesc(uint vi, int status, byte[] desc);...
  • Page 346: User Flatness Correction Downloads Using C++ And Visa

    Creating and Downloading User-Data Files User Flatness Correction Downloads Using C++ and VISA User Flatness Correction Downloads Using C++ and VISA This sample program uses C++ and the VISA libraries to download user–flatness correction values to the signal generator. The program uses the LAN interface but can be adapted to use the GPIB interface by changing the address string in the program.
  • Page 347 Creating and Downloading User-Data Files User Flatness Correction Downloads Using C++ and VISA //************************************************************************************ // PROGRAM NAME:FlatCal.cpp // PROGRAM DESCRIPTION:C++ Console application to input frequency and amplitude // pairs and then download them to the signal generator. // NOTE: You must have the Agilent 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 348 Creating and Downloading User-Data Files User Flatness Correction Downloads Using C++ and VISA if (status)//if any errors then display the error and exit the program fprintf(stderr, "viOpen failed (%s)\n", instOpenString); return -1; printf("Example Program to Download User Flatness Corrections\n\n"); printf("Enter number of frequency and amplitude pairs: "); int num = 0;...
  • Page 349 Creating and Downloading User-Data Files User Flatness Correction Downloads Using C++ and VISA sprintf((char*)str,":corr:flat:pair %s %c %s\n",pairsList[2*j], c, pairsList[2*j+1]); // << on SAME line! viWrite(vi, str,strlen((char*)str),0); //store the downloaded correction pairs to PSG memory const char* fileName = "flatCal_data";//user flatness file name //write the SCPI command to the buffer str sprintf((char*)str, ":corr:flat:store \"%s\"\n", fileName);//write to buffer viWrite(vi,str,strlen((char*)str),0);//write the command to the PSG...
  • Page 350: Data Transfer Troubleshooting (N5182A, E4438C And E8267D Only)

    Creating and Downloading User-Data Files Data Transfer Troubleshooting (N5182A, E4438C and E8267D Only) Data Transfer Troubleshooting (N5182A, E4438C and E8267D Only) NOTE The section, User FIR Filter Coefficient File Download Problems, applies to the N5182A with Option 651, 652, or 654; the E4438C with Option 001, 002, 601, or 602; and the E8267D with Option 601 or 602.
  • Page 351: Pram Download Problems

    Creating and Downloading User-Data Files Data Transfer Troubleshooting (N5182A, E4438C and E8267D Only) Requirement for Continuous User File Data Transmission “Integer Number of Timeslots” Requirement for Multiple-Timeslots If a user file fills the data fields of more than one timeslot in a continuously repeating framed transmission, the user file is restarted after the last timeslot containing completely filled data fields.
  • Page 352 Creating and Downloading User-Data Files Data Transfer Troubleshooting (N5182A, E4438C and E8267D Only) Table 8-13 PRAM Download - Symptoms and Causes Symptom Possible Cause PRAM download exceeds the size of PRAM memory. ERROR - 223, Too much data Either use a smaller pattern or get more memory by ordering the appropriate hardware option.
  • Page 353: User Fir Filter Coefficient File Download Problems

    Creating and Downloading User-Data Files Data Transfer Troubleshooting (N5182A, E4438C and E8267D Only) User FIR Filter Coefficient File Download Problems Table 8-15 User FIR File Download Trouble - Symptoms and Causes Symptom Possible Cause There is not enough memory available for the FIR coefficient file being downloaded.
  • Page 354 Creating and Downloading User-Data Files Data Transfer Troubleshooting (N5182A, E4438C and E8267D Only) Agilent N518xA, E8663B, E44x8C, and E82x7D Signal Generators Programming Guide...
  • Page 355 Index Symbols memory allocation, non- volatile memory 202, memory allocation, volatile memory Pulse/RF Blank, configuring .NET framework setting GPIB volatile memory types Numerics Waveform Download Assistant 2’s complement data format web server, on 8757d SICL 8, 26, GPIB addresses Signal Studio pass- thru commands Signal Studio Toolkit pass- thru programming...
  • Page 356 Index modifying hex editor window UNIX, using order, user file commands status, monitoring 8757d values pass- thru, troubleshooting bits and bytes Agilent mxg, menu path byte order downloads, binary file byte swapping downloads, bit file changing byte order e8663b interleaving I/Q data e8663b, menu path esg, menu path GPIB 63, 64, 65,...
  • Page 357 Index BERT status utilities calibration status Agilent Signal Studio, Toolkit frequency status IntuiLink for signal generators modulation status Waveform Download Assistant power status waveform data status advanced programming languages status register commands reading, using VISA and C e443xb signal generator files 189, data questionable registers encrypted files for extraction BERT event...
  • Page 358 Index filter data CDMA modulation waveform data custom modulation enter function TDMA format errors 19, W- CDMA modulation ESE commands filters carrier, activating See Agilent esg carrier, modulating even number of samples data limitations event enable register firmware status, monitoring description framed data, usage event registers...
  • Page 359 Index using VISA and C memory locations 199, verifying operation saving to a text file for review GPIB address scaling psg, setting address waveform structure guides iabort ibloc 64, ibstop ibwrt hardware iclear layers, remote programming IEEE standard 22, status, monitoring igpibllo help mode iloc...
  • Page 360 Index suite, overview sockets, programming 61, USB, selecting for libraries VISA LAN, troubleshooting GPIB functionality, verifying IP address GPIB I/O libraries, selecting LAN interface IO, Agilent 2, LAN, assigning RS- 232 setting 29, 30, selecting, for computer setting Agilent mxg setting esg/psg/e8663b list format, downloading iremote...
  • Page 361 PCI- GPIB 26, See Agilent mxg PERL example phase discontinuity n5181a/82a/83a avoiding Pulse/RF Blank configuring Baseband Studio, for Waveform Capture and Playback National Instruments NI- 488.2 26, samples VISA 8, 26, 45, 54,...
  • Page 362 HP Basic Visual Basic 262, setting VXI- 11 Agilent mxg e8663b See Agilent psg Pulse/RF Blank e8663b, setting setting, e8663b esg, setting remote interface n5181a/82a/83a, setting programming psg, setting RS- 232 Agilent N518xA, E8663B, E44x8C, and E82x7D Signal Generators Programming Guide...
  • Page 363 Agilent mxg e8663b samples even number waveform Pulse/RF Blank save and recall e8663b scaling I/Q data SCPI n5181a/82a/83a error queue file transfer methods SICL 8, 45, GPIB, overview GPIB examples 26, programming languages, common iabort reference iclear register model...
  • Page 364 Index PERL setting and querying UNIX system overview Windows using software STB command layers, remote programming storage libraries, IO internal SRE commands non- volatile memory, Agilent mxg SRQ command system requirements SRQ method, status registers standard event status enable register talker group TCP/IP...
  • Page 365 Index memory location PRAM, memory location unencrypted files user- data files downloading for extraction 207, See user data downloading for no extraction 207, extracting I/Q data unframed data, usage volatile memory, PRAM verifying waveforms Version M cable IO Libraries, Agilent 5, functionality, verification viPrintf interface...
  • Page 366 Index programming language HP BASIC, using 267–274 references memory Visual C++ allocation 200, NI- 488.2, queries using size 202, VISA, generating a swept signal volatile and non- volatile Visual C++ and VISA samples generating a swept signal simulation software, using viTerminate structure volatile memory...

This manual is also suitable for:

E4438cN5182aE4428cE8663bE8257dE8267d ... Show all

Table of Contents