OPC part 2 DDE

DDE or Dynamic Data Exchange is an early Windows technology used to move data from application to application inside a Microsoft Windows environment. The concepts and terminology of DDE are not only of historical interest, a lot of today’s technologies include OPC UA are based on this foundation.

At its core, DDE uses the Windows Messaging Layer (WML) to actually move messages from one place to another. Windows is by nature a message system so the components of Windows naturally communicate to one another by sending messages.

So why not just use the WML to move messages from one place to another? Well, WML is a lot more generic than DDE. DDE strips out a lot of the complexity from WML to build an inter-processor communication system that is simple and easy to use for the windows application developer.

In DDE applications built for Industrial and Building Automation applications, there is a Server application program that gathers data from automation devices and makes it available to one or more Client devices. This terminology is very important. The Server is the provider of data and while the user of the data is known as a CLIENT.

Interprocess communications using DDE in these applications have a number of advantages. These include:

·         Non Blocking Operation – DDE applications are only loosely linked. A DDE Client application that requests data from a Server sends off the message and goes about its normal business. Other communication implementations implement blocking interfaces where the Client has to stop and wait for a response from the server.

·         No Data Knowledge – DDE is totally blind to the message data carried from a Server to a Client. The Endian, data size and other aspects are outside the scope of DDE.

·         It’s light weight and simple – Because of its simplicity, DDE can be small, fast and efficient. No DLLs are required to implement DDE.

Now some of you will be quick to point out that DDE is old technology. That’s not exactly true. I would tell you that it’s archaic technology.

But what’s wrong with that? Will Microsoft abandon it? The answer is NO. DDE is simply a nice, wrapper built around the standard message system of Microsoft Windows. They can’t really eliminate DDE without drastically changing the entire OS.

So, how does DDE work?

DDE uses a hierarchical series of attributes that define a connection. They are an APPLICATION name, a TOPIC and an ITEM. The Application is just what the name implies. It is the Client or Server Application that is the target for the message. The TOPIC is a secondary identification within that Application. IN Excel, the Topic is the Worksheet name. Together, the Application and Topic, are sometimes referred to as a Channel. They point to a particular destination.

The last part of the series is the ITEM. The Item is the reference to the actual piece of data being transferred.

When a Client wishes to connect to a Server it requests the Application Service/Topic (CHANNEL) from the WML. Windows broadcasts the request and the first Server to accept the request is connected. Multiple conversations can occur using many different ITEM codes over that same Channel. This is done so that there is only one item of information exchanged in each conversation.

DDE is a very lightweight, simple and yes, archaic, form of interprocess communication. It’s important to understand not just for historical reasons but as a basic building block for a lot of the interprocess technologies that followed it.