EasyManua.ls Logo

Allen-Bradley Powermonitor 3000 - Page 270

Allen-Bradley Powermonitor 3000
356 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Publication 1404-UM001D-EN-E - October 2004
C-16 Sample Applications
The range Sheet1!D7:D14 is the write source range and the read target
range. The Read graphic element is associated with the following VBA
script or macro:
Sub ReadDateAndTime()
'Open DDE link; the first argument is the application we
'want to DDE with. Second argument is the DDE topic name
'configured in RSLinx
RSIchan = DDEInitiate(“RSLINX”, “DF1_1404_123”)
'Read the date/time table from the PM3000 and put it in
'the excel sheet
Range(“Sheet1!D7:D14”) = DDERequest(RSIchan, “N11:0,L8”)
'Close DDE link
DDETerminate (RSIchan)
End Sub
The Write graphic element is associated with the following VBA script:
Sub WriteDateAndTime()
'Open DDE link
RSIchan = DDEInitiate(“RSLINX”, “DF1_1404_123”)
'Write data from the excel sheet into the PM3000
DDEPoke RSIchan, “N11:0,L8”, Range(“Sheet1!D7:D14”)
'Close DDE link
DDETerminate (RSIchan)
End Sub

Table of Contents