Specifications
154 Chapter 7
Measurement Result Processing
Using Marker Function
Example program using macro (E4991A VBA)
Example 7-2 shows an example program for the marker search function. This program is
saved under the filename mkr_sear.bas on the sample programs disk. Below is an
explanation of the program’s details.
Lines 110 - 180 Substitutes variables for the trace number, marker number, partial
search range, and defined peak value.
Line 220 Resets the E4991A.
Lines 240 - 270 Displays Trace 1 and sets the measurement parameter. In addition,
turns off Trace 2.
Line 290 Sets the sweep parameter (sweep type).
Lines 310 - 330 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 350 - 360 Resets sweep averaging when sweep averaging function is set to on.
Line 380 Starts the sweep and substitutes a variable of “bool” for sweep
completion.
Lines 390 - 400 Displays a message of “Sweep Aborted” when sweep is aborted
(bool=0) during the measurement.
Line 410 Describes the program routine below this line when sweep is
completed without problem (bool=1).
Line 430 Executes an auto-scale adjustment on the specified trace.
Lines 450 - 480 Sets Marker 1 and Marker 2 to on and sets the instrument to
continuous marker mode.
Lines 500 - 550 Turns on the partial search function and moves the active marker to a
specified position on the X-axis. Next, sets the left and right
boundaries of the partial search range.
Lines 570 - 580 Sets the ΔX and ΔY values to define the peak.
Lines 620 - 640 Sets Marker 1 as the active marker. Next, executes a positive peak
search and moves the active marker to the positive peak position.
Line 650 Reads out the result of the positive peak search using the function
program “peak_not_found”.
Lines 660 - 670 Displays a message of “Sweep Aborted” when a positive peak is not
found.
Lines 680 - 740 Reads and displays the stimulus value and measurement value at the
active marker (positive peak) position when a positive peak is found.
Lines 760 - 780 Sets Marker 2 as the active marker. Next, executes a negative peak
search and moves the active marker to the negative peak position.
Line 790 Reads out the result of the negative peak search using the function
program “peak_not_found”.
Lines 800 - 810 Displays the message of “Sweep Aborted” when a negative peak is not
found.
Lines 820 - 880 Reads and displays the stimulus value and measurement value at the