Sign in to follow this  
Followers 0
NoLegalMoves

Rockwell to Excel

4 posts in this topic

I configured a topic called PLC01 through Rslinx that I know works. In my excel sheet, I am trying to read a tag value using the following vba code. All I get is a #REF! error in my target cell.. what is wrong?? I have enabled macros and turned down security settings... Sub ReadPLC01() 'open dde link: testsol=DDE Topic RSIchan = DDEInitiate("RSlinx", "PLC01") Data = DDERequest(RSIchan, "COM_PLC01_CIP11_EQU[0], L1,C1") 'Paste data into selected range Range("[ReadPLC.xlsm]Sheet2!B1").Value = Data 'close dde link DDETerminate (RSIchan) End Sub

Share this post


Link to post
Share on other sites
Moved your topic to the Allen Bradley forum. You should get a little more exposure here. I'm rusty with doing DDE topics in RsLinx but what flavor or RsLinx are you working with? Lite, Single Node, OEM, etc?

Share this post


Link to post
Share on other sites
Sounds like your connection is not opened? I have a sample code here you can look at. http://forums.mrplc.com/index.php?app=downloads&showfile=134

Share this post


Link to post
Share on other sites
If you are still working on this issue, I would recommend switching over to OPC instead of DDE. It is more reliable and more supported. I wrote an Excel datalogging sheet using OPC for a customer a couple years ago because of budget constraints, and it's been very stable. I'd be happy to share some examples if you need them.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0