Using the Code Builder
Home Product
Details Free 
Demo Pricing &
Ordering Related
Products Support About Us

Return to Documents list

Using the Code Builder Tool / OPC Item Generator

What is the OPC Item Generator?

The OPC Item Generator is a utility that can save you time and energy. It essentially is a code-builder that you can quickly and easily configure, generate your code and then copy+paste it into your application.

Here's the OPC Item Generator window:

Using this utility is very easy. Let's take a look-by-example as we generate the VB6 code for reading a Tag from the Greenhouse OPC Server:

  1. Open the OPC Item Generator utility from:
    Start > Programs > Software Toolbox > OPC Web Client 3.00 > Utilities > OPC Item Generator
  2. In the "Machine name" field you can specify the computer where the OPC Server resides. If the OPC Server is local (as we will assume it is in this case) simply ignore this field.
  3. The "Server class" field is the OPC Server we intend to use. Click on the "..." button to browse the available OPC Servers on the local computer and then pick the " OPCLabs.KitServer.2" OPC Server from the list.
  4. The "ItemID" field is the Tag we intend to use.
  5. You have the ability to specify the "Access path" and "Requested data type" but these are very rarely needed. We will ignore these fields in this example.
  6. The "Target" list shows the development languages/templates that can be used. Highlight "Visual Basic".
  7. The "Function" list allows you to pick what you want to do, the picture above shows "ReadItemValue" and "WriteItemValue". Simply highlight the "ReadItemValue".
  8. Click the "Preview & Copy to Clipboard" to generate the code and copy it to the Windows clipboard.
  9. Open your application source code and then paste the generated code into the relevant location.

Example output from OPC Item Generator:

      
    Value = EasyDA.ReadItemValue( _
       "", _
       "OPCLabs.KitServer.2", _
       "Simulation.Random", _
       "", _
       0 _
       )

This utility will expand with more options to choose your development language, and the methods/functions you will be able to auto-generate.

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