48 Chapter1
Preparing for Use
Writing Your First Program
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
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.
Step Tasks (SCPI Command Subsystem)
1. Set system
parameters
• Printer setup (HCOPy)
• I/O & addressing (SYSTem)
• Display configuration (DISPlay)
• Data formatting (FORMat)
• Status and errors (*commands/STATus)
2. Select mode & setup
mode
• Mode selection (INSTrument:SELect)
• Standard selection (SENSe:RADio)
• RF channel (SENSe:CHANnel)
• Frequency (SENSe:FREQuency)
• Triggering (TRIGger)
• Input (INPut)
3. Select measurement
& setup measurement
• Measurement selection (MEASure)
• Meas control/restart (INITiate)
• Markers (CALCulate:<meas>:MARKer)
• Averaging (SENSe:<meas>:AVERage)
• Bandwidth (SENSe:<meas>:BWIDth)
• FFT & meas window (SENSe:<meas>:FFT)