OPC DA Collector

OPC Data Collectors

The OPC Collector collects data from any OPC 1.0 or OPC 2.0 compliant OPC Server (such as CIMPLICITY). The OPC Collector automatically determines the capability of the OPC Server to which it is connected and supports appropriate features based on this information.

Summary of OPC Collector Features

The following table outlines the features of the OPC Collector.

FeatureCapability
Browse Source For TagsYes (on OPC Servers that support browsing)
Browse Source For Tag AttributeYes
Polled CollectionYes
Minimum Poll Interval100 ms
Unsolicited CollectionYes (OPC 2.0 Only)

If you are using an OPC Collector with unsolicited data collection and have collector compression disabled, all new values should produce an exception. When the OPC Collector is doing unsolicited collection, the deadband percentage is determined by the collector deadband percent. You can only configure the collector deadband percent by enabling compression.

Timestamp ResolutionYes
Accept Device TimestampsYes
Floating Point DataYes
Integer DataYes
String DataYes
Binary DataYes
Python Expression TagsYes

OPC Data Collectors Tag Attributes Available in Browse

The following table outlines the tag attributes available when browsing.

Note: While some of these attributes are queried on a browse, they are not shown in the browse interface. These attributes are used when adding a tag, but it is not visible to you if all attributes come from the server or not.
AttributeCapability
TagnameYes
Source AddressYes
Engineering Unit DescriptionYes, varies by OPC Server Vendor.
Data TypeYes
Hi Engineering UnitsYes, varies by OPC Server Vendor.
Lo Engineering UnitsYes, varies by OPC Server Vendor.
Hi ScaleNo
Lo ScaleNo
Is Array TagYes

OPC Data Types

The following table lists the OPC data types recommended for use with Historian

Note: The OPC Collector requests data from the OPC server in the native data type. Then the OPC collector converts the received value to a Historian Data Type before sending it to the data archiver.
OPC Data TypeRecommended Data Type in Historian
I1 - 16 bit signed integerSingle Integer
I4 - 32 bit signed integerDouble Integer
R4 - 32 bit floatSingle Float
R8 - 64 bit double floatDouble Float
UI2 - 16 bit unsigned single integerUnsigned Single Integer
UI4 - 32 bit unsigned double integerUnsigned Double Integer
UI8 - 64 bit unsigned quad integerUnsigned Quad Integer
I8 - 64 bit quad integerQuad Integer
BSTRVariable String
BOOLBoolean
I1 - 8 bit single integerByte

The Configuration Section for OPC Collectors

To access the Configuration section for an OPC Collector, select an OPC Collector from the list on the left and select Configuration. The following figure appears.



OPC Collector Specific Configuration

The Configuration section displays the following information.

FieldDescription
OPC Server Prog IDThe Program ID for the OPC Server that you want this collector to connect to.
Read ModeCache or Device, indicating the type of OPC reads the collector should perform. To change the mode, select the other option from the drop-down menu. Refer to your OPC Server documentation for more information.
First Browse CriteriaTop-level search criteria for browsing tags from the data source. Top-level and second-level criteria are ANDed together for the browse. The final browse criteria, therefore, consists of a combination of first-level and second-level criteria ANDed together
Second Browse CriteriaSecond-level search criteria for browsing tags from the data source. Top-level and second-level criteria are ANDed together for the browse.
Threading Model

The type of threading model selected for this collector. The model selected must match the threading model of the OPC Server. The default setting is multithreaded. Refer to your OPC Server documentation for more information.

It is recommended that you configure your OPC Collector to use the default Multi threading model. Some OPC Servers do not work well with Multi threading. If you experience problems running your OPC Collector with Multi threading, change the threading model setting to the Apartment model.

Configuration Changes

Whether your OPC Collector configuration changes are processed in real time or after shutting down and restarting the collector. Select the Made On-Line option to process any configuration changes immediately (after 30 seconds) when you select the Update button. Select the Made After Collector Restart option to hold all configuration changes until you manually stop and restart the OPC Collector.

NOTE: To allow configuration changes, you also must enable the On-Line Tag Configuration Changes option on the Advanced section of the Collector Maintenance page.

To manually restart the OPC Collector, stop and start the collector through the Services window if you are running your OPC Collector as a service. For more information, refer to the Configuring an Historian Data Collector for Automatic Startup section of the Historian Data Collectors manual. If you are not running the collector as a service, open the OPC Collector's console window, type s, and press enter to shut down the collector. For more information, refer to Running Collectors as Console Applications section of the Historian Data Collectors manual.

Starting and stopping the collector in the General section of the Collector Maintenance page does not constitute a manual restart. You must either start and stop the collector from the Services window or the Console application.

Note: Certain OPC Servers cannot handle processing configuration changes online. If you experience any instability with changes made online, it is recommended that you set the Configuration Changes field on the Configuration section of the OPC Collector to Made After Collector Restart.

Configuration of OPC Collector Specific Fields

Enter values for the OPC Collector-specific field parameters through the OPC Collector Maintenance Configuration section of Historian Administrator. The following table lists the descriptions of the collector-specific fields:

FieldDescription
OPC Server Prog IDOPC Prog ID of the locally installed OPC Server.
Read ModeRead Source (DEVICE or CACHE). See the OPC Specification on the OPC Foundation website.
First Browse CriteriaA comma separated list of criteria used as Filter 1 in a browse for tags.
Second Browse CriteriaA comma separated list of criteria used as Filter 2 in a browse for tags.

Note that the Tag Filters in First Browse Criteria and Second Browse Criteria are used to filter the tags returned on a browse. You can add multiple strings to each filter, separated by commas. If a filter is supplied, a tag must have one of the identified strings in the tagname in order to be returned. Consider the tags within a filter to be OR'ed and Filters 1 and 2 to be AND'ed.

For example, USGB014 in Filter 1 and F_CV, B_CUALM in Filter 2 translates to: Give me all the tags that contain USGB014 AND contain F_CV OR B_CUALM.

Threading ModelMultithreaded or Apartment. Use apartment threaded for best compatibility. Use multithreaded for better performance if your server is also multithreaded
Configuration Changes

Certain OPC Servers cannot handle processing configuration changes online.

This field allows you to select whether your OPC Collector configuration changes are processed in real time or after shutting down and restarting the collector. Select the Made On-Line option to process any configuration changes immediately when you select the Update button. Select the Made After Collector Restart option to hold all configuration changes until you manually stop and restart the OPC Collector.

Starting and stopping the collector in the General section of the Collector Maintenance page does not constitute a manual restart. You must either start and stop the collector from the Services window or the Console window. For more information, refer to the Configuring the Data Collector for Automatic

Startup and the Running Collectors as Console Applications sections of the Historian Data Collectors manual.

Normally, changes are applied approximately 30 seconds after the last change.

Browsing OPC Hierarchy

About this task

If your OPC server supports hierarchical organization of your tags in a tree structure, Historian will use the server's hierarchy when browsing an OPC collector in the Non-Web Administrator.

To browse for OPC tags in a hierarchy:

Procedure

  1. Browse your OPC data source for new tags.
  2. From the Collector list, select the OPC collector you wish to browse. A hierarchical tree appears in the Browse Results window.
  3. To limit the displayed tags to only those that are not collected, from the Show Only list select Source Tags Not Collected.
  4. To limit the displayed tags to match a tag name or tag description, enter the value to match in the Source Tag Name or Description text boxes.
  5. Navigate to the node in the tree you want to browse, and then select Browse. The tags within the selected portion of the OPC tag hierarchy will be displayed.
    1. To browse automatically, select the AutoBrowse check box. The available tags will be displayed in the Browse Results window whenever a node is selected in the tree.
    2. To show all child elements within a hierarchy, enable the Show All Children check box. All tags at, or below the hierarchical level of the selected node in the tree will be displayed in the Browse Results window.
  6. Select the tag or tags you want to add to Historian, and select Add Selected Tags. Collected tags will appear in black in the tag list.
    Note:
    • The Browse option for the OPC Collector will not return all items that reside in the Server configuration. Items that may not get returned include, but are not limited to, unsupported data types and user-defined items in some Simulation Servers. Occasionally, items that do not appear in the browse can still be added manually using the Add Tag Manually option.
    • If you are browsing and adding tags with the OPC Collector, note that some OPC Collectors do not support data blocks with a length greater than 1. These OPC Servers can choose to show the first item in an array in the browse rather than show them all. For example, an OPC Server may contain 3000 analog values datablock:1 to datablock:3000, but would only show datablock:1.
    • If you want to archive data from poll records of a length greater than 1, it is recommended that you use the Excel Add-In to configure a large block of tags - including the missing items - and add the tags.
    • If you are unable to browse items on your OPC server containing forward slashes ( / ), you may have to change the default separator in your OPC Collector configuration. To do so, you will need to open the Windows Registry Editor and edit the HKEY_LOCAL_MACHINE\SOFTWARE\Intellution, Inc\iHistorian\Services\OPCCollector\[Collector Name]\OPCBrowseTreeSep key (where [Collector Name] is the name of your OPC collector) and change the string value to a character not present among your OPC Server item IDs. Typical values include |, !, or &. Create this key if it does not already exist.
    • If you are unable to browse readable items in your OPC server with the OPC collector, you may need to change the browse access mask used by the collector. To do so, you will need to open the Windows Registry Editor and edit the [HKEY_LOCAL_MACHINE\SOFTWARE\Intellution, Inc.\iHistorian\Services\OPCCollector\[Collector Name] (where [Collector Name] is the name of your OPC collector) and add DWORD key "OPCBrowseAccessRightsMask"=dword:00000003. Valid values are 0, 1, 2, 3 with 1 being the default. Use 0 or 3 if you are unable to browse readable items. Creating or changing the value takes effect on the next browse attempt and does not require a collector restart.

OPC Group Creation

It is recommended that you limit the number of OPC groups created by the Historian system to increase performance. To limit the number of OPC groups created on the OPC Server, consider grouping Historian tags (collected by the OPC Collector) using the least amount of collection intervals possible.

Configuring GE Intelligent Platform Drivers and Deadbands for the OPC Collector

About this task

If you want to add items of different data types to Historian using the OPC Collector to a GE Intelligent Platform v7.x driver/OPC Server, and you are using deadbands, you must manually modify the Source Address for each item you add to specify the EGU range for that item.

Note: For other third party (non-GE Intelligent Platforms) OPC Servers, refer to OPC Server documentation for information on how the deadband works.

To change the source address for a specified item:

Procedure

  1. Select the item in Tag Maintenance page.
  2. Select Collection.
  3. Add the following fields to each tag's Source Address field:
    |SIGNALCONDITIONING,LOWEGU,HIGHEGU,HARDWAREOPTIONS
    

    where SIGNALCONDITIONING, LOWEGU, HIGHEGU, and HARDWAREOPTIONS are the actual values that you want to use with the particular item.

    For example, you would change an item with a Source Address of Device0:M1015 to Device0:M1015|NONE,0,255,NONE. The 0 and255 values correspond to the LOWEGU and HIGHEGU span of the item.

Example: Using Deadbands with the SI7 Driver

When you use the SI7 driver, it sets the global default values for engineering unit (EGU) limits used for deadband calculations to the following values

l  Lo EGU = 0

l  Hi EGU = 65535

l  EGU Span = Hi EGU LO EGU = 65535 ???

You may want change the default values for this driver if the items that you add use data types other than Integers, such as Floats.

If you want all items to use the same data type, you could change the settings for the HiEGU and LoEGU for the driver in the Registry Editor under the following key: \\HKEY_LOCAL_MACHINE\SOFTWARE\In-tellution\Drivers\SI7\OPC\ItemDefaults. These values apply to all items not specified by the Source Address after you restart the driver.

However, if all items do not use the same data type, as described previously in this section, you must manually modify the Source Address for each item you add in Historian Administrator so that it includes the |SIGNALCONDITIONING,LOWEGU,HIGHEGU,HARDWAREOPTIONS options.

Troubleshooting an OPC Collector that Fails to Start

If an OPC Collector fails to start when you restart your computer, it could be because:

  • There is not enough free space for the collector to create its buffer files on startup.
  • Historian is trying to run the OPC Collector before the OPC Server fully starts.

To isolate the cause of the restart issue, review the OPC Collector log file in the C:\Historian Data\LogFiles folder, or the most recent log messages in the Windows Event Viewer. Once you determine what may be causing the issue, you can attempt to fix it by adding a new DWORD setting, MinimumDiskFreeBufferSize, in the Windows Registry for the OPC Collector.

Tips for Reviewing the OPC Collector Log Messages

When reviewing the OPC Collector log file, or the log messages from the Event Viewer, keep in mind:
  • If you notice a message that states that Historian could not create the buffer files, then the issue is most likely that you do not have enough free space available for the buffer files.
  • If you notice the OPC Collector connection attempt, a COM initialization attempt, and then a shutdown, the cause of the error is most likely that the OPC Collector is trying to start before the OPC Server fully starts.
  • If you look at the log files and you do not see anything special, aside from a startup attempt and a shutdown message, then begin by assuming the OPC Server is not fully starting. If the workaround for that issue does not appear to work, try adjusting the buffer size.

If there is not enough free space for buffer files

If it appears that there is not enough free space for the buffer files, either free up disk space, or change the buffer size in the Windows Registry by adding a new DWORD value, MinimumDiskFreeBufferSize, for the OPC Collector. As a recommendation, try using 10 or 20 MB as your buffer size value. If the problem still exists and then try slightly decreasing the value until you find one that works.
  1. Select Run from the Start Menu. The Run window appears.
  2. Type Regedit and press Enter. The Registry Editor appears.
  3. Locate the ComputerName_OPC1_CollectorName key, where ComputerName is the name of your computer, OPC1 is an assigned value, and CollectorName is the name of your collector. You can find this key here:
    HKEY_LOCAL_MACHINE\SOFTWARE\Intellution, Inc.\iHistorian\Services\OPCCollector\ComputerName_OPC1_CollectorName4
  4. Add a new DWORD value. Enter the name MinimumDiskFreeBufferSize, select the decimal option, and set the value to a small number such as 10 or 20. The value that you enter represents the number of MB.
  5. Close the Windows Registry and restart your computer.
  6. If the Collector does not connect to the Historian Server, check the log file in the Logfiles folder on the collector computer again.

    If the log still states that Historian ???could not create buffer files???, then repeat steps 1-6, this time using a smaller number.

Once the OPC Collector connects to the Historian Server, the collector should also appear in Historian Administrator. Then, you can readjust the buffer file size on the bottom of the collector's General section.

The OPC Collector Tries to Start Before the OPC Server Fully Starts

If it appears that the OPC Collector is starting before the OPC Server starts, you need to specify a time delay for the OPC Collector startup. To specify this time delay, you add a new DWORD value, MachineUpTimeDelay, in the Windows Registry for the OPC Collector. You can set the value of this DWORD to the number of seconds that you want the OPC Collector to delay it's startup. As a recommendation, try 120 seconds first. If the problem still exists and then try slightly increasing the value until you find one that works.

The OPC Collector Hangs on First Polled Read

If polled reads take more than a few seconds to start when the OPC collector is polling from your OPC server, you may need to change the First Read Mode used by the OPC collector. Specify the mode by using REGEDIT to create the DWORD value OPCFirstReadMode under the OPC collector. An exact REG file cannot be provided, since it is different for different OPC servers but here is an example for Windows Registry Editor Version 5.00 :
HKEY_LOCAL_MACHINE\SOFTWARE\Intellution, Inc.\iHistorian\Services\OPCCollector\T20_OPC_Matrikon_OPC_Simulation] "OPCFirstReadMode"=dword:00000001

Valid values are 1 and 2, with 2 being the default.

Use 1 to cause the collector to do a faster OPC_DS_CACHE read on first poll instead of the slower OPC_ DS_DEVICE read.

Note: Creating or changing the value requires a collector restart.

Validating Items Before Adding to Polled Collection Group

To validate the items before adding them to the polled collection groups from the OPC collector, you may need to use OPCValidateBeforeAdd. Specify the mode by using REGEDIT to create the DWORD value OPCValidateBeforeAdd under the OPC collector. An exact REG file cannot be provided, since it is different for different OPC servers but here is an example:
[HKEY_LOCAL_MACHINE\SOFTWARE\Intellution, Inc.\iHistorian\Services\OPCCollector\MYPC_OPC_Matrikon_OPC_Simulation
"OPCValidateBeforeAdd"=dword:00000001

Set the value to 1 if you want the OPC collector to validate the items before adding them to the polled collection.

Delaying the Startup of the OPC Collector for the CIMPLICITY OPC Server

To add a startup delay for the OPC Collector for the CIMPLICITY OPC Server, follow these steps:
  1. Select Run from the Start Menu. The Run window appears.
  2. Type Regedit and press Enter. The Registry Editor appears.
  3. Locate the ComputerName_OPC1_CollectorName key, where ComputerName is the name of your computer, OPC1 is an assigned value, and CollectorName is the name of your CIMPLICITY collector. You can find this key here:
    HKEY_LOCAL_MACHINE\SOFTWARE\Intellution, Inc.\iHistorian\Services\OPCCollector\ComputerName_OPC1_CollectorName
  4. Add a new DWORD value. Enter the name MachineUpTimeDelay, select the decimal option, and set the value to a small number such as 120. The value that you enter represents the number of seconds.
  5. Close the Windows Registry and restart your computer.
  6. If the OPC Collector still does not appear to start, check the log file in the Logfiles folder on the collector computer again. If the log states the same messages, then repeat steps 1-5 again, but this time increase the MachineUpTimeDelay value.

Considerations When Connecting OPC Collector to Redundancy Master with Primary and Secondary IGS Servers

Consider the following information when you connect an OPC Collector to a Kepware Redundancy Master with both primary and secondary servers using IGS (Industrial Gateway Server).

Note: These considerations assume that both IGS servers share the same channel, device, and tags.
  • If, after creating a tag in Historian, you modify the tag???s existing source address, Historian will consider this an invalid tag until the OPC Collector is restarted.

    For example, suppose there is a tag in IGS Server called ???r;Tag1 with source address K0001 and the source address of Tag1 is modified from K0001 to R9998. Historian considers this an invalid tag. No data update occurs and no Bad Quality marker is set in Historian. The OPC Collector must be restarted to ensure that data is collected for this tag in Historian.

  • Restart sequence is important, and needs to be done in order from the source.

    When you need to restart after encountering an issue, restart the Redundancy Master Service before restarting the OPC Collector.

  • If IGS OPC tags are added in Historian Server, then these tags cannot be deleted in IGS Server.

    If you attempt to delete them in IGS Server, the error ???Rejecting attempt to delete reference object??? is displayed at the IGS Server end.

    To avoid this error, first delete the tags in Historian which were associated with IGS Server and then delete the device in IGS Server.

  • Failure to browse IGS Server Tags may require OPC Collector restart.
    Note: If the OPC Collector status shows as Running, but you are unable to browse IGS Server tags, restarting your OPC Collector may solve this issue.