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-232. . . continued350 !360 ! Download data points to volatile memory370 !380 DISP "Downloading Arb..."390 OUTPUT @Fgen;"DATA:DAC VOLATILE,#532000"; ! Output binary block header400 WAIT 1 ! Wait for interface410 OUTPUT @Bin;Waveform(*); ! Output binary block420 WAIT 1 ! Wait for interface430 OUTPUT @Fgen;";*OPC?" ! Send terminator and wait for download to complete440 ENTER @Fgen;Value ! Enter value450 DISP "Download Complete"460 !470 OUTPUT @Fgen;"DATA:COPY DAMP_SINE, VOLATILE" ! Copy to non-volatile memory480 OUTPUT @Fgen;"FUNC:USER DAMP_SINE" ! Select the active waveform490 OUTPUT @Fgen;"FUNC:SHAP USER" ! Output the selected waveform500 ENDQuickBASIC / RS-232 (Program 5)’ This program shows how to download an arbitrary waveform’ using ASCII data over the RS-232 interface. The program’ generates a damped sine wave using 1,000 points.’npnts = 1000’ Define number of ASCII points in waveformNCYCLES = 10’ Define number of cyclesDAMPFACTOR = -5 ’ Define damping factorDIM waveform(npnts)’ Dimension waveform array’’ Configure COM2 for 9600 baud, even parity, 7 data bits, 2 stop bits,’ suppress detection of Request to Send (rs), set timeout of Data Carrier’ Detect line (cd), and terminate output with line feed (lf).’OPEN "com2:9600,e,7,2,rs,cd,lf,pe" FOR RANDOM AS #1 LEN = 1000’PRINT #1, ":SYST:REM" ’ Enable the remote RS-232 mode’PRINT #1, "*RST"’ Reset the function generatorPRINT #1, "FORM:BORD SWAP" ’ Swap data bytes (send LSB first)PRINT #1, "FREQ 5000" ’ Output frequency is 5 kHzPRINT #1, "OUTP:LOAD 50" ’ Output termination is 50 ohmsPRINT #1, "VOLT 5"’ Output amplitude is 5 Vpp268

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

Saved successfully!

Ooh no, something went wrong!