Tektronix AFG2021 Programmer's Manual

Tektronix AFG2021 Programmer's Manual

Arbitrary function generator
Hide thumbs Also See for AFG2021:

Advertisement

Quick Links

xx
AFG2021
Arbitrary Function Generator
ZZZ
Programmer Manual
*P077058701*
077-0587-01

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the AFG2021 and is the answer not in the manual?

Questions and answers

Summary of Contents for Tektronix AFG2021

  • Page 1 AFG2021 Arbitrary Function Generator Programmer Manual *P077058701* 077-0587-01...
  • Page 3 AFG2021 Arbitrary Function Generator Programmer Manual www.tektronix.com 077-0587-01...
  • Page 4 Copyright © Tektronix. All rights reserved. Licensed software products are owned by Tektronix or its subsidiaries or suppliers, and are protected by national copyright laws and international treaty provisions. Tektronix products are covered by U.S. and foreign patents, issued and pending. Information in this publication supersedes that in all previously published material.
  • Page 5: Table Of Contents

    Command Descriptions ..................2-17 Status and Events Status and Events ....................Status Reporting Structure .................. Registers ...................... Queues ...................... 3-10 Messages and Codes..................3-11 Programming Examples Programming Examples ..................Appendices Appendix A: SCPI Conformance Information ............... AFG2021 Arbitrary Function Generator Programmer Manual...
  • Page 6 Table of Contents AFG2021 Arbitrary Function Generator Programmer Manual...
  • Page 7: Preface

    In addition to this AFG2021 Arbitrary Function Generator Programmer Manual, the following documentation is available for this instrument: AFG2021 Arbitrary Function Generator Quick Start User Manual. The quick start user manual provides information on installation, general features, operating the instrument, and user interface.
  • Page 8 Preface AFG2021 Arbitrary Function Generator Programmer Manual...
  • Page 9: Getting Started

    Getting Started...
  • Page 11: Overview Of The Manual

    Section 2 also describes the effect of each command and provides examples of how you might use it. The Command Groups subsection provides lists by functional areas. The commands are listed alphabetically in the Command Descriptions section. AFG2021 Arbitrary Function Generator Programmer Manual...
  • Page 12: Connecting The Interface

    Figure 1-3: Event-driven program Connecting the Interface The AFG2021 with Option GL has a 24-pin GPIB connector on its rear panel, as shown in the following figure. (The AFG2021 base model provides a USB port only.) This connector has a D-type shell and conforms to IEEE Std 488.1-1987.
  • Page 13: Using The Gpib Port

    Figure 1-4: GPIB connector (rear panel with Option GL only ) Using the GPIB Port The instrument has Talker/Listener functions through which it can communicate with other devices, as well as the external controller, located on the bus. Figure 1-5: GPIB connection AFG2021 Arbitrary Function Generator Programmer Manual...
  • Page 14: Setting The Gpib Address

    6. Press the Return to up menu button when you have set the GPIB address to save the setting. NOTE. The GPIB address cannot be initialized by the *RST command. Using TekVISA TekVISA is Tektronix implementation of VISA (Virtual Instrument Software Architecture), an industry-standard communication protocol. VISA provides AFG2021 Arbitrary Function Generator Programmer Manual...
  • Page 15 TekVISA to your PC. Unzip the downloaded file in a temporary directory of your choice and run Setup.exe. NOTE. The details on TekVISA concepts and operations are explained in the TekVISA Programmer Manual that can be also found on the Tektronix Web site. AFG2021 Arbitrary Function Generator Programmer Manual...
  • Page 16 Getting Started AFG2021 Arbitrary Function Generator Programmer Manual...
  • Page 17: Syntax And Commands

    Syntax and Commands...
  • Page 19 This section provides the following information: Command Syntax defines the command syntax and processing conventions. Command Groups describes command groups which lists the commands by function. Command Descriptions describes the notation of each of the commands in alphabetical order. AFG2021 Arbitrary Function Generator Programmer Manual...
  • Page 20: Command Syntax

    A command message is a command or query name, followed by any information the instrument needs to execute the command or query. Command messages consist of five element types. AFG2021 Arbitrary Function Generator Programmer Manual...
  • Page 21 The leading colon (:) always returns you to the base of the command tree. Queries. Queries cause the instrument to return information about its status or settings. Queries have the structure: [:]<Header>? [:]<Header>?[<Space><Argument>[<Comma><Argument>]...] AFG2021 Arbitrary Function Generator Programmer Manual...
  • Page 22: Scpi Commands And Queries

    The SCPI language is based on a hierarchical or tree structure as shown in the following figure that represents a subsystem. The top level of the tree is the root node; it is followed by one or more lower-level nodes. Figure 2-1: Example of SCPI subsystem hierarchy tree AFG2021 Arbitrary Function Generator Programmer Manual...
  • Page 23 5 indicates that the following 5 digits (12234) specify the length of the data in bytes; xxxxx ... indicates the data #0xxxxx...<LF><&EOI> boolean Boolean numbers or values ON or ≠ 0 OFF or 0 AFG2021 Arbitrary Function Generator Programmer Manual...
  • Page 24 As shown in the following figure, you can create a short form by using only the upper case letters. The accepted short form and the long form are equivalent and request the same action of the instrument. Figure 2-2: Example of abbreviating a command AFG2021 Arbitrary Function Generator Programmer Manual...
  • Page 25 <NR3>. (SI units are units that conform to the Systeme International d'Unites standard.) For example, you can use the input format 200 mV or 1.0 MHz instead of 200.0E-3 or 1.0E+6, respectively, to specify voltage or frequency. AFG2021 Arbitrary Function Generator Programmer Manual...
  • Page 26 :source:frequency 100mhz SOURCE:frequency 10MHZ NOTE. Literal strings (quoted) are case sensitive, for example, file names. No embedded spaces are allowed between or within nodes. correct :OUTPUT:FILTER:LPASS:FREQUENCY 200MHZ incorrect :OUTPUT: FILTER: LPASS:FREQUENCY 200MHZ AFG2021 Arbitrary Function Generator Programmer Manual...
  • Page 27: Ieee 488.2 Common Commands

    All of the common commands and queries are listed in the last part of the Syntax and Commands section. The following are examples of common commands: *ESE 16 *CLS The following are examples of common queries *ESR? *IDN? AFG2021 Arbitrary Function Generator Programmer Manual...
  • Page 28 Command Syntax 2-10 AFG2021 Arbitrary Function Generator Programmer Manual...
  • Page 29: Command Groups

    Set/query the lock of setup memory overwrite and deletion MEMory:STATe:RECall:AUTo Set/query the recall of last set memory MEMory:STATe:VALid? Query the availability of setup memory *RCL Recall instrument setting from setup memory *SAV Save instrument setting to setup memory AFG2021 Arbitrary Function Generator Programmer Manual 2-11...
  • Page 30 Table 2-11: Source commands Header Description [SOURce]:ROSCillator:SOURce Set/query clock reference input [SOURce[1]]:AM[:DEPTh] Set/query amplitude modulation depth [SOURce[1]]:AM:INTernal:FREQuency Set/query internal modulation frequency [SOURce[1]]:AM:INTernal:FUNCtion Set/query modulation waveform setting [SOURce[1]]:AM:INTernal:FUNCtion:EFILe Set/query EFILe setting [SOURce[1]]:AM:SOURce Set/query amplitude modulation source 2-12 AFG2021 Arbitrary Function Generator Programmer Manual...
  • Page 31 Set/query phase modulation status [SOURce[1]]:PULSe:DCYCle Set/query pulse waveform duty cycle [SOURce[1]]:PULSe:DELay Set/query pulse waveform lead delay [SOURce[1]]:PULSe:HOLD Set/query pulse waveform parameter [SOURce[1]]:PULSe:PERiod Set/query pulse waveform period [SOURce[1]]:PULSe:TRANsition[:LEADing] Set/query pulse waveform leading edge time AFG2021 Arbitrary Function Generator Programmer Manual 2-13...
  • Page 32 Header Description *CLS Clear all event registers and queues *ESE Set/query standard event status enable register *ESR? Return standard event status register *PSC Set/query power-on status clear *SRE Set/query service request enable register 2-14 AFG2021 Arbitrary Function Generator Programmer Manual...
  • Page 33 Synchronization Commands. Synchronization commands let you synchronize the operation of the instrument. The following table lists and describes the Synchronization commands. Table 2-14: Synchronization commands Header Description *OPC Set/query operation complete *WAI Wait to continue AFG2021 Arbitrary Function Generator Programmer Manual 2-15...
  • Page 34 Set/query the period of internal clock Screen Copy. Screen copy command copies screen image and saves it to a file. Table 2-17: Screen copy command Header Description HCOPy:SDUMp[:IMMediate] Copy screen image and save the file to USB memory. 2-16 AFG2021 Arbitrary Function Generator Programmer Manual...
  • Page 35: Command Descriptions

    This command performs an internal calibration and returns 0 (Pass) or a calibration error code. NOTE. The self-calibration can take several minutes to complete. During this time, the instrument does not execute any commands. Do not power off the instrument during the self-calibration. AFG2021 Arbitrary Function Generator Programmer Manual 2-17...
  • Page 36 The self-calibration can take several minutes to complete. During this time, the instrument does not execute any commands. Do not power off the instrument during the self-calibration. Group Calibration and Diagnostic Syntax CALibration[:ALL] CALibration[:ALL]? Related Commands *CAL? Arguments None 2-18 AFG2021 Arbitrary Function Generator Programmer Manual...
  • Page 37 NOTE. The self-test can take several minutes to complete. During this time, the instrument does not execute any commands. Do not power off the instrument during the self-test. Group Calibration and Diagnostic AFG2021 Arbitrary Function Generator Programmer Manual 2-19...
  • Page 38 <NR2> is a range of display brightness from 0.00 through 1.00 (resolution: 3 digits, step: 5%). The larger the value, the higher the screen brightness. MINimum sets the display to the lowest brightness level. MAXimum sets the display to the highest brightness level. Returns <NR2> 2-20 AFG2021 Arbitrary Function Generator Programmer Manual...
  • Page 39 five minutes. Group Display Syntax DISPlay:SAVer[:STATe] {ON|OFF|<NR1>} DISPlay:SAVer[:STATe]? Related Commands DISPlay:SAVer:IMMediate Arguments ON or <NR1>≠0 enables the screen saver function. OFF or <NR1>=0 disables the screen saver function. AFG2021 Arbitrary Function Generator Programmer Manual 2-21...
  • Page 40 Examples DISPLAY[:WINDOW]:TEXT[:DATA] returns the currently displayed text message. DISPlay[:WINDow]:TEXT:CLEar (No Query Form) This command clears the text message from the display screen. Group Display Syntax DISPlay[:WINDow]:TEXT:CLEar 2-22 AFG2021 Arbitrary Function Generator Programmer Manual...
  • Page 41 This query-only command returns the contents of the Standard Event Status Register (SESR) used in the status events reporting system in the instrument. *ESR also clears the SESR (since reading the SESR clears it). AFG2021 Arbitrary Function Generator Programmer Manual 2-23...
  • Page 42 HCOPy:SDUMp[:IMMediate] Arguments None Examples HCOPY:SDUMP[:IMMEDIATE] copies the screen image and may create a file TEK00001.BMP in a USB memory. *IDN? (Query Only) This query-only command returns identification information on the instrument. Group System 2-24 AFG2021 Arbitrary Function Generator Programmer Manual...
  • Page 43 This command sets or queries whether to lock the specified setup memory. If you lock a setup memory, you cannot overwrite or delete the setup file. You cannot execute this command for the setup memory of location number 0 (last setup memory). AFG2021 Arbitrary Function Generator Programmer Manual 2-25...
  • Page 44 MEMory:STATe:RECall:AUTo {ON|OFF|<NR1>} MEMory:STATe:RECall:AUTo? Arguments OFF or <NR1>=0 disables the last setup recall function. ON or <NR1>≠0 enables the recall of the setup memory last used before the instrument was powered off. Returns <NR1> 2-26 AFG2021 Arbitrary Function Generator Programmer Manual...
  • Page 45 MEMORY:STATE:VALID? 1 been saved. MMEMory:CATalog? (Query Only) This query-only command returns the current state of the mass storage system (USB memory). Group Mass Memory Syntax MMEMory:CATalog? Related Commands MMEMory:CDIRectory Arguments None Returns <NR1>,<NR1>[,<file_name>,<file_type>,<file_size>]... where: AFG2021 Arbitrary Function Generator Programmer Manual 2-27...
  • Page 46 This command deletes a file or directory from the mass storage system. If a specified file in the mass storage is not allowed to overwrite or delete, this command causes an error. You can delete a directory if it is empty. Group Mass Memory 2-28 AFG2021 Arbitrary Function Generator Programmer Manual...
  • Page 47 MMEMory:LOAD:TRACe (No Query Form) This command copies a waveform data file in the mass storage system to Edit Memory. If the file format is different, this command causes an error. Group Mass Memory AFG2021 Arbitrary Function Generator Programmer Manual 2-29...
  • Page 48 MMEMory:MDIRectory (No Query Form) This command creates a directory in the mass storage system. If the specified directory is locked in the mass storage system, this command causes an error. Group Mass Memory Syntax MMEMory:MDIRectory <directory_name> 2-30 AFG2021 Arbitrary Function Generator Programmer Manual...
  • Page 49 If the file in the mass storage is locked, this command causes an error. You cannot create a new file if the directory is locked. Group Mass Memory Syntax MMEMory:STORe:TRACe EMEMory,<file_name> AFG2021 Arbitrary Function Generator Programmer Manual 2-31...
  • Page 50 “1” indicates that all pending operations are complete. Examples *OPC might return 1 to indicate that all pending OPC operations are finished. *OPT? (Query Only) This query-only command returns a list of the options installed in your instrument. Group System 2-32 AFG2021 Arbitrary Function Generator Programmer Manual...
  • Page 51 INFinity sets the load impedance to >10 kΩ. MINimum sets the load impedance to 1 Ω. MAXimum sets the load impedance to 10 kΩ. Returns <ohms>::=<NR3> Examples OUTPut1:IMPedance MAXimum sets the CH 1 load impedance to 10 kΩ . AFG2021 Arbitrary Function Generator Programmer Manual 2-33...
  • Page 52 Output Syntax OUTPut[1][:STATe] {ON|OFF|<NR1>} OUTPut[1][:STATe]? Arguments ON or <NR1>≠0 enables the instrument output. OFF or <NR1>=0 disables the instrument output. Returns <NR1> Examples sets the instrument CH 1 output to ON. OUTPUT1:STATE ON 2-34 AFG2021 Arbitrary Function Generator Programmer Manual...
  • Page 53 ESER are set to 0 at power-on. When *PSC is false, the current values in the SRER and ESER are preserved in nonvolatile memory when power is shut off and are restored at power-on. Group Status Syntax *PSC <NR1> *PSC? AFG2021 Arbitrary Function Generator Programmer Manual 2-35...
  • Page 54 *RCL 3 restores the instrument from a copy of the settings stored in memory location 3. *RST (No Query Form) This command resets the instrument to the factory default settings. Group System Syntax *RST 2-36 AFG2021 Arbitrary Function Generator Programmer Manual...
  • Page 55 This command sets or queries the modulation depth of AM modulation for the specified channel. You can set the modulation depth from 0.0% to 120.0% with resolution of 0.1%. Group Source Syntax [SOURce[1]]:AM[:DEPTh] {<depth>|MINimum|MAXimum} [SOURce[1]]:AM[:DEPTh] {MINimum|MAXimum} AFG2021 Arbitrary Function Generator Programmer Manual 2-37...
  • Page 56 You can select the source of modulating signal by using the [SOURce[1]]:AM:SOURce [INTernal|EXTernal] command. Group Source Syntax [SOURce[1]]:AM:INTernal:FREQuency {<frequency>|MINimum|MAXimum} [SOURce[1]]:AM:INTernal:FREQuency {MINimum|MAXimum} Related Commands [SOURce[1]]:AM:SOURce Arguments <frequency>::=<NRf>[<units>] where: <NRf> is the modulation frequency. <units>::=[Hz | kHz | MHz] Returns <frequency> 2-38 AFG2021 Arbitrary Function Generator Programmer Manual...
  • Page 57 This command sets or queries an EFILe name used as a modulating waveform for AM modulation. A file name must be specified in the mass storage system. This command returns “ ” if there is no file in the mass storage. AFG2021 Arbitrary Function Generator Programmer Manual 2-39...
  • Page 58 SOURce1:AM:SOURce INTernal sets the CH 1 source of modulating signal to internal. [SOURce[1]]:AM:STATe This command enables or disables AM modulation for the specified channel. The query command returns the state of AM modulation. 2-40 AFG2021 Arbitrary Function Generator Programmer Manual...
  • Page 59 This command sets or queries the number of cycles (burst count) to be output in burst mode for the specified channel. The query command returns 9.9E+37 if the burst count is set to INFinity. AFG2021 Arbitrary Function Generator Programmer Manual 2-41...
  • Page 60 Source Syntax [SOURce[1]]:BURSt[:STATe] {ON|OFF|<NR1>} [SOURce[1]]:BURSt[:STATe]? Arguments ON or <NR1>≠0 enables the burst mode. OFF or <NR1>=0 disables the burst mode. Returns <NR1> Examples SOURce1:BURSt:STATe ON enables the burst mode for the CH 1. 2-42 AFG2021 Arbitrary Function Generator Programmer Manual...
  • Page 61 When you specify the internal noise, you can set or query the noise level by SOURce<3>:POWer[:LEVel][:IMMediate][:AMPLitude] command. To disable the internal noise add, specify “”. Group Source Syntax [SOURce[1]]:COMBine:FEED [“NOISe”] [SOURce[1]]:COMBine:FEED? Related Commands SOURce<3>:POWer[:LEVel][:IMMediate][:AMPLitude] AFG2021 Arbitrary Function Generator Programmer Manual 2-43...
  • Page 62 This command sets or queries the peak frequency deviation of FM modulation for the specified channel. The setting range of frequency deviation depends on the waveform selected as the carrier. For more information, refer to the AFG2021 instrument Specifications and Performance Verification Manual.
  • Page 63 If you specify EFILe when there is no EFILe or the EFILe is not yet defined, this command causes an error. Group Source Syntax [SOURce[1]]:FM:INTernal:FUNCtion {SINusoid|SQUare|TRIangle| RAMP| NRAMp| PRNoise| USER[1]| USER2|USER3|USER4|EMEMory|EFILe} [SOURce[1]]:FM:INTernal:FUNCtion? Related Commands [SOURce[1]]:FM:SOURce AFG2021 Arbitrary Function Generator Programmer Manual 2-45...
  • Page 64 <file_name> includes path. Path separators are forward slashes (/). Returns <file_name> Examples SOURce1:FM:INTernal:FUNCtion:EFILe “SAMPLE1” sets a file named “SAMPLE1” in the mass storage. [SOURce[1]]:FM:SOURce This command sets or queries the source of modulating signal of FM modulation for the specified channel. 2-46 AFG2021 Arbitrary Function Generator Programmer Manual...
  • Page 65 This command sets or queries the center frequency of sweep for the specified channel. This command is always used with the [SOURce[1]]:FREQuency:SPAN command. The setting range of center frequency depends on the waveform selected for sweep. AFG2021 Arbitrary Function Generator Programmer Manual 2-47...
  • Page 66 The resolution is 1 μHz or 12 digits. For more information, refer to the AFG2021 instrument Specifications and Performance Verification Manual. Group Source...
  • Page 67 SWEep means that the output frequency is controlled by the sweep command set. The sweep is valid. Returns CW|FIXed|SWEep Examples specifies the sweep command set for SOURce1:FREQuency:MODE SWEep controlling the CH 1 output frequency. AFG2021 Arbitrary Function Generator Programmer Manual 2-49...
  • Page 68 The setting range of start frequency depends on the waveform selected for sweep. For more information on the setting range, refer to the specifications page of Quick Start User Manual. Group Source Syntax [SOURce[1]]:FREQuency:STARt {<frequency>|MINimum|MAXimum} [SOURce[1]]:FREQuency:STARt {MINimum|MAXimum} Related Commands [SOURce[1]]:FREQuency:MODE [SOURce[1]]:FREQuency:STOP 2-50 AFG2021 Arbitrary Function Generator Programmer Manual...
  • Page 69 This command sets or queries the stop frequency of sweep for the specified channel. This command is always used with the [SOURce[1]]:FREQuency:STARt command. The setting range of stop frequency depends on the waveform selected for sweep. For more information, refer to the AFG2021 instrument Specifications and Performance Verification Manual. Group...
  • Page 70 You can use this command only when the internal modulation source is selected. Group Source Syntax [SOURce[1]]:FSKey:INTernal:RATE {<rate>|MINimum|MAXimum} [SOURce[1]]:FSKey:INTernal:RATE ? {MINimum|MAXimum} Arguments <rate>::=<NRf>[<units>] where: <NRf> is the modulation rate. <units>::=[Hz | kHz | MHz] 2-52 AFG2021 Arbitrary Function Generator Programmer Manual...
  • Page 71 FSK modulation. You can select a sine, square, ramp, or arbitrary waveform for the carrier waveform. Group Source Syntax [SOURce[1]]:FSKey:STATe {ON|OFF|<NR1>} [SOURce[1]]:FSKey:STATe? Arguments ON or <NR1>≠0 enables FSK modulation. OFF or <NR1>=0 disables FSK modulation. AFG2021 Arbitrary Function Generator Programmer Manual 2-53...
  • Page 72 This command sets or queries the symmetry of ramp waveform for the specified channel. The setting range is 0.0% to 100.0%. Group Source Syntax [SOURce[1]]:FUNCtion:RAMP:SYMMetry {<symmetry>|MINimum|MAXimum} [SOURce[1]]:FUNCtion:RAMP:SYMMetry {MINimum|MAXimum} Arguments <symmetry>::=<NR2>[<units>] where: <NR2> is the symmetry. 2-54 AFG2021 Arbitrary Function Generator Programmer Manual...
  • Page 73 √ √ Sweep √ Burst √ √ If you select a waveform shape that is not allowed with a particular modulation, sweep, or burst, the Run mode will automatically be changed to Continuous. AFG2021 Arbitrary Function Generator Programmer Manual 2-55...
  • Page 74 <units>::=[RAD | DEG] If <units> are omitted, RAD is specified automatically. The setting ranges are: RAD: -2 PI to +2 PI, relative to phase value DEG: -360 to +360, relative to phase value 2-56 AFG2021 Arbitrary Function Generator Programmer Manual...
  • Page 75 You can use this command only when the internal modulation source is selected. You can set the internal modulation frequency from 2 mHz to 50.00 kHz with resolution of 1 mHz. AFG2021 Arbitrary Function Generator Programmer Manual 2-57...
  • Page 76 If you specify EFILe when there is no EFILe or the EFILe is not yet defined, this command causes an error. Group Source Syntax [SOURce[1]]:PM:INTernal:FUNCtion {SINusoid|SQUare|TRIangle| RAMP|NRAMp|PRNoise| USER[1]|USER2|USER3|USER4|EMEMory|EFILe} [SOURce[1]]:PM:INTernal:FUNCtion? Related Commands [SOURce[1]]:PM:SOURce 2-58 AFG2021 Arbitrary Function Generator Programmer Manual...
  • Page 77 <file_name> includes path. Path separators are forward slashes (/). Returns <file_name> Examples SOURce1:PM:INTernal:FUNCtion:EFILe “SAMPLE1” sets a file named “SAMPLE1” in the mass storage. [SOURce[1]]:PM:SOURce This command sets or queries the source of modulation signal of PM modulation for the specified channel. AFG2021 Arbitrary Function Generator Programmer Manual 2-59...
  • Page 78 This command sets or queries the internal noise level which applies to the output signal for the specified channel. The noise level represents the percent against current amplitude level. The setting range is 0 to 50%. 2-60 AFG2021 Arbitrary Function Generator Programmer Manual...
  • Page 79 The instrument will hold the settings of leading edge and trailing edge when the duty cycle is varied. Refer to the [SOURce[1]]:PULSe:WIDTh command for the setting range. Group Source Syntax [SOURce[1]]:PULSe:DCYCle {<percent>|MINimum|MAXimum} [SOURce[1]]:PULSe:DCYCle {MINimum|MAXimum} Related Commands [SOURce[1]]:PULSe:WIDTh AFG2021 Arbitrary Function Generator Programmer Manual 2-61...
  • Page 80 0 ns to Pulse Period - {Pulse Width + 0.8 × (Leading Edge Time + Trailing Edge Time)} (Triggered/Gated burst mode) Returns <delay> Examples SOURce1:PULSe:DELay 20ms sets the CH 1 lead delay to 20 ms. 2-62 AFG2021 Arbitrary Function Generator Programmer Manual...
  • Page 81 This command sets or queries the period for pulse waveform. Group Source Syntax [SOURce[1]]:PULSe:PERiod {<period>|MINimum|MAXimum} [SOURce[1]]:PULSe:PERiod {MINimum|MAXimum} Arguments <period>::=<NRf>[<units>] where: <NRf> is the pulse period. <units>::=[ns | μs | ms | s] Returns <period> AFG2021 Arbitrary Function Generator Programmer Manual 2-63...
  • Page 82 CH 1 leading edge time to 200 ns. [SOURce[1]]:PULSe:TRANsition:TRAiling This command sets or queries the trailing edge time of pulse waveform. Group Source Syntax [SOURce[1]]:PULSe:TRANsition:TRAiling {<seconds>|MINimum| MAXimum} [SOURce[1]]:PULSe:TRANsition:TRAiling {MINimum|MAXimum} Arguments <seconds>::=<NRf>[<units>] where: <NRf> is the trailing edge of pulse waveform. 2-64 AFG2021 Arbitrary Function Generator Programmer Manual...
  • Page 83 {MINimum|MAXimum} Related Commands [SOURce[1]]:PULSe:DCYCle Arguments <seconds>::=<NRf>[<units>] where: <NRf> is the pulse width. <units>::=[ns | μs | ms | s] Returns <seconds> Examples SOURce1:PULSe:WIDTh 200ns sets the CH 1 pulse width to 200 ns. AFG2021 Arbitrary Function Generator Programmer Manual 2-65...
  • Page 84 You can use this command only when the internal modulation source is selected. If you specify EFILe when there is no EFILe or the EFILe is not yet defined, this command causes an error. Group Source 2-66 AFG2021 Arbitrary Function Generator Programmer Manual...
  • Page 85 “ ” if there is no file in the mass storage. Group Source Syntax [SOURce[1]]:PWM:INTernal:FUNCtion:EFILe <file_name> [SOURce[1]]:PWM:INTernal:FUNCtion:EFILe? Arguments <file_name>::=<string> specifies a file name in the mass storage system. The <file_name> includes path. Path separators are forward slashes (/). Returns <file_name> AFG2021 Arbitrary Function Generator Programmer Manual 2-67...
  • Page 86 PWM modulation. You can select only pulse waveform as a carrier waveform for PWM. Group Source Syntax [SOURce[1]]:PWM:STATe {ON|OFF|<NR1>} [SOURce[1]]:PWM:STATe? Arguments ON or <NR1>≠0 enables PWM modulation. OFF or <NR1>=0 disables PWM modulation. Returns <NR1> 2-68 AFG2021 Arbitrary Function Generator Programmer Manual...
  • Page 87 <NR2> is the PWM deviation. <units>::=PCT Returns <percent> Examples SOURce1:PWM[:DEViation]:DCYCle 5.0 sets the CH 1 PWM deviation to 5.0%. [SOURce]:ROSCillator:SOURce This command sets the reference clock to either internal or external. Group Source AFG2021 Arbitrary Function Generator Programmer Manual 2-69...
  • Page 88 <units>::=[ns | μs | ms | s] Returns <seconds> Examples SOURce1:SWEep:HTIMe 1ms sets the CH 1 hold time to 1 ms. [SOURce[1]]:SWEep:MODE The [SOURce[1]]:SWEep:MODE command selects auto or manual for the sweep mode for the specified channel. 2-70 AFG2021 Arbitrary Function Generator Programmer Manual...
  • Page 89 This command sets or queries the sweep return time. Return time represents the amount of time from stop frequency through start frequency. Return time does not include hold time. Group Source Syntax [SOURce[1]]:SWEep:RTIMe {<seconds>|MINimum|MAXimum} [SOURce[1]]:SWEep:RTIMe {MINimum|MAXimum} Arguments <seconds>::=<NRf>[<units>] where: AFG2021 Arbitrary Function Generator Programmer Manual 2-71...
  • Page 90 This command sets or queries the sweep time for the sweep for the specified channel. The sweep time does not include hold time and return time. The setting range is 1 ms to 300 s. Group Source 2-72 AFG2021 Arbitrary Function Generator Programmer Manual...
  • Page 91 [SOURce[1]]:VOLTage[:LEVel][:IMMediate]:HIGH {MINimum|MAXimum} Arguments <voltage>::=<NRf>[<units>] where: <NRf> is the high level of output amplitude. <units>::=[mV | V] Returns <voltage> Examples SOURce1:VOLTage:LEVel:IMMediate:HIGH 1V sets the high level of CH 1 output amplitude to 1 V. AFG2021 Arbitrary Function Generator Programmer Manual 2-73...
  • Page 92 CH 1 output amplitude to -1 V. [SOURce[1]]:VOLTage[:LEVel][:IMMediate]:OFFSet This command sets or queries the offset level for the specified channel. Group Source Syntax [SOURce[1]]:VOLTage[:LEVel][:IMMediate]:OFFSet {<voltage>|MINimum|MAXimum} [SOURce[1]]:VOLTage[:LEVel][:IMMediate]:OFFSet {MINimum|MAXimum} Arguments <voltage>::=<NRf>[<units>] where: <NRf> is the offset voltage level. <units>::=[mV | V] 2-74 AFG2021 Arbitrary Function Generator Programmer Manual...
  • Page 93 Group Source Syntax [SOURce[1]]:VOLTage[:LEVel][:IMMediate][:AMPLitude] {<amplitude>|MINimum|MAXimum} [SOURce[1]]:VOLTage[:LEVel][:IMMediate][:AMPLitude] {MINimum|MAXimum} Arguments <amplitude>::=<NRf>[<units>] where: <NRf> is the output amplitude. <units>::=[VPP | VRMS | DBM] Returns <amplitude> Examples SOURce1:VOLTage:LEVel:IMMediate:AMPLitude 1V sets the CH 1output amplitude to 1 V. AFG2021 Arbitrary Function Generator Programmer Manual 2-75...
  • Page 94 This command sets or queries the lower limit of the output amplitude low level for the specified channel. Group Source Syntax [SOURce[1]]:VOLTage:LIMit:LOW {<voltage>|MINimum|MAXimum} [SOURce[1]]:VOLTage:LIMit:LOW ? {MINimum|MAXimum} Arguments <voltage>::=<NRf>[<units>] where: <NRf> is the lower limit of output amplitude. <units>::=[mV | V] Returns <voltage> 2-76 AFG2021 Arbitrary Function Generator Programmer Manual...
  • Page 95 Returns VPP|VRMS|DBM Examples SOURce1:VOLTage:UNIT VPP sets the voltage units to Vp-p. *SRE This command sets and queries the bits in the Service Request Enable Register (SRER). AFG2021 Arbitrary Function Generator Programmer Manual 2-77...
  • Page 96 32, showing that the bits in the SRER have the binary value of 00100000. STATus:OPERation:CONDition? (Query Only) This query-only command returns the contents of the Operation Condition Register. Group Status Syntax STATus:OPERation:CONDition? Arguments None Returns <bit_value>::=<NR1> 2-78 AFG2021 Arbitrary Function Generator Programmer Manual...
  • Page 97 Operation Event Register. Group Status Syntax STATus:OPERation[:EVENt]? Arguments None Returns <NR1> Examples STATUS:OPERATION[:EVENT]? might return 1 which indicates that the OEVR contains the binary number 00000000 00000001 and the CALibrating bit is set to on. AFG2021 Arbitrary Function Generator Programmer Manual 2-79...
  • Page 98 32 which indicates that STATUS:QUESTIONABLE:CONDITION? the QCR contains the binary number 00000000 00100000 and the accuracy of frequency is questionable. STATus:QUEStionable:ENABle This command sets or queries the mask for the Questionable Enable Register. Group Status 2-80 AFG2021 Arbitrary Function Generator Programmer Manual...
  • Page 99 00000000 00100000 and the FREQuency bit is set to on. *STB? (Query Only) This query-only command returns the contents of the Status Byte Register (SBR) using the Master Summary Status (MSS) bit. Group Status Syntax *STB? AFG2021 Arbitrary Function Generator Programmer Manual 2-81...
  • Page 100 The instrument does not beep when an error or warning caused by remote command execution. Group System Syntax SYSTem:BEEPer:STATe {ON|OFF|<NR1>} SYSTem:BEEPer:STATe? Arguments ON or <NR1>≠0 enables the beeper. OFF or <NR1>=0 disables the beeper. 2-82 AFG2021 Arbitrary Function Generator Programmer Manual...
  • Page 101 This command enables or disables the click sound when you push the front panel buttons or turn the general purpose knob. The query command returns “0” (OFF) or “1” (ON). Group System Syntax SYSTem:KCLick[:STATe] {ON|OFF|<NR1>} SYSTem:KCLick[:STATe]? AFG2021 Arbitrary Function Generator Programmer Manual 2-83...
  • Page 102 OFF or <NR1>=0 unlocks front panel controls. Returns <NR1> Examples SYSTEM:KLOCK[:STATE] ON locks front panel controls. SYSTem:PASSword:CDISable (No Query Form) This command disables protected commands. The instrument security protection is activated. Group System Syntax SYSTem:PASSword:CDISable <password> Related Commands SYSTem:PASSword[:CENable], 2-84 AFG2021 Arbitrary Function Generator Programmer Manual...
  • Page 103 <password>::=<string> specifies current password. The string is case sensitive. Examples SYSTEM:PASSWORD[:CENABLE] <password> deactivates the security protection. SYSTem:PASSword[:CENable]:STATe? (Query Only) This query-only command returns the security protection state. Group System Syntax SYSTem:PASSword[:CENable]:STATe? Related Commands SYSTem:PASSword:CDISable, AFG2021 Arbitrary Function Generator Programmer Manual 2-85...
  • Page 104 <new_password>::=<string> specifies a new password. Password strings are case sensitive. A password must have at least four characters, and not more than 12 characters. Examples SYSTEM:PASSWORD:NEW “DEFAULT”,“abc123” changes the current password DEFAULT to abc123. 2-86 AFG2021 Arbitrary Function Generator Programmer Manual...
  • Page 105 Syntax SYSTem:ULANguage {ENGLish|FRENch|GERMan|JAPanese|KORean|SCHinese| TCHinese|RUSSian} SYSTem:ULANguage? Arguments ENGLish|FRENch|GERMan|JAPanese|KORean|SCHinese|TCHinese|RUSSian specifies which language will be used to display instrument information on the screen. Returns ENGL|FREN|GERM|JAP|KOR|SCH|TCH|RUSS Examples SYSTEM:ULANGUAGE FRENch specifies that the instrument displays information in French. AFG2021 Arbitrary Function Generator Programmer Manual 2-87...
  • Page 106 This query-only command returns the names of user waveform memory and edit memory. Group Trace Syntax TRACe|DATA:CATalog? Arguments None Returns <string> A series of strings separated by commas is returned. Each string is enclosed within quotation marks. Examples TRACE|DATA:CATALOG? might return “USER1”,”USER4”,”EMEM” 2-88 AFG2021 Arbitrary Function Generator Programmer Manual...
  • Page 107 This command transfers the waveform data from the external controller to the edit memory in the instrument. The query command returns the binary block data. Trace Group Syntax TRACe|DATA[:DATA] EMEMory,<binary_block_data> TRACe|DATA[:DATA]? Arguments <binary_block_data> where <binary_block_data> is the waveform data in binary format. Returns <binary_block_data> AFG2021 Arbitrary Function Generator Programmer Manual 2-89...
  • Page 108 DATA:DATA:LINE EMEMory,1,2047,250,4094 sets a data value of 2047 for start point 1 and a data value of 4094 for end point 250, and interpolates linearly between these two points in the edit memory. 2-90 AFG2021 Arbitrary Function Generator Programmer Manual...
  • Page 109 This example indicates that the data value of point number 500 is set to 2047. TRACe|DATA:DEFine (No Query Form) This command resets the contents of edit memory. Group Trace Syntax TRACe|DATA:DEFine EMEMory[,{<points>|<trace_name>}] Arguments <points>::=<NR1> where AFG2021 Arbitrary Function Generator Programmer Manual 2-91...
  • Page 110 This command is invalid when <trace_name> is being output, or <trace_name> is locked. Examples DATA:DELete:NAME USER1 deletes the contents of USER1 waveform memory. TRACe|DATA:LOCK[:STATe] This command sets or queries whether to lock or unlock the user waveform memory. 2-92 AFG2021 Arbitrary Function Generator Programmer Manual...
  • Page 111 2 to 131072. Returns <NR1> Examples sets the waveform data points to 500 in the edit DATA:POINts EMEMory, 500 memory. *TRG (No Query Form) This command generates a trigger event. AFG2021 Arbitrary Function Generator Programmer Manual 2-93...
  • Page 112 TRIGGER:SEQUENCE:SLOPE POSitive sets the trigger slope to positive, which triggers on the rising edge of the signal. TRIGger[:SEQuence]:SOURce This command sets or queries the trigger source for an external trigger signal. Group Trigger 2-94 AFG2021 Arbitrary Function Generator Programmer Manual...
  • Page 113 Arguments <seconds>::=<NRf>[<units>] where: <units>::=[μs | ms | s] Returns <seconds> Examples TRIGGER[:SEQUENCE]:TIMER 5ms sets the internal trigger rate to 5 ms. TRIGger[:SEQuence][:IMMediate] (No Query Form) This command forces a trigger event to occur. AFG2021 Arbitrary Function Generator Programmer Manual 2-95...
  • Page 114 None Returns <NR1> where: <NR1>=0 indicates that the self-test completed without errors. <NR1>≠0 indicates that the instrument detected an error. Examples *TST? performs a self-test and returns 0 if no error is reported. 2-96 AFG2021 Arbitrary Function Generator Programmer Manual...
  • Page 115 OPC message are complete. Group Synchronization Syntax *WAI Related Commands *OPC Arguments None Examples *WAI prevents the instrument from executing any further commands or queries until all pending commands that generate an OPC message are complete. AFG2021 Arbitrary Function Generator Programmer Manual 2-97...
  • Page 116 Command Descriptions 2-98 AFG2021 Arbitrary Function Generator Programmer Manual...
  • Page 117: Status And Events

    Status and Events...
  • Page 119: Status Reporting Structure

    The error and event reporting system consists of the following three blocks: Standard/Event Status Operation Status Questionable Status The operations processed in these blocks are summarized in status bytes, which provide the error and event data. AFG2021 Arbitrary Function Generator Programmer Manual...
  • Page 120 The block has two registers: the Standard Event Status Register (SESR) and the Event Status Enable Register (ESER). Refer to the Standard/Event Status Block shown at the bottom of the previous figure. (See Figure 3-1.) AFG2021 Arbitrary Function Generator Programmer Manual...
  • Page 121: Registers

    The registers in the event reporting system fall into two functional groups: The Status Registers contain information about the status of the instrument. Enable Registers determine whether selected types of events are reported to the Status Registers and the Event Queue. AFG2021 Arbitrary Function Generator Programmer Manual...
  • Page 122 Request Service (RQS) bit and indicates to the controller that a service request has occurred (in other words, that the GPIB bus SRQ line is LOW). The RQS bit is cleared when serial poll ends. AFG2021 Arbitrary Function Generator Programmer Manual...
  • Page 123 Not used Standard Event Status Register (SESR). The SESR records eight types of events that can occur within the instrument as shown in the following figure. Figure 3-3: The Standard Event Status Register (SESR) AFG2021 Arbitrary Function Generator Programmer Manual...
  • Page 124 The command was not executed properly because the conditions for execution is differed from those required. AFG2021 Arbitrary Function Generator Programmer Manual...
  • Page 125 Indicates that the operation is complete. This bit is set when all pending operations complete following the *OPC command. Operation Event Register (OEVR). This register has the same content as the Operation Condition Register. AFG2021 Arbitrary Function Generator Programmer Manual...
  • Page 126 Questionable Event Register (QEVR). This register has the same content as the Questionable Condition Register. Questionable Condition Register (QCR). The Questionable Condition Register is made up of sixteen bits which note the occurrence of two types of events. Figure 3-5: Questionable Condition Register (QCR) AFG2021 Arbitrary Function Generator Programmer Manual...
  • Page 127 Service Request Enable Register (SRER). The SRER consists of bits defined exactly the same as bits 0 through 7 in the SBR. You can use this register to define which events will generate service requests. AFG2021 Arbitrary Function Generator Programmer Manual...
  • Page 128: Queues

    Use the STATus:QUEStionable:ENABle? query to read the contents of the QENR. Figure 3-9: Questionable Enable Register (QENR) Queues There are two types of queues in the status reporting system: output queue and error/event queues. 3-10 AFG2021 Arbitrary Function Generator Programmer Manual...
  • Page 129: Messages And Codes

    Messages and Codes Error and event codes with negative values are SCPI standard codes. Error and event codes with positive values are unique to the AFG2021 instrument. The following table lists event code definitions (See Table 3-5.). When an error occurs, you can find its error class by checking for the code in the following...
  • Page 130 Invalid character in number -123 Exponent too large -124 Too many digits -128 Numeric data not allowed -130 Suffix error -131 Invalid suffix -134 Suffix too long -138 Suffix not allowed -140 Character data error 3-12 AFG2021 Arbitrary Function Generator Programmer Manual...
  • Page 131 -210 Trigger error -211 Trigger ignored -212 Arm ignored -213 Init ignored -214 Trigger deadlock -215 Arm deadlock -220 Parameter error -221 Settings conflict -222 Data out of range -223 Too much data AFG2021 Arbitrary Function Generator Programmer Manual 3-13...
  • Page 132 Macro header not found -280 Program error -281 Cannot create program -282 Illegal program name -283 Illegal variable name -284 Program currently running -285 Program syntax error -286 Program runtime error -290 Memory use error 3-14 AFG2021 Arbitrary Function Generator Programmer Manual...
  • Page 133 The following table shows lists the error codes that are returned in response to an unanswered query. Table 3-9: Query errors Error codes Message query error -400 -410 query INTERRUPTED -420 query UNTERMINATED AFG2021 Arbitrary Function Generator Programmer Manual 3-15...
  • Page 134 *OPC command, completes all selected pending operations. Events Table 3-13: Operation complete events Event code Event message -800 Operation complete Device Errors The following table lists the error codes that are unique to the AFG2021 instrument. 3-16 AFG2021 Arbitrary Function Generator Programmer Manual...
  • Page 135 Self-test failed; CH1 x 20 dB 2 attenuator 2411 Self-test failed; CH1 Filter 2501 Self-test failed; CH1 Sine Flatness 9112 Waveform error; invalid waveform length 9113 Waveform error; waveform length is too short AFG2021 Arbitrary Function Generator Programmer Manual 3-17...
  • Page 136 Status and Events 3-18 AFG2021 Arbitrary Function Generator Programmer Manual...
  • Page 137: Programming Examples

    Programming Examples...
  • Page 139 Windows PC compatible systems equipped with TekVISA and a National Instruments GPIB board with the associated drivers. TekVISA is the Tektronix implementation of the VISA Application Programming Interface (API). TekVISA is industry-compliant software for writing interoperable instrument drivers in a variety of Application Development Environments (ADEs).
  • Page 140 Data = i * Int(16382 / 500) 'Data range is from 0 to 16382 High = Int(Data / 256) 'AFG's Data Format is big endian Low = Data - (High * 256) wave(2 * i) = High wave(2 * i + 1) = Low Next i AFG2021 Arbitrary Function Generator Programmer Manual...
  • Page 141 Low = Data - (High * 256) wave(2 * i) = High wave(2 * i + 1) = Low Next i 'Transfer waveform ' Transfer arbitrary block data to edit memory Tvc1.SendEndEnabled = False Tvc1.WriteString ("TRACE:DATA EMEMORY,#44000") AFG2021 Arbitrary Function Generator Programmer Manual...
  • Page 142 'Copy contents of edit memory to USER1 Tvc1.WriteString ("TRAC:COPY USER1,EMEM") 'Set CH1 output parameters Tvc1.WriteString ("FUNCTION USER1") 'Set output waveform USER1 Tvc1.WriteString ("FREQUENCY 8K") 'Set frequency 8kHz Tvc1.WriteString ("OUTPUT ON") 'Set CH1 output on End Sub AFG2021 Arbitrary Function Generator Programmer Manual...
  • Page 143: Appendices

    Appendices...
  • Page 145: Appendix A: Scpi Conformance Information

    √ CDIRectory(?) √ DELete √ LOAD STATe √ TRACe √ LOCK [STATe](?) √ MDIRectory √ STORe STATe √ TRACe √ OUTPut[1] IMPedance(?) √ POLarity(?) √ [STATe](?) √ TRIGger MODE(?) √ [SOURce] ROSCillator SOURce(?) √ AFG2021 Arbitrary Function Generator Programmer Manual...
  • Page 146 √ FREQuency CENTer(?) √ MODE(?) √ SPAN(?) √ STARt(?) √ STOP(?) √ [CW|FIXed](?) √ INTernal FSKey RATE(?) √ SOURce(?) √ STATe(?) √ [FREQuency](?) √ FUNCtion EFILe(?) √ RAMP SYMMetry(?) √ [SHAPe](?) √ [ADJust](?) √ AFG2021 Arbitrary Function Generator Programmer Manual...
  • Page 147 STATe(?) √ [DEViation] DCYCle(?) √ SWEep HTIMe(?) √ MODE(?) √ RTIMe(?) √ SPACing(?) √ TIME(?) √ VOLTage LIMit HIGH(?) √ LOW(?) √ UNIT(?) √ [LEVel] [IMMediate] HIGH(?) √ LOW(?) √ OFFSet(?) √ [AMPLitude](?) √ AFG2021 Arbitrary Function Generator Programmer Manual...
  • Page 148 SECurity IMMediate √ ULANguage(?) √ VERSion? √ TRACe|DATA CATalog? √ COPY √ [DATA](?) √ LINE √ VALue(?) √ DEFine √ DELete [NAME] √ LOCK [STATe](?) √ POINts(?) √ TRIGger [SEQuence] SLOPe(?) √ SOURce(?) √ AFG2021 Arbitrary Function Generator Programmer Manual...
  • Page 149 [IMMediate] √ *CAL? √ *CLS √ *ESE(?) √ *ESR? √ *IDN? √ *OPC(?) √ *OPT? √ *PSC(?) √ *RCL √ *RST √ *SAV √ *SRE(?) √ *STB? √ *TRG √ *TST? √ *WAI √ AFG2021 Arbitrary Function Generator Programmer Manual...
  • Page 150 Appendix A: SCPI Conformance Information AFG2021 Arbitrary Function Generator Programmer Manual...
  • Page 151 QCR, 3-8 *IDN?, 2-24 QENR, 3-10 QEVR, 3-8 query errors, 3-15 MEMory:STATe:DELete, 2-25 questionable condition register, 3-8 MEMory:STATe:LOCK, 2-25 questionable enable register, 3-10 MEMory:STATe:RECall:AUTo, 2-26 questionable event register, 3-8 MEMory:STATe:VALid?, 2-27 queues, 3-10 AFG2021 Arbitrary Function Generator Programmer Manual Index-1...
  • Page 152 [SOURce[1]]:FSKey:STATe, 2-53 STATus:OPERation:CONDition?, 2-78 [SOURce[1]]:FSKey[:FREQuency], 2-52 STATus:OPERation:ENABle, 2-79 [SOURce[1]]:FUNCtion:EFILe, 2-54 STATus:OPERation[:EVENt]?, 2-79 [SOURce[1]]:FUNCtion:RAMP:SYMMetry, 2-54 STATus:PRESet, 2-80 [SOURce[1]]:FUNCtion[:SHAPe], 2-55 STATus:QUEStionable:CONDition?, 2-80 [SOURce[1]]:PHASe[:ADJust], 2-56 STATus:QUEStionable:ENABle, 2-80 [SOURce[1]]:PM:INTernal:FREQuency, 2-57 STATus:QUEStionable[:EVENt]?, 2-81 [SOURce[1]]:PM:INTernal:FUNCtion, 2-58 *STB?, 2-81 [SOURce[1]]:PM:INTernal:FUNCtion:EFILe, 2-59 Index-2 AFG2021 Arbitrary Function Generator Programmer Manual...
  • Page 153 TRIGger:SEQuence:SLOPe, 2-94 SYSTem:PASSword[:CENable], 2-85 TRIGger[:SEQuence]:SOURce, 2-94 SYSTem:PASSword[:CENable]:STATe?, 2-85 TRIGger[:SEQuence]:TIMer, 2-95 SYSTem:SECurity:IMMediate, 2-87 TRIGger[:SEQuence][:IMMediate], 2-95 SYSTem:ULANguage, 2-87 *TST?, 2-96 SYSTem:VERSion?, 2-88 user request events, 3-16 TRACe|DATA:CATalog?, 2-88 TRACe|DATA:COPY, 2-89 TRACe|DATA:DEFine, 2-91 *WAI, 2-97 TRACe|DATA:DELete[:NAME], 2-92 AFG2021 Arbitrary Function Generator Programmer Manual Index-3...

Table of Contents