|
|
|
|

|
|
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:
- Open the OPC Item Generator utility from:
Start > Programs > Software Toolbox > OPC Web Client 3.00 > Utilities > OPC Item Generator
- 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.
- 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.
- The "ItemID" field is the Tag we intend to use.
- 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.
- The "Target" list shows the development languages/templates that can be used. Highlight "Visual Basic".
- The "Function" list allows you to pick what you want to do, the picture above shows "ReadItemValue" and "WriteItemValue". Simply highlight the "ReadItemValue".
- Click the "Preview & Copy to Clipboard" to generate the code and copy it to the Windows clipboard.
- 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.
|
|

|
|
|