Tutorial - Getting started with Delphi
Home Product
Details Free 
Demo Pricing &
Ordering Related
Products Support About Us

Back to all documents

Tutorial - Getting Started with Delphi and the OPC Web Client ActiveX Controls

The following tutorial takes you through the steps of setting-up Borland Delphi (version #5 is assumed) to be able to use the OPC Web Client ActiveX Controls.

Creating a new project

  1. Open Borland Delphi.
  2. Create a new Project by going to the "File" menu and choosing "New".
  3. A blank windows form will open.

Referencing the OPC Web Client

In order to use the OPC Web Client ActiveX Controls, we need to reference it and allow Delphi to build the appropriate wrappers. This specific process of building the wrappers ONLY NEEDS TO BE DONE the first time you ever use the OPC Web Client ActiveX Controls. Once the wrappers are built you will be able to skip this step and go straight to step Installing the OPC Web Client in future projects.

  1. Open the "Project" menu and choose the option "Import Type Library..." as shown below:

     
  2. Scroll down the list of libraries and select the "EasyOPCDA 3.0 Type Library"  as shown below:

     a
  3. Click the "Install" button at the bottom of the window (as shown above).
  4. A dialog will open requesting the filename of the type library file that will be created. You can accept the default settings as shown below:

     

Installing the OPC Web Client component into your Project

  1. Go to the "Component" menu and choose "Install Component...", as shown below:
     
  2. The following window will open:
     


    Note: The default location for imported type libraries is:
    \Program Files\Borland\Delphi\Imports


  3. It is in this window that you need to browse and select the "EASYOPCDALib_TLB.pas" file that was created in the previous step Referencing the OPC Web Client.
  4. Click the OK button to close this window.
  5. You may see some dialogs warning you that some files will be overwritten, click OK so accept this.

Using the OPC Web Client

By far the easiest way to use the OPC Web Client within Delphi (for learning purposes) is to simply create a simple form with a push-button. All Delphi code will then be placed within the click-event handler for the push-button.

You will find within the Delphi development toolbar under the "ActiveX" section two new icons for the OPC Web Client:
Simply drag-n-drop the EasyDA icon onto your form.

Now simply add the button to the form as shown below:

Now double-click on the button to go to the click event handler:

You are now ready to paste code from the tutorials section into this event.

Copyright Software Toolbox, Inc., 1996-2004, All Rights Reserved Worldwide.
148A East Charles Street, Matthews, North Carolina, USA 28105
Phone: 704-849-2773 or 1-888-665-3678 (US), Fax: 704-849-6388
sales@softwaretoolbox.com | support@softwaretoolbox.com