DDE (Dynamic Data Exchange) is a well-established mechanism for exchanging data among processes in MS-Windows. The mechanism was intentionally designed to be easy to use and to represent data as simply as possible. DDE is implemented in many popular programs that run in Windows, such as Microsoft Excel and Microsoft Word. This widespread availability makes DDE a good choice for general data sharing.
The competition with DDE is COM, with its variants for OLE: OPC and ActiveX. By comparison, DDE is simpler, and therefore faster, than the equivalent COM interface if implemented as a separate process. DDE is much easier to implement in code, and offers a particular data model as (name, value) pairs. In the case of real-time data, this model is well suited, and therefore offers the best cost/benefit ratio when programming for real-time data.
However, DDE was not designed to be used over a network. The Cogent solution for this shortcoming is to mirror two Cascade DataHubs over a network or the Internet using TCP. Thus, two programs that use only DDE can exchange data across a robust, TCP-enabled link.
DDE defines data in terms of (service, topic, item), explained as follows:
A name used by a DDE server to identify its service to DDE clients. The default DDE service name for the Cascade DataHub is datahub. Unlike most Windows programs, the Cascade DataHub lets you change this name, or add more names if you'd like.
A way to categorize items. This corresponds to a Cascade DataHub domain.
A variable that holds a value. This corresponds to a Cascade DataHub point.
Here are some service and topic names for several Windows programs:
Application | DDE Service Name | DDE Topic Name |
---|---|---|
Cascade DataHub | Multiple names can be assigned. The default name is datahub. | Any Cascade DataHub domain name, the default domain is default. |
Microsoft Excel | EXCEL | The name of the spreadsheet, chart, macro, etc. For example: mysheet.xls |
Microsoft Access | MSACCESS | The name of the table, SQL query, or macro to run. |
Microsoft Word | WINWORD | The name of the document, including the .doc extension. |
FoxPro | FOXPRO | |
InTouch Viewer | VIEW | TAGNAME |
FIX DMACS | DMDDE | DATA |
National Instruments' Lookout | LOOKOUT | The name of the application, without the .lkp extension. |
Asymetrix Toolbook | TOOLBOOK | The name of the toolbook application, with the .tbk extension. |
Here are a few service and topic names for financial data feeds:
Data Feed | DDE Service Name | DDE Topic Name | Symbol Example |
---|---|---|---|
ADP Shark | ML | LP | IBM.N.Q |
Bloomberg | BLP | M | IBM EQUITY,[LAST TRADE] |
Bridge | BDDE | TKR | @USH8/LS |
FXCM | FXPS | BID | EUR/USD |
Future Source (CalcSource) | CALCSRC | P | USH8.LAST |
Future Source (ProfNet) | PROFDDE | LIVE | APIU02,LAST |
Knight Rider Profit Center | QMASTER | QUOTE | USH8.LAST |
METATRADER | MT | BID | USDCHF |
METATRADER v. 4 | MT4 | BID | USDCHF |
MGFOREX | MGFOREX | RATES | USD |
Moneycast | WBSERVER | SES | 19/L (19 is a stock code) |
Reuters | REUTER | IDN | USH8 /IBM ,LAST |
Telerate WorkStation | TWINDDE | QUOTES | USH8.3 LAST |
Universal Market Data Server | USDDE | QUOTE | US8H;LAST |
In DDE, the role of client and server in data exchange is fairly clear. A client initiates the activity, and the server responds. To facilitate two-way data transfer, each Cascade DataHub can each act as both client and server. This is what allows Excel spreadsheets to share data bidirectionally across a network.
There are three ways to send and receive ordinary data over DDE. Here is a brief explanation, using the Cascade DataHub and Microsoft Excel as examples:
Poke The client sends data for an item directly to the server. In Excel, this is done with a macro. The server does not necessarily reply. The actual data flow is from client to server—from Excel to DataHub.
Request The client asks the server to send an item's data. In Excel, this is done with a macro. The client receives either the requested value, or NULL if the server can't send the value. The actual data flow is from server to client—from DataHub to Excel.
Advise The client asks to be notified of any change in the data for an item. If the server agrees to the request, it sends the new value for the item each time its value changes. The Cascade DataHub can conduct two-way communication with Excel using only this advise capability, as follows:
To receive data into Excel from the DataHub, you set the the DataHub to act as a DDE server, which requires you to enter a service name. This identifies the the DataHub to Excel. Then you can drag and drop a point name from the DataHub into a cell of an Excel spreadsheet.
To send data from Excel to the DataHub, you set the the DataHub to act as a DDE client, which requires you to enter service, topic, and item names. These identify the item in the spreadsheet to the DataHub. Then, in Excel, you name a cell with the DataHub point name.
Copyright © 1995-2010 by Cogent Real-Time Systems, Inc. All rights reserved.