Adding the PI-SDK Controls to Your Visual Studio.Net Project

Programming with the .NET user controls requires that you add the controls to your VS.NET project. If you plan to use the PI-SDK you need to add a reference to each SDK Interop assembly that you are going to use.

Adding the PI-SDK Interops

Open your Visual Studio.NET project. From the Project menu, or References item of the Solution Explorer pane, select Add Reference. In the dialog presented, select the .NET pane and scroll down until you see the items like "OSIsoft.PISDK". Select/highlight the wanted items, press Select and then OK to close the dialog.

If the Interops are not listed, you will need to browse for them. In the presented dialog, press Browse button and browse to PI-SDK installation directory (e.g. c:\program files\pipc\pisdk), select the wanted assemblies (osisoft.xxx.dll), press Open and then OK.

Select View/Object Browser menu, select OSIsoft.PISDK from the presented tree-view and browse the methods, properties, and events for the objects. Context-sensitive help is available on the bottom of the browser window.

You may also want to select OSIsoft.PITimeServer and OSIsoft.PISDKCommon Interop 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 OSIsoft.SDK.Controls.MDBTree Control (MDBTreeNET) to the toolbox

From the View menu, select the Toolbox item, right-click on the toolbox and select Add/Remove Items. In the presented dialog, locate and select the MDBTreeNet control and press OK.

If the control is not present you need to locate it. Press Browse and navigate to PISDK installation folder. Select/Highlight OSISoft.SDK.Controls.MDBTreeNet.dll and press Open and finally OK to close the dialog.

The following picture illustrates what the MDBTreeNet user control looks like in VS.Net Object Browser.

 

Adding the Archive Editor controls to the toolbox (.NET)

From the View menu, select the Toolbox item, right-click on the toolbox and select Add/Remove Items. In the presented dialog, locate and select the PIArchiveEditor or PIAnnotationEditor (or both) and press OK.

If the control is not present you need to locate it. Press Browse and navigate to PISDK installation folder. Select/Highlight OSISoft.SDK.Controls.PIArchiveEditor.dll, press Open and check/select the desired controls. Press OK to close the dialog.

The object browser view is similar to the MDBTreeNet view:

Using the Archive Editor dialogs (.NET)

You need to add a reference, unless you already have it, to the PIArchiveEditor assembly. From the Project menu, select Add Reference, scroll down the assembly list and select/click OSISoft.SDK.Controls.PIArchiveEditor, press Select and then OK.

With the reference in place, you can now create a new instance of a dialog. You can use the full name, i.e. OSIsoft.PISDK.Controls.PIArchiveEditDlg or the plain class name (PIArchiveEditDlg) if you add a using statement to your code (using OSIsoft.PISDK.Controls). Same instructions apply to the PIAnnotationEditDlg dialog.

Please view the "Adding the PI-SDK Controls to Your Visual Basic Project" on how to use the dialogs in VB6 projects.

Enabling Operational Intelligence