Sign in to follow this  
Followers 0
pete3589

Excel DDE to PLC speed issues

3 posts in this topic

I created a DDE application some time ago using the examples found in the DDE help files in RS Linx. My program basically pulls tags out of the plc, and gives the user the option to write values back to the plc. It is relatively simple with just a few push buttons to read and write the data as well as to clear the screen. Long stretches of my code look like this (for the read at least). data = DDERequest(Import, "OptionAutoStartControlMethod") Range("[COOPERPLC.XLS]Sheet1!A21").Value = data data = DDERequest(Import, "SetptAutoReloadPressureOffset") Range("[COOPERPLC.XLS]Sheet1!A22").Value = data I have about 500 tags to read and write to. It takes about 3 minutes to read, and then 3 minutes to write all of the tags. Recently I saw another application similar to mine that read and wrote much faster, and Im not sure why. I believe he was able to use For statements to make his code a bit cleaner than repeating the DDE code as I did above (unfortunately I cant since the tags are not similar). He was reading a similar number of tags, and using the same technique as above with the for statements, but his collected the data much faster. Does anyone know how to increase the speed of the data collection from DDE? Maybe a setting that I am missing in Linx or Excel? Or perhaps a suggestion that would speed things up a bit.

Share this post


Link to post
Share on other sites
I'm curious if you are referring to the sample code I posted not too long ago for Ecxel to PLC thru RSlinx under the HMi download section. Try reducing your command to the following: Range("[COOPERPLC.XLS]Sheet1!A21").Value = DDERequest(Import, "OptionAutoStartControlMethod") Range("[COOPERPLC.XLS]Sheet1!A22").Value = DDERequest(Import, "SetptAutoReloadPressureOffset") Keep in mind that each DDE request opens a new topic and has overhead. You might also try the following. in Your target PLC create a Transfer Data file or files. Like N77 or F88 and pack all your varied data into these two or three files. Then modify your definiton to read a block rather than a single point. This will prove faster.

Share this post


Link to post
Share on other sites
I did an excel dde system 4 years ago, writing 4000 values either to or from an SLC500. The data was blocked as Bob suggests, and a write or read took about 10 seconds. Here is an extract from the VB code: OP66_Data = DDERequest(RSIchan, "N255:1,L50,C1") 'Paste OP66 data into selected range Range("[RECETTE.XLS]op66!C3:C52").Value = OP66_Data 'OP67 'get OP67 data and store in data variable OP67_Data = DDERequest(RSIchan, "N255:51,L50,C1") 'Paste OP67 data into selected range Range("[RECETTE.XLS]op67!C3:C52").Value = OP67_Data I was reading in blocks of 50 words associated with machine operations.

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