API Programming Overview

The Pulse Building API uses a COM object model that you can use in your software application to access all features available in the Pulse Building GUI. The Pulse Building installer installs and registers API components (dlls) on your PC and you can access the COM object by making a reference to it in your Visual Basic project. When you develop your Visual Basic program using the Pulse Building COM object, all object properties and methods used by the Pulse Building GUI can be accessed by the application.

The Pulse Building COM object is called AgtPBProject. The Classes section of this Help document has API information that describes in detail the classes, properties, and methods for the object. In addition, you can use the Visual Basic Object Browser to view the methods, properties, and classes associated with the AgtPBProjectobject.

In the Visual Basic integrated development environment (IDE) the Object Browser is available under the View pulldown menu. In this menu select AgtPBProject under Classes to view all of the available properties, methods, and classes of the Pulse Building COM object.  

The programming examples, with the exception of the Executive Test example, duplicate the examples manually generated in the Pulse Building Examples section of this Help document. You can run the manual examples and compare the results to the results obtained from the programming example.

Requirements

The Visual Basic IDE must be installed on your computer. In addition you must have the following installed on your computer:

For more information on the requirements for remotely controlling instruments, refer to the Signal Studio Software Installation Guide and the signal generator Programming Guide.

Visual Basic Examples

This section tells you how to use the Pulse Building API in a Visual Basic application and gives example programs for three different signals:

Developing Your Visual Basic Application

When you install the Pulse Building software, the Pulse Building API will be registered on your computer. To make the Pulse Building COM object available in your Visual Basic application, perform the follow the steps:

  1. Run Microsoft Visual Basic 6.0.

  2. Open a Standard EXE from the New Project window.

  3. Select Project - References from the project window.

  4. Select the Keysight Signal Studio for Pulse Building in the Available References list box. Click the check box to the left of this item.

  5. Click OK.

If you are importing text data from a file you will need to select the Microsoft Scripting Runtimelibrary from the Available References. The Frequency Agile example uses file input to read data from text files and therefore requires this library.

To use the Pulse Building COM object in your application you must declare an object of type AgtPBProject which is the name of the Keysight Pulse Building COM object. To declare the Pulse Building COM object add the following code statement in the General section of the Visual Basic Form1:

Dim project As AgtPBProject

The name, project in this example, can be any name you choose. For example, you could use: Dim Freq_Agile As AgtPBProject  .   

To access the Pulse Building COM object add the following code to the Form_Load event procedure:

Set project = New AgtPBProject

To initialize a new project add the following code to command button event procedure:

project.NewProject ("Frequency Agile.pbp")

The .NewProject procedure declares default parameters for the .pbp project. If you have an existing .pbp file, such as one generated in the Pulse Building Examples section of this Help document, you can load the file using the .OpenProject procedure. You can then change the project file in your code and save this changed version to a different file name using the .SaveProject procedure.

Running the Visual Basic Examples

These example programs are available in the following default directory:

Windows 7

C:\Users\Public\Public Documents\Keysight\Pulse Building\Samples\VB6

Windows XP

C:\Documents and Settings\All Users\Keysight\Pulse Building\Samples\VB6

 

The programs should be run from that location. See the Signal Studio Software Installation Guide for information on the I/O interface and how to connect the signal generator, analyzer, and PC.

It is recommended that the examples shown in the Pulse Building Examples section of this Help document be reviewed and the signals generated by those examples be compared to those created by the program examples. Use the analyzer settings shown in the examples section to view the waveform.  

COM API

Frequency Agile Program Example

Sensitivity Program Example

Complex Test Program Example

Executive Test Program Example