To read a value into a CitectSCADA variable directly from an
external DDE server application currently running on the same
computer as CitectSCADA,
use the Cicode
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 CitectSCADA variable "PV1". This DDE function is one-way, and will need to be called whenever the value needs to be updated in CitectSCADA.
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 CitectSCADA 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
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.