Specifications

11 4 Chapter 5
Measurement Start and Detection of Measurement End
Example Programs for Detecting Measurement End
Example Programs for Detecting Measurement End
The following example programs can be used for the detection of measurement end.
Example program using HTBasic (SRQ)
Example 5-1 shows an example program for detecting measurement end by using an SRQ.
After setting the number of times for sweep averaging at 4 and setting the SRQ, a sweep is
performed four times. Then, when the SRQ for the measurement end occurs, a message
indicating completion is displayed and the program ends. This program is saved under the
filename sweep.htb on the sample programs disk. The details of the program are explained
below.
Line 50 Sets the GPIB address of the E4991A.
Lines 70 - 80 Substitutes variables for the trace number and the number of sweep
averaging.
Lines 100 - 120 Turns on Trace 1 and activates the sweep averaging function.
Lines 140 - 160 Sets the trigger source for the internal trigger and turns off the
continuous activation of the trigger system. Then, resets the trigger
system and sets the trigger sequence to the idle state.
Line 180 Performs a sweep and calls the sub-program for detecting
measurement end.
Lines 260 - 280 Reads the on/off status of the sweep averaging function and substitutes
a variable for the status. Next, when the sweep averaging function is
turned on, resets the averaging and returns the averaging counter to
zero.
Lines 300 - 310 Set so that only when the operation status condition register bit 4
transits from 1 to 0 (negative transition), the operation status event
register bit 4 is set at 1.
Lines 320 - 330 Sets the instrument so that the operation status event register bit 4 is
enabled and the status byte register bit 7 is effective.
NOTE The bit indicating measurement in progress when calibration and fixture compensation
data are measured is prepared separately from other bits indicating a measurement in
progress. To detect the completion of these, set the instrument so that the operation status
condition register bit 0 is enabled.
NOTE When the sweep averaging function is set on, the measurement end is detected upon
completion of the specified number of times for averaging.
Lines 340 -360 Clears the status byte register and operation status register.
Lines 380 - 390 Sets the branch for the SRQ interruption and enables the SRQ
interruption.
Line 400 Starts measurement.
Line 420 Waits for the completion of measurement.