Specifications

Chapter 7 163
Measurement Result Processing
Using Marker Function
7. Measurement Result
Processing
Example program using macro (E4991A VBA)
Example 7-4 shows an example program for the marker limit test. This program is saved
under the filename lim_test.bas on the sample programs disk. Below is an explanation of
the program’s details.
Lines 100 - 110 Substitutes a variable for the trace number.
Line 130 - 410 Substitutes variables for the stimulus value of the test marker and the
upper and lower values of the test limit.
Line 450 Resets the E4991A.
Lines 470 - 490 Turns on Trace 1 and sets the measurement parameter and display
format. Turns off Trace 2.
Line 510 Sets the sweep parameter.
Lines 530 - 570 Sets the reference marker to the test marker and sets the stimulus value
for the test marker and the upper and lower values for the test limit.
Line 590 - 650 Sets Markers 1-8 to the test marker and sets the stimulus value for the
test marker and the upper and lower values for the test limit.
Line 670 Turns on the marker limit test function.
Lines 690 - 710 Sets the trigger source to the internal trigger and turns off the
continuous activation of the trigger system. Then, it resets the trigger
system and sets the trigger sequence to the idle state.
Lines 730 - 740 Resets sweep averaging when sweep averaging function is set to on.
Line 760 Starts the sweep and substitutes a variable of “bool” for sweep
completion.
Lines 770 - 780 Displays a message of “Sweep Aborted” when sweep is aborted
(bool=0) during the measurement.
Line 790 Describes the program routine below this line when sweep is
completed without problem (bool=1).
Line 800 Executes auto-scale adjustment for the specified trace.
Lines 820 - 850 Reads the measurement value at the reference marker and the results
of the limit test.
Lines 870 - 920 Reads the measurement values at the Markers 1-8 and the results of the
limit test.
Line 940 Reads the results of the limit tests at all of the test markers.
Lines 960 - 1110 Saves the limit test results to a specified file (a:\lim_res.txt) and
displays the results of the limit test.
Line 1130 Stops the execution of the macro.