20.3. Data Exchange Protocols

The DataHub program relays data between programs using OPC, TCP or DDE. It also tunnels data over a network or the Internet using TCP. This section gives an overview of these protocols.

20.3.1. OPC Protocol

OPC is an interface specification for data communications that is popular in industrial environments. Please refer to for general information about OPC.

OPC connections are always client-server. Setting up the DataHub program to use OPC is simply a matter of configuring it to act as a client or as a server, or both. When acting as a client, it will automatically attempt to find or start the OPC server that has been configured, and then start receiving data. When acting as a server, it will automatically respond to requests from any OPC client on the system.

OPC Items and Properties

There are two implementation of OPC for real-time data access: OPC DA (Classic) and OPC UA. Both use the concept of an item as a way to structure data. In OPC DA, every item has 6 required properties: Value, Timestamp, Quality, Access Rights, Scan Rate, and Canonical Type. The OPC UA spec includes this kind of item, as well as many others. DataHub software implements only the part of the OPC UA spec that is similar to OPC DA. Furthermore, as users of the data, we are mostly interested in Value, Timestamp, and Quality. OPC items can also have up to 30 optional properties, such as Description, Engineering Units, High, Low, Alarm Level, and so on. For example, an item might represent a temperature reading on a tank like this:

PropertyCurrent value
Value47.2
TimestampApr 27 16:27:24.300
QualityGood
High60.0
Low38.5
Alarm Level54.0
Engineering UnitsCelsius
DescriptionTemperature of Tank A

The DataHub program maintains an item and all of its optional properties as separate data points. The item's 6 required properties are maintained internally, but the DataHub program displays the information corresponding to the Value, Timestamp, and Quality in the Data Browser under the columns Value, Date and Quality.

This relatively simple picture becomes more complex when we learn that the OPC specification allows a property to be an item in its own right. This implies, in turn, that properties can have properties. Some OPC servers implement properties as items, and some do not. Normally when an OPC server does treat properties as items, those items have only the 6 required properties and you don't get an infinite recursion.

This has implications for configuring a DataHub instance and working with data sets. If an OPC server implements properties as items, the DataHub instance could potentially have access to many more data points than for an OPC server whose items are not properties. For this reason, the DataHub program makes it optional to pick up all items that are properties.

It also affects the results of a filtered connection to an OPC server. Filters set up in the DataHub program are based on items. If your OPC server implements properties as items, and if you choose to pick up all items that are properties, then any filter you run apply to those items as well.