Allen-Bradley Powermonitor 3000 User Manual page 270

Table of Contents

Advertisement

C-16
Sample Applications
Publication 1404-UM001D-EN-E - October 2004
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

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

1404-m41404-m61404-m51404-m8

Table of Contents