DDE via C++

pkingsbury

Member
Join Date
Apr 2008
Location
Cambridge, ON
Posts
4
Hello all,

I am beginning to write an application which obtains PLC data via the DDE interface in RSLinx Classic.

Previously I had configured an Excel spreadsheet to obtain the data, but due to a number of consistent application failures (application crashing after X hours, data not being read without twiddling with the spreadsheet, etc) I decided to write a more reliable and less crash-prone C++ application.

In the spreadsheet I had accessed the RSLinx DDE interface using "RSLINX" as the 'application', and the shortcuts I'd defined inside RSLinx Classic as the 'topic'. Despite the problems I mentioned above, this works.

I tried using these values for the application and topic inside my C++ application, and I consistently get the error 'DMLERR_NO_CONV_ESTABLISHED', which evaluates to the description "A client's attempt to establish a conversation has failed".

I have only begun scratching the surface of DDE via C++, and have been using a tutorial (here) as a starting point for reading my PLC data (adapting it to read through RSLinx rather than from a local application).

I am unsure how to proceed, so any help would be appreciated!

Best regards,
- Peter
 
Well I found the problem. It seems that the sample code (linked above) does not correctly convert string datatypes required by the DDE API. After I rewrote this small DDE-unrelated bit of code, my application works fine.

Thanks to anyone who read this!
 
With DDE going away sometime in the near future, why not go ahead and write your application utilizing OPC?
 
Mostly for reasons of legacy implementation support.

Where can I find out more about this "going away" state of DDE?

Also, is there an OPC API available without cost? e.g. similar to the DDE API provided by Microsoft. I've come across scads of toolkits in the $1000's range, I'm wondering if there is a popular free/open source SDK I might use?

Cheers,
- Peter
 
Fully functional KEPWare KEPServer is a free download; the only limitation being it will run for 2 hours then stop. Right after that it can be restarted for another 2 hours - and so on. An indispensable testing and developement tool. It has drivers for Allen-Bradley PLCs that don't need RSLinx to run. There is COM and .NET API along with VB and C# sample projects.

For the real production, you would have to buy a runtime license for about $800. Normally you would need one license per installation; however, if money is tight and the amount of data is not large, one installation can serve multiple PLCs and multiple clients. You would have to tweak DCOM settings to make it work this way.
 
Can you please post those changes that made that code work. I'm just starting to explore this and I'm running into problems. I think I'm having the same problems you are were having. But I'm unable to find a solution.
 

Similar Topics

Hi all. Citect 7.3 SP1 / Excel 14 (2010) I am able to use DDEWrite and DDERead within cicode to set cells and read cells in excel. However doing...
Replies
1
Views
2,416
We are experiencing random slow performance when writing to a string tag in a Clx PLC via ethernet and RSLinx 2.43. The write is most of the time...
Replies
2
Views
5,395
U
Does anyone know a way for me to work from a database, that is linked to serveral PLCs, and somehow using DDE , link Excel to this Database so...
Replies
4
Views
5,847
I was wondering if anyone would be willing to show me some examples of using Visual Basic to communicate to a s7 226 via the rs232 port and DDE...
Replies
2
Views
8,330
I need to support some old data collection that is running on Excel, but I need to get it running on LibreOffice. The following statement works...
Replies
0
Views
54
Back
Top Bottom