Top  | Previous | Next

Connecting to OPC Classic (COM)

Important

Classic OPC is based on COM, which is a technology in Microsoft Windows. Therefore, the information in this section only applies to Ignition gateways installed on Windows. For other operating systems, OPC-UA must be used.

 

Introduction

The OPC-COM module provides the ability to connect to OPC servers that only communicate using the older COM based OPC-DA standard.  If you have an OPC server that is not capable of  accepting OPC-UA connections and you need to talk to a PLC for which Ignition has no supported driver, then you'll have to use the OPC-COM module to make your device data available in Ignition.  Connections to OPC servers will be held open while the Ignition gateway is running. All subscriptions to the server will use the same connection.

 

This section provides a brief walk-through of how to set-up a new Local or Remote OPC-DA server connection using the COM module.  Due to the complications that Windows DCOM security settings can cause, this set-up guide is followed by the Troubleshooting OPC-COM Connections section that deals with an overview of how to deal with a faulted server connection due to DCOM security settings as well as other possibilities.

 

 

Necessary Preliminary Steps - Install OPC Core Components

The OPC-COM module relies on a .dll package provided by the OPC Foundation (www.opcfoundation.org) called the OPC Core Components.  You can download the OPC Core Components Redistributable from the OPC Foundation's website under the downloads section.  Registration with the OPC Foundation is required before you can download the package, but the registration process is free and painless.

 

There are two packages to choose from, the 32-bit (x86) and the 64-bit (x64) so make sure you get the correct one for the version of Java and Ignition you are running.  64-bit Java and Ignition needs the 64-bit Core Components package and likewise 32-bit installations need the 32-bit package.  It should also be noted that if you are going to be connecting to an OPC server on a remote machine then you must also install the appropriate version of the Core Components on that server as well.  The version type, 64-bit or 32-bit, does not need to be the same across the two servers.  Just be sure to install the version that is appropriate for the OPC Server and Windows architecture.

 

Once you have the correct package downloaded you can extract the contents of the .zip file and then run the installer.  With the core components installed you can now proceed to setting up your OPC-DA server connection in Ignition.

 

Recap -

1.Register at www.opcfoundation.org
2.Download appropriate OPC Core Components Redistributable package
3.Install Core Components on Ignition server
4.(Remote) Install Core Components on remote machine running the OPC-DA server

 

 

Creating an OPC-DA Connection

With the OPC Core Components now installed the next step is creating/configuring a new OPC-DA server connection.  Follow these steps:

 

1.Navigate to the Ignition Gateway Configuration section (i.e. http://localhost:8088/main/web/config).
2.Under OPC Connections select Servers and then select “Create new OPC Server Connection...”
3.Choose the OPC-DA COM Connection option and then select whether you want to make a local connection or if the OPC server resides on a remote machine.  For the most part, setting up a local or remote connection to an OPC-DA server is the same.  There are only a couple of differences for a remote connection that will be highlighted along the way.

 

4.Local - Selecting a local connection will take you to a screen that contains a list of the available and running OPC servers located on the local machine.

  Remote - For a remote connection you will first have to specify the host name or IP address of the machine the the OPC server resides on and then (as of Ignition 7.4) you will be redirected to the available servers list.

5.Select the OPC server that you wish to connect to from the list.  In the case where your server is not listed then consult "OPC server is not listed..." topic of the troubleshooting section.

 

Unique Remote Connection Settings:

Remote connections have a few unique settings that you can specify.  You can get to these settings by selecting the “Show advanced properties” check box.  As of Ignition 7.4 these should all be set for you  (except for the CLSID which should no longer be necessary but is still available for you to set if you wish).

 

Remote Server

   Specifies that the server is remote and that a DCOM connection will be used

Host Machine

   The computer name or IP address of the machine on which the remote server is running

CLSID

This is no longer required as of Ignition 7.4, but it is still made available for you. It can be used in place of the ProgId because the ProgId is really just used to lookup the CLSID in the registry.  This id can be found in the registry of the machine hosting the server under:

 HKEY_CLASSES_ROOT\OPCServerName\CLSID

 

 

6.All of the settings for the server connection are rather straight forward and each property has a description of its functionality.  Most of these settings should be fine when left at their default values.    The only setting that could possibly give you some trouble is the ProgId.  If you selected your OPC server from the list on the “Choose OPC-DA Server” page then this will be filled in for you.  However, if for whatever reason your server wasn't listed and you chose the “Other Server” option then you will have to know the ProgId for your server and specify it here.  The ProgId is used to look up the CLSID of the OPC Server in the Windows Registry and without this a connection cannot be made.

 

7.When you are finished fine tuning these settings click “Create New OPC Server Connection”.  You will be redirected to the OPC Server Connections page and your new server connection should be listed.  The status of your connection will read “Connected” if Ignition was able to successfully connect to the third party OPC server.

 

Connection is Faulted

In the case where your connection status is reporting Faulted, the troubleshooting process begins. As previously stated, configuring the DCOM settings on your machine can be a headache. The Troubleshooting OPC-COM Connection section is an attempt to ease the process of determining why your connection is faulted and how to go about fixing the issue. If after exhausting the options presented to you there you are still having issues getting you server connection up, give our Inductive Automation tech support line a call and one of our representatives will be happy to assist you.

 

 

Creating an OPC-HDA Connection

The process of connecting to an OPC-HDA server is similar to that of a DA server. Instead of going to the "OPC Connections" section, however, you define the server as a Tag History Provider.

1.Navigate to the Ignition gateway configuration section, as outlined above.
2.Under Tags, History, select "Create new Historical Tag Provider..."
3.Select "OPC-HDA Provider"
4.Follow the step outlined above, for DA connections.
5.Once complete, the status on the Tags>History screen will show the state of the connection. If Connected, you should now be able to browse and query the server through the Ignition designer.

 

Example - Adding OPC-HDA data to a chart

1.Open the designer, and create or open a project.
2.Create a window, and add an Easy Chart component.
3.Double-click on the chart, or right click and select Customizers>Easy Chart Customizer to bring up the chart customization window.
4.Next to the "Tag History Pens" table, select the first button, "Browse for tags". This will display a tree for browsing all historical tags.
5.Browse through your defined HDA server. Once you find a tag, select "ok" to add it to the chart.
6.You may edit the tag to alter its aggregation mode, though the HDA provider will select a supported mode automatically if the specified mode does not exist in the server.
7.Once you save the configuration, the chart should update with the requested data.

 

A similar procedure can be used anywhere Tag History can be bound or used.