Excel DDE macro: write a block of words
The following macro writes a value to
N7:0
through N7:10
in a PLC-5 using the RSLinx Classic topic, testsol
: The only difference between this block write macro and the individual write macro is in the POKE
statement. The addition of the block specifiers, L5
for a block length of 5, C1
for data in one column, and the array specification B7:B11
, allow this macro to write a block of data. In this example, the data to be written is placed in cells B7
through B11
. This routine writes a block of five words:Sub Block_Write()
'open dde link: testsol=DDE Topic |
RSIchan = DDEInitiate("RSLinx", "testsol") |
'write data thru channel |
DDEPoke RSIchan, "N7:30,L5", Range("[RSLINXXL.XLS]DDE_Sheet!B7:B11") |
'close dde link |
DDETerminate (RSIchan) |
End Sub
Provide Feedback