2.3. Data Exchange Protocols

The Cascade DataHub relays data between programs using DDE, OPC, or TCP. It also mirrors data to Cascade Connect or other DataHubs over TCP. This section gives an overview of these protocols.

2.3.1. DDE Protocol

DDE (Dynamic Data Exchange) is a well-established mechanism for exchanging data among processes in MS-Windows. There are three DDE commands for establishing communication with Windows programs such as Excel. Which of these commands you use depends on how you plan to control the flow of data between the spreadsheet and the Cascade DataHub.

  1. DDEPoke writes a data value to the Cascade DataHub. For example, to send a value from an Excel spreadsheet to the DataHub, the DDEPoke command is run from within an Excel macro. For more details, please refer to Section 5.2.2, “Method 2 - Excel Macros using DDEPoke”.
  2. DDERequest reads a data value from the Cascade DataHub. To get that value into Excel, for example, the DDERequest command is run from within an Excel macro. For more details, please refer to Section 5.1.2, “Method 2 - Excel Macros using DDERequest”.
  3. DDEAdvise creates a connection, called an advise loop, that updates a new data value automatically. The advise loop is a unidirectional link, established by a client program that wants to receive data from a server program. The client continues to receive new point values as long as the two programs are running, or until the advise loop is terminated.
    You can use DDEAdvise to read data from the Cascade DataHub by configuring the DataHub to act as a DDE Server. For an example using Excel, please refer to Section 5.1.1, “Method 1 - Drag and Drop using DDEAdvise”.
    Likewise, you can use DDEAdvise to write data to the Cascade DataHub, by configuring it to act as a DDE Client. For an example using Excel, please refer to Section 5.2.1, “Method 1 - Cascade DataHub as a Client, with DDEAdvise”.

For more information on DDE, please refer to Appendix F, DDE Overview.

2.3.2. OPC Protocol

OPC (OLE for Process Control) is an interface specification for data communications that is popular in industrial environments. It is faster than DDE, and has more features, but its complex programming requirements and specialized use mean that it is not usually supported by non-industrial software.

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

2.3.3. TCP and Mirroring

The Cascade DataHub uses TCP to communicate over a LAN, WAN, or the Internet. You can join two or more Cascade DataHubs together over TCP and share exact copies of the data through data mirroring. Mirroring means that the data and any updates to that data on one DataHub are exactly mirrored across the network onto any other DataHub that is connected. Once a mirroring connection is established each participant maintains and updates an identical data set, as simultaneously as the TCP connection will permit. For more information on mirroring, please refer to Section 8.4, “Mirroring”.

2.3.4. The DataHub API

The DataHub APIs for C++, Java, and .NET lets any TCP-enabled program interface with the DataHub.