Poke Excel Data to Control Logix

Chuck Woodbury

Lifetime Supporting Member
Join Date
Apr 2005
Location
Valley Springs, California
Posts
78
I am trying to poke data from excel into an array in ControlLogix.
From Rockwell's Knowledgebase I found code to do individual cells and an array with 10 columns. I need one column.
In the following code command button 1 works fine, command button 2 does not. I get no errors running the VB.
Anyone have any suggestions? Thank you.

Private Sub CommandButton1_Click()
Call DDE_Write_RSLinx
End Sub

Sub DDE_Write_RSLinx()
DDEChannel = Application.DDEInitiate(app:="RSLinx", topic:="Home")
DDEItem = "TABLE_BRIX[0]"
Set RangeToPoke = ActiveCell
'Set RangeToPoke = ActiveCell 'Replace above line of code w/ this one to be able to highlight the cell w/ the value to poke
Application.DDEPoke DDEChannel, DDEItem, RangeToPoke
Application.DDETerminate DDEChannel
End Sub

Private Sub CommandButton2_Click()
Call DDE_Write_RSLinx1
End Sub

Sub DDE_Write_RSLinx1()
DDEChannel = Application.DDEInitiate(app:="RSLinx", topic:="Home")
DDEItem = "TABLE_BRIX[0,800],L801,C1"
Set RangeToPoke = Worksheets("BRIX").Range("A1:A801")
'Set RangeToPoke = ActiveCell 'Replace above line of code w/ this one to be able to highlight the cell w/ the value to poke
Application.DDEPoke DDEChannel, DDEItem, RangeToPoke
Application.DDETerminate DDEChannel
End Sub
 
Hi again all. Still looking for anyone that may know where my code is wrong to write an array of excel data to ControlLogix. I have tried many variations to the DDEItem but still have yet to get it to write.
 
I opened the RSLinx Event Log and DDE Client Diagnostics to watch what was happening during the code running. It showed me that I am limited to 115 Maximum Data Points so the 800 I was trying to do at once will not be possible. I will have to split it up into several steps. I have still not been able to make it work but I have managed to shut down RSLinx by pressing my command button in excel.
 
I intentionally do not poke values from my Excel VBA (for other reasons I'm not going into here).


My applications have rows populated with the addressing I wish to read. I then open the channel, read the address in each row (one at a time due to they usually are not incremented 1 by 1 in the array) until all rows are read, then close the channel.

You could do the same with the pokes.
 
Does this help?

I've used this successfully.
Utility for setting and adjusting bottling conveyor speeds.
Private Sub CommandButton1_Click()
'open dde link: testsol=DDE Topic
RSIchan = DDEInitiate("RSLinx", "Still_Wine")
'write data thru channel
DDEPoke RSIchan, "Z2_111MTR01.SPD_HZ_CPM_RATIO", Range("J22")
DDEPoke RSIchan, "Z2_111MTR03.SPD_HZ_CPM_RATIO", Range("J23")
DDEPoke RSIchan, "Z2_111MTR05.SPD_HZ_CPM_RATIO", Range("J24")
DDEPoke RSIchan, "Z2_111MTR07.SPD_HZ_CPM_RATIO", Range("J25")
DDEPoke RSIchan, "Z2_111MTR09.SPD_HZ_CPM_RATIO", Range("J26")
DDEPoke RSIchan, "Z2_111MTR11.SPD_HZ_CPM_RATIO", Range("J27")
DDEPoke RSIchan, "Z2_111MTR13.SPD_HZ_CPM_RATIO", Range("J28")
DDEPoke RSIchan, "Z2_111MTR15.SPD_HZ_CPM_RATIO", Range("J29")
DDEPoke RSIchan, "Z2_111MTR21.SPD_HZ_CPM_RATIO", Range("J30")
DDEPoke RSIchan, "Z2_111MTR23.SPD_HZ_CPM_RATIO", Range("J31")
DDEPoke RSIchan, "Z2_111MTR25.SPD_HZ_CPM_RATIO", Range("J32")
DDEPoke RSIchan, "Z2_111MTR27.SPD_HZ_CPM_RATIO", Range("J33")
DDEPoke RSIchan, "Z2_111MTR29.SPD_HZ_CPM_RATIO", Range("J34")
DDEPoke RSIchan, "Z2_112MTR01.SPD_HZ_CPM_RATIO", Range("J35")
DDEPoke RSIchan, "Z2_112MTR03.SPD_HZ_CPM_RATIO", Range("J36")
DDEPoke RSIchan, "Z2_112MTR05.SPD_HZ_CPM_RATIO", Range("J37")
DDEPoke RSIchan, "Z2_112MTR07.SPD_HZ_CPM_RATIO", Range("J38")
DDEPoke RSIchan, "Z2_112MTR09.SPD_HZ_CPM_RATIO", Range("J39")
DDEPoke RSIchan, "Z2_112MTR11.SPD_HZ_CPM_RATIO", Range("J40")
DDEPoke RSIchan, "Z2_112MTR13.SPD_HZ_CPM_RATIO", Range("J41")
DDEPoke RSIchan, "Z2_112MTR15.SPD_HZ_CPM_RATIO", Range("J42")
DDEPoke RSIchan, "Z2_112MTR17.SPD_HZ_CPM_RATIO", Range("J43")
DDEPoke RSIchan, "Z2_112MTR19.SPD_HZ_CPM_RATIO", Range("J44")
DDEPoke RSIchan, "Z2_112MTR21.SPD_HZ_CPM_RATIO", Range("J45")
'close dde channel
DDETerminate (RSIchan)
End Sub
 

Similar Topics

I have read several posts related to this Topic and gathered information from each but have still had no success. Attached is where I'm stuck. I...
Replies
3
Views
2,743
Hello all. First post here. I'm using Excel to handle all of my tag data and such. I'm wondering if there is a way to write to tag descriptions...
Replies
0
Views
1,501
I know there are other topics on this, but I'm trying to get an already working Macro in Excel to run on my machine (Win 7 64-Bit). I'm thinking...
Replies
3
Views
2,643
I know this has been covered many times and I have tried EVERY code snip-it that I have found to no avail... First off I have data already setup...
Replies
16
Views
22,029
Hi I am having an InTouch application and want to use a DDEPoke from Excel to modify a "Memory Message" tag. I am successful in reading this...
Replies
6
Views
7,458
Back
Top Bottom