Adding the PI-SDK Controls to Your Visual Basic Project

Programming with the PI-SDK Active-X controls requires that you add both the PI-SDK and the Active-X control(s) to your Visual Basic project.

Adding the PI-SDK

Open your Visual Basic project. From the Visual Basic Project menu select the References item. In the dialog presented, scroll down until you see the item "PISDK 1.3 Type Library." Make sure the checkbox is checked, then click OK.

Note: If you don't see the entry, you must first install the PI-SDK version 1.2 or 1.3.

From the View/Object Browser menu, you can now select PISDK from the dropdown and browse the methods, properties, and events for the objects. Press F1 to get context-sensitive help.

You may also want to select PITimeServer1.1 and PISDKCommon 1.0 type libraries when building PI-SDK applications. These libraries supply historical time objects and some generic collections and interfaces that are used as arguments to some PI-SDK methods.

Adding the PI-SDK Control (PI-ServerPickList)

From the Project menu, select the Components item. In the dialog presented, scroll down until you see the item "PI-SDK Control" and check the checkbox next to it then click OK. At this point you should see the PI-ServerPickList icon appear in the Visual Basic toolbox.

Adding the PI-MDBTree Control (MDBTree)

From the Project menu, select the Components item. In the dialog presented, scroll down until you see the item "PI-MDBTree Control" and check the checkbox next to it then click OK. At this point you should see the PI-MDBTree icon appear in the Visual Basic toolbox.

The following picture illustrates what the PI-ServerPickList control looks like in Visual Basic Object Browser. The same principles apply to the MDBTreeCtrl also.

 

From the View/Object Browser menu, you can now select PISDKCtl, or PIMDBTreeCtl, from the dropdown and browse the methods, properties, and events for the control. Press F1 to get context-sensitive help.

 

Adding the PIArchiveEditor COM-interop dialogs (PIAcrhiveEditDlg and PIAnnotationEditDlg)

These two dialogs are described here instead of the "Dialogs" section of this manual because they, by themselves, don't provide additional functionality to the contained controls.

You need to add a reference, unless you already have it, to the PIArchiveEditor assembly. From the Project menu, select References, scroll down the assembly list and select/click "OSISoft - PI Archive data/annotations editor" and press OK.

With the reference in place, you can now create a new instance of PIArchiveEditDlg or PIAnnotationEditDlg, set the properties and then show it (Show or ShowDialog method).

Please view the "Adding the PI-SDK Controls to Your Visual .NET" project on how to use the dialogs in VSNet projects.

 

Enabling Operational Intelligence