The
DDE is a dynamic exchange of data and it serves for sharing variables between several applications on one computer. These can be various applications using the
DDE (
Excel,
Access, etc.) including other PROMOTIC applications.
If a group of variables has to be shared, then one
DDE server and one or more
DDE clients must exist for this group. The
DDE server "owns" all variables, the clients refer to these variables, they can read them and write into them, if it is enabled.
The address of a shared variable consists from three parts:
- service (application): usually the name of the application (there is the "PROMOTIC" word in the PROMOTIC system and this can be changed)
- topic: the name of the data area (there is the "OBJECT" word in the PROMOTIC system but this cannot be changed)
- item: the name of the variable (it is entered in the PROMOTIC system by the application designer)
The
DDE serves for data sharing on one computer. After starting the network extension
NetDDE, data sharing is enabled between the applications that are running on various computers connected to the same network. The program
NetDDE.exe (included in
Windows OS) must be started on these computers, which represents the network
DDE agent that provides the transmission of selected
DDE data between computers. See:
NetDDE setting.
Data sharing by means of the
DDE can be used for many aims but in the technological processes control the most used solution is
to get data from the PLC device. Otherwise the PROMOTIC system holds
its own drivers for common devices but these drivers don't fully cover all PLC devices. For communication of the PROMOTIC application with PLC devices it is possible to purchase software from another company (usually directly from the PLC manufacturer). This software is an application that can communicate with PLC devices and it can then serve to other applications (including the PROMOTIC application) as the data server. According to the interface,
OPC servers or/and
DDE servers can be purchased. The
OPC is better and faster interface than the
DDE but sometimes the
OPC server needn't be available and only the
DDE server is available. Such
DDE server is the software that communicates from one side with PLC devices and it communicates from the other side over the
DDE interface with other applications - in our case with the PROMOTIC application.
The usage of
DDE is very simple for the designer and it is sufficient, for example, only to create
ExtDdeClient and fill in the parameters of the
DDE address for the chosen object of the
PmaData type.
The disadvantage is relatively the slow transfer between the
DDE server and the application (it goes about the data transfer between various applications). If we want to move thousands of values within a short time period, then some problems occur. The next disadvantage (often very essential for designers) is (usually) the impossibility to configure individual messages. It is impossible for example to set that analog inputs have to be transferred once a minute and digital inputs once a second.
In the PROMOTIC application it is possible not only to share the data by means of the
DDE communication but it is possible to send a command into the
DDE server (see
Pm.DdeExecute method).
Setting as DDE server
In the
DDE configuration window the item
Application 'service' is defined in the
DDE server part. All shared variables provided by the PROMOTIC application as the
DDE server are offered under the
service (default: text
"PROMOTIC") and
topic (text
"OBJECT") address. It is necessary to:
- NOT checked the option "
Share all data except disabled". If you check it, then everything not forbidden by default is shared, which is usually not suitable.
But still it is necessary to define which items (which specific data) are to be shared. There are two ways of doing so:
1)
Data extension: A very convinient way of defining the data we want to communicate with is to use
Data extension It is defined in data item of the
PmaData object and for
DDE server the
ExtDdeServer is used.
2) The obsolete way: it is performed in objects
PmaNumber or
PmaData, on the "
DDE" tab. Here in the
"DDE server" configurators part it is necessary to:
- set the "
DDE item" configurator to the data name (identifier). By this name the item is accessible to other applications. But the names of any two items for one
topic and
service must not be the same.
Setting as DDE client
In the
DDE configuration window in the part
DDE client groups DDE client groups are defined, by means of which items are shared. Items in one group have common
service and
topic. This setting must be the same as the
service and
topic of the server with which the data have to be shared.
By setting the
DDE group it is defined which
DDE server is requested to communicate with. But still there is the necessity to define which items (which concrete data) have to be shared.
1)
Data extension: A very convinient way of defining the data we want to communicate with is to use
Data extension It is defined in data item of the
PmaData object and for
DDE client the
ExtDdeClient is used.
2) The obsolete way: This is performed in objects
PmaNumber or
PmaData, on the "
DDE" tab. Here in the
"DDE client" configurators part set:
DDE group - the
DDE client group in which we want to share the variable.
DDE item - by this name the item is shared.
The items in the "
DDE server" window have no meaning for setting the
DDE client.