Build OPC Items
Build OPC Items
Build OPC Items
The text and screen shots in this document are compatible with Workbench Version 8.3.0 and subsequent releases. If you are running a previous
version, please contact Technical Support.
3
Build OPC Items Getting Started
Contents
SECTION 1 – BUILD OPC ITEMS OPERATION ............................................................................................... 4
SECTION 2 – BUILD OPC ITEMS INTERNALS ................................................................................................ 5
SECTION 3 – TROUBLESHOOTING ................................................................................................................. 7
Following a successful strategy compilation, a project’s symbolic tags can be automatically exported to, and
viewed from within, the Universal Server. To export tags to the Universal Server, you must configure the
system to automatically launch an external application.
1. First, the external application must be installed on your system.
a. Insert the CD into your drive and launch Windows Explorer to view the CD’s contents.
b. Double-click the setup.exe file. If Microsoft .NET Framework is not detected on your system,
the installation program will load it first; otherwise, you will be taken immediately to the
following step.
c. Click Next on the first screen if you wish to install the Build OPC Items application.
d. Select Yes to accept the license agreement.
e. The application is stored, by default, in <installation_directory>\Utilities\BuildOPCItems. If
you chose to install the program to another location, browse to that directory and click Next.
f. A window appears asking whether OPC items should be automatically built for each project. If
you answer yes, the ExternalApps.ini file (described below) will be automatically added to
the projects subdirectory. The appropriate entry will automatically be added to the
ExternalApps.ini file to build OPC items after a compilation.
g. The program installed to the specified folder. Click Finish.
2. Next, the External Applications feature can be used to configure the system for launching the program
that was just installed.
a. To build OPC items for all projects, create an “ini” file named ExternalApps.ini (if it does not
already exist) and store it in the Projects directory that was created when the system was
installed. (This step is performed automatically if you answered Yes to step f, above.)
b. To build OPC items for a specific project (xxx), create an “ini” file named ExternalApps.ini (if
it does not already exist) and store it in the particular project directory (proj_xxx) that was
created when the project was created in the Workbench.
c. To build OPC items for a specific controller (yyy), create an “ini” file named ExternalApps.ini
(if it does not already exist) and store it in the particular controller directory (ctrl_yyy) that was
created when the controller was created in the Workbench.
d. Open the “ini” file in a text editor and add a line to the end of the “ini” file in the following
format: (This step is automatically performed for .ini files added at the project level when Yes
is the response for Step f, above.)
path\ExportTagsToUS.exe,<server>,<databasename>,<username>,<password>,
<controller>
Where path is the location of the BuildOPCItems folder installed by the Build OPC Items
Installation program. The default path is <installation_directory>\Utilities\BuildOPCItems.
The installation program is named Build OPC Items; however, the executable it installs is called
ExportTagsToUS.exe. This section describes the ExportTagsToUS executable.
Given the command line parameters, the program extracts a controller’s tag data from the CSVReal and
CSVDiscrete project database tables. Data are extracted from the CSVReal table, the RealName (Tag Name),
Comment (Tag Description), MinRaw, MaxRaw (item scaling), MinEU, MaxEU (engineering unit scaling), and
ItemName (Modbus Starting Address). The ItemName is in the form of xxxxxx [F:S] where xxxxxx is the
address and the square brackets enclose an optional modifier. The address followed by F signals a floating
point; the address followed by S signals a signed integer (short), and the address without any additional
information signals the default, an unsigned integer (short). The ItemName is decoded to pass the address,
default client data type, and field data type to the server. Other real information passed to the server includes:
• Addresses per register - always 1
• Bytes per Register - 2
• High Bit - not used for Reals
• Low Bit - not used for Reals
• Number Registers (2 for floating point; 1 for signed/unsigned integer)
• Access Flags - Read Only if the address < 400000; otherwise read/write; Auto Scanning always
enabled and Scaling always enabled.
From the CSVDiscrete table, the DiscreteName (TagName), Comment (TagDescription), and ItemName
(Address) data are extracted. A discrete’s starting address takes two forms. An address in the register range
below 200000 is a discrete 1 bit value, but addresses in the 300000-400000 range could be a discrete bit
mask within an integer value. For this reason, register addresses in the 300000-400000 range will appear as
xxxxxx:yy where xxxxxx is the Modbus starting address and the :yy defines the bit number to mask. The
ItemName is decoded to pass the address, default client data type and field data type to the server. For
discrete data, the following additional information is passed to the server:
• Addresses per register - 1
• Bytes per Register - 1
• High Bit - not used
• Low Bit - the bit number if this is an integer bit mask
• Number Registers - 1
• Access Flags - Read Only if the address >= 100000 (this includes bit masked values); otherwise,
read/write and auto reset enabled. Auto Scanning is always enabled.
Section 3 – Troubleshooting
Since this application does not have a user interface, refer to the Microsoft Application Event Log for all error
messages. The errors will be self-explanatory; however, the following are a few of the more common
problems:
• The controller name sent to ExportTagsToUS.exe must match the device name defined in the
Universal Server.
• The Universal Server will not allow item updates from the ExportTagsToUS.exe if it has the device
locked in edit mode.
• The Universal Server will not add or update duplicate items.