Excel VBA / RSLINX DDE randomly stops working

phuz

Member
Join Date
Jun 2008
Location
Mohnton, PA
Posts
1,044
I have a customer who is using Excel to manage recipe files. I have macros that look for data changes to enable loading, saving, etc. One of the tabs has real-time data from the current recipe and today I get a phone call about the dreaded #N/A in all the cells. This happened once before where I had to re-create the DDE topic before it started talking again. It's been several weeks since there has been an issue and I am wondering what is causing it. I actually have two DDE topics configured to point at the same ethernet SLC 5/05. The other excel file is running to create datalogs which export to a csv file. Is there a problem having two topics pointing to the node? Can both files use the same topic without problem?

Under the data collection tab in the topic configuration in RSLINX, I have polled messages enabled and set for 1000ms. Limit maximum packets enabled and set to 20. Update hotlink after poke is enabled. Optimize poke packets is enabled. That's it. Most of the time it works great. I've had them reboot and it still won't communicate.

I've sent a request that they remove the topics and re-add them which I am pretty sure will resolve the issue for now. But I need something a little more permanent. I don't like this issue of recipe management, but they chose it and now that it's not talking, they are down. o_O
 
I doubt that the chosen method will ever be highly reliable for long periods of time. You may be able to make resetting communications easier by simply shutting down RSLinx and restarting it.

I have read some lengthy discussions about why this method is unreliable, and I have experienced it first hand. Getting more than a week of continuous operation without a hiccup was considered pretty good in my experience. What I was doing was simply for reporting, not part of daily operations. For daily operations, they need to invest in a proven solution like an HMI with direct drivers or a trustworthy software package.
 
Thanks for sharing my thoughts. As part of this project, we installed a PV+ for them, but they have a recipe structure which exceeds the limitations of a SLC. They have chosen to use Excel to manage the recipe files over DDE instead of upgrading to a CompactLogix which would be capable of housing all the recipe data. I suppose I can have RSlinx restart every night.
 
It might be worth a little more investigation to find where in the chain things are coming undone (excel, RSlinx or underlying Windows OS).

I don't see any reason why you can't have one topic used by both - how many data points? I've got a couple SLCs with a few hundred points being read.

I'd dig up a DDE test client and get it working when the system is working. Then when it falls over, try the DDE test client. If that works, then it's Excel (my biggest suspect).

I know it's always hard to convince a client to fork out for expensive software, but if they got themselves a small tag count version of Intouch, they could certainly make both their recipe use and historical data logging much more reliable. WonderWare's FSGateway and DAS drivers for the SLC / micrologix range have been rock solid in my experience.

There are plenty of other more cost effective PC HMI solutions too, but I haven't used them so can't vouch for them.
 
I wish they would use Intouch. It's my favorite HMI software to date. Can you recommend a particular DDE test client?

They have about 250 integers, a couple boolean, and a couple string values that are constantly being updated.
 
Inside of RSLinx under DDE/OPC in the menu there is DDE Client Diagnositics. There is a wealth if information here.
 
I use to have a problem with early versions of Excel dropping out overnight, but now I use a keep-alive signal every minute and use the hand-shake to confirm comms are running with a timer (70sec )on the excel sheet macro to give a warning message on timeout.
Only occasions comms have been lost have been on power brownouts. If you are testing, you could adapt the handshake to log comms down on the Excel sheet.
Regards, Paul
 
Frankly I'm more than a little surprised that they're using DDE. It's not too difficult to use OPC if you've got the license for it. Maybe a page or two of VBA inside Excel. Excel is not the greatest solution but DDE is probably the worst. If you need some help I can probably dig up some sample code. It's really not that complicated.

Good luck,

(8{)} :) .)
(Yosi)
 
Something to consider. If you are using Excel to DDE and you open Google Chrome it will block DDE connections from Excel to DDE sources. Other DDE applications are not affected only Microsoft products. This issue has been reported to Google by several hundred people over the last year but, to-date, Google has not done anything to correct it. That is just an FYI.

On a different note I suspect that it is probably just a failure in DDE on that PC.
 
Frankly I'm more than a little surprised that they're using DDE. It's not too difficult to use OPC if you've got the license for it. Maybe a page or two of VBA inside Excel. Excel is not the greatest solution but DDE is probably the worst. If you need some help I can probably dig up some sample code. It's really not that complicated.

Good luck,

(8{)} :) .)
(Yosi)

You don't need to buy anything for OPC, you have RLinx. But it does take some seroius rogramming to get OPC to work.
 
You don't need to buy anything for OPC, you have RLinx. But it does take some seroius rogramming to get OPC to work.

Totally disagree. If the customer has the proper RSLinx license it's simply a matter of including the correct object type in VBA and then adding groups, topics, and items as needed. This is seriously not a lot of code. I'd venture that the recipe handling part of this project is more complicated than the link to OPC. If you are familiar with VB/VBA you should have this running in a matter of hours.

Finally, you can't compare the reliability of OPC to DDE.

Cheers,

(8{)} :) .)
(Yosi)
 

Similar Topics

Hi. I have a task of creating checklists for a plant that contain many standard items. My idea is to do this in Excel, whereby in one sheet I...
Replies
11
Views
3,307
Hello, I am looking for help writing to PLC tags from Excel. I am using Factory Talk Gateway as an OPC server and Excel VBA to write out to an...
Replies
5
Views
3,077
Hello. For a PLC data logging application at a candy factory, a customer requested me to setup an add-in for MS Excel called "MX Sheet" which is...
Replies
22
Views
7,958
Good evening, I'll start by explaining what i want to do and then what I've tried. We have an excel document at work that contains our material...
Replies
4
Views
2,276
I have not been able to crack this one out, even after much thinking and googling:banghead:. I would be so grateful if I can get some guidance...
Replies
11
Views
3,674
Back
Top Bottom