Sign in to follow this  
Followers 0
CanaanP

DDE Question

16 posts in this topic

I'm learning a little about DDE, and how to tie rslinx to excel. I'm curious though, is it possible to do that in reverse? Is it possible to send information to the PLC using DDE? For example, if I wanted to have like a visual basic button on a screen, could that button send a command to the plc when pressed to enable a bit? I know that things like that are possible with rsview and such, but I'd like to know if it is possible without using AB software other than rslinx. Any help is much appreciated. Thanks

Share this post


Link to post
Share on other sites
Try this link http://www.software.rockwell.com/support/d...tail.cfm?ID=241

Share this post


Link to post
Share on other sites
That looks sweet, except I'm unable to do anything with it... apparently excel 07 does not include vba support or something like that and when I open the file I'm told that the vba component is removed. All the macros that the buttons are programmed with are gone. I guess I would need to downgrade to the 03 version of excel to open it properly.

Share this post


Link to post
Share on other sites
It could also be that the security settings of your Excel application are set to very high. In Excel 2003, these settings are found under Tools -> Options -> Security tab, then Macro Security. Of course, the newer version may have moved it somewhere else...These settings may be established by your IT dept. Also, there may be Add-ins required that you are missing. Paul

Share this post


Link to post
Share on other sites
It is most definitely either your security settings in excel 2007 or your topic configs in rslinx. I have used DDE with Excel 2007 to both read and write to plc 5's, slc's and contrologix's plcs. The following are links to sample programs you can play with and adapt to your needs. http://forums.mrplc.com/index.php?autocom=downloads&showfile=820 http://forums.mrplc.com/index.php?autocom=downloads&showfile=543 Do you have the Developer Tab showing in the Ribbon of your excel? If not then use the office button and select excel options to display the Developer Tab. On the Developer Tab select Visual Basic and you should see your code. if your security settings are wrong you will not be able to get this far. Try the above and let us know how we can help next.

Share this post


Link to post
Share on other sites
I appreciate all the help that has been offered, but I'd like to just mention that although I'm new to PLCs and this whole DDE thing, I've been messing with computers for a very, very long time. Has anyone with Excel 07 actually been able to open and run the xl5vb.xls? When I open it, I immediately get this message:. When I click ok, I get this message: Now, when I type the first error message into google, this is the very first link: http://support.microsoft.com/kb/926430 It describes to a T the exact problem that I am experiencing and says to call support services. I haven't called, but I pretty much consider that to be a dead end. I know that Excel 07 has VBA, but when I am trying to tell you guys is that the 07 Excel does not support certain vba stuff written with an older version of Excel.... I don't know the exact details, but it is not my settings that is causing this problem. If someone else with Excel 07 can open this file and run it, then I will eat my hat.

Share this post


Link to post
Share on other sites
Where did you get the file xl5vb.xls? Can you zip and post it to this forum? I use excel 2007 and will ahve time alter this week to take a look if I can get the file.

Share this post


Link to post
Share on other sites
LOL, it's the first reply I got in this post - from b_carlton I think it was. Click the link and it takes you to what appears to be an internal rockwell support page.

Share this post


Link to post
Share on other sites
This may be of no help whatsoever but it may give a hint. In Excel 2000 under Tools - AddIns was a selection of other capabilities to add to Excel which are not installed by default. I've had to add capabilities for Octal for some of my AutomationDirect addressing. I have no idea if this wikll help though.

Share this post


Link to post
Share on other sites
Dooh! -- Even a wizard can pull a Homer Simpson. I jsut cruised Microsoft.com for a bit and cannot get a decent response to where the VBA Converter PACK for Excel 2007 download is. If I have any success I'll post back. For now if you want to try DDE look at the two mrplc links I posted. Theya re for 2003 and 2007 sheets which won't have the issue the excel 95/5.0 sheet you're using has. By the way your error exists because RA posted the sheet in 5.0/95 format.

Share this post


Link to post
Share on other sites
Posted a request on RA forum as well check out http://forums.rockwellautomation.com/rockw...p;thread.id=164

Share this post


Link to post
Share on other sites
Try setting your VB form as a DDE source, then make your VB button do a dde link to Linx via a Topic you create in Linx. The DDE topic in VB is the topic name in Linx and the item is the datatable (bit) you want to send data to. I have done this many times to read and write data to a PLC/SLC via VB6. See the attached file. It's a VB program that reads/writes to a PLC5 via Linx and DDE. You'll have to modify it for your use, but I used it to configure a PLC5 with bits and words all over the data table. PLC5_DDE.ZIP Edited by crashcup

Share this post


Link to post
Share on other sites
It took some doing and I have not the hardware to test the converted file, but check out this zip file. xlvb.zip USE VERSION 2 BELOW I took the Excel 5.0/95 file into Excel 2003 and saved as a 2003 XLS format. It has all the modules and code and appears it should work. I then opened the 2003 XLS format in Excel 2007 and saved it as a macro-enabled spreadsheet XLSM format. This also has the modules and code present. And should work. Hopefully somebody with hardware to play with can test this out for us. Realized after I posted the above I forgot to change file names in the modules. This one has a better shot at working. xlvb_V2.zip

Share this post


Link to post
Share on other sites
For anyone inteerest Excel 2003 installed on a 2 GB Thumb drive while Office 2007 was on C: Drive. No interaction problems yet. Both Excels 2003 and 2007 run fine.

Share this post


Link to post
Share on other sites
You can install and run excel on a thumbdrive? really?

Share this post


Link to post
Share on other sites
it worked on my Dimension 4300 running XP Home SP3. The drive was USB 2.0.

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