Other topics about VBA Programming
By combining the COM objects provided for the E5071C and the ripple analysis library, you can easily perform the ripple analysis of waveforms.
Below table shows the flow of program development using the ripple analysis library. First, set up the analysis range and peak definition to use the procedures for ripple analysis.
Condition setting before using the ripple analysis library
Specifying the analysis range
Setting the peak definition
Using the ripple analysis library
Since the analysis conditions are not specified in the ripple analysis library, before using the procedure for ripple analysis, set up the analysis range and the peak definition using COM objects.
Use the following COM objects to specify the analysis range for ripple analysis.
Use the following COM objects to set up the peak definition for ripple analysis.
Use the provided procedures for ripple analysis to analyze the ripple of waveforms and output the result. All procedures perform analysis only within the stimulus range for the specified channel.
Function Name |
Description |
|
Returns the maximum value of the difference between a positive peak and a negative peak |
Returns the maximum value of the difference between a positive peak and its right adjacent negative peak. |
|
|
Returns the maximum value of the difference between a positive peak and its left adjacent negative peak. |
|
Returns the maximum value of the difference between a positive peak and its adjacent negative peak. |
Returns the maximum value of the vertical distance between a line segment connecting 2 adjacent positive peaks and the negative peak between them. |
|
|
Returns the mean value of the differences between a negative peak and its right and left adjacent positive peaks. |
Returns the maximum value of the total of the differences between a negative peak and its right and left adjacent positive peaks. |
|
Returns the maximum value of the total of the differences between a negative peak and its right and left adjacent positive peaks and the stimulus value (Stim) of the valley of the ripple. |
|
Returns the values (LeftValue and RightValue) and the stimulus values (LeftStimulus and RightStimulus) of the right and left negative peaks detected first below the specified value (D) relative to the maximum value. |
|
Returns the difference between the positive peak detected first when searched from the left edge toward the right edge and its right adjacent negative peak. |
|
|
Returns the difference between the positive peak detected first when searched from the right edge toward the left edge and its left adjacent negative peak. |
Returns the difference of the stimulus value between the positive peak detected first when searched from the left edge toward the right edge and its right adjacent negative peak. |
|
Returns the difference of the stimulus value between the positive peak detected first when searched from the left edge toward the right edge and its left adjacent negative peak. |
Here is a simple sample program using the ripple analysis procedures.
Sub Sample()
Dim Val As Double (1)
SCPI.CALCulate(1).SELected.FUNCtion.PEXCursion = 1.5 (2)
SCPI.CALCulate(1).SELected.FUNCtion.PPOLarity = "BOTH" (2)
SCPI.CALCulate(1).SELected.FUNCtion.DOMain.STARt = 935E6 (3)
SCPI.CALCulate(1).SELected.FUNCtion.DOMain.STOP = 960E6 (3)
SCPI.CALCulate(1).SELected.FUNCtion.DOMain.STATe = True (3)
·
·
Val = MaxPeakToPeak(1) (4)
End Sub
Let us break down the code into a number of blocks and see what they do.
Defines a variable Val as Double.
Sets the lower limit of the peak excursion value and polarity for the peak search to 1.5 and both of positive peak and negative peak, respectively.
Sets the analysis range for channel 1 to 935 MHz to 960 MHz.
For channel 1, substitutes the return value from the MaxPeakToPeak function (procedure) in the ripple analysis library to the Val variable.