D |
Viewing PLC Data in another DDE-compliant Application
You can view the PLC data in another
To copy the link to the clipboard, from the ªOptions/Driver Messagesº screen select the desired link in the ªTopic/Item Listº by clicking on it and then clicking the Copy button. To paste the link in another application, switch to the other application and paste the link (this is typically done with the ªPaste Specialº or ªPaste Linkº option from the ªEditº selection on the menu bar, but the exact procedure may vary depending on the application).
Writing Values to the PLC from another Application
To write data to a PLC address, the client DDE application must POKE the desired value to the server link that represents the address. Note: in this demonstration software, the only topic that is supported is ªCPUIDº and the only items supported are the following: ªR,1º,ªR,2º,ªI,1º,ªO,1º.
The following Microsoft Excel macro (in cells A1 through A4) writes the value in cell B1 to register 1.
cell A1 ± INITIATE(ºMICROWINº,ºCPUIDº)
cell A2 ± POKE(A1,ºR,1º,B1) cell A3 ± TERMINATE(A1)
cell A4 ± RETURN()
cell B1 ± Data for Register 1
This specific macro would execute the following steps:
1.The ªINITIATEº function opens a DDE channel to Server ªMICROWINº and Topic ªCPUIDº.
2.The ªPOKEº function writes the data value in spreadsheet cell B1 to register 1 (ºR,1º).
3.TheªTERMINATEº function closes the DDE channel that was opened in cell A1.
4.The ªRETURNº function ends the macro.
Ordering Information
For information about ordering this product, and for technical support, contact:
Engineering Specialists Inc.
12805 W. Burleigh Rd.
Brookfield, WI 53005±3119
414±782±3050
Appendix D Communications Using Windows DDE |