Specifications
172 Chapter 7
Measurement Result Processing
Equivalent Circuit Analysis
Example program using macro (E4991A VBA)
Example 7-6 shows an example program for the equivalent circuit analysis. This program
is saved under the filename circuit.bas on the sample programs disk. Below is an
explanation of the details of the program.
Lines 120 - 180 Substitutes variables for the sweep range, number of measurement
points, trace number, sweep averaging factor, and type of the
equivalent circuit model.
Line 220 Resets the E4991A.
Lines 240 - 280 Turns on Trace 1 and Trace 2. In addition, sets the measurement
parameters for each trace.
Lines 300 - 350 Sets the sweep conditions and sweep averaging function.
Lines 370 - 390 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 410 - 420 Resets sweep averaging when sweep averaging function is set to on.
Line 440 Starts the sweep and substitutes a variable of “bool” for sweep
completion.
Lines 450 - 460 Displays a message of “Sweep Aborted” when sweep is aborted
(bool=0) during the measurement.
Line 470 Describes the program routine below this line when sweep is
completed without problem (bool=1).
Lines 480 - 490 Executes auto-scale adjustment for the specified trace.
Lines 510 - 520 Sets the equivalent circuit model and executes the equivalent circuit
analysis.
Lines 540 - 600 Reads and displays the values of the equivalent circuit parameter.
Lines 620 - 670 Simulates the frequency characteristics of the equivalent circuit. After
that, auto-scale adjustment is executed for both data trace and memory
trace.
Lines 690 - 730 Reads the simulation results of the frequency characteristics in the
memory trace.
Lines 750 - 840 Saves the simulation results of the frequency characteristics to a
specified file (a:\equ_trace).
Lines 820 - 1050 Stops the execution of the macro.
Example 7-6 Equivalent circuit analysis (macro)
10 Sub Main()
20 Dim trc1 As Integer, trc2 As Integer, nop As Integer
30 Dim swp_count As Integer, data_size As Integer
40 Dim equ_model As String, start_f As String, stop_f As
String
50 Dim file As String, buff As String
60 Dim r1 As Double, c1 As Double, l1 As Double, c0 As Double
70 Dim sim_data_z As Variant, sim_data_thd As Variant
80 Dim i As Integer, swp_bool As Integer, bool As Integer
90 Dim fileNum As Integer