11.07.2015 Views

Agilent 33120A User's Guide

Agilent 33120A User's Guide

Agilent 33120A User's Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 6 Application ProgramsDownloading an Arbitrary Waveform over RS-232Downloading an Arbitrary Waveform over RS-232This program teaches the following concepts:œ How to define a set of binary waveform points and download thepoints to volatile memory. The downloaded waveform is a dampedsine wave.œ How to copy the download waveform to non-volatile memory.BASIC / RS-232 (Program 5)10 !20 ! This program shows how to download an arbitrary waveform30 ! using binary data over the RS-232 interface. The program40 ! generates a damped sine wave using 16,000 points.50 !60 OPTION BASE 170 CONTROL 10,3;9600 ! Configure PC for 9600 baud (COM2)80 CONTROL 10,4;7 ! Configure PC for 8 bits with no parity90 INTEGER Waveform(16000),I,Ncycles ! Dimension array and variables100 REAL Damp_factor ! Define real variable110 ASSIGN @Fgen TO 10 ! Device address is 10120 ASSIGN @Bin TO 10;FORMAT OFF ! Prepare interface for binary data130 OUTPUT @Fgen;"*RST" ! Reset the function generator140 !150 OUTPUT @Fgen;"SYST:REM" ! Enable the remote RS-232 mode160 OUTPUT @Fgen;"FORM:BORD SWAP" ! Swap data bytes (send LSB first)170 OUTPUT @Fgen;"FREQ 5000" ! Output frequency is 5 kHz180 OUTPUT @Fgen;"OUTP:LOAD 50" ! Output termination is 50 ohms190 OUTPUT @Fgen;"VOLT 5" ! Output amplitude is 5 Vpp200 !210 Ncycles = 10 ! Define number of cycles220 Damp_factor = -5 ! Define damping factor230 !240 ! Calculate data points250 !260 DISP "Calculating Data Points..."270 FOR I=1 TO 16000280 IF I

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!