Executive Test Program Example

The Executive Test example program uses the Pulse Building API to create five signal patterns and demonstrates how to create a test program to download those patterns. The Executive Test program uses a menu from which you can select one of the patterns and download that pattern to the signal generator. This example provides a demonstration on how to control the playback of multiple patterns using the API. The .pbp file created in by this program can be viewed by running the Pulse Building executable and opening the Executive Text.pbp file.

The Frequency Agile, Sensitivity, and Doublet patterns available in the menu were created previously in the Programming and Pulse Building Examples sections of this Help document. Refer to those sections for descriptions and information on these patterns. In addition two new patterns are created in this program example: Variable PRI and Modulation.

The Variable PRI pattern uses a trapezoidal pulse with no modulation as the object type for each of its ten pattern items. The repetition interval is different for each of the pattern items. The repetition interval for the first pattern item is 10 us. The repetition interval for successive pattern items decreases by 1 us with the exception or the last pattern item which has an 11 us repetition interval.

The Modulation pattern uses a raised-cosine pulse with FM Chirp modulation and jitter. This pulse is used as the object type in a pattern consisting of one pattern item. The repetition interval for the pattern item is 20 us and is repeated 100 times. Jitter is applied using a Gaussian probability distribution function model and the leading edge jitter deviation is +/- 100 ns.

The Executive program builds the Pulse Library, the Pattern Library and displays a form showing a listing of all the patterns available in the library. You can select a pattern from the menu, download and play the pattern and stop playing the pattern using command buttons on the form. A downloaded pattern plays continuously on the signal generator until the Stop button is pressed or until another pattern is selected and downloaded.

The Executive Test program will:

Each of the forms that make up this program example is discussed in the following sections:

Details on procedures and declarations include:

Pulse Building Form

The Pulse Building form is the first form displayed when the program is run. The Connect command buttons on this form are described in detail in the Signal Generator and Spectrum Analyzer Connection Forms section. In addition to the Connect command buttons, the Executive Pulse Building form has the following command buttons:

A check mark in the Apply Corrections check box indicates that corrections are applied to the signal. The corrections used are RF Flatness and Image Rejection. You must have an analyzer connected to the signal generator if you want to use corrections.

This example creates and saves the .pbp file in the directory where the Executive Test program is run. The .pbp file consists of the Pulse and Pattern Library items along with all associated parameters.

You must have a spectrum/signal analyzer connected to the signal generator if you want to use corrections.

General Section

The following code listing is from the Pulse Building form's General section. Descriptions follow the code lines. 

Option Explicit ' It is advised that Option Explicit be used to prevent spelling and declaration errors in the program.

Dim project As AgtPBProject ' Declare an object, project, as type AgtPBProject. All the functionality available in the Pulse Building GUI is available in the AgtPBProject object.

Dim cw1 As AgtPBPulse ' Declare an object of type AgtPBPulse with the name cw1. Each pulse must be dedclared as an AgtPBPulse type.

Dim cw2 As AgtPBPulse ' Declare an object of type AgtPBPulse with the name cw2.

Dim cw3 As AgtPBPulse ' Declare an object of type AgtPBPulse with the name cw3.

Dim BarkerA As AgtPBPulse ' Declare an object of type AgtPBPulse called  BarkerA.

Dim BarkerB As AgtPBPulse ' Declare an object of type AgtPBPulse with the name  BarkerB.

Dim FMChirp As AgtPBPulse ' Declare an object of type AgtPBPulse with the name FMChirp.

Dim AgilePattern As AgtPBPattern ' Declare an object of type AgtPBPattern called AgilePattern. Each pattern must be declared as an AgtPBPattern type.

Dim AgileItem As AgtPBPatternItem ' Declare an object, AgileItem, as type AgtPBPatternItem. Each pattern item must be declared as an AgtPBPatternItem type.

Dim DoubletPattern As AgtPBPattern ' Declare an object, DoubletPattern as type AgtPBPattern.

Dim SensitivityPattern As AgtPBPattern' Declare an object, SensitivityPattern, as type AgtPBPattern.

Dim DoubletItem As AgtPBPatternItem ' Instantiate a pattern item DoubletItem, as type AgtPBPatternItem for the DoubletPattern pattern.

Dim SensitivityItem As AgtPBPatternItem ' Declare an object SensitivityItem, as type AgtPBPatternItem for the Sensitivity pattern. Each pattern item must be declared as an AgtPBPatternItem type.

Dim ModulationPattern As AgtPBPattern ' Declare an object, ModulationPattern, as type AgtPBPattern.

Dim ModulationItem As AgtPBPatternItem ' Declare an object, ModulationItem, as type AgtPBPatternItem.

Dim VariablePattern As AgtPBPattern ' Declare an object, VariablePattern as type AgtPBPattern.

Dim VariableItem As AgtPBPatternItem ' Declare an object, VariableItem, as type AgtPBPatternItem.

Dim SpectrumAnalyzer As AgtPBSpectrumAnalyzer ' Declare an analyzer instrument object.

Dim SignalGenerator As AgtPBSignalGenerator ' Declare a signal generator instrument object.

Dim IData() As Double ' Declare an array for I text data.

Dim QData() As Double ' Delcare and array for Q text data.

Dim customProfile() As Double ' Declare an array for custom profile data.

Dim SGConnected As Boolean ' Used to verify signal generator IO connection.

Dim SAConnected As Boolean ' Used to verify signal generator IO connection.

Form Load Event

The following code listing is from the Pulse Building form's Form_Load() event. Functions and code descriptions follow or precede the code statements.

Private Sub Form_Load()

On Error GoTo Error_Handler ' Sets up an error trap to handle errors. If an error occurs in this procedure, the code execution jumps to the Error_Handler line label and a message describing the error is generated.

Set project = New AgtPBProject ' Creates a new .pbp project by instantiating an object of type AgtPBProject.

Call RunProgram ' This call will create the Executive Test project.

Exit Sub

Error_Handler:

MsgBox Err.Description    

End Sub

cmdRun Procedure

The following code listing is from the Pulse Building form's cmdRun_click() procedure. Functions and code descriptions follow or precede the code statements. This procedure downloads and plays the selected menu item pattern.

Private Sub cmdRun_Click()

On Error GoTo ErrorHandler ' If errors occur in the procedure, go to the ErrorHandler line label.

' The next lines of code check to see that the Signal generator I/O connection is valid. If the flag SGConnected is false then the If-Then statement executes.

cmdRun.Enabled = False ' Disable the Download and Play button until the process has finished.

If Not SGConnected Then

Call MsgBox("Connect Signal Generator", vbOKOnly)   

frmMain.MousePointer = vbDefault   

Exit Sub   

End If

' The next lines of code check to see that the an I/O connection with the analyzer is valid.

' If there is no analyzer and the corrections check box is checked then the If-Then statement is executed.

If Not SAConnected And chkCorrections.Value = 1 Then

Call MsgBox("Connect Spectrum Analyzer", vbOKOnly)    

frmMain.MousePointer = vbDefault    

Exit Sub    

End If

frmMain.MousePointer = vbHourglass ' Use the hourglass mouse pointer to indicate program activity.

cmdRun.Enabled = False ' Disable the Download and Play button until this process has finished.

' Check to see that there is a pattern selected to download.

If optFreq = False And optSensitivity = False And optDoublet = False And optModulation = False And optVariable = False Then

Call MsgBox("Select a Pattern to Download", vbOKOnly)    

frmMain.MousePointer = vbDefault    

cmdRun.Enabled = True    

Exit Sub    

End If

project.OpenProject ("Executive Test.pbp") ' Open the project.

' The following lines of code select the pattern menu item to download and play. The option buttons are associated with each pattern.

If optFreq = True Then

' If no analyzer then corrections must be disabled.    

If chkCorrections.Value = 0 Then    

project.ImageRejectionCorrectionEnabled = False ' Disable Image Rejection.        

project.RFFlatnessCorrectionEnabled = False ' Disable RF Flatness.        

End If    

project.DownloadAndPlayPattern ("Frequency Agile") ' Download and play the signal on the signal generator.    

Call MsgBox("Frequency Agile Pattern Downloaded to Signal Generator", vbOKOnly)    

End If

If optSensitivity = True Then

' If no analyzer then corrections must be disabled.       

If chkCorrections.Value = 0 Then    

project.ImageRejectionCorrectionEnabled = False        

project.RFFlatnessCorrectionEnabled = False        

End If    

project.DownloadAndPlayPattern ("Sensitivity") ' Download and play the signal on the signal generator.    

Call MsgBox("Sensitivity Pattern Downloaded to Signal Generator", vbOKOnly)    

End If

If optDoublet = True Then

' If no analyzer then corrections must be disabled.        

If chkCorrections.Value = 0 Then    

project.ImageRejectionCorrectionEnabled = False        

project.RFFlatnessCorrectionEnabled = False        

End If    

project.DownloadAndPlayPattern ("Doublet") ' Download and play the signal on the signal generator.    

Call MsgBox("Doublet Pattern Downloaded to Signal Generator", vbOKOnly)    

End If

If optModulation = True Then

' If no analyzer then corrections must be disabled.        

If chkCorrections.Value = 0 Then    

project.ImageRejectionCorrectionEnabled = False        

project.RFFlatnessCorrectionEnabled = False        

End If    

project.DownloadAndPlayPattern ("Modulation") ' Download and play the signal on the signal generator.    

Call MsgBox("Modulation Pattern Downloaded to Signal Generator", vbOKOnly)    

End If

If optVariable = True Then

' If no analyzer then corrections must be disabled.        

If chkCorrections.Value = 0 Then    

project.ImageRejectionCorrectionEnabled = False        

project.RFFlatnessCorrectionEnabled = False        

End If    

project.DownloadAndPlayPattern ("Variable PRI") ' Download and play the signal on the signal generator.    

Call MsgBox("Variable PRI Pattern Downloaded to Signal Generator", vbOKOnly)    

End If

frmMain.MousePointer = vbDefault ' Use default mouse pointer.

cmdRun.Enabled = True ' Enable the cmdRun command button.

Exit Sub

ErrorHandler:

frmMain.MousePointer = vbDefault    

cmdRun.Enabled = True ' Re-enable the Download and Play button because; an excerption occurred.     

Call MsgBox(Err.Description, vbOKOnly)    

End Sub

Signal Generator and Spectrum Analyzer Connection Forms

The Sensitivity Program Example describes the signal generator and spectrum/signal analyzer I/O connection forms. Refer to that section for details.

ReadDataASCIIFile Function

The code listing for this function is described in the Frequency Agile Program Example. Refer to that example for details and descriptions on the function.

RunProgram Procedure

The following code listing is from the RunProgram procedure. Functions and code descriptions follow or precede the code statements. This procedure builds all the pulses and patterns used in the Menu Driven Test example.

Private Sub RunProgram()

Dim indexItem As Integer ' Counter variable.

Dim powerScale As Integer ' Variable to indicate the power scale setting.

Dim RepInterval As Double ' Variable used for repetition interval time duration.

Dim Counter As Integer ' Counter variable.   

On Error GoTo Error_Handler ' Sets up an error trap to handle errors. If an error occurs in this procedure, the code execution jumps to the Error_Handler line label and a message describing the error is generated.

project.NewProject ("Executive Test.pbp") ' Create a new .pbp project.    

frmMain.MousePointer = vbHourglass ' Use the mouse hourglass to show in process operations.    

cmdRun.Enabled = False ' Disable the Download and Play button until the process has finished.    

Set cw1 = project.PulseLibrary.CreateNewPulse("CW1") ' Instanatiate a new pulse called cw1.    

cw1.PulseType = AgtPBPulseType_Trapezoidal ' Set the pulse type to Trapezoidal.    

' The next line of code sets the rise time of the pulse to 30 ns, the fall time to 30 ns, 100% to 100% to 940 ns, the width jitter type to Gaussian, and the jitter deviation to 100 ns.     

Call cw1.SetEnvelopeTrapezoidal(0.00000003, 0.00000003, 0.00000094, AgtPBJitterType_None, 0)    

cw1.ModulationType = AgtPBModulationType_None ' Set the modulation type to none.     

dataType = "IQ" 'Variable to identify the IQ data text file    

Call ReadDataASCIIFile(IData(), QData(), customProfile(), dataType) ' Read pulse data from a text file.    

Set cw2 = project.PulseLibrary.CreateNewPulse("CW2") ' Instantiate a new pulse.    

cw2.PulseType = AgtPBPulseType_CustomIQ ' Set the pulse type to Custom IQ.    

' Set the sampling rate to 100 MHz, and use the I and Q data from a text file as the pulse data.    

Call cw2.SetCustomIQ(100000000, IData(), QData())    

cw2.ModulationType = AgtPBModulationType_None ' Set the modulation type to none.    

Set cw3 = project.PulseLibrary.CreateNewPulse("CW3") ' Create a new pulse called cw3.    

cw3.PulseType = AgtPBPulseType_CustomEnvelope ' Set the pulse type to custom profile.    

dataType = "Custom" ' Variable to identify the custom profile data text file.    

Call ReadDataASCIIFile(IData(), QData(), customProfile(), dataType) ' Read pulse data from a text file.    

' Set the sampling rate to 100 MHz, and use the customProfile data to create the CW3 Custom Profile Pulse    

Call cw3.SetEnvelopeCustom(100000000, customProfile())    

cw3.ModulationType = AgtPBModulationType_None ' Set the modulation to none.    

' Instantiate a new pattern called Frequency Agile    

Set AgilePattern = project.PatternLibrary.CreateNewPattern("Frequency Agile")    

' Adding the trapezoidal pulse (CW1) as the first pattern item.    

Set AgileItem = AgilePattern.CreateNewItemAt(AgtPBPatternItemObjectType_Pulse, "CW1", 0)    

' The following code statements set up the pattern item parameters.    

AgileItem.RepetitionIntervalSec = 0.00000333 ' Set the repetition rate to 3.33 us.    

AgileItem.NumberOfRepeats = 1 ' Set number of repeats for the pattern item.    

AgileItem.EdgeJitterType = AgtPBJitterType_None ' No jitter type for the pattern item.    

AgileItem.JitterDeviationSec = 0 ' No jitter deviation applied.    

AgileItem.RelativePowerScaleDB = 0 ' No power scale offset.    

AgileItem.FrequencyOffsetHz = -10000000 ' -10 MHz frequency offset for this pattern item.    

AgileItem.PhaseOffsetRad = 0 ' No phase offset.    

' Adding the custom I/Q pulse (CW2) as the second pattern item.    

Set AgileItem = AgilePattern.CreateNewItemAt(AgtPBPatternItemObjectType_Pulse, "CW2", 1)    

' The following code statements set up the pattern item parameters.    

AgileItem.RepetitionIntervalSec = 0.00000333    

AgileItem.NumberOfRepeats = 1    

AgileItem.EdgeJitterType = AgtPBJitterType_None    

AgileItem.JitterDeviationSec = 0    

AgileItem.RelativePowerScaleDB = 0    

AgileItem.FrequencyOffsetHz = 0    

AgileItem.PhaseOffsetRad = 0    

' Adding the custom envelope pulse (CW3) as the third pattern item.    

Set AgileItem = AgilePattern.CreateNewItemAt(AgtPBPatternItemObjectType_Pulse, "CW3", 2)    

' The following code statements set up the pattern item parameters.    

AgileItem.RepetitionIntervalSec = 0.00000333    

AgileItem.NumberOfRepeats = 1    

AgileItem.EdgeJitterType = AgtPBJitterType_None    

AgileItem.JitterDeviationSec = 0    

AgileItem.RelativePowerScaleDB = 0    

AgileItem.FrequencyOffsetHz = 10000000    

AgileItem.PhaseOffsetRad = 0    

' Adding CW1 as the 4th pattern item.    

Set AgileItem = AgilePattern.CreateNewItemAt(AgtPBPatternItemObjectType_Pulse, "CW1", 3)    

' The following code statements set up the pattern item parameters.    

AgileItem.RepetitionIntervalSec = 0.00000333    

AgileItem.NumberOfRepeats = 1    

AgileItem.EdgeJitterType = AgtPBJitterType_None    

AgileItem.JitterDeviationSec = 0    

AgileItem.RelativePowerScaleDB = 0    

AgileItem.FrequencyOffsetHz = -10000000    

AgileItem.PhaseOffsetRad = 1.047    

' Adding CW2 as the 5th pattern item.    

Set AgileItem = AgilePattern.CreateNewItemAt(AgtPBPatternItemObjectType_Pulse, "CW2", 4)    

' The following code statements set up the pattern item parameters.    

AgileItem.RepetitionIntervalSec = 0.00000333    

AgileItem.NumberOfRepeats = 1    

AgileItem.EdgeJitterType = AgtPBJitterType_None    

AgileItem.JitterDeviationSec = 0    

AgileItem.RelativePowerScaleDB = 0    

AgileItem.FrequencyOffsetHz = 0    

AgileItem.PhaseOffsetRad = 1.047    

' Adding CW3 as the 6th pattern item.    

Set AgileItem = AgilePattern.CreateNewItemAt(AgtPBPatternItemObjectType_Pulse, "CW3", 5)    

' The following code statements set up the pattern item parameters.    

AgileItem.RepetitionIntervalSec = 0.00000333    

AgileItem.NumberOfRepeats = 1    

AgileItem.EdgeJitterType = AgtPBJitterType_None    

AgileItem.JitterDeviationSec = 0    

AgileItem.RelativePowerScaleDB = 0    

AgileItem.FrequencyOffsetHz = 10000000    

AgileItem.PhaseOffsetRad = 1.047    

' Adding CW1 as the 7th pattern item.    

Set AgileItem = AgilePattern.CreateNewItemAt(AgtPBPatternItemObjectType_Pulse, "CW1", 6)    

' The following code statements set up the pattern item parameters.    

AgileItem.RepetitionIntervalSec = 0.00000333    

AgileItem.NumberOfRepeats = 1    

AgileItem.EdgeJitterType = AgtPBJitterType_None    

AgileItem.JitterDeviationSec = 0    

AgileItem.RelativePowerScaleDB = 0    

AgileItem.FrequencyOffsetHz = -10000000    

AgileItem.PhaseOffsetRad = 2.093    

' Adding CW2 as the 8th pattern item.    

Set AgileItem = AgilePattern.CreateNewItemAt(AgtPBPatternItemObjectType_Pulse, "CW2", 7)    

' The following code statements set up the pattern item parameters.    

AgileItem.RepetitionIntervalSec = 0.00000333    

AgileItem.NumberOfRepeats = 1    

AgileItem.EdgeJitterType = AgtPBJitterType_None    

AgileItem.JitterDeviationSec = 0    

AgileItem.RelativePowerScaleDB = 0    

AgileItem.FrequencyOffsetHz = 0    

AgileItem.PhaseOffsetRad = 2.093    

' Adding CW3 as the 9th pattern item.    

Set AgileItem = AgilePattern.CreateNewItemAt(AgtPBPatternItemObjectType_Pulse, "CW3", 8)    

' The following code statements set up the pattern item parameters.    

AgileItem.RepetitionIntervalSec = 0.00000333    

AgileItem.NumberOfRepeats = 1    

AgileItem.EdgeJitterType = AgtPBJitterType_None    

AgileItem.JitterDeviationSec = 0    

AgileItem.RelativePowerScaleDB = 0    

AgileItem.FrequencyOffsetHz = 10000000    

AgileItem.PhaseOffsetRad = 2.093    

' Instantiating a new pulse named BarkerA.    

Set BarkerA = project.PulseLibrary.CreateNewPulse("BarkerA")    

BarkerA.PulseType = AgtPBPulseType_RaisedCosine ' Setting the pulse type to raised cosine.    

' Set the rise time to 100 ns, the fall time to 100 ns, 100% to 100% to 800 ns, the width jitter type to none, and the jitter deviation to 0 seconds.    

Call BarkerA.SetEnvelopeRaisedCosine(0.0000001, 0.0000001, 0.0000008, AgtPBJitterType_None, 0)    

BarkerA.ModulationType = AgtPBModulationType_Barker ' Select Barker code modulation for the pulse.    

BarkerA.SetModulationBarker (13) ' Use Barker code number 13.    

' Instantiate a new pulse called BarkerB.    

Set BarkerB = project.PulseLibrary.CreateNewPulse("BarkerB")    

BarkerB.PulseType = AgtPBPulseType_RaisedCosine ' Setting the pulse type to raised cosine.    

' The following code statement sets the pulse rise time to 100 ns, the fall time to 100 ns, 100% to 100% amplitude duration to 800 ns, the width jitter type to None, and the jitter deviation to 0 seconds.        

Call BarkerB.SetEnvelopeRaisedCosine(0.0000001, 0.0000001, 0.0000008, AgtPBJitterType_None, 0)    

BarkerB.ModulationType = AgtPBModulationType_Barker ' Select Barker code modulation for the pulse.    

BarkerB.SetModulationBarker (7) ' Use Barker code number 7.    

' Instantiate a new pattern called Doublet.    

Set DoubletPattern = project.PatternLibrary.CreateNewPattern("Doublet")    

' Instantiate a new pattern item. The item is the raised cosine (BarkerA) pulse.    

Set DoubletItem = DoubletPattern.CreateNewItemAt(AgtPBPatternItemObjectType_Pulse, "BarkerA", 0)    

DoubletItem.RepetitionIntervalSec = 0.000005 ' Repetition interval set for 5 us.    

DoubletItem.NumberOfRepeats = 1 ' Number of repeats for the pattern item set to 1.    

DoubletItem.EdgeJitterType = AgtPBJitterType_None ' No jitter type selected.    

DoubletItem.JitterDeviationSec = 0 ' Jitter deviation set to 0.    

DoubletItem.RelativePowerScaleDB = 0 ' The item's signal generator RF power level is not changed.    

DoubletItem.FrequencyOffsetHz = 0 ' Signal generator RF frequency is not changed.    

DoubletItem.PhaseOffsetRad = 0 ' Signal generator RF signal phase offset set to 0 degrees.    

' Instantiate a new pattern item. The item is the raised cosine (BarkerB) pulse.    

Set DoubletItem = DoubletPattern.CreateNewItemAt(AgtPBPatternItemObjectType_Pulse, "BarkerB", 1)    

DoubletItem.RepetitionIntervalSec = 0.000045 ' Repetition interval set for 45 us.    

DoubletItem.NumberOfRepeats = 1 ' Number of repeats for the pattern item set to 1.    

DoubletItem.EdgeJitterType = AgtPBJitterType_None ' No jitter selected.    

DoubletItem.JitterDeviationSec = 0 ' Jitter deviation set to 0.    

DoubletItem.RelativePowerScaleDB = -20 ' The item's carrier power level is set 20 dB below the BarkerA pulse.    

DoubletItem.FrequencyOffsetHz = 0 ' Signal generator frequency is not changed.    

DoubletItem.PhaseOffsetRad = 0 ' Signal generator RF signal phase is not changed.    

' Instantiating a new pattern called Sensitivity.    

Set SensitivityPattern = project.PatternLibrary.CreateNewPattern("Sensitivity")    

' The following code statement sets the power level to -10 dBm for the sensitivity pattern.    

SensitivityPattern.Properties.AmplitudeDBm = -10    

' The next section of code uses a loop to fill in the pattern items and parameters for the sensitivity pattern.    

' Each of the sensitivity pattern items is a Doublet pattern. The first line of code in the loop instantiates a pattern item object; sensitivityItem using the Doublet pattern and at the counter "indexItem" index position.     

For indexItem = 0 To 9    

Set SensitivityItem = SensitivityPattern.CreateNewItemAt(AgtPBPatternItemObjectType_Pattern, "Doublet", indexItem)        

SensitivityItem.RepetitionIntervalSec = 0.00005 ' Repetition interval set for 50 us.        

SensitivityItem.NumberOfRepeats = 1 ' Number of repeats for the pattern item set to 1.        

SensitivityItem.EdgeJitterType = AgtPBJitterType_None ' No jitter applied.        

SensitivityItem.JitterDeviationSec = 0 ' Jitter deviation set to 0.        

SensitivityItem.RelativePowerScaleDB = powerScale ' Set the power scale value for this item.        

SensitivityItem.FrequencyOffsetHz = 0 ' No change to signal generator RF signal.        

SensitivityItem.PhaseOffsetRad = 0 ' No change to the phase of the signal generator RF.        

If indexItem < 5 Then ' Based on the index, change the power scale value.        

powerScale = powerScale - 6            

Else        

powerScale = powerScale + 6            

End If        

Next 'indexItem    

' Instantiate a new pulse called FMChirp.    

Set FMChirp = project.PulseLibrary.CreateNewPulse("FMChirp")    

FMChirp.PulseType = AgtPBPulseType_RaisedCosine ' Set the pulse type to raised cosine.    

' The next code statement sets the rise time to 30 ns, the fall time to 30 ns, 100% to 100% to 2 us, the width jitter type to Gausian, and the jitter deviation to 100 ns.    

Call FMChirp.SetEnvelopeRaisedCosine(0.00000003, 0.00000003, 0.000002, AgtPBJitterType_Gaussian, 0.0000001)    

' The next code statement applies FM Chirp modulation to the pulse.    

FMChirp.ModulationType = AgtPBModulationType_FMChirp    

' The next code statement sets the chirp range to 20 MHz and deviation to ascending.    

Call FMChirp.SetModulationFMChirp(20000000, AgtPBFMChirpDeviationType_Ascending)    

' Instantiate a new pattern named Modulation.    

Set ModulationPattern = project.PatternLibrary.CreateNewPattern("Modulation")    

' Instantiate a pattern item in the Modulation pattern. The FMChirp is used as the pattern item.    

Set ModulationItem = ModulationPattern.CreateNewItemAt(AgtPBPatternItemObjectType_Pulse, "FMChirp", 0)    

ModulationItem.RepetitionIntervalSec = 0.00002 ' Set the repetition interval for 20 us.    

ModulationItem.NumberOfRepeats = 100 ' Set the number of repeats to 100.    

ModulationItem.EdgeJitterType = AgtPBJitterType_Gaussian ' Set jitter type to Gaussian.    

ModulationItem.JitterDeviationSec = 0.0000001 ' Jitter deviation set to 100 ns.    

ModulationItem.RelativePowerScaleDB = 0 ' No power scaling applied to the pattern item.    

ModulationItem.FrequencyOffsetHz = 0 ' No frequency offset during the pulse on time.    

ModulationItem.PhaseOffsetRad = 0 ' No phase offset applied to the pulse.    

' Instantiate a new pattern called Variable PRI.    

Set VariablePattern = project.PatternLibrary.CreateNewPattern("Variable PRI")    

' The following loop statement adds 10 pattern items to the Variable PRI pattern. Each pattern item has a different repetition interval associated with it.    

RepInterval = 0.00001    

For Counter = 0 To 9    

Set VariableItem = VariablePattern.CreateNewItemAt(AgtPBPatternItemObjectType_Pulse, "CW1", Counter)        

If Counter = 9 Then            

RepInterval = 0.000011                

End If            

VariableItem.RepetitionIntervalSec = RepInterval ' The RepInterval starts at .00001 seconds.        

VariableItem.NumberOfRepeats = 1 ' Number of repeats.        

VariableItem.EdgeJitterType = AgtPBJitterType_None ' No jitter applied.        

VariableItem.JitterDeviationSec = 0 ' No jitter deviation.        

VariableItem.RelativePowerScaleDB = 0 ' No power scaling of patten item.        

VariableItem.FrequencyOffsetHz = 0 ' No frequency offset.        

VariableItem.PhaseOffsetRad = 0 ' No phase offset.        

RepInterval = RepInterval - 0.000001 ' Repetition interval is decreased by 1 us.        

Next ' Counter    

' Comment the next line if you don't want to save the .pbp file to the PC.    

project.SaveProject ' Save the signal parameters in the Executive Test.pbp file.    

frmMain.MousePointer = vbDefault ' Use default mouse icon.    

cmdRun.Enabled = True ' Re-enable the Download and Play button; the process is finished.    

Exit Sub

Error_Handler:

frmMain.MousePointer = vbDefault ' Use the default mouse pointer.    

cmdRun.Enabled = True ' Re-enable the Download and Play button because; an exception occurred.     

Call MsgBox(Err.Description, vbOKOnly)    

End Sub

API Programming Overview

Frequency Agile Program Example

Sensitivity Program Example

Complex Test Program Example