Sunday, January 9, 2011

Dynamic Data Exchange (DDE) and How it works

Dynamic Data Exchange (DDE) is an interprocess communications specification that is built into the Microsoft Windows operating system. It allows Windows programs that support DDE to exchange data between themselves. All communications occur within the Windows environment, essentially transparent to the users, using very simple communication instructions.

Note:

AdvanceDDE protocol is the only version supported by RSLinx-OEM. DDE is
not available with RSLinx Lite.
RSLinx

The easiest way to visualize Dynamic Data Exchange is to think of a conversation between people in a room. These people represent the different Microsoft Windows applications (software programs) running on your computer.

Note:

Not all applications that run under Microsoft Windows support DDE Check with an application’s manufacturer before purchasing an application for use with RSLinx.
DDE Ilustration

Some of the people in the room ask questions (clients), others provide answers (servers), and some both ask questions and provide answers (client/servers).
  • In other words, the client initiates or requests a data transfer and the servers respond to the request by providing or accepting data.
Dynamic Data Exchange questions are quite generic. When Microsoft Excel asks RSLinx a question, it is merely looking for data. Excel does not know where the data is coming from. Excel only knows that it asked RSLinx a question, and if RSLinx has an answer, then the data will be provided.
Each Dynamic Data Exchange question consists of three parts:
  • To whom am I talking (i.e., which APPLICATION gets the question)?
  • What subject are we talking about (i.e., what is the general TOPIC)?
  • Which data do I require (i.e., what specific ITEM are we talking about)?
In other words, who is talking? what’s the general topic?
what specific data?
Windows DDE uses the words: Application, Topic, Item to describe the DDE conversation that takes place between programs running under Windows (e.g., RSLinx and Excel).

Definitions of Application, Topic, and Item:
Application: When you use a Microsoft Windows application to obtain data from another Windows application, you must provide the name of the Application you wish to respond to your question. The Application refers to the program you are running, such as RSLinx would be the application that some client (such as Excel) would talk to (it usually refers to the executable program file, e.g., RSLinx.exe).
To use the previous example, when you pose a question to your group of people, you must tell them whom you want a response from. When you ask RSLinx for data from a PLC on a highway, the Application name to use is RSLinx. (RSLinx.exe is the name of the RSLinx executable file and thus the name to use for DDE communications no matter what you have named the RSLinx icon).

Topic: Once the Application is known, we must determine which Topic to discuss. To use the previous example, when you pose a question to an individual, you must select a general Topic to talk about. With DDE, available Topics are determined by the Application. The person asking the question must choose an available topic, or data exchange cannot take place.
In RSLinx, a Topic will consist of the information necessary to get us communicating with a particular PLC.
A DDE Project is a storage container for one or more DDE Topics, as a folder holds files in Windows. By grouping topics together in a project, you can make multiple topics available at the same time.
Item: After the Application and Topic are known, your Microsoft Windows application must provide RSLinx with the specific Item to discuss. To use the example of the conversing people: if the individual (who) and general topic of conversation are known, you must determine the exact data you require.
In the case of Excel, we might know we want to talk to RSLinx (Application) about a PLC-5 at a certain station (Topic) (that is, we want to send data from a PLC-5 to an Excel spreadsheet). The last part of the question, Item, determines which specific data table address to return to your Windows application.
Example:  Application  Topic                   Item
RSLinx           PLC5Topic1        C5:0.acc
(RSLinx)         (specific PLC)     (specific counter value)
Where RSLinx is the application name, PLC5Topic1 is an example topic name, and C5:0.acc is an example item, in this case a counter accumulator in a PLC-5.
The Application, Topic, and Item are basic parts of all DDE conversations. Each DDE compatible Windows program has its own unique syntax. The syntax are special markings, such as ‘ = | and ! . Consult the documentation of your Windows program to determine the exact procedure and syntax used for DDE conversations.
Data Format: AdvanceDDE, XL_Table and CF_Text
A brief discussion of available Data Formats for DDE communications follows. It is intended to provide you with a general understanding of Data Format from a user standpoint. Normally no user intervention or control of data formats is possible, and for the most part, the use of different data formats is transparent to the user. There is one major exception – you will certainly notice a vast improvement of the speed at which your data is transferred if one of the “higher” levels of the available data formats is used. Microsoft has implemented two Data Formats that are available for DDE conversations:
CF_Text and XL_Table.
CF_Text is the simplest and easiest to implement. All DDE compliant applications should be able to understand this data format. It is the basic level of compliance to Microsoft’s DDE specification. Microsoft has also defined a faster data format called XL_Table. Microsoft has only implemented this data format in Excel.
FastDDE is a proprietary format used by Wonderware that is faster than XL_Table, but does not incorporate error checking.
From a data throughput standpoint, CF_Text is slow and XL_Table is fast. In a general way, you can think of CF_Text as an ASCII transfer with each data item being a single message, while XL_Table blocks the data into a table, so many items may be a single message.
RSLinx can communicate using any of these data formats. When a DDE channel is established, a form of handshaking takes place that automatically establishes the data format to be used (the fastest format both the client and server can understand).
AdvanceDDE
In addition to supporting CF_Text and XL_Table, Rockwell Software has also implemented its own DDE data format. This format is called AdvanceDDE (also known as PackedDDE).
AdvanceDDE is specifically designed for industrial communications giving the communications increased data throughput and well defined error checking to ensure data communications integrity.
AdvanceDDE’s speed performance is accomplished in numerous ways. Among these, it allows for the binary transfer of data (thus there is no performance penalty for converting numeric binary data to text and back again). It also packetizes data to allow multiple data items per message (instead of one as in CF_Text).
All Rockwell Software Products can understand AdvanceDDE allowing for fast and accurate DDE communications.


Save Now

No comments:

Post a Comment