Extensibility > Exchanging Data with Other Applications > Using DDE (Dynamic Data Exchange) > Reading values from a DDE application

Reading values from a DDE application

To read a value into a Citect SCADA variable directly from an external DDE server application currently running on the same computer as Citect SCADA, use the Cicode DDERead() function. For example:

PV1 = DDERead("Excel", "[Book1]Sheet1", R1C1);

The data from Row 1, Column 1 on Sheet 1 of Book 1 in Excel is read and stored in the Citect SCADA variable "PV1". This DDE function is one-way, and will need to be called whenever the value needs to be updated in Citect SCADA.

Reading from a DDE server assumes a prior knowledge of the DDE server. In the above example, Excel needs to be running and the appropriately named spreadsheet needs to exist. The Citect SCADA variable PV1 needs to also have been previously declared.

Note: Instead of using the once only DDERead(), you could use the multiple use DDE handle function DDEhRequest().

Verify that remote requests are enabled in the other application. For example, in Excel, you need to confirm that the Ignore other applications check box is cleared (the default setting). In Excel 2003, use Tools | Options | General to adjust this setting.

The High security setting (if selected) on Microsoft Office 2000 and later versions does not appear to affect the use of remote DDE Client requests with those Office applications. See Using DDE with Microsoft Office applications.

Published June 2018