DDE Input Module
The DDE Input Module acts as a Dynamic data exchange (DDE) client when it extracts information from a DDE server application such as Microsoft Excel.
Module icon
Overview
DDE is a protocol that allows two Windows NT applications to communicate and exchange data. The two programs involved in the interaction are called the server and the client. The DDE server is the application that supplies the data, and the DDE client is the application that receives the data.
The DDE Input Module can be linked to the DDE server through setup registers. For example, you can specify an Excel spreadsheet item in the setup registers, and then any value you enter for this item can instantly appear in the Virtual Processor.
NOTE: The registers and settings available in this module depend on the device or node you are configuring, as well as its firmware and template versions. Not all registers or settings are available on all devices or the Virtual Processor, and labels may vary.
Inputs
There are no inputs in a DDE Input Module.
Setup registers
To initiate a link with the DDE server, the client (the DDE Input module) must request a server name, followed by a topic name, and an item name. You have to specify these names in the following setup registers.
Server
This register specifies the DDE server application that the module is connected to. For example, the server name for Microsoft Excel is EXCEL.
Topic
The topic identifies a file or node name. In the case of file-based DDE server applications such as Microsoft Excel, the topic is typically a file name with a .XLS extension, i.e. name.XLS.
Item
This register specifies the element in the DDE server application that contains the data. In the case of an Excel file, the item is the spreadsheet cell identifier, which is a row number and a column number. For example, B5 is entered as r5c2 for row 5, column 2.
Output registers
Value
This Numeric register contains the value read from the DDE server. It will automatically be updated each time the server issues a new value. The value becomes not available whenever the DDE link goes down or the module is linked to a new DDE server.
Status
This Boolean output register shows the status of the DDE link. on indicates a live link to the DDE server. off indicates a “broken” link. This register shows the not available value if one of the setup registers is blank.
Event
All events are recorded in the Event register.
Possible events and their associated priority numbers are:
Event priority group | Priority | Description |
---|---|---|
Setup Change | 10 | Input links, setup registers or labels have changed. |
The Event output register stores the following information for each ION event: time stamp, priority, cause, effect, and any values or conditions associated with the cause and effect.
Responses to special conditions
The following table summarizes how the DDE Input module behaves under different conditions.
Condition | Response of output registers |
---|---|
After the module is re-linked or its setup registers are changed | The Value output register is not available. The Status output register shows the current status of the DDE link. |
When the device is started or powered-up (either the first time, or after a shut-down) | The Value output register is not available. The Status output register shows the current status of the DDE link. |
Detailed module operation
Once you have specified the setup register values, and the DDE server is successfully linked, the data identified in the Item setup register should appear in the Value output register.
For the server to link successfully, the server must be in the location specified. If you want to verify the location of your DDE server, open the Windows NT Explorer and check the directory structure and file name.
If the module senses that the link with the DDE server is broken, it automatically runs a routine to reconnect as soon as the server is available. Upon reconnection, most DDE servers will automatically update the Value output register with the new value in the DDE application. If your DDE server does not update the register, you may have to go to the DDE application and enter a new number for the Value register to access, or set the application to automatically update links.
A DDE link transfers data in textual exchange format, meaning that the DDE Input module receives text and converts the text to a number.
A framework that makes use of DDE Input module is shown in the next diagram. To perform a real time cost calculation, you can set up an Arithmetic module to accept a value from an Excel spreadsheet and a meter reading from an IED node. This way, you can calculate the current cost of electricity using your utility’s tariff structure that is detailed in your Excel file. The tariff structure may include demand and time-of-use penalties. The result is a real time display of actual electricity costs.