RSLinx DDE and Excel

Marie1982

Member
Join Date
Feb 2007
Location
House
Posts
121
Hello guys,

I'm trying to read a block of words from a ControlLogix into Excel using a DDE channel. In Excel, i'm using a macro activated by a button to do the reading. The code is in VBA. I found the code in RSLinx help, here it is:

"Excel DDE macro: read a block of words

Reading data from a PLC via DDE requires a macro like the following. This macro assumes that there is a worksheet created and saved as RSLINXXL.XLS. This is the destination of the data that will be read by the macro. This routine reads a block of five words:

Sub Block_Read()

'open dde link: testsol=DDE Topic

RSIchan = DDEInitiate("RSLinx", "testsol")

'get data and store in data variable

data = DDERequest(RSIchan, "N7:30,L5,C1")

'Paste data into selected range

Range("[RSLINXXL.XLS]DDE_Sheet!A7:A11").Value = data

'close dde link

DDETerminate (RSIchan)

End Sub "

I wrote exactly that code and when I activate the macro, I get the "error 438: Property or method not supported/managed by the object." If I click on debug, it higlights the line with the DDERequest command.

Do you know how to get rid of that error?????

Thank you very much

Marie
 
As I said, the error is at the line with the DDERequest command.

The version of RSLinx is RSLinx Classic V. 2.50.00.20 (CPR 7)

Marie
 
The OP is using a contrologix, I don't believe it supports a data type of N7:30. Maybe a tag name. ( note: I have never done this)
 
Probably an easy way of getting the correct syntax for the controllogix is to go into RSLinx, Edit, Copy DDE/OPC Link. This way at least you know the syntax is correct when you past it in the cell.
Also check you version of Linx like the others have said...I've never really used DDE in Excel but I assume you need higher than Lite.
 
Mickey's right. It should be a tag like MyInteger or something. What tag are you trying to read in the Controllogix?
 
Actually you are specifying a length of 5 so it would have to be an array like MyInteger[0].

Give us the tag and the number of elements you want to read
 
No need to use a macro, simply type the request for data into a cell - example to read PV of a PID tag called "MyPID" :-

=RSLINX|MyTopic!MyPID.PV

MyTopic is the RSLINX topic name, pointing at the contoller.

If you try to address an array tag - such as MyArray[13], the square brackets cause errors, so you need single quotes around the tagname :-

=RSLINX|MyTopic!'MyArray[13]'
 
ok thats what i have also done so far, now i have real time data in a excel cell. Now what if i want to log it, lets say, twice a day?
 
neo1125 said:
ok thats what i have also done so far, now i have real time data in a excel cell. Now what if i want to log it, lets say, twice a day?

We do this all the time. We just move the data into temporary memory locations which are referenced in excel and then save a copy of the excel file. You can automate the entire process using vba.
 

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,333
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,111
So I Read about DDE. I've already set up my topic configuration in RSLinx. I'm now trying to move forward in Excel. I see the formulas, but I...
Replies
21
Views
13,074
Hi I have Linx classic and FT View ME and want to create a config sheet so i can send info from excel into my PLC. I have read various things...
Replies
5
Views
3,672
I have the following DDE Topic in Excel from a ControlLogix processor: =RSLINX|'SW123'!'CCip_Rcp[0].FiRns.Vol_Sp,L1,C1' It was created using a...
Replies
0
Views
2,793
Back
Top Bottom