rslinx and excel

shadow314

Member
Join Date
Mar 2007
Location
Indiana
Posts
1
Hi all,

I'm trying to read data from controllogix into an excel sheet. The tag i'm trying to read is an array1[24000]. Below is the code i'm working with

sub read_data()

rsichan=DDEInitiate("rslinx","measurement")
data = DDERequest(Rsichan,"array4[0],L24000,C1")
range("[data1.XLS]Sheet1!A1:A24000").value= data
DDETerminate(rsichan)
end sub

The question i have is, when i run this code its putting #REF in the all the cells. But if I limit myself to L100 then its dumping the values in the excel sheet. I went ahead and tried to do looping like for i=1 to 24000
data = DDERequest(Rsichan,"array4,L1,C1")
range("[data1.XLS]Sheet1!A(i)").value= data
next i

but its throwing me an error in the data line as error2023. Its important for me to have all these 24000 data points. Kindly give me your inputs on this issue.

thanks.
 

Similar Topics

Hi, I'm brand new to the forum and spent some time looking around but could not find an answer to my question. I'm using an excel spreadsheet to...
Replies
3
Views
1,336
Hello! I am trying to help a coworker get access to a company dashboard. It runs on my computer and I have set up similar dashboards myself, so...
Replies
4
Views
2,513
Hello All, I know it is possibile to access data from a PLC directly to excel using a OPC link through RSLinx...
Replies
2
Views
1,743
I use dde/OPC to read tag vaule in excel file its working ok when rslinx running NOT as service but when I run rslinx as service I got an error at...
Replies
5
Views
1,932
Sorry if this is off topic, but this is more of a VBA question. I have some data that needs to be collected weekly. I have an excel sheet so that...
Replies
6
Views
2,124
Back
Top Bottom