Specifications

136 Chapter 6
Read and Write Measurement Data
Example Programs for Reading Internal Data Arrays
Example program using macro (E4991A VBA)
The dc bias monitor value at the time of the dc bias voltage sweep is read in ASCII transfer
format and the results are saved to a specified file. When using a macro, you cannot select
a binary transfer format. The program shown in
Example 6-4 is saved under the filename
bias_mon.bas on the sample programs disk. Below is an explanation of the program’s
details.
Lines 110 - 190 Substitutes variables for the trace number, dc bias voltage sweep
range, number of measurement points, sweep averaging factor, and
CW frequency and level value of the signal source.
Line 230 Resets the E4991A.
Lines 250 - 270 Turns on Trace 1 and sets the measurement parameter to impedance. In
addition, turns off Trace 2.
Lines 290 - 360 Sets the sweep parameter for the dc bias voltage sweep. Next, sets the
sweep range, number of measurement points, sweep direction, and
sweep averaging function.
Lines 380 - 400 Sets the CW frequency of the signal source, the mode of the oscillator
level, and the level value.
Lines 420 - 440 Turns on the dc bias output and the monitor function. However, when
using the monitor function, due to the necessity of setting the marker
function in advance, marker 1 is set on.
Lines 460 - 480 Sets the trigger source in 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.
Lines 500 - 510 Resets the sweep averaging when sweep averaging function is set to
on.
Line 530 Starts the sweep and substitutes a variable of “bool” for sweep
completion.
Lines 540 - 550 Displays a message of “Sweep Aborted” when sweep is aborted
(bool=0) during the measurement.
Line 560 Describes the program routine below this line when sweep is
completed without problem (bool=1).
Line 570 Sets the data transfer format to ASCII format.
Lines 590 - 600 Reads out the data trace array.
Lines 610 - 620 Reads out the dc bias level monitor array.
Lines 630 - 640 Reads out the stimulus array.
Lines 660 - 760 Saves the measurement values and the dc bias monitor values to the
specified file.
Lines 790 Stops execution of the macro.
Example 6-4 Reading the monitor value
10 Sub Main()
20 Dim meas_data As Variant, mon_bias As Variant, swp_prm As
Variant
30 Dim header As String, buff As String, img As String