In this example, we will setup NetDDE connection in an EXCEL spreadsheet (the NetDDE Client) to read tags from a remote Advantech WebAccess/SCADA SCADA node (the DDE Server) using the DDE Share configured in the previous section. This example works for Windows 2000 and Windows XP Professional.
1. Log on the Client Windows Operating System with a user name and password that is recognized by the SCADA Node Windows Security. This can be either a Domain User common to both PCs or a user account created on both PCs with the same user name and password.
2. Start EXCEL
3. Select a Cell.
4. Enter a formula with the following format:
=’\\remoteCOMPUTERNAME\NDDE$’|sharename!item
To read data using the Advantech WebAccess/SCADA example in the previous section:
=’\\remoteCOMPUTERNAME\NDDE$’|Advantech WebAccess/SCADA!tagname
If the computer name is DEMO and the tagname is SPEED
=’\\DEMO\NDDE$’|Advantech WebAccess/SCADA!SPEED
Notice that there is a single quote ( ‘ ) between the equal sign (=) and the double backslash (||). There is also a single quote after NDDE$. EXCEL is very fussy about this. The two single quotes enclose ‘\\COMPUTER\NDDE$’.
Figure 14.3 - NetDDE connection to Advantech WebAccess/SCADA in Excel
Note – in Windows XP it seems necessary to Save the Spreadsheet, close, then reopen it to force the NetDDE links to become active.
5. Save the Workbook.
6. Close the Workbook.
7. Reopen the Work book.
8. EXCEL will ask if you want to update Links? Select YES.