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 ProgramsUsing the Status Registers. . . continued250 !260 ! Set up function generator to output FM waveform270 !280 OUTPUT @Fgen;"OUTP:LOAD 50" ! Output termination is 50 ohms290 OUTPUT @Fgen;"APPL:SIN 5000,5" ! Carrier waveshape is sine function,300 ! output frequency is 5 kHz @ 5 Vpp310 OUTPUT @Fgen;"FM:INT:FUNC SIN" ! Modulating waveshape is sine wave320 OUTPUT @Fgen;"FM:INT:FREQ 500" ! Modulating frequency is 500 Hz330 OUTPUT @Fgen;"FM:DEV 250" ! Frequency deviation is 250 Hz340 OUTPUT @Fgen;"FM:STAT ON" ! Turn FM modulation on350 !360 OUTPUT @Fgen;"*OPC?" ! Send "1" to output buffer when complete370 ENTER @Fgen;Value ! Enter value380 !390 OFF INTR Hpib ! Disable interrupts400 END410 !420 SUB Err_msg ! Error subprogram is called if errors occurred430 DIM Message$[80] ! Dimension array for error440 INTEGER Code ! Define integer variable450 COM @Fgen ! Use same address as in main program460 B=SPOLL(@Fgen) ! Use Serial Poll to read Status Byte470 ! (all bits are cleared too)480 !490 ! Loop until error queue is cleared500 !510 REPEAT520 OUTPUT @Fgen;"SYST:ERR?"530 ENTER @Fgen;Code,Message$540 PRINT Code,Message$550 UNTIL Code=0560 STOP570 SUBEND262

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

Saved successfully!

Ooh no, something went wrong!