background image

Program Comments

The following comments give additional details on the program examples in
this chapter.

Amplitude Effects

on Voltage List

If the segment data is sent as voltage values, the AFG changes the data into
digital-to-analog converter (DAC) codes. This requires that the voltage
value of the segment data MUST NOT exceed the AFG’s current amplitude
level (set by 

[SOURce:]VOLTage[:LEVel][:IMMediate][:AMPLitude]

). If it

does, the AFG generates an error. 

Reference

Oscillator Sources

The 

SINusoid

SQUare

TRIangle

, and 

RAMP

 functions can use any

of the Reference Oscillator Sources. The sources, selected by

[SOURce:]ROSCillator:SOURce

, are:

INTernal

 - 42.94967296 MHz (power-on value)

EXTernal

 - User provided value (the front panel “ Aux In”  BNC)

If using the 

EXTernal

 reference oscillator source, enter the source

frequency to the AFG using

[SOURce:]ROSCillator:FREQuency:EXTernal <

frequency

>

.

Waveforms in the

EPRom

The following are the waveforms located in the EPRom:

EEPRom1

Sine Wave

EEPRom2

Triangle Wave

EEPRom3

Sin(x)/x for 8.25 radians

EEPRom4

Haversine

EEPRom5

Square Wave

EEPRom6

First ten terms of a Square Wave

EEPRom7

First four terms of a Square Wave

EEPRom8

Falling Ramp

EEPRom9

First 20 terms of a Falling Ramp

EEPRom10

Rising Ramp

EEPRom11

First 20 terms of a Rising Ramp

EEPRom12

White Noise

EEPRom13

Modulated White Noise

EEPRom14

A 3rd, 4th, 5th Harmonic Chord

EEPRom15

8 cycles of a linear rising Sine Wave

EEPRom16

Positive half-cycle Sine Wave

 

Chapter 3

Generating Arbitrary Waveforms with the HP E1340A    82

Содержание E1340A

Страница 1: ...age Programs 31 Introductory Programs 36 AFG Self Test 36 Resetting and Clearing the AFG 37 Querying the Power On Reset Configuration 37 Checking for Errors 38 Generating a Sine Wave 40 HP E1340A Example Programs 40 2 Generating Standard Waveforms with the HP E1340A 41 Chapter Contents 41 Standard Waveforms Flowchart 41 Generating DC Voltages 43 C and QuickBASIC Program Versions 44 Generating Sine...

Страница 2: ...al Charge Discharge Waveform 78 Generating a Sine Wave with Spikes 79 Generating a Half Rectified Sine Wave 80 Program Comments 82 Amplitude Effects on Voltage List 82 Reference Oscillator Sources 82 Waveforms in the EPRom 82 4 HP E1340A Sweeping and Frequency Shift Keying 83 Chapter Contents 83 The Command Reference 83 Programming Flowchart 83 Sweeping 85 Sweeping Considerations 85 Sweeping Using...

Страница 3: ...on Count 107 Enabling the Gate 108 6 HP E1340A High Speed Operation 109 Chapter Contents 109 Using DAC Data to Generate Waveforms 109 Program Example 110 Using Definite Length Blocks to Transfer Data 113 Definite Length Block Data Format 113 Data Byte Size 113 Program Example 114 Using the VXIbus Backplane 120 Using the VXIbus Backplane to Download Segment Data 120 Downloading Segment Data into Me...

Страница 4: ...mand Coupling 136 Linking Commands 137 SCPI Command Reference 137 ABORt 138 ARM 139 STARt LAYer 1 COUNt 139 STARt LAYer2 COUNt 140 STARt LAYer2 SLOPe 140 STARt LAYer2 SOURce 141 CALibration 142 AC BEGin 142 AC POINt 143 DATA AC 143 DATA DC 143 DC BEGin 144 DC POINt 144 STATe AC 145 INITiate 146 IMMediate 146 OUTPut 147 IMPedance 147 LOAD 148 SOURce ARBitrary 149 DAC SOURce 149 DOWNload 150 DOWNloa...

Страница 5: ...tor 170 FREQuency EXTernal 170 GATE STATe 171 SOURce 171 SOURce SWEep 173 COUNt 174 POINts 175 TIME 175 SOURce VOLTage 177 LEVel IMMediate AMPLitude 177 LEVel IMMediate AMPLitude UNIT VOLTage 179 LEVel IMMediate OFFSet 180 STATus 181 OPERation QUEStionable CONDition 182 OPERation QUEStionable ENABle 182 OPERation QUEStionable EVENt 183 OPERation QUEStionable NTRansition 183 OPERation QUEStionable ...

Страница 6: ...oup 207 The Status Byte Status Group 208 Using the Standard Event Status Group 210 9 HP E1340A Block Diagram Description 211 Chapter Contents 211 AFG Description 211 What is an Arbitrary Waveform 211 Generating Waveforms 212 Output DAC 212 Memory 213 Reference Oscillator 213 Frequency Generators 213 Output Circuitry 214 Microprocessor 214 Input Output Connectors 214 A HP E1340A Specifications 215 ...

Страница 7: ... 238 The Input Data Register 238 Command Descriptions and Formats 239 Setting the Output Function and Loading RAM 243 Setting the Signal Frequency 244 Setting the Output Attenuation 245 Setting the Amplitude Offset 246 Setting the Sweep Rate 247 Setting the Burst Count 247 The AFG Output Mode 248 Starting the Waveform 251 Querying the AFG 251 AFG Soft Reset 252 Aborting the Waveform 252 Program Ti...

Страница 8: ...e Output 265 Downloading an Arbitrary Waveform 266 Fast Frequency Changes 268 Sending Data Directly to the DAC 271 Example Program Subprograms 272 Querying AFG Parameters 280 Notes 8 HP E1340A Arbitrary Function Generator User s Manual Contents ...

Страница 9: ...this product is the sole responsibility of the Buyer HP does not warrant the Buyer s circuitry or malfunctions of HP products that result from the Buyer s circuitry In addition HP does not warrant any damage that oc curs as a result of the Buyer s circuit or any defects that result from Buyer supplied products NO OTHER WARRANTY IS EXPRESSED OR IMPLIED HP SPECIFICALLY DISCLAIMS THE IMPLIED WARRANTI...

Страница 10: ...the removal of covers or shields are for use by service trained personnel only Under certain conditions dangerous voltages may exist even with the equipment switched off To avoid dangerous electrical shock DO NOT perform procedures involving cover or shield removal unless you are qualified to do so DO NOT operate damaged equipment Whenever it is possible that the safety protection features built i...

Страница 11: ...IEC 801 2 1991 EN50082 1 1992 4kVCD 8kVAD IEC 801 3 1984 EN50082 1 1992 3 V m IEC 801 4 1988 EN50082 1 1992 1kV Power Line 5kV Signal Lines Supplementary Information The product herewith complies with the requirements of the Low Voltage Directive 73 23 EEC and the EMC Directive 89 336 EEC and carries the CE marking accordingly Tested in a typical configuration in an HP B Size VXI mainframe Europea...

Страница 12: ...Notes 12 HP E1340A Arbitrary Function Generator Module User s Manual ...

Страница 13: ...is well organized O O O O O Instructions are easy to understand O O O O O The documentation is clearly written O O O O O Examples are clear and useful O O O O O Illustrations are clear and helpful O O O O O The documentation meets my overall expectations O O O O O Please write any comments or suggestions below be specific cut along this line fold here Your Name Company Name Job Title Address City ...

Страница 14: ...14 HP E1340A Arbitrary Function Generator Module User s Manual ...

Страница 15: ...Programs Page 40 Preparation for Use This section shows how to prepare the AFG for use Included are instructions to install the AFG to download the AFG Device Driver and to address the AFG Installing the AFG The AFG can be installed in any mainframe slot except slot 0 For installation instructions in a B Size VXIbus System refer to the B size Installation and Getting Started Guide For installation...

Страница 16: ...le s HP IB port The program to download the driver is named VXIDLD_GET and is in GET SAVE format The program is located on the HP IBASIC example program disk HP part number E1340 10035 This disk is formatted in the LIF format HP IBASIC in an HP E1300 E1301 Mainframe or HP E1405 E1406 Command Module This system downloads the drivers using the HP IBASIC i e HP Instrument BASIC program language The l...

Страница 17: ... shown in Figure 1 1 The E1340A AFG logical address is used to place the AFG in the servant area of a commander e g HP E1405 E1406 Command Module to address the AFG see Addressing the AFG later in this chapter Figure 1 1 Setting the Logical Address 17 Getting Started with the HP E1340A Chapter 1 ...

Страница 18: ...erface Select Code 8 The IBASIC interface select code is 8 This select code is used to access all devices installed in B size and C size systems under IBASIC control Primary HP IB Address 09 This is the address of the HP IB port on the Mainframe or Command Module Valid addresses are 0 to 30 The mainframe command module has a factory set address of 9 Secondary HP IB Address 10 This address is deriv...

Страница 19: ...uments The HP E1300 E1301 Mainframe or HP E1405 E1406 Command Module with the AFG driver installed interprets the ASCII command strings and sets the AFG accordingly The Mainframe Command Module does this by writing to the AFG registers SCPI Command Structure The AFG SCPI command set is found in Chapter 7 SCPI commands are based on a hierarchical structure also known as a tree system In this system...

Страница 20: ...however the headers are abbreviated In an example program the previous statement with a mode parameter of FIX would appear as SOUR FREQ MODE FIX Command Coupling Many of the AFG SCPI commands are value coupled This means that the value set by one command may affect the valid limits for the values of other commands This can result in Settings Conflict errors when the program executes To prevent the...

Страница 21: ...nt the commands are linked with a semicolon and a colon This is illustrated in the following lines SOUR ROSC SOUR INT SOUR FUNC SHAP SIN or SOUR ROSC SOUR INT SOUR FUNC SHAP SIN Both techniques are used in the programs found throughout this manual Note that the semicolon and colon link commands within different subsystems Only a semicolon is required to link commands within the same subsystem see ...

Страница 22: ...s 4 10 Assign I O path between IBASIC and the E1340A 20 ASSIGN Afg TO 80910 30 COM Afg Waveform 1 4096 40 50 Set up error checking 60 ON INTR 8 CALL Errmsg 70 ENABLE INTR 8 2 80 OUTPUT Afg CLS 90 OUTPUT Afg SRE 32 100 OUTPUT Afg ESE 60 110 120 Call the subprogram which resets the AFG 130 CALL Rst 140 Set AFG parameters 150 OUTPUT Afg SOUR ROSC SOUR INT reference oscillator 160 OUTPUT Afg SOUR FREQ...

Страница 23: ... E1340 440 COM Afg Waveform 450 OUTPUT Afg RST OPC reset the AFG 460 ENTER Afg Complete 470 SUBEND 480 490 SUB Errmsg 500 Errmsg Subprogram which displays E1340 programming errors 510 COM Afg Waveform 520 DIM Message 256 530 Read AFG status byte register and clear service request bit 540 B SPOLL Afg 550 End of statement if error occurs among coupled commands 560 OUTPUT Afg 570 OUTPUT Afg ABORT abo...

Страница 24: ...ing Programs The HP IBASIC programs are stored on the disk as ASCII files The program name is shown in the program title and in line 1 of the program e g 1 RE SAVE ARB_GEN To get a program type GET file name e g GET ARB_GEN Declaring IBASIC Variables in COM common Memory When writing or modifying IBASIC programs array variables can be declared in COM common memory Variables not in COM memory resid...

Страница 25: ...er HP E1301A Mainframe E1405 E1406 Command Module HP E1340A Logical Address 80 Instrument Language SCPI C Compiler Used Unless otherwise noted all C Language programs were compiled and tested using the following compilers Microsoft C Version 5 10 Microsoft QuickC Version 2 0 Borland Turbo C Version 2 0 Borland Turbo C Version 1 0 Running a Program To run a program first compile and link the progra...

Страница 26: ...rogram name path clhpib lib Turbo C and Turbo C tcc ml path program name path tchhpib lib Change the AL and ml parameters to the appropriate types when compiling in the smaller memory models see the appropriate C Language manual for the parameter type C Program Example Following is an example program written in C using the HP 82335 HP IB Interface Card The program sends commands to the AFG to gene...

Страница 27: ...mmands int length void run_query void void rst_clr void void send_data char commands float Wave_seg int num_size void check_error char func_tion void main void Run the program rst_clr Reset the AFG gen_seg Generate segment list and output sequence run_query Query waveform segment memory void gen_seg void char static set_commands Use set_commands to setup the AFG SOUR ROSC SOUR INT Select the Ref O...

Страница 28: ...f float Setup the AFG cmd_exe set_commands sizeof set_commands sizeof char Call routine to check for AFG errors check_error gen_seg set_commands Calculate the segments for loop 0 loop seg_size loop Wave_seg loop loop 00122 Call function to execute the final command with segment data send_data seg_commands Wave_seg seg_size Call routine to check for AFG errors check_error gen_seg seg_commands Setup...

Страница 29: ... and EOL to send continuous data to the AFG send last command IOEOI ISC 0 IOEOL ISC 0 IOOUTPUTS ADDR commands strlen commands Re enable EOL and EOI for normal HP IB operation then send the data IOEOI ISC 1 IOEOL ISC state 2 IOOUTPUTA ADDR Wave_seg num_size void run_query void char name 6 int length 5 Query segment memory IOOUTPUTS ADDR SOUR LIST SEGM SEL 19 IOENTERS ADDR name length printf nWavefo...

Страница 30: ...heck_error char func_tion char into 161 int length 160 IOOUTPUTS ADDR SYST ERR 9 Query error register IOENTERS ADDR into length Enter error message if atoi into 0 Determine if error is present If errors present print and exit while atoi into 0 printf Error s in function s n n into func_tion IOOUTPUTS ADDR SYST ERR 9 IOENTERS ADDR into length exit 1 Chapter 1 Getting Started with the HP E1340A 30 ...

Страница 31: ...ress 80 Instrument Language SCPI Running a Program To run a program first compile and link the program to make an executable file You can either compile and link the program in the QuickBASIC environment or compile and link separately on the command line as follows Using the QuickBASIC Environment To compile and link a program select the QuickBASIC environment as follows qb path program name l pat...

Страница 32: ...s how to send coupled commands performs error checking of the AFG ARB_GEN BAS This program generates a 4096 points ramp The data to generate the ramp is transferred to the AFG as voltages DECLARE SUB GenSeg DECLARE SUB CmdExe Commands Length DECLARE SUB SendData Commands WaveSeg NumSize DECLARE SUB RstClr DECLARE SUB CheckError FuncType DECLARE SUB RunQuery COMMON SHARED ADDR ISC REM INCLUDE QBSET...

Страница 33: ...ual Length Info LEFT Info Actual Length WEND END END IF END SUB SUB CmdExe Commands Length FOR I 1 TO Length CALL IOOUTPUTS ADDR Commands I LEN Commands I NEXT I END SUB SUB GenSeg DIM SetCommands 1 TO 2 DIM OutCommands 1 TO 2 DIM WaveSeg 1 TO 4096 SetCommands 1 SOUR ROSC SOUR INT Select the Ref Oscillator SetCommands 1 SetCommands 1 SOUR FREQ FIX 1e3 Set waveform frequency SetCommands 1 SetComman...

Страница 34: ...rrors CALL CheckError GenSeg SetCommands Calculate the segments store in memory FOR I 1 TO 4096 WaveSeg I I 00122 NEXT I Call function to execute the final command with segment data CALL SendData SegCommands WaveSeg 4096 Call function to check for AFG errors CALL CheckError GenSeg SegCommands Setup the AFG for output CALL CmdExe OutCommands 2 Call function to check for AFG errors CALL CheckError G...

Страница 35: ...RINT PRINT Segment Name Info END SUB SUB SendData Commands WaveSeg NumSize Endline CHR 13 CHR 10 First disable EOI and EOL to send continuous data to the AFG send last command CALL IOEOI ISC 0 CALL IOEOL ISC 0 CALL IOOUTPUTS ADDR Commands LEN Commands Re enable EOL and EOI for normal HP IB operation then send the data CALL IOEOI ISC 1 CALL IOEOL ISC Endline LEN Endline CALL IOOUTPUTA ADDR SEG Wave...

Страница 36: ...d Module Upon completion of the test one of the self test codes listed in Table 1 1 is returned HP IBASIC SLFTST 1 RE SAVE SLFTST 10 Send the self test command enter and display the result 20 DIM Message 256 30 OUTPUT 80910 TST 40 ENTER 80910 Rslt 50 IF Rslt 0 THEN 60 REPEAT 70 OUTPUT 80910 SYST ERR 80 ENTER 80910 Code Message 90 PRINT Code Message 100 UNTIL Code 0 110 END IF 120 PRINT Rslt 130 EN...

Страница 37: ...SIGN Afg TO 80910 30 COM Afg 40 Call the subprogram 50 CALL Rst_cls 60 END 70 80 SUB Rst_cls 90 Rst_cls subprogram which resets and clears the AFG 100 COM Afg 110 OUTPUT Afg RST CLS OPC reset and clear the AFG 120 ENTER Afg Complete 130 SUBEND C and QuickBASIC Programs The C and QuickBASIC versions of RSTCLS are on the C language example programs disk HP P N E1340 10036 Querying the Power On Reset...

Страница 38: ...subprogram added to the HP IBASIC programs to check for errors Line 140 clears the AFG standard event status register Lines 150 and 160 unmask the appropriate bits in the AFGs status byte register and standard event status register When an error occurs the subprogram Errmsg reads the AFG error queue and displays the code and message Note that line 310 is used to force an end of statement condition...

Страница 39: ...rror execution error and command error bits 120 decimal sum 60 in the E1340A standard event status register 130 OUTPUT Afg CLS 140 OUTPUT Afg SRE 32 150 OUTPUT Afg ESE 60 160 170 Subprogram calls would be here 180 190 WAIT 1 allow error branch to occur before turning intr off 200 OFF INTR 8 210 END 220 230 SUB Errmsg 240 Errmsg Subprogram which displays E1340 programming errors 250 COM Afg 260 DIM...

Страница 40: ...O 80910 30 COM Afg 40 50 Reset the AFG 60 CALL Rst 70 OUTPUT AFG SOUR VOLT LEV IMM AMPL 5 set amplitude 80 OUTPUT Afg INIT IMM output sine wave using reset conditions 90 END 100 110 SUB Rst 120 Rst subprogram which resets the AFG 130 COM Afg 140 OUTPUT Afg RST OPC reset the AFG 150 ENTER Afg Complete 160 SUBEND C and QuickBASIC Programs The C and QuickBASIC versions of RSTSINE are on the C languag...

Страница 41: ...re as follows Standard Waveforms Flowchart Page 41 Generating DC Voltages Page 43 Generating Sine Triangle and Square Waves Page 45 Generating Ramp Waves Page 47 Selecting the Amplitude Levels and Output Units Page 50 Program Comments Page 52 Standard Waveforms Flowchart The flowchart on page 42 shows the sequence used to generate standard waveforms The reset power on values of each command are al...

Страница 42: ...Chapter 2 Generating Standard Waveforms with the HP E1340A 42 ...

Страница 43: ... on page 50 for more information HP IBASIC Program Example DCVOLTS 1 RE SAVE DCVOLTS 2 This program outputs 5V dc 3 10 Assign I O path between IBASIC and the E1340A 20 ASSIGN Afg TO 80910 30 COM Afg 40 50 Set up error checking 60 ON INTR 8 CALL Errmsg 70 ENABLE INTR 8 2 80 OUTPUT Afg CLS 90 OUTPUT Afg SRE 32 100 OUTPUT Afg ESE 60 110 120 Call the subprogram which resets the AFG 130 CALL Rst 140 15...

Страница 44: ...ASIC Program Versions The C example program DCVOLTS C is in directory CPROG and the QuickBASIC example program DCVOLTS BAS is in directory QBPROG on the C and QuickBASIC example disk part number E1340 10036 Chapter 2 Generating Standard Waveforms with the HP E1340A 44 ...

Страница 45: ...tion Although RST automatically selects this function it is selected here for good programming practice For the Triangle and Square Wave functions use the TRIangle and SQUare parameters respectively instead of SINusoid 4 Set the Amplitude SOURce VOLTage LEVel IMMediate AMPLitude amplitude This command specifies the amplitude Refer to the section called Selecting the Amplitude Levels and Output Uni...

Страница 46: ...150 Set AFG parameters 160 OUTPUT Afg SOUR FREQ FIX 1E3 frequency 170 OUTPUT Afg SOUR FUNC SHAP SIN function 180 OUTPUT Afg SOUR VOLT LEV IMM AMPL 5V amplitude 190 OUTPUT Afg INIT IMM wait for arm state 200 210 WAIT 1 allow interrupt to be serviced 220 OFF INTR 8 230 END 240 250 SUB Rst 320 SUB Errmsg C and QuickBASIC Program Versions The C example program SINEWAVE C is in directory CPROG and the ...

Страница 47: ...Refer to Appendix B for the frequency limits 3 Select the Function SOURce FUNCtion SHAPe RAMP This command selects the RAMP function 4 Select the Ramp Polarity SOURce RAMP POLarity INVerted This command selects the polarity of the RAMP wave Use NORMal for the initial voltage to go positive use INVerted for the initial voltage to go negative 5 Set the Amplitude SOURce VOLTage LEVel IMMediate AMPLit...

Страница 48: ...N Afg TO 80910 30 COM Afg 40 50 Set up error checking 60 ON INTR 8 CALL Errmsg 70 ENABLE INTR 8 2 80 OUTPUT Afg CLS 90 OUTPUT Afg SRE 32 100 OUTPUT Afg ESE 60 110 120 Call the subprogram which resets the AFG 130 CALL Rst 140 150 Set AFG parameters 160 OUTPUT Afg SOUR ROSC SOUR INT reference oscillator 170 OUTPUT Afg SOUR FREQ FIX 10E3 frequency 180 OUTPUT Afg SOUR FUNC SHAP RAMP function 190 OUTPU...

Страница 49: ...s The C example program RAMPWAVE C is in directory CPROG and the QuickBASIC example program RAMPWAVE BAS is in directory QBPROG on the C and QuickBASIC example disk part number E1340 10036 49 Generating Standard Waveforms with the HP E1340A Chapter 2 ...

Страница 50: ... milliwatt These units are assumed only if no other units are specified in the SOURce VOLTage LEVel IMMediate AMPLitude amplitude command The output units are only valid for amplitude and not offsets volts is required for offsets 3 Set the Amplitude and the Offset SOURce VOLTage LEVel IMMediate AMPLitude amplitude SOURce VOLTage LEVel IMMediate OFFSet offset These commands specify the amplitude an...

Страница 51: ... Set AFG parameters 160 OUTPUT Afg SOUR VOLT LEV IMM AMPL UNIT VOLT VPP output units 200 OUTPUT Afg SOUR VOLT LEV IMM AMPL 8 amplitude 210 OUTPUT Afg SOUR VOLT LEV IMM OFFS 1 offset 220 OUTPUT Afg INIT IMM wait for arm state 230 240 WAIT 1 allow interrupt to be serviced 250 OFF INTR 8 260 END 270 280 SUB Rst 350 SUB Errmsg C and QuickBASIC Program Versions The C example program OUTPUNIT C is in di...

Страница 52: ...mplitude and offset for an open circuit The amplitude and offset range are doubled while resolution worsens by a factor of 2 Output Units Comments The selected unit type can be overridden by sending a unit suffix with the amplitude command For example if the selected unit is VPP sending SOURce VOLTage LEVel IMMediate AMPLitude 5V changes the unit type to volts i e V for that command However the de...

Страница 53: ...ng the values of other commands in effect at that time The values of other commands affecting the MIN and MAX computation are subsequently changed but the already computed MIN and MAX values do not change Thus if a group of coupled commands are sent where the MINimum and MAXimum parameters conflict with the current AFG setting the AFG generates an error This happens even though the commands that f...

Страница 54: ...Chapter 2 Generating Standard Waveforms with the HP E1340A 54 ...

Страница 55: ...opping Page 69 Generating Built In Arbitrary Waveforms Page 73 Sample Programs Page 76 Generating a Damped Sine Wave Page 76 Generating an Exponential Charge Discharge Waveform Page 78 Generating a Sine Wave with Spikes Page 79 Generating a Half Rectified Sine Wave Page 80 Program Comments Page 82 Arbitrary Waveforms Flowchart The flowchart on page 58 shows the commands and the command execution o...

Страница 56: ...n of AB or ABCD waveform segments The AB combination outputs the 8192 point waveform defined by the A and B waveform segments Thus the A segment is output first and then the B segment The ABCD combination outputs the 16384 point waveform defined by the A B C and D waveform segments Thus the A segment is output first and the D segment is output last Similarly the AB combination outputs a waveform w...

Страница 57: ...Figure 3 1 Generating Arbitrary Waveforms 57 Generating Arbitrary Waveforms with the HP E1340A Chapter 3 ...

Страница 58: ...Chapter 3 Generating Arbitrary Waveforms with the HP E1340A 58 ...

Страница 59: ...tor Source see Program Comments later in this chapter 3 Set the Waveform Frequency SOURce FREQuency CW FIXed frequency This command sets the repetition rate of the waveform See Appendix B for the frequency limits 4 Select the Arbitrary Waveform Function SOURce FUNCtion SHAPe USER This command selects the arbitrary waveform function 5 Set the Maximum Output Amplitude SOURce VOLTage LEVel IMMediate ...

Страница 60: ...titutes the waveform segment 8 Select the User Name SOURce FUNCtion USER name This command selects the waveform segment to be output Make the name in this command the same name as the waveform segment to be output 9 Initiate the Waveform INITiate IMMediate This command generates an immediate output with the arm source set to IMMediate Refer to Chapter 5 for triggering information 10 Query the Wave...

Страница 61: ...oscillator 160 OUTPUT Afg SOUR FREQ FIX 1E3 frequency 170 OUTPUT Afg SOUR FUNC SHAP USER function 180 OUTPUT Afg SOUR VOLT LEV IMM AMPL 5 1V scale amplitude 190 200 Call subprogram which defines waveform segment 210 CALL Ramp_wave 220 230 Select output sequence and initiate waveform 240 OUTPUT Afg SOUR FUNC USER A 250 OUTPUT Afg INIT IMM wait for arm state 260 270 WAIT 1 allow interrupt to be serv...

Страница 62: ... ISC 0 respectively ISC contains the HP IB select code and the 0 and NULL values disables the carriage return CR and line feed LF to allow the AFG to receive a command string without a terminator 2 Next sent to the AFG the SCPI SOURce LIST SEGment VOLTage command string using IOOUTPUTS ADDR commands strlen commands ADDR contains the AFG HP IB address commands contains the SCPI command string and s...

Страница 63: ...d line feed LF before transferring all the data The SendData routine in the QuickBASIC program do this as follows refer to the QuickBASIC routine below 1 Disable EOI and EOL using IOEOI ISC 0 and IOEOL ISC 0 respectively ISC contains the HP IB select code the 0 and NULL values disables the carriage return CR and line feed LF to allow the AFG to receive a command string without a terminator 2 Next ...

Страница 64: ... a CR and LF This lets the AFG know that it can receive a new command SUB SendData Commands WaveSeg NumSize Endline CHR 13 CHR 10 First disable EOI and EOL then send the last command CALL IOEOI ISC 0 CALL IOEOL ISC 0 CALL IOOUTPUTS ADDR Commands LEN Commands Re enable EOL and EOI for normal HP IB operation then send the data CALL IOEOI ISC 1 CALL IOEOL ISC Endline LEN Endline CALL IOOUTPUTA ADDR S...

Страница 65: ...eform See Appendix B for the frequency limits 3 Select the Arbitrary Waveform Function SOURce FUNCtion SHAPe USER This command selects the arbitrary waveform function Couple the command to the previous frequency command 4 Set the Maximum Output Amplitude SOURce VOLTage LEVel IMMediate AMPLitude amplitude This command specifies the maximum output amplitude The amplitude must be equal or greater tha...

Страница 66: ...nd Waveform Segment as Voltages SOURce LIST SEGMent VOLTage voltage_list This command stores the points of the B waveform segment into the AFG s segment memory These points are sent to the AFG as volts which are the output voltage points that constitutes the waveform segment 9 Select the User Name SOURce FUNCtion USER AB This command selects the waveform segments to be output i e AB 10 Initiate th...

Страница 67: ...0 150 Set AFG parameters 160 OUTPUT Afg SOUR FREQ FIX 10E3 frequency 170 OUTPUT Afg SOUR FUNC SHAP USER function 180 OUTPUT Afg SOUR VOLT LEV IMM AMPL 5 1V scale amplitude 190 200 Call subprogram which defines waveform segments A and B 210 CALL Sine_tri_wave 220 230 Select output sequence and initiate waveform 240 OUTPUT Afg SOUR FUNC USER AB 250 OUTPUT Afg INIT IMM wait for arm state 260 270 WAIT...

Страница 68: ...UTPUT Afg SOUR LIST SEGM SEL B select segment name 490 OUTPUT Afg SOUR LIST SEGM VOLT Waveform2 load waveform points 500 SUBEND 510 520 SUB Rst 590 SUB Errmsg C and QuickBASIC Program Versions The C example program MULSEG C is in directory CPROG and the QuickBASIC example program MULSEG BAS is in directory QBPROG on the C and QuickBASIC example disk part number E1340 10036 Chapter 3 Generating Arb...

Страница 69: ...t switching 1 Reset the AFG RST The RST command aborts waveform output and sets the AFG to a defined state 2 Setup the AFG for an Arbitrary Waveform Output SOURce FREQuency CW FIXed frequency SOURce FUNCtion SHAPe USER SOURce VOLTage LEVel IMMediate AMPLitude amplitude These commands setup the AFG to output arbitrary waveforms 3 Select the First Waveform Segment SOURce LIST SEGMent SELect A Use A ...

Страница 70: ...Refer to Chapter 5 for triggering information HP IBASIC Program Example ARB_HOP 1 RE SAVE ARB_HOP 2 This program hops selects between two waveform segments based 3 on the level of a 1 kHz 0 to 5V square wave applied to the AFG s 4 Aux In connector A low level selects segment A sine wave a 5 high level selects segment B triangle wave 6 10 Assign I O path between IBASIC and the E1340A 20 ASSIGN Afg ...

Страница 71: ... which defines waveforms 320 COM Afg Waveform1 Waveform2 350 FOR I 1 TO 4096 360 Waveform1 I 5 SIN 2 PI I 4096 370 NEXT I 380 390 OUTPUT Afg SOUR LIST SEGM SEL A Select segment name 400 OUTPUT Afg SOUR LIST SEGM VOLT Waveform1 load waveform points 410 420 FOR I 1 TO 2047 430 Waveform2 I I 0024414 440 NEXT I 450 FOR I 2048 TO 4096 460 Waveform2 I 4096 I 0024414 470 NEXT I 480 490 OUTPUT Afg SOUR LI...

Страница 72: ...example program ARB_HOP C is in directory CPROG and the QuickBASIC example program ARB_HOP BAS is in directory QBPROG on the C and QuickBASIC example disk part number E1340 10036 Chapter 3 Generating Arbitrary Waveforms with the HP E1340A 72 ...

Страница 73: ...ency CW FIXed frequency SOURce FUNCtion SHAPe USER SOURce VOLTage LEVel IMMediate AMPLitude amplitude These commands setup the AFG to output an arbitrary waveform 3 Download the Waveform Data from the EEProm into Memory SOURce ARBitrary DOWNload source dest length This command downloads the segment data from the EPROM where source selects the waveform block in the EPROM dest is the waveform segmen...

Страница 74: ...checking 60 ON INTR 8 CALL Errmsg 70 ENABLE INTR 8 2 80 OUTPUT Afg CLS 90 OUTPUT Afg SRE 32 100 OUTPUT Afg ESE 60 110 120 Call the subprogram which resets the AFG 130 CALL Rst 140 150 Set AFG parameters 160 OUTPUT Afg SOUR FREQ FIX 1E3 frequency 170 OUTPUT Afg SOUR FUNC SHAP USER function 180 OUTPUT Afg SOUR VOLT LEV IMM AMPL 5V amplitude 190 OUTPUT Afg SOUR ARB DOWN EEPR16 A 4096 download wavefor...

Страница 75: ...xample program ROM_DOWN C is in directory CPROG and the QuickBASIC example program ROM_DOWN BAS is in directory QBPROG on the C and QuickBASIC example disk part number E1340 10036 75 Generating Arbitrary Waveforms with the HP E1340A Chapter 3 ...

Страница 76: ...ing a Damped Sine Wave This program generates a Damped Sine Wave using 4096 segments or points HP IBASIC Program Example SIN_D 1 RE SAVE SIN_D 2 This program generates a damped sine wave 3 10 Assign I O path between IBASIC and the E1340A 20 ASSIGN Afg TO 80910 30 COM Afg Waveform 1 4096 40 50 Set up error checking 60 ON INTR 8 CALL Errmsg 70 ENABLE INTR 8 2 80 OUTPUT Afg CLS 90 OUTPUT Afg SRE 32 1...

Страница 77: ...e serviced 280 OFF INTR 8 290 END 300 310 SUB Damped_sine 320 Damped_sine Subprogram which defines a damped sine wave 330 COM Afg Waveform 340 A 4 4096 350 W 2 PI 50 360 FOR T 1 TO 4096 370 Waveform T EXP A T SIN W T 380 NEXT T 390 400 OUTPUT Afg SOUR LIST SEGM SEL A select segment name 410 OUTPUT Afg SOUR LIST SEGM VOLT Waveform load waveform points 420 SUBEND 430 440 SUB Rst 510 SUB Errmsg C and...

Страница 78: ...discharge waveform 210 CALL Charge 310 SUB Charge 320 Charge Subprogram which defines an exponential charge discharge 330 waveform 340 COM Afg Waveform 350 Rc 400 360 FOR T 1 TO 4096 370 IF T 0 AND T 2047 THEN 380 Waveform T 1 1 EXP T Rc 390 END IF 400 IF T 2047 THEN 410 Waveform T 1 1 EXP 2048 Rc 1 1 EXP T 2047 Rc 420 END IF 430 NEXT T 440 450 OUTPUT Afg SOUR LIST SEGM SEL A select segment name 4...

Страница 79: ...page 76 with the following differences 1 RE SAVE SPIKES 2 This program generates a sine wave with a spike 150 Set AFG parameters 160 OUTPUT Afg SOUR FREQ FIX 1E3 frequency 170 OUTPUT Afg SOUR FUNC SHAP USER function 180 OUTPUT Afg SOUR VOLT LEV IMM AMPL 1 5V scale amplitude 190 200 Call subprogram which defines waveform segment 210 CALL Sine_spike 310 SUB Sine_spike 320 Sine_spike Subprogram which...

Страница 80: ...ST SEGM VOLT Waveform load waveform points 470 SUBEND C and QuickBASIC Program Versions The C example program SPIKES C is in directory CPROG and the QuickBASIC example program SPIKES BAS is in directory QBPROG on the C and QuickBASIC example disk part number E1340 10034 Generating a Half Rectified Sine Wave This program generates a Half Rectified Sine Wave using 4096 segments or points Chapter 3 G...

Страница 81: ...R I 1 TO 4096 350 Waveform I SIN 2 PI I 4096 360 NEXT I 370 FOR I 2049 TO 4096 380 Waveform I 0 390 NEXT I 400 410 OUTPUT Afg SOUR LIST SEGM SEL A select segment name 420 OUTPUT Afg SOUR LIST SEGM VOLT Waveform load waveform points 430 SUBEND C and QuickBASIC Program Versions The C example program SIN_R C is in directory CPROG and the QuickBASIC example program SIN_R BAS is in directory QBPROG on ...

Страница 82: ...Hz power on value EXTernal User provided value the front panel Aux In BNC If using the EXTernal reference oscillator source enter the source frequency to the AFG using SOURce ROSCillator FREQuency EXTernal frequency Waveforms in the EPRom The following are the waveforms located in the EPRom EEPRom1 Sine Wave EEPRom2 Triangle Wave EEPRom3 Sin x x for 8 25 radians EEPRom4 Haversine EEPRom5 Square Wa...

Страница 83: ...nce Detailed information on the commands introduced in this chapter can be found in Chapter 7 under Command Reference The commands in this chapter are shown in their entirety optional headers included to help you locate them in the reference Programming Flowchart The flowchart on page 84 shows the commands and the command execution order to generate standard waveforms The reset power on values of ...

Страница 84: ...Chapter 4 HP E1340A Sweeping and Frequency Shift Keying 84 ...

Страница 85: ...rt and Stop Frequencies The following program specifies a start frequency and a stop frequency and continuously sweeps between 0 and 1 MHz The program also queries the start frequency stop frequency center frequency and frequency span to show the relationship between them Using the flowchart as a guide the steps of this program are 1 Select the Reference Oscillator SOURce ROSCillator SOURce source...

Страница 86: ...FREQ MODE SWE frequency mode 180 OUTPUT Afg SOUR FREQ STAR 0 start frequency 190 OUTPUT Afg SOUR FREQ STOP 1E6 stop frequency 200 OUTPUT Afg SOUR FUNC SHAP SIN function 210 OUTPUT Afg SOUR VOLT LEV IMM AMPL 5V amplitude 220 OUTPUT Afg INIT IMM wait for arm state 230 240 Call subprogram which queries sweep parameters 250 CALL Query 260 270 WAIT 1 allow interrupt to be serviced 280 OFF INTR 8 290 EN...

Страница 87: ...start stop center and span values returned are START 0 000000000E 000 STOP 1 000000000E 006 CENTER 5 000000000E 005 SPAN 1 000000000E 006 C and QuickBASIC Programs The C program SMPLSWP1 C is in directory CPROG and the QuickBASIC program SMPLSWP1 BAS is in directory QBPROG on the example program disk HP P N E1340 10036 87 HP E1340A Sweeping and Frequency Shift Keying Chapter 4 ...

Страница 88: ... LEVel IMMediate AMPLitude amplitude 6 Place the AFG in the Wait for arm State INITiate IMMediate HP IBASIC SMPLSWP2 1 RE SAVE SMPLSWP2 2 This program sweeps a sine wave from 1 kHz to 21 kHz by 3 specifying a start frequency and a frequency span 4 10 Assign I O path between IBASIC and the E1340A 20 ASSIGN Afg TO 80910 30 COM Afg 40 50 Set up error checking 60 ON INTR 8 CALL Errmsg 70 ENABLE INTR 8...

Страница 89: ...eep2 370 OUTPUT Afg SOUR FREQ CENT 380 ENTER Afg Sweep3 390 OUTPUT Afg SOUR FREQ SPAN 400 ENTER Afg Sweep4 410 PRINT START Sweep1 STOP Sweep2 420 PRINT 430 PRINT CENTER Sweep3 SPAN Sweep4 440 SUBEND 450 460 SUB Rst 530 SUB Errmsg The start stop center and span values returned are START 1 000000000E 003 STOP 2 100000000E 004 CENTER 1 100000000E 004 SPAN 2 000000000E 004 C and QuickBASIC Programs Th...

Страница 90: ...y Sweep SOURce SWEep POINts number 5 Set the Sweep Repetition Time SOURce SWEep TIME number 6 Set the Output Function SOURce FUNCtion SHAPe shape 7 Set the Signal Amplitude SOURce VOLTage LEVel IMMediate AMPLitude amplitude 8 Place the AFG in the Wait for arm State INITiate IMMediate HP IBASIC SWP_PVST 1 RE SAVE SWP_PVST 2 This program sweeps a sine wave from 5 kHz to 15 kHz 3 in 0 5 seconds to de...

Страница 91: ...UTPUT Afg SOUR FUNC SHAP SIN function 220 OUTPUT Afg SOUR VOLT LEV IMM AMPL 5V amplitude 230 OUTPUT Afg INIT IMM wait for arm state 240 250 WAIT 1 allow interrupt to be serviced 260 OFF INTR 8 270 END 280 290 SUB Rst 360 SUB Errmsg C and QuickBASIC Programs The C program SWP_PVST C is in directory CPROG and the QuickBASIC program SWP_PVST BAS is in directory QBPROG on the example program disk HP P...

Страница 92: ...d using the frequency shift keying function of the AFG A 5V 1 kHz square wave control signal is applied to the AFG s front panel FSK port Output frequencies of 20 kHz and 10 kHz occur as the level of the 1 kHz signal changes Using the flowchart as a guide the steps of this program are 1 Select the Reference Oscillator SOURce ROSCillator SOURce source 2 Select the Frequency shift Keying Mode SOURce...

Страница 93: ... Rst 140 150 Set AFG parameters 160 OUTPUT Afg SOUR ROSC SOUR INT reference oscillator 170 OUTPUT Afg SOUR FREQ MODE FSK frequency mode 180 OUTPUT Afg SOUR FREQ FSK 10E3 20E3 FSK frequencies 190 OUTPUT Afg SOUR FUNC SHAP SIN function 200 OUTPUT Afg SOUR VOLT LEV IMM AMPL 5V amplitude 210 OUTPUT Afg INIT IMM wait for arm state 220 230 WAIT 1 allow interrupt to be serviced 240 OFF INTR 8 250 END 260...

Страница 94: ...uency MODE command are CW FIXed Single frequency mode FSKey Frequency shift keying mode SWEep Frequency sweep mode Frequency Points The number of frequencies generated points in a frequency sweep can be from 2 to 1 073 741 824 The default number is 1001 The number of points is set with the SOURce SWEep POINts command and applies to sweeps only Specifying a Sweep Time The sweep time set by SOURce S...

Страница 95: ...uration The HP E1340A AFG uses an ARM triggering configuration to output the standard and arbitrary waveforms When initiated an arm signal enables the AFG to output the waveforms each time an arm signal is received The ARM States The AFG operates within three states Idle Wait for arm and Instrument Action When power is applied or following a reset or an abort the AFG is in the Idle state The AFG i...

Страница 96: ...Mediate is executed when the AFG is not in the Idle state error 213 Init ignored is generated Arming the AFG In order for the AFG to output a waveform it must be armed The information in this section covers the commands and programming sequence used to arm the AFG for fixed frequency waveform generation Arming Commands The commands which arm the AFG allow you to specify the following the arm sourc...

Страница 97: ...ource When the AFG receives as arming signal it outputs a 10 kHz 1 Vpp square wave The steps of this program are 1 Select the FIXed Frequency Mode SOURce FREQuency MODE mode 2 Set the Output Frequency SOURce FREQuency CW FIXed frequency 3 Set the Output Function SOURce FUNCtion SHAPe shape 4 Set the Signal Amplitude SOURce VOLTage LEVel IMMediate AMPLitude amplitude 5 Set the Arm Source ARM STARt ...

Страница 98: ... OUTPUT Afg SOUR FREQ MODE FIX frequency mode 170 OUTPUT Afg SOUR FREQ FIX 1E3 frequency 180 OUTPUT Afg SOUR FUNC SHAP SQU function 190 OUTPUT Afg SOUR VOLT LEV IMM AMPL 1VPP amplitude 200 OUTPUT Afg ARM STAR LAY2 SOUR EXT arm source 210 OUTPUT Afg ARM STAR LAY2 COUN INF arm count 220 OUTPUT Afg ARM STAR LAY1 COUN 1E3 cycle count 230 OUTPUT Afg INIT IMM wait for arm state 240 250 WAIT 1 allow inte...

Страница 99: ...output switching The steps of this program are 1 Set the Output Burst Frequency SOURce FREQuency CW FIXed frequency 2 Set the Output Function SOURce FUNCtion SHAPe shape 3 Set the Signal Amplitude SOURce VOLTage LEVel IMMediate AMPLitude amplitude 4 Set the Arm Source ARM STARt LAYer2 SOURce source 5 Set the Edge of the External Arm Signal ARM STARt LAYer2 SLOPe edge 6 Set the Arm Count ARM STARt ...

Страница 100: ...ts the AFG 130 CALL Rst 140 150 Set AFG parameters 160 OUTPUT Afg SOUR FREQ FIX 10E3 frequency 170 OUTPUT Afg SOUR FUNC SHAP SIN function 180 OUTPUT Afg SOUR VOLT LEV IMM AMPL 2 5VPP amplitude 190 OUTPUT Afg ARM STAR LAY2 SOUR EXT arm source 200 OUTPUT Afg ARM STAR LAY2 SLOP POS arm slope 210 OUTPUT Afg ARM STAR LAY2 COUN INF arm count 220 OUTPUT Afg ARM STAR LAY1 COUN 5 cycle count 230 OUTPUT Afg...

Страница 101: ...ed frequency 3 Set the Output Function SOURce FUNCtion SHAPe shape 4 Set the Signal Amplitude SOURce VOLTage LEVel IMMediate AMPLitude amplitude 5 Set the Gate State On SOURce ROSCillator GATE STATe state 6 Place the AFG in the Wait for arm State INITiate IMMediate HP IBASIC GATE_SIG 1 RE SAVE GATE_SIG 2 This program gates the output of a 10 kHz triangle wave When 3 the gate signal is high the gat...

Страница 102: ... 220 WAIT 1 allow interrupt to be serviced 230 OFF INTR 8 240 END 250 260 SUB Rst 330 SUB Errmsg C and QuickBASIC Programs The C program GATE_SIG C is in directory CPROG and the QuickBASIC program GATE_SIG BAS is in directory QBPROG on the example program disk HP P N E1340 10036 Aborting Waveforms Aborting a waveform places the AFG in the Idle state The waveform is halted and the output remains at...

Страница 103: ...and low when the main output is 0V Note that since an analog comparator detects zero crossing it may not detect exact crossing Also at high frequencies the comparator s sensitivity declines and it may not detect signal excursions much less than the DAC s full scale range for both negative and positive polarities SEGMent This source outputs a marker pulse at the completion of a segment For multiple...

Страница 104: ...le The commands are 1 Reset the AFG RST 2 Setup the AFG for an Arbitrary Waveform Output SOURce FREQuency CW FIXed frequency SOURce FUNCtion SHAPe USER SOURce VOLTage LEVel IMMediate AMPLitude amplitude 3 Select the Marker Source SOURce MARKer FEED source 4 Select the Marker Pulse Polarity SOURce MARKer POLarity polarity 5 Generate and Store the First Waveform Segment SOURce LIST SEGMent SELect A ...

Страница 105: ...uency 170 OUTPUT Afg SOUR FUNC SHAP USER function 180 OUTPUT Afg SOUR VOLT LEV IMM AMPL 5 1V scale amplitude 190 OUTPUT Afg SOUR MARK FEED OUTP ZERO marker source 200 OUTPUT Afg SOUR MARK POL INV marker source polarity 210 220 Call subprogram which defines waveform segments A and B 230 CALL Sine_tri_wave 240 250 Select output sequence and initiate waveform 260 OUTPUT Afg SOUR FUNC USER AB 270 OUTP...

Страница 106: ... 4096 I 0024414 480 NEXT I 490 500 OUTPUT Afg SOUR LIST SEGM SEL B select segment name 510 OUTPUT Afg SOUR LIST SEGM VOLT Waveform2 load waveform points 520 SUBEND 530 540 SUB Rst 610 SUB Errmsg C and QuickBASIC Programs The C program MARK_OUT C is in directory CPROG and the QuickBASIC program MARK_OUT BAS is in directory QBPROG on the example program disk HP P N E1340 10036 Chapter 5 HP E1340A Ar...

Страница 107: ...Rt LAYer2 SOURce source is for fixed continuous frequency waveforms AFG Arming Sources The arming sources set by the ARM STARt LAYer2 SOURce source command are EXTernal The HP E1340A s front panel Start Arm In BNC connector TTL levels Available for repetitive burst output only IMMediate Immediate arming An arm is internally generated when the start trigger sequence enters the wait for arm state AF...

Страница 108: ...reference oscillator can be gated the gate must be enabled This is done with the SOURce ROSCillator GATE STATe command When the mode is ON gating is enabled When OFF gating is disabled Chapter 5 HP E1340A Arming and Marker Outputs 108 ...

Страница 109: ...sferring waveform segments as Digital to Analog Converter DAC Codes to the AFG is faster than transferring a voltage list The following shows how to transfer the lists as DAC codes using 16 bit integers The DAC codes are transferred to the AFG as a comma separated list Be sure to set the upper 4 bits of the integers to 0 Determining DAC Codes For outputs into matched loads and with the amplitude s...

Страница 110: ...tomatically sets this command it is given here for good programming practice 4 Select the Waveform Segment SOURce LIST SEGMent SELect name Use either A B C or D in name for the waveform segment 5 Store the Waveform Segment as DAC Data SOURce LIST SEGMent VOLTage DAC voltage_list This command stores the waveform segment into segment memory using DAC codes consisting of 16 bit integers 6 Generate th...

Страница 111: ...orm 240 OUTPUT Afg SOUR FUNC USER A 250 OUTPUT Afg INIT IMM wait for arm state 260 270 WAIT 1 allow interrupt to be serviced 280 OFF INTR 8 290 END 300 310 SUB Ramp_wave 320 Ramp_wave Subprogram which defines ramp waveform 330 COM Afg Waveform 340 FOR I 2048 TO 2047 STEP 1 calculate waveform points as dac codes 350 Waveform 2049 I I 0024426 0025 2048 360 NEXT I 370 380 OUTPUT Afg SOUR ARB DAC SOUR...

Страница 112: ...am UNS_DAT BAS is in directory QBPROG on the C and QuickBASIC example disk part number E1340 10036 This program is very similar to the example programs used in Chapter 3 The only difference is that this program transfers the segment data as DAC codes instead of voltage values Chapter 6 HP E1340A High Speed Operation 112 ...

Страница 113: ...the number of data bytes to be sent for example if 4096 data bytes are to be sent digits equals 4096 see Data Byte Size below 8 bit data bytes is the data i e DAC codes sent to the AFG A typical example of a data block sending 8192 8 bit data bytes is 48192 data bytes Data Byte Size The DAC codes are transferred to the AFG as 16 bit integer values that meet the coding set by the IEEE 488 2 standar...

Страница 114: ...itude 3 Select the DAC Data Source SOURce ARBitrary DAC SOURce INTernal This command selects the source that transfers data to the DAC see Program Comments Use INTernal to transfer the data using the SOURce LIST 1 subsystem 4 Select the Waveform Segment SOURce LIST SEGMent SELect name Use either A B C or D in name for the waveform segment 5 Store the Waveform Segment as DAC Data SOURce LIST SEGMen...

Страница 115: ...Afg1 TO 80910 FORMAT OFF path for binary data 40 COM Afg Afg1 INTEGER Waveform 1 4096 50 60 Set up error checking 70 ON INTR 8 CALL Errmsg 80 ENABLE INTR 8 2 90 OUTPUT Afg CLS 100 OUTPUT Afg SRE 32 110 OUTPUT Afg ESE 60 120 130 Call the subprogram which resets the AFG 140 CALL Rst 150 160 Set AFG parameters 170 OUTPUT Afg SOUR FREQ FIX 1E3 frequency 180 OUTPUT Afg SOUR FUNC SHAP USER function 190 ...

Страница 116: ...inite Length Block Data to the AFG requires that the data sent with the SOURce LIST SEGMent VOLTage DAC command must be contiguous To do this send no carriage return CR and line feed LF before transferring all the data The send_data function does this as follows refer to the C function below 1 Disable EOI and EOL using IOEOI ISC 0 and IOEOL ISC 0 respectively ISC contains the HP IB select code and...

Страница 117: ...plete non zero digit digits 8 bit data bytes block to the AFG Since the DAC codes are in a 16 bit integer format the programs send 2 8 bit data bytes for each DAC code all values are sent in one data block The number of data bytes transferred depends on the number in num_bytes 5 After all the data is sent the function sends blank data using IOOUTPUTS ADDR 0 to terminate the data transfer with a CR...

Страница 118: ...F is disabled the AFG holds execution until all the data is sent 3 Enable EOI and EOL using IOEOI ISC 1 and IOEOL ISC Endline LEN Endline respectively The variable Endline contains the decimal codes for CR and LF Although EOL and EOI are enabled no CR and LF is sent until all voltage data transfer is completed next step 4 The DAC data values are sent next using the array WaveSeg 1 in IOOUTPUTAB AD...

Страница 119: ...1 CALL IOEOL ISC Endline LEN Endline CALL IOOUTPUTS ADDR 0 END SUB Swapping the Data Bytes The C and QuickBASIC programs used with a PC type computer sends the least significant bit LSB of the data byte first and the most significant bit MSB last Thus IOOUTPUTAB must swap the data bytes in order to send the LSB last To do this set swap in IOOUTPUTAB ADDR Wave_seg num_bytes swap C program or SwapSi...

Страница 120: ...G s A16 address space see Appendix C for information on registers Downloading Directly into the DAC This method immediately outputs the DAC data point when received The DAC code received by the AFG sets the DAC to output to the received value Send the DAC codes as 16 bit integers with the upper 4 bits set to 0 Send the DAC data directly into the AFG s register with address 12 decimal 0C hex offset...

Страница 121: ...ds are Executed OPC This command allows the AFG to wait until it has executed all commands before the computer begins sending the data If the computer sends the data too soon it will be lost 6 Setup the AFG to Store the Second Waveform Segment SOURce ARBitrary DOWNload source dest length The source is VXI for the VXIbus the dest is the name of the waveform segment to receive the data i e A B C or ...

Страница 122: ...nd to the AFG after all data is downloaded 10 Generate Download and Store the Second Waveform Segment as DAC Codes This step stores the DAC codes of the Waveform Segment into memory The command or downloading method used depends on the device that downloads the data For example the device may be an embedded controller like the HP E1480A V360 Controller You can also use the HP E1405A E1406A Command...

Страница 123: ...ress space The base 50 address is used with the AFG s input data register offset to form 60 the complete register address 70 Base_addr DVAL 1FC000 16 80 64 80 90 COM Afg Base_addr INTEGER Wave1 1 4096 INTEGER Wave2 1 4096 100 110 Set up error checking 120 ON INTR 8 CALL Errmsg 130 ENABLE INTR 8 2 140 OUTPUT Afg CLS 150 OUTPUT Afg SRE 32 160 OUTPUT Afg ESE 60 170 180 Call the subprogram which reset...

Страница 124: ...ve1 I load waveform points 500 NEXT I 510 OUTPUT Afg OPC allow downloading to complete 520 ENTER Afg Ready 530 OUTPUT Afg SOUR ARB DOWN COMP disable downloading from VXIbus 540 550 FOR I 1 TO 2047 calculate waveform points as dac codes 560 Wave2 I I 0024414 0025 2048 570 NEXT I 580 FOR I 2048 TO 4096 590 Wave2 I 4096 I 0024414 0025 2048 600 NEXT I 610 620 OUTPUT Afg SOUR ARB DAC SOUR INT dac data ...

Страница 125: ...programs use the HP E1405A E1406A Command Module version A 06 00 or above or the HP E1300A E1301A Mainframe version A 06 00 or above to download the data into memory However the command module mainframe is only used to demonstrate the downloading method for C and QuickBASIC A better method is to use an embedded controller If you wish to use the HP E1405A E1406A Command Module or HP E1300A E1301A M...

Страница 126: ...see Program Comments Use VXI to transfer the data directly to the DAC 5 Wait Until All Commands are Executed OPC This command allows the AFG to wait until it has executed all commands before the computer begins sending the data If the computer sends the data too soon it will be lost 6 Generate and Download the DAC Codes This step transfers the DAC codes to the DAC The command or downloading method...

Страница 127: ... 50 address is used with the input data register offset to form the 60 complete register address 70 Base_addr DVAL 1FC000 16 80 64 80 90 COM Afg Base_addr INTEGER Waveform 1 4096 100 110 Set up error checking 120 ON INTR 8 CALL Errmsg 130 ENABLE INTR 8 2 140 OUTPUT Afg CLS 150 OUTPUT Afg SRE 32 160 OUTPUT Afg ESE 60 170 180 Call the subprogram which resets the AFG 190 CALL Rst 200 Set AFG paramete...

Страница 128: ...OP 480 FOR I 1 TO 4096 continually download dac codes 490 WRITEIO 9826 Base_addr 12 Waveform I 500 NEXT I 510 END LOOP 520 SUBEND 530 540 SUB Rst 610 SUB Errmsg C and QuickBASIC Program Version The C example program VXISRCE C is in directory CPROG and the QuickBASIC example program VXISRCE BAS is in directory QBPROG on the C and QuickBASIC example disk part number E1340 10036 The C and QuickBASIC ...

Страница 129: ...ge list the output amplitude can be set to any of the values listed in Appendix B The amplitude does not have to be to the maximum DAC code value Incorrect AFG Operation from Incorrect DAC Codes The AFG requires that the data it receives must be correct or it will not execute it correctly Unlike using other data transfer methods the AFG does not perform any error checking on the data when it is di...

Страница 130: ...Chapter 6 HP E1340A High Speed Operation 130 ...

Страница 131: ...Reference Page 137 Common Command Reference Page 188 HP E1340A Command Quick Reference Page 197 SCPI Conformance Information Page 200 ABORt 138 ARM 139 STARt SEQuence 1 139 LAYer 1 139 COUNt 139 LAYer2 140 COUNt 140 SLOPe 140 SOURce 141 CALibration 142 AC 142 BEGin 142 POINt 143 DATA 142 AC 143 DC 143 DC 144 BEGin 144 POINt 144 STATe 144 AC 145 INITiate 146 IMMediate 146 OUTPut 147 IMPedance 147 L...

Страница 132: ...Stionable 182 CONDition 182 ENABle 182 EVENt 183 NTRansition 183 PTRansition 184 PRESet 184 SYSTem 185 ERRor 185 VERSion 185 TRIGger 186 STARt SEQuence 1 186 COUNt 186 SOURce 187 Command Types Commands are separated into two types IEEE 488 2 Common Commands and SCPI Commands Common Command Format The IEEE 488 2 standard defines the Common Commands that perform functions like reset self test status...

Страница 133: ...ator A colon always separates one command keyword from a lower level command keyword as shown below ARM LAY2 SOUR EXT Abbreviated Commands The command syntax shows most commands as a mixture of upper and lower case letters The upper case letters indicate the abbreviated spelling for the command For shorter program lines send the abbreviated form For better program readability you may send the enti...

Страница 134: ...ly used decimal representations of numbers including optional signs decimal points and scientific notation 123 123E2 123 1 23E2 123 1 23E 2 1 23000E 01 Special cases include MINimum MAXimum and INFinity The Comments section within the Command Reference will state whether a numeric parameter can also be specified in hex octal and or binary H7B Q173 B1111011 Boolean Represents a single binary condit...

Страница 135: ...block Indefinite length block 0 data byte s NL END Examples of sending 4 data bytes 14 byte byte byte byte 3004 byte byte byte byte 0 byte byte byte byte NL END Optional Parameters Command parameters shown within square brackets are optional The brackets are not part of the parameter and are not sent to the AFG If you do not specify a value for an optional parameter the instrument chooses a defaul...

Страница 136: ...ng group and associated commands are listed in Appendix B Table B 2 Commands not in the coupling group must precede or follow commands in the coupling group Executing uncoupled commands in a coupling group breaks the coupling and can cause a Settings Conflict error Command queries commands with a question mark are uncoupled commands and should be executed before or after coupled commands Chapter 1...

Страница 137: ... COUN 20 LAY2 COUN 5 Command Choices Some commands are listed as two commands separated with a vertical bar This means that either command name can be used For example use either CW or FIXed when CW FIXed is shown SCPI Command Reference This section contains the SCPI commands for the HP E1340A Arbitrary Function Generator Commands are listed alphabetically by subsystem and also within each subsyst...

Страница 138: ...ny other settings of the HP E1340A The Pending Operation Flag set true by the INITiate IMMediate command will be set false as a consequence of entering the trigger idle state Subsequent OPC OPC and WAI commands will therefore complete immediately Executable when initiated Yes Coupled command No Related Commands OPC OPC WAI INITiate IMMediate RST Condition RST places the HP E1340A in the trigger id...

Страница 139: ...efault Units number numeric see below MINimum MAXimum none Ramp Sine Square and Triangle Outputs MINimum selects 1 repetition MAXimum selects 65534 repetitions 9 9E 37 is equivalent to INFinity Arbitrary Waveform Output MINimum selects 1 repetition If SOURce FUNCtion USER A B C D HOP_AB is selected MAXimum selects 65534 repetitions If SOURce FUNCtion USER AB is selected MAXimum selects 32767 repet...

Страница 140: ... LAYer2 SOURce RST Condition ARM STARt LAYer2 COUNt 1 Example Setting the start arm count ARM LAY2 COUN INF SOUR EXT Start arm count is infinity and source is front panel Aux In BNC STARt LAYer2 SLOPe ARM STARt LAYer2 SLOPe edge selects the edge rising or falling on the HP E1340A s front panel Aux In BNC which starts waveform generation This edge is significant only with ARM STARt LAYer2 SOURce se...

Страница 141: ...ource for reference oscillator gating or as a start arm source Only one of these uses may be active at any time If ARM STARt LAYer2 SOURce IMMediate is set then ARM STARt LAYer2 COUNt must be set to 1 If ARM STARt LAYer2 SOURce EXTernal is set ARM STARt LAYer2 COUNt must be set to INFinity The ARM STARt LAYer2 SLOPe command selects the active edge for the front panel Aux In BNC when used as the st...

Страница 142: ...ocedure for the HP E1340A It sets the HP E1340A up for the first of the measurements in the procedure See the Calibration section of the HP E1340A Service Manual for detailed information on the use of this command Comments Most of the HP E1340A s commands cannot be executed while calibration is in progress The RST command may be used to prematurely terminate the calibration procedure without affec...

Страница 143: ... Related commands CALibration AC BEGin RST Condition none DATA AC CALibration DATA AC block transfers the AC portion of the HP E1340A s calibration constants in IEEE 488 2 arbitrary block program data format The query form returns this portion of the calibration constants in IEEE 488 2 definite block data format See the Calibration section of the HP E1340A Service Manual for detailed information o...

Страница 144: ...int computes needed calibration constants and sets up the HP E1340A for the next measurement Each calibration constant is checked for validity when it is computed When all measurements and computations are completed the constants are stored in the HP E1340A s non volatile calibration memory The RST command should be sent after completing the calibration procedure to restore normal operation See th...

Страница 145: ...g the output signal to compensate for filter and other roll offs When waveform generation at high frequencies is halted either because ARM LAYer1 COUNt cycles have been generated or because an ABORt command was executed filter loss disappears and the output level may exceed the level specified by SOURce VOLTage LEVel IMMediate AMPLitude It is recommended that AC amplitude correction be used only f...

Страница 146: ... halt waveform generation This command is an overlapped command as described by IEEE 488 2 Section 12 The exit from the idle state caused by INITiate IMMediate shall cause its Pending Operation Flag to be set true This Pending Operation Flag will be set false when the idle state is re entered Comments Use the ABORt command to prematurely halt the waveform generation and place the trigger system in...

Страница 147: ...for SCPI compatibility only Parameters Parameter Name Parameter Type Range of Values Default Units impedance numeric 50 MINimum MAXimum Ohms MINimum and MAXimum select 50Ω output impedance Comments Impedance values between 25 and 62 5 will be accepted and rounded to 50 Ω Values outside that range will cause error 222 Argument out of range to occur Executable when initiated Yes Coupled command Yes ...

Страница 148: ...t commands will output the specified voltages into an open circuit Parameters Parameter Name Parameter Type Range of Values Default Units load numeric 50 9 9E 37 INFinity MINimum MAXimum Ohms MINimum and MAXimum both select 50Ω load impedance Use 9 9E 37 or INFinity to indicate an open circuit output Comments Executable when initiated Query form only Coupled command Yes Related commands OUTPut IMP...

Страница 149: ... address space Setting the DAC data source to a setting other than INTernal disables the ARM subsystem the SOURce subsystem except for the SOURce ARBitrary and SOURce VOLTage subsystems and the TRIGger subsystem The HP E1340A immediately outputs each DAC data point when received The DAC data must be provided as integer numbers between 0 and 4095 0 generates negative full scale output 4095 generate...

Страница 150: ...ing ramp EEPRom9 First 20 terms of a falling ramp EEPRom10 Rising ramp EEPRom11 First 20 terms of a rising ramp EEPRom12 White noise EEPRom13 Modulated white noise EEPRom14 A 3rd 4th 5th harmonic chord EEPRom15 8 cycles of a linear rising sine wave EEPRom16 Positive half cycle sine wave VXI The VXIbus data transfer bus Waveform Data The waveform data consists of a single 16 bit word for each volta...

Страница 151: ...erformed on downloaded data Similarly the number of points sent is not checked against the length specified Erratic operation may occur if invalid data is downloaded Waveform segment contents are unspecified at power on and must be loaded before the segment may be output Executable when initiated No Coupled command No Related Commands SOURce ARBitrary DOWNload COMPlete SOURce VOLTage LEVel IMMedia...

Страница 152: ...e when initiated No Coupled command No Related Commands SOURce ARBitrary DOWNload RST Condition downloading disabled Example Download 4096 points from the VXI backplane to waveform segment C ARB DOWN VXI C 4096 Set up for download download data ARB DOWN COMP Indicate download complete SOURce ARBitrary DOWNload COMPlete 152 HP E1340A Command Reference Chapter 7 ...

Страница 153: ...er SPAN 2 If any two commands are sent as part of a frequency coupled group within a single program message then these two will be set as specified and the other two will change If more than two are sent in the group the sweep will be determined by the last two received When MINimum and MAXimum are used with these commands the values that will be set are the minimum and maximum values that will no...

Страница 154: ...hen the 42 94967296 MHz internal reference oscillator is used For SOURce FUNCtion USER AB two segments are output and the maximum possible frequency is half the above value For SOURce FUNCtion USER ABCD four segments are output and the maximum possible frequency is one fourth the above value Waveforms in the HP E1340A are generated by indexing through 4 096 points of memory data 8 192 for SOURce F...

Страница 155: ...lator RST Condition SOURce FREQuency CENTer 7 5 MHz Example Setting the center frequency FREQ CENT 1E3 Set center frequency to 1000 Hz CW FIXed SOURce FREQuency CW FIXed frequency selects the non swept waveform frequency Parameters Parameter Name Parameter Type Range of Values Default Units frequency numeric see below MINimum MAXimum Hz MINimum selects 0 Hz MAXimum selects the current reference os...

Страница 156: ...APe and USER SOURce ROSCillator RST Condition SOURce FREQuency FSKey 10 kHz 15 MHz Example Setting the frequency shift frequencies FREQ FSK 1E6 1 KHZ Set 1 MHz and 1 kHz frequencies MODE SOURce FREQuency MODE mode determines which set of commands control the frequency subsystem The settings have the following meanings CW or FIXed Selects single frequency mode SOURce FREQuency CW FIXed selects the ...

Страница 157: ... FREQuency SPAN freq_span sets the frequency span for a frequency swept waveform Parameters Parameter Name Parameter Type Range of Values Default Units freq_span numeric see below MINimum MAXimum Hz The legal range for freq_span as well as the MINimum and MAXimum values are context dependent See the section Coupling Rules at the beginning of the SOURce FREQuency subsystem for a description of the ...

Страница 158: ...he starting frequency FREQ STAR 1 KHZ Set starting frequency to 1000 Hz STOP SOURce FREQuency STOP stop_freq sets the stopping frequency for a frequency swept waveform Parameters Parameter Name Parameter Type Range of Values Default Units stop_freq numeric see below MINimum MAXimum Hz The legal range for stop_freq as well as the MINimum and MAXimum values are context dependent See the section Coup...

Страница 159: ...oltage SQUare Generates a square wave TRIangle Generates a stepped triangle wave USER Generates an arbitrary waveform The SOURce FUNCtion USER command selects the segment sequence to be generated Note Selecting a shape other than DC or USER causes the voltage data contained in waveform segment D to be overwritten by the voltage data for the selected waveform shape Segment D must be reloaded before...

Страница 160: ... Range of Values Default Units name character data A B C D AB ABCD HOP_AB NONE none NONE selects no segment sequence Comments Segment sequences A B C and D output the corresponding segments Sequence AB outputs segments A and B Sequence ABCD outputs all four segments Sequence HOP_AB allows waveform hopping between segments A and B The Aux In BNC selects which segment is output a TTL high level sele...

Страница 161: ...and are provided primarily for compatibility and completeness reasons Subsystem syntax SOURce LIST SEGMent CATalog query only DEFine query only SELect name VOLTage voltage_list no query DAC voltage_list no query POINts query only SSEQuence CATalog query only DEFine query only SELect name SEQuence query only SEGMents query only SEGMent CATalog SOURce LIST SEGMent CATalog returns a comma separated l...

Страница 162: ...T SEL D Select waveform segment D LIST DEF Query size of waveform segment D SEGMent SELect SOURce LIST SEGMent SELect name selects a waveform segment for subsequent SOURce LIST SEGMent subsystem commands Parameters Parameter Name Parameter Type Range of Values Default Units name discrete A B C D NONE none NONE selects no waveform segment Comments There are only 4 legal segment names A B C D Alphab...

Страница 163: ...ust contain exactly 4096 points The voltage values specified by this command are scaled relative to the full scale output voltage specified by SOURce VOLTage LEVel IMMediate AMPLitude in effect at the time the voltage point list is created Subsequently changing the full scale output voltage will change the actual output voltages that are generated Waveform segment contents are unspecified at power...

Страница 164: ...able when initiated No Coupled command No Related Commands SOURce LIST SEGMent VOLTage SOURce VOLTage LEVel IMMediate AMPLitude RST Condition unaffected Power On Condition waveform segment contents are unspecified Example Defining a waveform segment voltage point list LIST SEL B Select waveform segment B LIST VOLT DAC 4 1048 4095 2048 Define 4096 waveform voltages SEGMent VOLTage POINts SOURce LIS...

Страница 165: ...gth of 4 Comments Executable when initiated Yes Coupled command No Related Commands SOURce LIST SSEQuence SELect RST Condition unaffected Power On Condition segment sequence lengths are predefined as specified above Example Querying the length of a segment sequence LIST SSEQ SEL AB Select sequence AB LIST SSEQ DEF Query the length of the segment sequence SSEQuence SELect SOURce LIST SSEQuence SELe...

Страница 166: ...cified above Example Querying a segment sequence LIST SSEQ SEL AB Select segment sequence AB LIST SSEQ SEQ Query segment sequence SSEQuence SEQuence SEGMents SOURce LIST SSEQuence SEQuence SEGMents returns a number indicating the number of waveform segments contained in the currently selected segment sequence Sequences A B C and D contain only 1 segment Sequence AB contains 2 segments Sequence ABC...

Страница 167: ...ly SOURce MARKer POLarity must be set to NORMal when using this source SOURce ROSCillator The internal 42 94967296 MHz reference oscillator SOURce MARKer POLarity must be set to NORMal when using this source SOURce SWEEP Outputs a marker pulse on the last point of a frequency sweep SOURce MARKer POLarity may be either NORMal or INVerted with this source Parameters Parameter Name Parameter Type Ran...

Страница 168: ...en MARKer FEED SEGMent or SOURce ROSCillator is selected INVerted must be selected when MARKer FEED OUTPut ZERO is selected Either NORMal and INVerted may be selected when MARKer FEED SOURce SWEep is selected Executable when initiated Query form only Coupled command Yes Related Commands SOURce MARKer FEED RST Condition SOURce MARKer POLarity NORMal Example Setting the Aux Out BNC polarity MARK FEE...

Страница 169: ...erates a negative going ramp Parameters Parameter Name Parameter Type Range of Values Default Units polarity discrete INVerted NORMal none Comments Executable when initiated Query form only Coupled command Yes Related Commands SOURce FUNCtion SHAPe RST Condition SOURce RAMP POLarity NORMal Example Selecting ramp polarity FUNC SHAP RAMP Select ramp output RAMP POL INV Select negative going ramp SOU...

Страница 170: ... numeric 1 Hz through 42 94967296 MHz MINimum MAXimum Hz MINimum selects 1 Hz MAXimum selects 42 94967296 MHz Comments AC amplitude correction can only be made if the current reference oscillator frequency is 42 94967296 MHz either internal or external CALibration STATe AC must be set to OFF when a different external reference oscillator frequency is selected Indicating an incorrect frequency for ...

Страница 171: ...N Enable gating SOURce SOURce ROSCillator SOURce source selects the reference oscillator source The available sources are EXTernal The HP E1340A s front panel Aux In BNC INTernal The internal 42 94967296 MHz oscillator Using this oscillator with the SOURce FREQuency subsystem gives a frequency resolution of 01 Hz Parameters Parameter Name Parameter Type Range of Values Default Units source discret...

Страница 172: ...y Coupled command Yes RST Condition SOURce ROSCillator SOURce INTernal Example Setting the reference oscillator source ROSC SOUR EXTernal Select an external oscillator source SOURce ROSCillator SOURce 172 HP E1340A Command Reference Chapter 7 ...

Страница 173: ...the minimum number of points is 2 and the maximum is 10 kHz 1 kHz 01 Hz 1 or 900 001 points Considering sweep time the fastest the HP E1340A can sweep is 187 µS per frequency point with AC amplitude correction disabled or 250 µS per point with AC amplitude correction enabled Up to 25 5 mS additional delay per frequency point is possible in 100 µS increments Thus the fastest amplitude corrected swe...

Страница 174: ...purposes only Parameters Parameter Name Parameter Type Range of Values Default Units number numeric 9 9E 37 INFinity MINimum MAXimum none MINimum and MAXimum both select INFinity sweeps 9 9E 37 is equivalent to INFinity Comments Executable when initiated Yes Coupled command Yes Related Commands INITiate IMMediate ABORt RST Condition SOURce SWEep COUNt INFinity Example Setting the sweep count SWE C...

Страница 175: ...Yes Related Commands SOURce FREQuency CENTer MODE SPAN START and STOP RST Condition SOURce SWEep POINts 1001 Example Setting the number of points in the sweep SWE POIN 100 Set 100 points in sweep TIME SOURce SWEep TIME time selects the duration of the sweep The duration is the time from the start of the sweep until when the last frequency begins to be output Parameters Parameter Name Parameter Typ...

Страница 176: ...ion time is desired SWEep TIME should be set according to the following equation SWEep TIME time points 1 points Thus to set a repetition time of 1 S for a 100 point sweep SWEep TIME should be set to 99 S Executable when initiated Query form only Coupled command Yes Related Commands SOURce SWEep POINts CAL STATe AC RST Condition SOURce SWEep TIME 1 05 Example Setting the duration of the sweep SWE ...

Страница 177: ...ull scale the 20 dB attenuator will not be used Thus a very small amplitude signal riding on a large offset will have relatively poor amplitude resolution and will tend to be noisy Subsystem Syntax SOURce VOLTage LEVel IMMediate AMPLitude amplitude UNIT VOLTage units OFFSet offset LEVel IMMediate AMPLitude SOURce VOLTage LEVel IMMediate AMPLitude amplitude sets the output amplitude when SOURce FUN...

Страница 178: ...aveform shapes output amplitude control is implemented via a output multiplier circuit followed by a switchable 20 dB step attenuator The step attenuator is used only when both amplitude and offset are each below one tenth of their full scale values For DC output acceptable units are V volts For arbitrary waveform output acceptable units are V volts and VPK For ramp sine square and triangle output...

Страница 179: ... INFinity is set These units are also meaningless and unavailable for user defined waveforms SOURce FUNCtion USER set and when directly driving the DAC from the VXIbus SOURce ARBitrary DAC SOURce VXI set Parameters Parameter Name Parameter Type Range of Values Default Units units discrete DBM DBMW V VPK VPP VRMS W none Comments Related Commands OUTPut LOAD SOURce VOLTage LEVEL IMMediate AMPLitude ...

Страница 180: ...imum selects the greater of 6 0 V output amplitude value and 5 12 V rounded down if needed to a multiple of 2 5 mV MAXimum selects the lesser of 6 0 V output amplitude value and 5 1175 V again rounded down For all waveform shapes when an open circuit load has been specified double all the voltage values above The above values bound the legal range for offset Comments Related Commands SOURce VOLTag...

Страница 181: ...s 0 CALibrating 3 SWEeping and 8 INITiated are defined for the HP E1340A All other bits are always zero Bit 0 CALibrating Set 1 during calibration Cleared 0 otherwise Bit 3 SWEeping Set 1 while a frequency sweep or list is in progress Cleared 0 when waveform generation is halted when frequency sweeping or lists are not selected and at the end of each sweep or list Bit 8 INITiated Set 1 by the INIT...

Страница 182: ...k specifies which bits of the associated Event Register are included in its summary bit The summary bit is the bit for bit logical AND of the Event Register and the unmasked bit s Parameters Parameter Name Parameter Type Range of Values Default Units unmask numeric or non decimal numeric 0 through 32767 none The non decimal numeric forms are the H Q or B formats specified by IEEE 488 2 Comments Ex...

Страница 183: ...s the negative transition mask For each bit unmasked a 1 to 0 transition of that bit in the associated Condition Register will set the same bit in the associated Event Register Parameters Parameter Name Parameter Type Range of Values Default Units unmask numeric or non decimal numeric 0 through 32767 none The non decimal numeric forms are the H Q or B formats specified by IEEE 488 2 Comments Execu...

Страница 184: ...ted Power on Condition STATUS OPERation QUEStionable PTRansition 32767 Example Setting the Operation Register positive transition mask STAT OPER PTR H0100 Set event bit when initiated condition is set PRESet STATus PRESet initializes the Enable Registers and transition masks for the Operation and Questionable Signal Status Registers and sets STATus OPC INITiate ON For both Status Registers the Ena...

Страница 185: ...P E1340A generates more than 30 messages that are not read it replaces the last error message in the queue with error 350 Too many errors No additional messages are placed into the queue until SYSTem ERRor reads some messages or the CLS clear status command clears the queue When the error queue is empty SYSTem ERRor returns 0 No error Executable when initiated Yes RST Condition unaffected Power On...

Страница 186: ...e However since this is equal to the length of the current waveform and is not configurable here the only legal value for this command is 9 91e37 or NaN not a number There is no need to send this command It is included for SCPI compatibility purposes only Parameters Parameter Name Parameter Type Range of Values Default Units number numeric 9 91e37 NAN MINimum MAXimum none MINimum and MAXimum selec...

Страница 187: ...or SCPI compatibility purposes only Parameters Parameter Name Parameter Type Range of Values Default Units source discrete INTernal none Comments Executable when initiated Yes Coupled command No Related Commands ABORt RST Condition TRIGger STARt SOURce INTernal Example Setting the start trigger source TRIG SOUR INT Trigger source is internal TRIGger STARt SOURce Chapter 7 HP E1340A Command Referen...

Страница 188: ...T TST Learn Device Setup Query Reset Command Self Test Query Synchronization OPC OPC WAI Operation Complete Command Operation Complete Query Wait to Continue Command Macro DMC name data EMC enable EMC GMC name LMC PMC RMC name Define Macro Command Enable Macro Command Enable Macro Query Get Macro Contents Query Learn Macro Query Purge Macros Command Remove Individual Macro Command Status Event CLS...

Страница 189: ...ge of Values Default Units name character data 1 through 12 characters none data block data any valid command sequence none Comments Legal macro names must start with an alphabetic character and contain only alphabetic numeric and underscore _ characters Alphabetic character case upper vs lower is ignored The name is allowed to be the same as a SCPI command but may be not be the same as a Common C...

Страница 190: ...Status Byte Register Mask is the sum of the decimal weights of the bits to be enabled The query form returns the current enable mask Parameters Parameter Name Parameter Type Range of Values Default Units mask numeric 0 through 255 none A 1 in a bit position enables the corresponding event a 0 disables it Comments Executable when initiated Yes Coupled command No Related Commands ESR SRE STB RST Con...

Страница 191: ... fields HEWLETT PACKARD E1340A 0 A 01 00 The first two fields identify this instrument as model number E1340A manufactured by Hewlett Packard The third field is 0 since the serial number of the E1340A is unknown to the firmware The last field indicates the revision level of the firmware Note The firmware revision field will change whenever the firmware is revised A 01 00 is the initial revision Th...

Страница 192: ...e and SECurity command states Note LRN should be sent singly in a program message since the number of commands in the returned sequence is large and may vary depending on firmware revision Comments Executable when initiated Yes Coupled command No Related commands RCL RST SAV RST Condition none OPC OPC causes the E1340A to wait for all pending operations to complete The Operation Complete bit bit 0...

Страница 193: ... purge an single macro definition Executable when initiated Yes Coupled command No Related commands DMC RMC RST Condition none RCL RCL number restores a previously stored programming state from one of the 10 possible stored state areas Number indicates which of the stored state areas should be used This command affects the same command settings as does RST Notable exceptions include the SOURce LIS...

Страница 194: ...The state of VXIbus word serial protocol The output queue The Service Request Enable Register The Standard Event Status Enable Register The enable masks for the Operation Status and Questionable Signal Registers Calibration data Waveform segment definitions Comments Executable when initiated Yes Coupled command No RST Condition none SAV SAV number stores the current programming state into one of t...

Страница 195: ...d The query form returns the current enable mask Parameters Parameter Name Parameter Type Range of Values Default Units mask numeric 0 through 255 none A 1 in a bit position enables service request generation when the corresponding Status Byte Register bit is set a 0 disables it Comments Executable when initiated Yes Coupled command No RST Condition unaffected Power On Condition no bits are enable...

Страница 196: ...ettings for all SCPI commands are unchanged by this command Comments Executable when initiated No Coupled command No RST Condition none WAI WAI causes the E1340A to wait for all pending operations to complete before executing any further commands If STATus OPC INITiate OFF is set command execution resumes when all commands received prior to the WAI have been executed If ON is set WAI waits for wav...

Страница 197: ...MPedance impedance OUTPut LOAD load SOURce ARBitrary SOURce ARBitrary DAC SOURce source SOURce ARBitrary DOWNload source dest length SOURce ARBitrary DOWNload COMPlete SOURce FREQuency SOURce FREQuency CENTer center_freq SOURce FREQuency CW FIXed frequency SOURce FREQuency FSKey frequency1 frequency2 SOURce FREQuency MODE mode SOURce FREQuency SPAN freq_span SOURce FREQuency STARt start_freq SOURc...

Страница 198: ...ce MARKer SOURce MARKer FEED source SOURce MARKer POLarity polarity SOURce RAMP SOURce RAMP POLarity polarity SOURce ROSCillator SOURce ROSCillator FREQuency EXTernal frequency SOURce ROSCillator GATE STATe state SOURce ROSCillator SOURce source SOURce SWEep SOURce SWEep COUNt number SOURce SWEep POINts number SOURce SWEep TIME time SOURce VOLTage SOURce VOLTage LEVel IMMediate AMPLitude amplitude...

Страница 199: ...UEStionable EVENt STATus OPERation QUEStionable NTRansition unmask STATus OPERation QUEStionable PTRansition unmask STATus PRESet SYSTem SYSTem ERRor SYSTem VERsion TRIGger TRIGger STARt COUNt number TRIGger STARt SOURce source Table 7 1 HP E1340A Command Quick Reference continued 199 HP E1340A Command Quick Reference Chapter 7 ...

Страница 200: ... INITiate IMMediate OUTPut IMPedance impedance SOURce FREQuency CENTer center_freq CW FIXed frequency MODE mode SPAN freq_span STARt start_freq STOP stop_freq FUNCtion SHAPe shape SOURce ROSCillator SOURce source SWEep COUNt number POINts number TIME time STATus OPERation QUEStionable CONDition ENABle unmask NTRansition unmask PTRansition unmask PRESet SYSTem ERRor VERSion TRIGger STARt SEQuence 1...

Страница 201: ...COMPlete FUNCtion USER name SOURce LIST SEGMent CATalog DEFine SELect name VOLTage voltage_list DAC voltage_list POINts SSEQuence CATalog DEFine SELect name SEQuence SEGMents MARKer FEED source POLarity polarity RAMP POLarity polarity ROSCillator FREQuency EXTernal frequency GATE STATe state Table 7 3 Non SCPI Commands Chapter 7 HP E1340A SCPI Conformance Information 201 ...

Страница 202: ...202 HP E1340A SCPI Conformance Information Chapter 7 ...

Страница 203: ...Page 207 The Status Byte Status Group Page 208 Using the Standard Event Status Group Page 210 Status System Registers Operating conditions within the AFG are monitored by registers in various status groups The status groups implemented by the AFG are Operation Status Group Condition Register Transition Filter Event Register Enable Register Standard Event Status Group Standard Event Status Register...

Страница 204: ...Figure 8 1 HP E1340A Status Groups and Associated Registers Chapter 8 HP E1340A AFG Status 204 ...

Страница 205: ...neration is complete after the waveform is aborted by an ABORt or RST command or a Device Clear The AFG then returns to the Idle state Reading the Condition Register Bit settings in the Condition Register can be determined with the command STATus OPERation CONDition Bits 0 3 and 8 have corresponding decimal values of 1 8 and 256 Reading the Condition Register does not affect the bit settings The b...

Страница 206: ...fies which bits in the Event Register can generate a summary bit which is subsequently used to generate a service request The AFG logically ANDs the bits in the Event Register with bits in the Enable Register and ORs the results to obtain a summary bit The bits in the Enable Register that are to be ANDed with bits in the Event Register are specified unmasked with the command STATus OPERation ENABl...

Страница 207: ... is received Execution Error EXE Bit 4 is set 1 when a command parameter is outside its legal range Device Dependent Error DDE Bit 3 is set 1 when an error other than a command error execution error or query error has occurred Query Error QYE Bit 2 is set 1 when the AFG output queue is read and no data is present or when data in the output queue has been lost Operation Complete OPC Bit 0 is set 1 ...

Страница 208: ...tions monitored by the other status groups to generate a service request The Status Byte Register The Status Byte Register contains the summary bits of the Questionable Signal Status Group QUES the Operation Status Group OPER and the Standard Event Status Group ESB The register also contains the message available bit MAV and the service request bit RQS 7 6 5 4 3 2 1 0 OPER RQS ESB MAV QUES unused ...

Страница 209: ...ervice Request Enable Register The Service Request Enable Register specifies which status group summary bit s will send a service request message to the computer over HP IB The bits are specified unmasked with the command SRE unmask All unmasked bits in the Enable Register can be determined with the command SRE The Service Request Enable Register is cleared at power on or by specifying an unmask v...

Страница 210: ...hich then reads the AFG error queue and displays the error code and message The steps of the program are 1 Unmask bits 5 CME 4 EXE 3 DDE 2 QYE in the Standard Event Status Enable Register so that the error will generate a Standard Event Status Group summary bit ESE unmask 2 Unmask bit 5 ESB in the Service Request Enable Register so that a service request is generated when the Standard Event Status...

Страница 211: ...y sweeping frequency shift keying and output DC volts All waveforms that the AFG generates except DC volts are arbitrary waveforms The only difference is that the user supplies the data for the arbitrary waveforms while the standard waveforms are already stored in an EPROM What is an Arbitrary Waveform Refer to Figure 9 1 An arbitrary waveform is equally divided into points that are the actual vol...

Страница 212: ...he RAM receives its data either from EPROMs or over the VXIbus through a register Besides receiving data from memory the DAC can also receive segment data directly over the VXIbus In this case the data on the VXIbus immediately set the DAC to an output voltage that corresponds to the DAC code value sent Each time the DAC receives a new code the DAC s output is set to the value in the new code Thus...

Страница 213: ...re directly stored into the RAMs The same operation then takes place as stated above Reference Oscillator The reference oscillator provides the clock signal for the frequency generator Thus frequency stability depends on the stability of the reference oscillator The AFG allows for user supplied reference oscillator sources for custom frequency values The reference oscillator also clocks the RAM an...

Страница 214: ...ude range is twice the matched load values Offset Circuitry This circuitry offsets the output amplifier to provide an offset voltage Microprocessor The purpose of the microprocessor is to monitor the Aux In input line to help control frequency shift keying burst and waveform hopping operation It also interprets low level commands received over the VME bus Input Output Connectors The AFG uses three...

Страница 215: ...on warranted supplementary information provided for application assistance Instrument Specifications Amplitude Resolution 12 bits Timebase Frequency 42 949673 MHz 50 PPM Number of Active Waveforms in Memory 4 Maximum Voltage Amplitude 10 24V DC Offset Range 5 11 V into 50Ω Built in Waveforms Sine Square Ramp Triangle Sin x x Noise Haversine Maximum Waveform Frequency 15 MHz Sine 1 MHz Square Ramp ...

Страница 216: ... whichever is greater 10 MHz to 15 MHz 34 dBc or 45 dBm whichever is greater Sine Flatness 23 dBm to 20 dBm referenced to 1 kHz frequency up to 10 MHz 0 2 dB frequency up to 15 MHz 0 5 dB Note Maximum output at 11 MHz to 15 MHz is only guaranteed to 20 dBm Integral Non Linearity 5 lsb Differential Non Linearity 5 lsb Jitter 23 nS Frequency Sweep Range 0 01 Hz to 15 MHz Sweep Rate of Change 0 4 Hz ...

Страница 217: ... Interrupt Level Not Used Power Requirements Voltage 5 V 12 V Peak Module Current 1 2 A 0 6 A Peak Dynamic Current 0 01 A 0 15 A Watts per Slot 13 2 Cooling per Slot 0 11 mm H2O 1 06 liters s Storage Temperature 40 to 75 C EMC RFI Safety meets FTZ 1046 1984 CSA 556B IEC 348 UL 1244 Net Weight 0 6 kg Appendix A HP E1340A Specifications 217 ...

Страница 218: ...218 HP E1340A Specifications Appendix A ...

Страница 219: ...ften referred to during E1340A programming The tables in this appendix include Table B 1 HP E1340A Example Program Listing Page 220 Table B 2 HP E1340A Coupled Commands Page 222 Table B 3 HP E1340A Power on Reset Page 223 Table B 4 HP E1340A Error Messages Page 224 Appendix B HP E1340A Useful Tables 219 ...

Страница 220: ..._R HP IBASIC C QuickBASIC Procedure for generating an arbitrary waveform 0 to 5V ramp waveform Arbitrary waveform with two segments Selects between two waveforms based on the level of the signal on the Aux In BNC Downloads a waveform to waveform segment memory from the waveform EPROM Damped sine wave arbitrary waveform Exponential charge dischargewpaveform Sine wave with spikes 1 2 wave rectified ...

Страница 221: ... Operation Chapter 6 UNS_DAT DACBLOK VXIDOWN VXISRCE HP IBASIC C QuickBASIC Downloads arbitrary waveform data as unsigned DAC codes Downloads arbitrary waveform data as DAC codes in a definite length block Downloading to the AFG s Input Data register from the VXI backplane Downloading directly to the DAC from the Input Data register AFG Status Chapter 9 ERRORCHK HP IBASIC Monitors programming erro...

Страница 222: ...SWEep POINts SOURce SWEep TIME SOURce VOLTage LEVel IMMediate AMPLitude SOURce VOLTage LEVel IMMediate OFFSet Un coupled Commands ABORt INITiate IMMediate SOURce ARBitrary DOWNload SOURce ARBitrary DOWNload COMPlete SOURce LIST SEGMent CATalog SOURce LIST SEGMent DEFine SOURce LIST SEGMent SELect SOURce LIST SEGMent VOLTage SOURce LIST SEGMent VOLTage DAC SOURce LIST SEGMent VOLTage POINts SOURce ...

Страница 223: ...signal polarity Arbitrary waveform sequence EMC CAL STAT AC ARB DAC SOUR VOLT AMPL UNIT VOLT ROSC FREQ EXT ROSC SOUR GATE STAT FREQ FIX FSK MODE STAR STOP SWE COUN POIN TIME FUNC SHAP RAMP POL VOLT AMPL OFFS OUTP LOAD ARM COUN LAY2 COUN SLOP SOUR MARK FEED POL FUNC USER 0 1 enabled INTernal V 4 294967296E 007 INTernal 0 off 1 000000000E 004 1 000000000E 004 1 500000000E 007 FIXed 0 000000000E 000 ...

Страница 224: ...ed with the number format 124 Too many digits More than 256 digits were used to specify a number 128 Numeric data not allowed A number was specified when a letter was required 131 Invalid suffix Parameter suffix incorrectly specified e g VO rather than VP 138 Suffix not allowed Parameter suffix is specified when one is not allowed 141 Invalid character data Discrete parameter specified is not a va...

Страница 225: ... execution error Macro program data sequence could not be executed due to a syntax error within the macro definition 273 Illegal macro label The macro label defined in the DMC command was too long the same as a common command keyword or contained invalid header syntax 276 Macro recursion error A macro program data sequence could not be executed because the sequence leads to the execution of a macr...

Страница 226: ... unless the DAC data source is internal 1018 Illegal while calibrating Command cannot be sent to the HP E1340A while the device is calibrating 1019 Illegal while not calibrating The command is only valid when the HP E1340A is calibrating 1100 Illegal segment name Attempting to download to a segment that doesn t exist or selecting a segment name that s the same as an existing sequence name 1102 Seg...

Страница 227: ...LAY1 COUN not INF ARM LAY1 COUN INF set SOUR FREQ FSK frequency minimum SOUR FREQ FSK MIN set SOUR FREQ FSK frequency maximum SOUR FREQ FSK MAX set ARM LAY1 COUN INF and ARM LAY2 SOUR EXT ARM LAY2 SOUR IMM set FUNC USER AB and ARM LAY1 COUN 32767 ARM LAY1 COUN 32767 set FUNC USER ABCD and ARM LAY1 COUN 16383 ARM LAY1 COUN 16383 set OUTP LOAD INF and SOUR VOLT unit W DBM or DBMW SOUR VOLT AMPL MIN ...

Страница 228: ...OFFS MIN set SOUR VOLT SOUR VOLT OFFS maximum SOUR VOLT OFFS MAX set SOUR VOLT voltage minimum SOUR VOLT MIN set SOUR VOLT voltage maximum SOUR VOLT MAX set SOUR FUNC SHAP not DC and SOUR VOLT voltage 0 0V absolute value of SOUR VOLT set SOUR ARB DAC SOUR not INT or SOUR FUNC SHAP USER and SOUR VOLT unit not V VPK SOUR VOLT AMPL MIN in V set SOUR FUNC SHAP DC and SOUR VOLT unit not V SOUR VOLT val...

Страница 229: ...ed programming The contents include Register Addressing Page 229 Computer Configurations Page 232 Register Descriptions Page 234 Command Descriptions and Formats Page 239 Program Timing and Execution Page 252 Example Programs Page 256 Register Addressing Register addresses for register based devices are located in the upper 25 of VXI A16 address space Every VXI device up to 256 devices is allocate...

Страница 230: ...Figure C 1A HP E1340A AFG Registers within A16 Address Space Figure C 1B AFG Registers within HP E1300 E1405 A16 Address Space 230 HP E1340A Register Based Programming Appendix C ...

Страница 231: ...R 64 offset register offset Figure C 1A Base_addr LADDR 256 reg number offset Figure C 1A 2 External Computer over HP IB to E1300 E1301 Mainframe or E1405 E1406 Command Module VXI READ logical_address offset VXI WRITE logical_address offset data DIAG PEEK Base_addr offset width DIAG POKE Base_addr offset width data AFG logical address setting LADDR offset register offset Figure C 1A Base_addr 1FC0...

Страница 232: ...al Computer using VXI READ and VXI WRITE register access is over HP IB Embedded Computer Programming C Size Systems If the E1340A AFG is part of a C Size VXI system the fastest throughput is achieved using an embedded computer such as the HP E1480 V 360 The embedded computer allows you to access the registers from the VXIbus backplane and since READIO and WRITEIO are used there is no parsing of SC...

Страница 233: ...Note The example programs found in this appendix are IBASIC programs using absolute addressing External Computer Programming When the AFG is programmed by an external computer through the E1300 E1301 mainframe or E1405 E1406 Command Module the registers are accessed using DIAG PEEK and DIAG POKE or VXI READ and VXI WRITE DIAG PEEK DIAG POKE and VXI READ VXI WRITE Throughput speed using DIAG PEEK a...

Страница 234: ...many variables or too large an array are in the stack Error 2 Memory Overflow will occur If a memory overflow occurs the stack size can be changed with the command PROGram MALLocate nbytes see the Instrument BASIC User s Manual for more information Register Descriptions There are four READ and four WRITE registers on the AFG This section contains a description and a bit map of each register The RE...

Страница 235: ...e The HP E1340 AFG uses the A16 address mode Manufacturer ID Bits 11 through 0 identify the manufacturer of the device Hewlett Packard s ID number is 4095 which corresponds to bits 11 0 being set to 1 Given the device classification addressing space and manufacturer of the HP E1340 AFG reading the ID register returns FFFF16 The Device Type Register The Device Type Register contains a model code wh...

Страница 236: ...ing or has failed its self test A one 1 indicates the reset is finished or the self test passed Bit 2 performs the same function Response Buffer Full A one 1 in bit 1 indicates data returned by a query is in the Query Response Register The bit is cleared 0 when the response is read from the register Command Buffer Empty A one 1 in bit 0 indicates a command or parameter can be written to the Comman...

Страница 237: ...ments in this appendix use 16 bit writes Except for the Input Data Register the WRITE registers only use the lower eight bits The Control Register The Control Register is used to perform a hardware reset of the AFG and to disable the AFG from driving the SYSFAIL line Address 15 8 7 6 5 4 3 2 1 0 base 0416 Not Used X X X X X X SYSFAIL Inhibit Reset Resetting the AFG Writing a one 1 to bit 0 hardwar...

Страница 238: ...t appear as 8 1 where 8 is the offset of the Command Register and 1 is the opcode A parameter might appear as 10 128 where 10 is the offset of the Parameter Register and 128 is the value of the parameter byte The AFG commands and parameters are covered in the section Command Descriptions and Formats The sequence and timing involved in sending commands are covered in the section Program Timing and ...

Страница 239: ...iptions and Formats The AFG commands and parameters are in the form of opcodes and data bytes Table C 2 lists the command opcodes and the format of the parameters Appendix C HP E1340A Register Based Programming 239 ...

Страница 240: ... 1 0 1 1 White noise 1 1 0 0 Modulated white noise 1 1 0 1 A 3rd 4th 5th harmonic chord 1 1 1 0 8 cycles of linear rising sine wave 1 1 1 1 Positive half cycle sine wave 0 0 RAM 0 0 1 RAM 1 1 0 RAM 2 1 1 RAM 3 Setting Frequency Register 1 Fixed frequency CW Sweep start frequency 1st FSK frequency Command Opcode 1 Bits 7 6 5 4 3 2 1 0 Byte 1 Most Significant Byte of Frequency Byte 2 2nd Significant...

Страница 241: ...t Byte 2 Least Significant Byte of Offset Setting the Sweep Rate Command Opcode 7 Bits 7 6 5 4 3 2 1 0 Byte 1 Most Significant Byte of Phase Increment Byte 2 2nd Significant Byte of Phase Increment Byte 3 3rd Significant Byte of Phase Increment Byte 4 Least Significant Byte of Phase Increment Byte 5 Delay tic Count Byte 6 0 Linear Sweep Setting the Burst Count Command Opcode 8 Bits 7 6 5 4 3 2 1 0...

Страница 242: ...t 1 External Clock Gate internal clock Byte 2 Bit 7 6 5 4 3 2 1 0 Bit Weight 128 64 32 16 8 4 2 1 Purpose RAM Bank Frequency Register Output Mode RAM Size Setting 0 0 RAM 0 0 1 RAM 1 1 0 RAM 2 1 1 RAM 3 0 Register 1 1 Register 2 0 0 0 Continuous fixed 0 0 1 FSK 0 1 0 Wave hop 0 1 1 Internal burst 1 0 0 External burst 1 0 1 Sweep 1 1 0 Direct DAC access 1 1 1 Fast frequency change 0 0 4k 0 1 8k 1 0...

Страница 243: ... an arbitrary waveform into RAM 0 the value of the function byte would be 0 which sets the bit pattern 0 0 0 0 0 0 0 0 Arbitrary waveforms must have exactly 4096 points Undefined points appear at the output as random values The Example Programs section demonstrates how to download and output arbitrary waveforms Download Mode Bit 6 of the setting the function and loading RAM byte Table C 2 is used ...

Страница 244: ...c is the reference oscillator frequency If the AFG s internal 42 94967296 MHz oscillator is used the equation simplifies to Frequency Fo 100 Frequency is converted to the form F1 224 F2 216 F3 28 F4 100 For example to send 1kHz in four bytes using the AFG internal oscillator Frequency 1E3 100 100 000 00 01 86 A016 0 1 134 16010 byte 1 byte 2 byte 3 byte 4 Arbitrary Waveform Frequency The maximum f...

Страница 245: ... the 12 bit output attenuator The attenuation value written to the AFG is based on the desired amplitude volts peak and the output load Amplitude 0 51175 into 50 Ω Atten Ampl 5 1175 2047 no attenuation Amplitude 0 51175 into 50 Ω Atten Ampl 0 51175 2047 20 dB attenuation Amplitude 1 0235 into open circuit Atten Ampl 10 235 2047 no attenuation Amplitude 1 0235 into open circuit Atten Ampl 1 0235 20...

Страница 246: ...nternal or external of 42 94967296 MHz Caution If amplitude correction is in effect for a programmed number of cycles burst correction will remain in effect after the burst completes This can result in an output signal 2 5 times the programmed value Sine wave correction is recommended for a continuous signal only Setting the Amplitude Offset The offset of the output signal is controlled by the 12 ...

Страница 247: ...count 1 delays of 100 µS The sixth byte is always 0 for a linear sweep Setting the Burst Count The burst count specifies the number of waveform cycles to occur when the burst output mode is set For all other output modes the burst count need not be set since an infinite number of cycles are output Format The burst count is a two byte parameter Table C 2 The count is converted to the form A1 28 A2 ...

Страница 248: ...Source The clock source bits 5 3 specify and control the AFG s reference clock oscillator The sources External external source is applied to the Aux In BNC Bit 0 must be set to 1 Gated allows the reference to be gated by a gate signal applied to the Aux In BNC Bit 0 must be set to 1 A TTL high level stops the output A TTL low level enables the output Burst allows a counted burst see Setting the Bu...

Страница 249: ...etting of bit 0 The bit is set based on the clock source setting and mode setting Setting bit 0 to 0 enables an external signal to select the output signal wave hop to select the output frequency FSK or to trigger a counted burst The external signal s rising edge selects the waveform in RAM 0 Its falling edge selects the waveform in RAM 1 Similarly its rising edge selects FSK frequency 1 and its f...

Страница 250: ...ter bit bit 5 is ignored Wave hop output mode is wave hopping Bit 0 of byte 1 must be set to 0 in order for a control signal applied to the Aux In BNC to select the output waveform The rising edge of the control signal selects the waveform in RAM 0 The falling edge of the control signal selects the waveform in RAM 1 When this mode is set the RAM bank bits 7 6 and the RAM size bits 1 0 are ignored ...

Страница 251: ...mode uses the 4k RAM size The Frequency Register and RAM size bits are ignored RAM Size The RAM size bits 1 0 of byte 2 specifies whether one two or four waveforms will comprise the output waveform If the RAM size is 8k or 16k the RAM bank bits 7 6 is ignored Starting the Waveform When register based programming the waveform is output when byte 2 of the output mode is processed by the AFG If the e...

Страница 252: ...ding command opcode 6 halts waveform generation by stopping the clock No other AFG settings are affected Program Timing and Execution When programming the AFG at the register level the structure of the program will generally be as follows Resetting the AFG Setting the function Setting the frequency Setting the attenuation and offset Setting the sweep rate Setting the burst count Setting the output...

Страница 253: ...is enabled when a reset occurs the AFG is taken off line by the system Resource Manager 3 Writing a 1 to bits 1 and 0 resets the AFG while preventing the AFG from asserting SYSFAIL Writing a 0 to bit 0 turns the reset function off 4 Bit 2 of the Status Register is monitored to determine when the reset is finished 5 Writing a 0 to bit 1 re enables SYSFAIL Figure C 2 Register Access to Reset the AFG...

Страница 254: ...ed to determine when a command and parameters can be written to the Command and Parameter Registers 3 Status Register bit 7 is monitored to determine when the AFG has finished processing the current command and parameter s and when the next command can be sent 4 Repeated passes through the flowchart are made until each AFG parameter e g function frequency etc has been set Figure C 3 Register Acces...

Страница 255: ... 0A16 Query Response Register base 0816 2 Command opcode 13 is written to the Command Register 3 Status Register bit 0 is monitored to determine when the query opcode can be written to the Parameter Register 4 Status bit 1 is monitored to determine when the response to the query is in the Query Response Register Figure C 4 Register Access to Query the AFG Appendix C HP E1340A Register Based Progra...

Страница 256: ...rm Hopping Sweeping Gating the Output Downloading an Arbitrary Waveform Fast Frequency Changes Sending Data Directly to the DAC Querying AFG Settings IBASIC Subprograms The IBASIC programs which are based on the flowcharts found in the Program Timing and Execution section pass opcodes and parameters to a series of subprograms The subprograms are in a separate file file name SUBS that is accessed b...

Страница 257: ...dB attenuation 1 0 dB attenuation Correction 0 enable amplitude correction 1 disable amplitude correction Offset 3 two bytes Sweep Rate 7 six bytes Burst Count 8 two bytes Clock Source Output Mode 9 Aux Out Aux In level Clock Source Aux Out 0 Normal 0 External 0 42 MHz osc 1 Inverted 1 Gated 1 Pulse cycle 2 Burst 2 Zero cross 3 Internal 3 Sweep sync 4 Input Data Register RAM Bank Frequency Registe...

Страница 258: ..._addr DVAL 1FC000 16 80 64 base address 40 50 Reset the AFG 60 Afg_reset 70 Set the function and load RAM 80 Function 0 0 sine wave in RAM 0 90 Set the frequency frequency register 1 100 Frequency1 1000 1 kHz 110 Set amplitude offset impedance correction 120 Amplitude 2 0 50 0 2 Vpk 0V 50 ohms correction enabled 130 Set the Aux Out level Aux In level clock source Aux Out signal 140 RAM bank freque...

Страница 259: ...gister 1 130 Frequency1 1000 1 kHz output frequency is 250 Hz 140 Set amplitude offset impedance correction 150 Amplitude 5 0 50 0 5 Vpk 0V 50 ohms correction enabled 160 Set the Aux Out level Aux In level clock source Aux Out signal 170 RAM bank frequency register and output mode 180 Mode 0 0 3 1 16 0 0 norm norm internal pulse cycle 16k reg 1 cont 190 END 200 Comments 1 To output waveforms from ...

Страница 260: ...et 70 Set function and load RAM 80 Function 0 0 sine wave in RAM 0 90 Set the frequency frequency register 2 100 Frequency2 10000 10 kHz 110 Set amplitude offset impedance correction 120 Amplitude 5 0 50 0 5 Vpk 0V 50 ohms correction enabled 130 Set the burst count 140 Burst 5 0E 4 50k cycles 150 Set the Aux Out level Aux In level clock source Aux Out signal 160 RAM bank frequency register and out...

Страница 261: ...Function 0 0 sine wave in RAM 0 90 Set the frequency frequency register 1 100 Frequency1 10000 10 kHz 110 Set amplitude offset impedance correction 120 Amplitude 5 0 50 0 5 Vpk 0V 50 ohms correction enabled 130 Set the burst count 140 Burst 5 0E 4 50k cycles 150 Set the Aux Out level Aux In level clock source Aux Out signal 160 RAM bank frequency register and output mode 170 Mode 0 0 2 1 0 0 4 nor...

Страница 262: ...0 Set the second FSK frequency frequency register 2 120 Frequency2 1 0E 4 10 kHz 130 Set amplitude offset impedance correction 140 Amplitude 5 0 50 0 5 Vpk 0V 50 ohms correction enabled 150 Set the Aux Out level Aux In level clock source Aux Out signal 160 RAM bank frequency register and output mode 170 Mode 0 0 3 1 0 0 1 norm norm internal pulse cycle bank 0 reg 1 FSK 180 END Comments 1 The first...

Страница 263: ...frequency frequency register 1 120 Frequency1 1000 1 kHz 130 Set amplitude offset impedance correction 140 Amplitude 5 0 50 1 5 Vpk 0V 50 ohms correction disabled 150 Set the Aux Out level Aux In level clock source Aux Out signal 160 RAM bank frequency register and output mode 170 Mode 0 0 3 1 0 0 2 norm norm internal pulse cycle bank 0 reg 1 w_hop 180 END 190 Comments 1 The waveforms used in wave...

Страница 264: ...dr 30 Base_addr DVAL 1FC000 16 80 64 base address 40 50 Reset the AFG 60 Afg_reset 70 Set function and load RAM 80 Function 0 0 sine wave in RAM 0 90 Set amplitude offset impedance correction 100 Amplitude 2 0 50 0 2 Vpk 0V 50 ohms correction enabled 110 Set the start and stop frequency sweep rate and sweep type 120 Linsweep 1000 10000 5 start freq stop freq rate 130 Set the Aux Out level Aux In l...

Страница 265: ...5 0E 4 50 kHz 110 Set amplitude offset impedance correction 120 Amplitude 2 5 0 50 0 2 5 Vpk 0V 50 ohms correction enabled 130 Set the Aux Out level Aux In level clock source Aux Out signal 140 RAM bank frequency register and output mode 150 Mode 0 0 1 1 3 0 0 norm norm gate pulse cycle bank 3 reg 1 cont 160 END 170 Comments 1 Gating is enabled by setting the clock source to Gated and the Aux In b...

Страница 266: ... Width 2 110 Waveform J 1023 Waveform J 1023 J 04 120 NEXT J 130 FOR J 1 TO Width 2 140 Waveform J 1023 Width 2 Waveform J 1023 Width 2 1 J 04 150 NEXT J 160 170 Scale_factor 2047 MAX MAX Waveform ABS MIN Waveform 180 FOR I 0 TO 4095 190 Waveform I Waveform I Scale_factor 2047 200 NEXT I 210 220 Reset the AFG 230 Afg_reset 240 Set function and load RAM 250 Function 16 0 arbitrary waveform in RAM 0...

Страница 267: ... the Input Data Register base 0C16 Arbitrary waveforms must be 4096 points long Undefined points are output as random amplitudes Since arbitrary waveforms are 4096 points the frequency of the waveform is the repetition rate rather than the sample rate of each point 3 The Function subprogram used with program ARBWAVE sets bit 6 of the output function and RAM byte Table C 2 This sets the output to 0...

Страница 268: ...se_addr 30 Base_addr DVAL 1FC000 16 80 64 base address 40 50 Reset the AFG 60 Afg_reset 70 Set the function and load RAM 80 Function 4 0 square wave in RAM 0 90 Set amplitude offset impedance correction 100 Amplitude 5 0 50 1 5 Vpk 0V 50 ohms correction disabled 110 Set the Aux Out level Aux In level clock source Aux Out signal 120 RAM bank frequency register and output mode 130 Mode 0 0 3 1 0 0 7...

Страница 269: ... IVAL C 7 2 16 1189 Check_done The following program generates the frequencies used by the program FASTFREQ HP IBASIC FREQ_GEN 1 RE SAVE FREQ_GEN 2 This program generates the frequencies used by example program FASTFREQ 3 10 DIM Line 100 20 CREATE ASCII Fdata 10 30 ASSIGN F TO Fdata 40 FOR I 1 TO 20 50 Freq 10000 RND 10000 60 Duration 1 RND 70 OUTPUT F VAL Freq VAL Duration 80 NEXT I 90 100 ASSIGN...

Страница 270: ...riting the command opcode line 1139 is commented and without checking for the done condition line 1189 is commented The frequency will continue to be changed after every four bytes until the mode is changed Amplitude correction is not available with this mode 4 This mode uses the 4k RAM size The Frequency Register and RAM size bits Table C 2 are ignored C and QuickBASIC Programs The C program FAST...

Страница 271: ...00 80 Voltage I 1024 RND 2048 90 NEXT I 100 110 Reset the AFG 120 Afg_reset 130 Set amplitude offset impedance correction 140 Amplitude 10 0 50 0 10 Vpk 0V 50 ohms correction enabled 150 Set the Aux Out level Aux In level clock source Aux Out signal 160 RAM bank frequency register and output mode 170 Mode 0 0 4 1 0 0 6 norm norm in data reg pulse cycle xxx xxx dirDAC 180 190 Write data to the DAC ...

Страница 272: ...waveform and places it 30 in the specified RAM 40 COM Base_addr 50 SELECT Function 128 waveform selection 60 CASE 0 Sine wave 70 Eeprom 128 80 CASE 1 Triangle wave 90 Eeprom 132 100 CASE 2 Sin x x 110 Eeprom 136 120 CASE 3 Haversine 130 Eeprom 140 140 CASE 4 Square wave 150 Eeprom 144 160 CASE 5 First 10 terms of square wave 170 Eeprom 148 180 CASE 6 First 4 terms of square wave 190 Eeprom 152 200...

Страница 273: ...60 Eeprom Eeprom 2 470 CASE 3 RAM 3 480 Eeprom Eeprom 3 490 END SELECT 500 510 Write_reg 8 5 520 Write_reg 10 Eeprom 530 Check_done 540 SUBEND 550 560 SUB Frequency1 Freq1 570 Frequency1 Subprogram which sets the output frequency using frequency 580 register 1 590 COM Base_addr 600 Freq Freq1 100 610 C DVAL Freq 16 620 630 Load the frequency value 640 Write_reg 8 1 650 Write_reg 10 IVAL C 1 2 16 6...

Страница 274: ...the 900 specified amplitude Also sets the DC offset and specifies 910 the output impedance and sets frequency correction 920 COM Base_addr 930 940 Atten 16384 Corr 0 turn off amplitude correction if Corr 1 950 SELECT Imp 960 CASE 50 970 IF Ampl 51175 OR Offset 51175 THEN 980 Atten Atten Ampl 5 1175 2047 990 C DVAL Atten 32768 16 32768 no attenuation 1000 Offset Offset 0025 2048 1010 ELSE 1020 Atte...

Страница 275: ...and stop frequencies 1360 Frequency1 Start_freq 1370 Frequency2 Stop_freq 1380 Calculate phase frequency increment 1390 Tic_cnt 256 1400 REPEAT 1410 Phase_inc Stop_freq Start_freq 00025 0001 Tic_cnt Rate 1420 Tic_cnt Tic_cnt 1 1430 UNTIL Phase_inc 01 AND Phase_inc 42949672 955 OR Tic_cnt 0 1440 C DVAL INT 100 Phase_inc 5 16 1450 1460 Load the phase increment tic count and sweep type value 1470 Wri...

Страница 276: ...rogram which sets the output mode 1710 COM Base_addr 1720 Clock 0 1730 Out_mode 0 1740 SELECT Out_lvl 1750 CASE 1 Aux out signal inverted 1760 Clock Clock 128 1770 END SELECT 1780 1790 SELECT In_lvl 1800 CASE 1 Invert signal in to Aux In 1810 Clock Clock 64 1820 END SELECT 1830 1840 SELECT Clock_source 1850 CASE 0 External 1860 Clock Clock 1 1870 CASE 1 Gated 1880 Clock Clock 9 1890 CASE 2 Burst 1...

Страница 277: ...SE 16 RAM size 16k RAM bank not used 2160 Out_mode Out_mode 2 2170 END SELECT 2180 2190 SELECT Freq_reg 2200 CASE 1 Frequency Register 2 2210 Out_mode Out_mode 32 2220 END SELECT 2230 2240 SELECT Mode 2250 CASE 1 FSK 2260 Out_mode Out_mode 4 2270 CASE 2 Wave hop 2280 Out_mode Out_mode 8 2290 CASE 3 Single burst 2300 Out_mode Out_mode 12 2310 CASE 4 Triggered burst 2320 Out_mode Out_mode 16 2330 CA...

Страница 278: ...ITEIO 9826 Base_addr 4 0 enable sysfail 2560 SUBEND 2570 2580 SUB Write_reg Reg Cp_data 2590 Write_reg Subprogram which writes data to command and parameter 2600 registers 2610 COM Base_addr 2620 Check_ready 2630 WRITEIO 9826 Base_addr Reg Cp_data 2640 SUBEND 2650 2660 SUB Check_pass 2670 Check_pass Monitors completion of reset 2680 REPEAT 2690 CALL Read_status Pass_fail Ready Done 2700 UNTIL Pass...

Страница 279: ...0 2870 SUB Read_status Pass_fail Ready Done 2880 Read_status Subprogram which reads the arb s Status Register 2890 COM Base_addr 2900 Status READIO 9826 Base_addr 4 2910 Ready BIT Status 0 2920 Pass_fail BIT Status 2 2930 Done BIT Status 7 AND Ready 2940 Qryrdy BIT Status 1 AND Done 2950 SUBEND Appendix C HP E1340A Register Based Programming 279 ...

Страница 280: ...Returns the least significant byte LSB used to set the output frequency Attenuation 58 59 Returns the most significant byte MSB used to set the attenuation Returns the least significant byte LSB used to set the attenuation Offset 56 57 Returns the most significant byte MSB used to set the DC offset Returns the least significant byte LSB used to set the DC offset Burst Count 17 18 Returns the most ...

Страница 281: ...rameters 120 COM Base_addr 130 Write_reg 8 13 140 Write_reg 10 Byte 150 Queryrdy 160 Byte READIO 9826 Base_addr 8 170 Byte BINAND Byte 255 180 PRInt Byte 190 SUBEND 200 210 SUB Parm2 Byte1 Byte2 220 Parm2 Subprogram which queries two byte parameters 230 COM Base_addr 240 Write_reg 8 13 250 Write_reg 10 Byte1 260 Queryrdy 270 Byte1 READIO 9826 Base_addr 8 280 Byte1 BINAND Byte1 255 2 8 290 300 Writ...

Страница 282: ...0 Queryrdy 570 Byte3 READIO 9826 Base_addr 8 580 Byte3 BINAND Byte3 255 2 8 590 600 Write_reg 8 13 610 Write_reg 10 Byte4 620 Queryrdy 630 Byte4 READIO 9826 Base_addr 8 640 Byte4 BINAND Byte4 255 650 660 Value Byte1 Byte2 Byte3 Byte4 100 670 PRInt Value 680 SUBEND 690 700 SUB Write_reg Reg Cp_data 710 Write_reg Subprogram which writes data to command and parameter 720 registers 730 COM Base_addr 7...

Страница 283: ...ryrdy BIT Status 1 AND Done 990 SUBEND Comments 1 The parameters shown in the program listing query the function 60 the attenuation 58 59 and the frequency in Frequency Register 1 48 49 50 51 Other parameters can be queried by sending other opcodes to the subprograms To query only one or two parameters comment out lines 50 through 70 as appropriate 2 Query responses bytes are returned to the Query...

Страница 284: ...284 HP E1340A Register Based Programming Appendix C ...

Страница 285: ...g 83 92 156 high speed operation 109 130 installation 15 logical address 17 operating specifications 215 218 output mode 248 250 reset sequence 253 resetting and clearing 37 SCPI commands 131 132 self test 36 soft reset 252 status 203 210 sweeping 83 triggering 95 186 AFGQUERY Example Program 281 283 Amplitude control 177 correction 246 effects on DAC codes 129 effects on voltage list 82 levels se...

Страница 286: ...CALibration AC POINt 143 CALibration DATA AC 143 CALibration DATA DC 143 CALibration STATe AC 145 CALibration DC BEGin 144 CALibration DC POINt 144 Certification 9 CHARGE Example Program 78 Checking for Errors 38 Clock Source 248 CLS 188 189 Command Descriptions and Formats 239 Command Register 238 Commander E1445A AFG 18 Commands arming 96 139 coupled 20 21 136 153 222 initiating the waveform 96 ...

Страница 287: ...byte size 113 format 113 Device Type Register 235 DIAG PEEK 233 DIAG POKE 233 Discrete Command Parameters 134 DMC 188 189 Documentation history 10 Downloading AFG device drivers 15 16 arbitrary waveforms 243 266 267 data using VXIbus backplane 120 into DAC 120 126 segment data 120 126 waveform segments in memory 120 122 Drivers 15 16 E Embedded Computer Programming 232 EMC 188 190 EMC 188 190 Enab...

Страница 288: ...ng signal 244 shift keying 83 92 156 262 start and span 88 157 start and stop 85 158 sweeping 85 Frequency Shift Keying 83 94 using the FSK port 92 FSK Example Program 262 FSK1 Example Program 93 FSweeping 83 94 G GATE Example Program 265 GATE_SIG Example Program 101 Gating enabling 108 171 output 265 waveforms 101 107 108 171 Generating arbitrary waveforms 55 82 212 built in arbitrary waveforms 7...

Страница 289: ...mmand Impedance output 52 147 Implied Keywords 134 135 INITiate Subsystem 146 INITiate IMMediate 96 146 Initiating Waveforms 96 146 Input Data Register 238 Installation mainframe 15 Instrument Specifications 215 217 INT_BRST Example Program 260 Interface Select Code 18 Internal Triggered Bursts 247 260 Introductory Programs 36 L Languages C Language 25 HP BASIC 19 QuickBASIC 31 32 SCPI 19 Language...

Страница 290: ...m 147 148 OUTPut IMPedance 147 OUTPut LOAD 148 P Parameter Register 238 Parameters arbitrary block program data 135 boolean 134 discrete 134 MINimum and MAXimum 53 136 numeric 134 optional 134 135 query settings 136 querying 251 252 255 280 signal frequency 244 PMC 188 193 Polarity marker signal 168 ramp waveform 169 Power on Configuration 37 Preparation for Use 15 Presetting enable register 209 t...

Страница 291: ...programs 256 external computers 233 external triggered bursts 247 261 fast frequency changes 268 270 frequency format 244 frequency register 250 frequency shift keying 262 gating the output 265 generating a sine wave 258 guidelines 234 IBASIC 232 233 IBASIC subprograms 256 internal triggered bursts 247 260 loading RAM 243 multiple waveforms 243 259 offset format 247 output attenuation setting 245 ...

Страница 292: ... VOLTage subsystem 177 181 STATus subsystem 181 184 structure 19 20 SYSTem subsystem 185 TRIGger subsystem 186 187 SCPI Conformance Information 200 201 SCPI Programming 19 Secondary HP IB Address 18 Segment Data downloading 120 126 Select Code 8 232 233 Selecting amplitude levels 50 output units 50 Self test AFG 36 Sending Data to DAC 271 Separator SCPI commands 133 Service Request Enable Register...

Страница 293: ...SPIKES Example Program 79 Square Wave generating 45 SRE 188 195 SRE 188 195 Standard Commands for Programmable Instruments See SCPI Command Standard Event Status Enable Register 208 Standard Event Status Group 207 standard event status enable register 208 standard event status register 207 using 210 Standard Event Status Register 207 reading 207 Standard Waveforms Flowchart 41 42 84 Standard Wavef...

Страница 294: ...73 74 cycle count 99 107 damped sine waves 76 77 data 150 151 downloading in memory 120 122 executing several segments 65 66 exponential charge discharge waves 78 frequency 244 gating 101 107 108 171 generating 212 generating arbitrary waves 55 82 generating built in arbitrary waves 73 74 generating DC voltages 43 generating ramp waves 47 generating simple arbitrary waves 59 60 generating sine wav...

Страница 295: ...Index HP E1340A Arbitrary Function Generator User s Manual 295 ...

Отзывы: