Promotic
WikipediaLinkedInYoutubeTwitterFacebook

Communication by standard interface DDE

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): mostly 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 can't be changed)
- item: the name of the data item (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 the OS Windows) must be started on these computers, which represents the network DDE agent that provides the transfer 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 PLC devices. Otherwise the PROMOTIC system holds its own drivers for common devices but these drivers don't fully cover all PLC devices. For the communication with a PLC it is possible to purchase software from another company (mostly directly from the PLC producer). This software is an application that can communicate with the PLC 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 the PLC device and it communicates from the other side over the DDE interface with other applications - in our case with the PROMOTIC application.

Using 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 Promotic objects of the PmData 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, some problems occur. The next disadvantage (often very essential for designers) is (mostly) 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 method Pm.DdeExecute).
 

Setting as DDE server

On the page PmRoot > DDE 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 (text "PROMOTIC" is preset) and topic (text "OBJECT") address. It is necessary:
- check the option "DDE enabled"
- don'nt check the option "Data sharing disabled"
- don'nt check the option "Share all data except disabled". If you check it, then everything not forbidden by default is shared, which is normally 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 PmData object and for DDE server the ExtDdeServer is used.
2) The obsolete way: it is performed in the PmNumber or PmData objects, on the DDE pages. Here in the 'DDE server' configurators part it is necessary to:
- set the "Item sharing" configurator to Share
- 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

On the page PmRoot > DDE 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 PmData object and for DDE client the ExtDdeClient is used.
2) The obsolete way: This is performed in the PmNumber or PmData objects, on DDE pages. Here in the 'DDE client' configurators part set:
DDE group - the 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.

© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice