Chapter 3. Making Connections

Table of Contents

3.1. DDE Connections
3.1.1. DDE Poke and DDE Request
3.1.2. DDE Advise
3.2. Mirroring Connections
3.2.1. Configure the master DataHub
3.2.2. Configure the slave DataHub
3.3. Configuring Bridges
3.3.1. Point-to-point configuration
3.3.2. Making transformations

3.1. DDE Connections

We generally use one of three of DDE commands to connect to the Cascade DataHub: DDEPoke, DDERequest, or DDEAdvise.

3.1.1. DDE Poke and DDE Request

If you plan to use DDEPoke or DDERequest, the DataHub will act as a DDE server. You will have to set up your DDE-enabled program to send commands to the DataHub. The following table summarizes the setup.

DDE CommandProgram actionProgram setupData flowDataHub actionDataHub setup
DDERequestReads data from DataHubConfiguration, macro, or code <== Acts as a serverDDE service name
DDEPokeWrites data to DataHubConfiguration, macro, or code ==> Acts as a serverDDE service name

3.1.1.1. Configuring the DataHub as a DDE server

The Cascade DataHub is preconfigured to act as a DDE server. You can double-check this as follows:

  1. With the DataHub running, right click on the Cascade DataHub system-tray icon and choose Properties.
  2. In the Properties window, select DDE .
  3. Ensure that the box Act as a DDE server is checked, and that at least one name, such as datahub, appears in the DDE Service Name area. If not, click the Add... button and add a name. This name is used by the communicating program to identify the Cascade DataHub.
  4. Click OK to close the Properties window.

3.1.1.2. Configuring a DDE client

You will probably need to configure your communicating program to read or write data. As you may know, DDE defines data using three variables: service, topic, and item, as follows:

service

A name used by a DDE server to identify its service to DDE clients, such as datahub for the DataHub, or excel for Excel.

topic

A way to categorize items. This corresponds to a Cascade DataHub data domain.

item

A variable that holds a value. This corresponds to a Cascade DataHub point.

Different DDE clients use the service, topic, and item names in different ways. For example, Excel uses them in the formula for a cell, like this:

=service|topic!item

For a service named datahub, and a point named test_point in the default data domain the Excel formula would look like this:

=datahub|default!test_point

Client programs that accept drag and drop values can be configured from the DataHub Data Browser window. It offers several formats from a drop-down list:

If none of these formats suits your purpose, you might be able to drag in the points and then modify the results. Otherwise, simply enter the service name, topic, and item in the way that the client program allows.

3.1.2. DDE Advise

You can use DDEAdvise commands to set up automatically-updating data streams to and from the DataHub. To do so, you will first need to determine the direction of data flow. The program that sends data acts as a server, and has a DDE service name. The program that receives the data acts as a client. The following table summarizes the connections.

DDE CommandProgram actionProgram setupData flowDataHub actionDataHub setup
DDEAdviseActs as clientSet up a DDE connection <== Acts as serverDDE service name
DDEAdviseActs as serverDDE service name ==> Acts as clientAdd DDE connection item(s)

If the data is flowing from the DataHub, you need to configure it as a DDE server (above). Otherwise, you should configure it as a DDE client.

3.1.2.1. Configuring the DataHub as a DDE client

To set up the DataHub for your program to receive data via DDEAdvise, you need to ensure that the DataHub is acting as a DDE client, and then add an Advise loop for each point you plan to send data for. Here's how:

  1. With the DataHub running, right click on the Cascade DataHub system-tray icon and choose Properties.
  2. In the Properties window, select DDE .
  3. Make sure the Act as DDE client box is checked.
  4. Click the Add button. This opens the DDE Item Definition window.
  5. Type in the following information:

      Connection Name: choose a name to identify this connection. It must be unique among all connection names.

      Service: type in the service name.

      [Note]

      If you don't know the service name or topic name for your program, check your user's manual. Also, there is a list of commonly used service names in the DDE Overview appendix.

      Topic: type in the name of your topic.

      Item Names: type the name of the item you wish to add.

  6. Click the Add button. The fields DDE Item, Point Name and Data Domain should automatically fill in with some values.
    [Note]

    Check the name in the Data Domain column. If it is not what you need, double-click it to select it, and change it.

  7. Click OK to close the DDE Item Definition window. The fields DDE Connection Name and Status in the Properties Window should now be filled in as well.
  8. Click OK to close the Properties Window.

The DataHub is now ready to act as a DDE client.