Writing Your First Program
When the instrument has been connected to a computer, the computer
can be used to send instrument instructions to make fast, repeatable
measurements. A variety of different programming languages,
computer types, and interface buses can be used for this process. The
following section describes some basic steps for making a measurement
program.
Three Basic Steps in a Measurement
Step
1. Set system
parameters
2. Select mode & setup
mode
3. Select measurement
& setup measurement
Programming a Measurement
General recommendations for writing a measurement program:
• Include comment lines in your program to describe what is
happening at each point. The way you include comment lines is
dependent on the controller and the programming language that you
are using.
• Use variables for function values. List the variables at the beginning
of the program.
• Perform the measurement manually, keeping track of the key
functions used. Identify the programming commands equivalent to
these front panel keys.
• In the program, execute an instrument preset (*RST) and select
Chapter 1
Tasks (SCPI Command Subsystem)
• Printer setup (HCOPy)
• I/O & addressing (SYSTem)
• Display configuration (DISPlay)
• Data formatting (FORMat)
• Status and errors (IEEE/STATus)
• Mode selection (INSTrument:SELect)
• Standard selection (SENSe:RADio)
• RF channel (SENSe:CHANnel)
• Frequency (SENSe:FREQuency)
• Triggering (TRIGger)
• Input (INPut)
• Measurement selection (MEASure)
• Meas control/restart (INITiate)
• Markers (CALCulate:<meas>:MARKer)
• Averaging (SENSe:<meas>:AVER)
• Bandwidth (SENSe:<meas>:BWID)
• FFT & meas window (SENSe:<meas>:FFT)
Preparing for Use
Writing Your First Program
21