3.2.Configuring the DataHub

Configure the DataHub to act as a client to OPC servers

To aggregate data from OPC servers, you need to set up the DataHub to act as a client to each server. Here's how:

  1. Right click on the OPC DataHub system-tray icon and choose Properties.
  2. In the Properties window, select OPC .
  3. Check the Act as an OPC Client box. Since the DataHub can be a client to more than one OPC server, you need to specify which OPC server you are going to connect to. To add a server, click the Add button and fill in the fields in the Define OPC Server Window:
  4. Type in or select the necessary information as appropriate.
    1. The first four fields define the OPC server:

        Connection Name:type a name to identify this connection. There should be no spaces in the name. It doesn't matter what name is chosen, but it should be unique to other connection names.

        Computer Name:type in or select from the drop-down list the name or IP address of the computer running the OPC server you want to connect to.

        OPC Server Name:select the name of the OPC server that you are connecting to from the list of available servers.

        Data Domain Name:type the name of the DataHub data domain in which the data points will appear.

    2. You can specify how the data is to be transferred.

        Maximum update rate (milliseconds):Enter the maximum rate you wish the data to be updated. This is useful for slowing down the rate of incoming data. The default is 0, which causes values to be updated as soon as possible. This value is also the polling time used by asynchronous and synchronous reads (see below).

        Read Method:Choose how to read data from the OPC server:

          Asynchronous AdviseThe OPC server sends a configured point's data to the DataHub immediately whenever the point changes value. This is the most efficient option, and has the least latency.

          Asynchronous ReadThe DataHub polls the OPC server for all configured points on a timed interval (set by the Maximum update rate). This option is less efficient than Asynchronous Advise, and has higher latency.

          Synchronous Cache ReadThe DataHub polls the OPC server for all configured points on a timed interval (set by the Maximum update rate), and this thread waits for a reply. This option is less efficient than Asynchronous Advise or Read, and has higher latency than either of them.

          Synchronous Device ReadThe DataHub polls the PLC or other hardware device connected to the OPC server for all configured points on a timed interval (set by the Maximum update rate), and this thread waits for a reply. This is the least efficient of all of these options, and has the highest latency.

        Write Method:Choose how to write data to the OPC server:

          Asynchronous Writeprovides higher performance. The OPC DataHub writes changes in point values to the OPC server without waiting for a response.

          Synchronous Writeelicits a quicker response from the OPC server, but results in lower overall performance. The OPC DataHub writes changes in point values to the OPC server without waiting for a response. This option is useful if the OPC server doesn't support asynchronous writes at all, or if it can't handle a large number of them.

          Depending on the OPC server you are configuring, you might have an option to use OPC DA 2.0 or 3.0. Please refer to the Data Transfer explanation in the OPC section of the Properties Window chapter for more information.

    3. There are several optional entries:

        Treat OPC item properties as DataHub pointslets you register and use non-standard OPC item properties as points in the DataHub. Generally you won't need this unless you plan to use the DataHub to distribute changes to values of the non-standard properties on your OPC items.

        [Note]

        The OPC DataHub will monitor these properties only if the OPC server exposes them as OPC items. If the properties do not show up when using this check-box, this means that the server does not expose the non-standard properties as items.

        [Important]

        Some OPC servers are slow to register their OPC items and properties. Using this option with one of these servers can significantly slow the start-up time of the DataHub

        Read only: Mark all items as Read-Onlylets you specify that the OPC server be read-only, regardless of how individual items are specified. Items in the DataHub that originate from such an OPC server will be read-only to all DataHub clients.

        Replace item time stamps with local clock timeallows you to set the timestamps for the items from this server to local clock time.

        Force connection to use OPC DA 3.0This setting will allow the user to choose the DA 3.0 write methods from the Write Method drop-down box. It will also instruct the OPC DataHub to attempt to browse the server using DA 3.0 browsing. This setting will override any automatic information that the OPC DataHub may determine about the server based on the server's registry entries.

        Never use OPC DA 3.0This setting will remove the DA 3.0 write methods from the Write Method drop-down box, and will instruct the OPC DataHub to only use DA 2.0 browsing. This setting will override any automatic information that the OPC DataHub may determine about the server based on the server's registry entries.

        For more information about OPC DA 2.0 and 3.0, please refer to the Data Transfer explanation in the OPC section of the Properties Window chapter.

        Set failed incoming values to zeroThe OPC spec requires an OPC server to send an EMPTY (zero) value whenever it sends a failure code in response to an item change or a read request. Some OPC servers, however, send a valid value with the failure code under certain circumstances. To ignore any such value from the OPC server and assume EMPTY, keep this box checked (the default). If instead you want to use the value supplied by your OPC server, uncheck this box.

        [Important]

        Unchecking this box will make the OPC DataHub's behavior non-compliant with the OPC specification.

        Never use OPC DA 2.0 BROWSE_TO functionThis setting will disallow the BROWSE_TO function when communicating with OPC DA 2 servers. Sometimes an OPC server will have problems with this function that prevent the OPC DataHub from connecting to it. Checking this box might allow the connection to be established in those cases.

    4. Finally, you can specify how the OPC items get selected. You can select them manually or load all of them.
      Manually Select Items

      Check the Manually Select Items box and press the Configure Items button to open the OPC Item Selection window, where you can specify exactly which points you wish to use:

      You can browse through the tree in the left pane, selecting points as you go. The selections will appear in the right pane. Follow these guidelines for making selections:

        To select a server item from the right-hand pane, click its check-box.

        To highlight a list of consecutive server items, click the first item, hold down the Shift key, and then click the last item. To highlight separate server items, hold down the Ctrl key as you click each item. To select a group of highlighted items, use the Spacebar.

        [Note]

        These may not function as described for Windows NT or Windows 2000 operating systems.

        Selecting a server item does not automatically add any of its child items. Each child item must be added separately. To view child items, click the + sign in front of the item. If an item has one or more children that have been selected, the item name(s) will appear in bold.

        To delete selected items from the right-hand pane, highlight them and press the Remove Selected button. Use the Shift and Ctrl keys as above to highlight groups of selected items.

      You may also configure dynamic items on the server. As you type in the Server Item ID, the system will fill in an identical DataHub Point Name for you (which you can change at any time). Press the Enter key or the Apply button to create the item. Checking the Copy names from selection box will fill in the entry with the name you select from the Selected Items list (above). The Recognize branch delimiter in point name option lets you select and apply a point delimiter for your dynamic items.

      Load All Items on Server

      In addition to manually loading items, you have the option in the Define OPC Server dialog to register all points, or filter for groups of points, from the OPC server.

      In the Server specific item filters you have the option create filters to select partial data sets. If you don't enter anything here, the DataHub will query the OPC server for all of its items and register them. The filters are all applied on a logical 'OR' basis, i.e. if a point satisfies the condition of any filter, it gets registered with the DataHub.

        Click the Add... button to add a filter. The Edit a filter string window will appear:

        Enter a string or a pattern to match one or more item names in the OPC server. Each server has its own syntax for pattern matching, so you may have to experiment a little to get exactly the points you need. Commonly, the symbol * matches any number of characters, while the symbol ? often matches a single character. In that case, an entry of ?a* would bring in all items with a as the second letter in their names.

        Click the Edit... button to open the Edit a filter string window and edit an existing filter. You can do the same thing by double-clicking a filter string in the list.

        Click the Remove button to remove a selected filter from the list.

  5. Click the Apply button in the Properties Window. The DataHub should begin to act as a client to the OPC server. You can verify this using the Data Browser or the the Connection Viewer. You can change these settings at any time. The OPC DataHub will reconnect and apply the changes when you click the Apply button in the Properties Window.

To add another OPC server, simply repeat the steps above.

Configure the DataHub to act as an OPC server

To get the aggregated data into one or more OPC clients, you need to set up the OPC DataHub to act as a server, as follows:

  1. Right click on the DataHub system-tray icon and choose Properties.
  2. In the Properties window, select OPC .
  3. Ensure that the Act as an OPC Server box is checked.
    [Note]

    If your OPC client requires that you hand-enter the OPC server name, use either Cogent.OPCDataHub or Cogent.OPCDataHub.1 .

    The Do not adjust OPC registry entries for this program option tells the OPC DataHub not to alter its registry settings. This is useful if you want to use the OPC DataHub with a redundancy server or some other program that modifies the DataHub's registry independently. Without this box checked, the DataHub will overwrite any external changes when it starts or when a change to the Act as an OPC Server status is applied.
    These two boxes work together, because turning the OPC server behavior on or off necessarily makes changes to the registry. Here is how you can change OPC server behavior when you also need to maintain registry settings:
    1. Uncheck Do not adjust OPC registry entries for this program. This will make the Act as an OPC Server checkbox visible.
    2. Check or uncheck the Act as an OPC Server as needed, and click Apply.
    3. Check Do not adjust OPC registry entries for this program and click Apply.
  4. Click Apply button at the bottom of the Properties window to apply the change. You can view connections with the Connection Viewer.

Once you have configured your OPC clients to work with the DataHub, you should be able to access the data from all the aggregated OPC servers in any OPC client.