Help - Search - Members - Calendar
Full Version: Problem with DDE-link and working with RSLogix5
Forums.MrPLC.com > PLCs and Supporting Devices > Allen Bradley
mulderm
Hello,

I have making in an Excel-sheet a DDE-link Topic between RSLinx Classic and a PLC5/25 processor.
When the value in the cel of the sheet changes, a macro will running for to do some handlings.
This take about 3 seconds.
Problem is that sometimes, when I working with RSLogix5 (with is also installed on the same PC) to do
some online programming, the Excel application is hanging at the moment that the macro is running.
I see this because the cursur is changing in a Hourglasses so the macro is running.
What can I do to help this problem?
When I not working on the pc everything is allright.

Greetings,

mulderm


BobLfoot
QUOTE(mulderm @ Jan 11 2007, 12:42 PM) [snapback]47670[/snapback]

Hello,

I have making in an Excel-sheet a DDE-link Topic between RSLinx Classic and a PLC5/25 processor.
When the value in the cel of the sheet changes, a macro will running for to do some handlings.
This take about 3 seconds.
Problem is that sometimes, when I working with RSLogix5 (with is also installed on the same PC) to do
some online programming, the Excel application is hanging at the moment that the macro is running.
I see this because the cursur is changing in a Hourglasses so the macro is running.
What can I do to help this problem?
When I not working on the pc everything is allright.

Greetings,

mulderm

Sounds like you have a continuous loop monitoring the excel cell. Did you remember the all important DoEvents command within the loop. THis gives Excel permission to service windows and other applications while running.
mulderm
No, explane please this command and how must I program this?

mulderm

BobLfoot
QUOTE(mulderm @ Jan 12 2007, 02:18 AM) [snapback]47711[/snapback]

No, explane please this command and how must I program this?

mulderm

The VBA command DoEvents is a reserved word just like For, Next, Loop, Sub, End and so forth.

When ever you have a looping situation in VBA it is advisable to include the DoEvents command within the loop. I'll demonstrate with a sample For Next Loop.

Without a DoEvents statement this loop could take a minute or more to execute. Tying up the processor the entire time.
For X = 1 to 10000000
Y(X) = Z(X) + 200
Next X

With a DoEvents statement this loop still could take a minute or more to execute, But each pass thru the loop would pause and give time to the processor to refresh screen and mouse and so forth.
For X = 1 to 10000000
Y(X) = Z(X) + 200
DoEvents
Next X

It is that simple to use and saves a world of headache. Note your macro might run slightly slower, but usually worth it.
mulderm
Excellent Boblfoot!
Now itīs clear.
Thank you very much, I will try this tomorrow.

mulderm

This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.