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.
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.