Help - Search - Members - Calendar
Full Version: Scan time and programming language
Forums.MrPLC.com > PLCs and Supporting Devices > Allen Bradley
slcman
Hi all,
I want to do a large amount of math operation with a compactlogix processor. I wrote to Rockwell support and they told me the ladder is the faster programming language, second is statement list & sequential and the slowest is function block. I'm surprise...I was thinking statement list will be faster than ladder! Anyone have some experience with different programming language? Ladder is really the faster ?
Peter Nachtwey
QUOTE (slcman @ Oct 19 2009, 06:06 PM) *
Hi all,
I want to do a large amount of math operation with a compactlogix processor. I wrote to Rockwell support and they told me the ladder is the faster programming language, second is statement list & sequential and the slowest is function block. I'm surprise...I was thinking statement list will be faster than ladder! Anyone have some experience with different programming language? Ladder is really the faster ?

I haven't done a bench test to really know. However, ST should be the fastest language IF the code gets compiled down to machine code but if ST gets compiled down to ladder then ladder should be faster. Ladder spends too much time loading parameters and storing the results for each block to be efficient.
MikeSmith
I've had a reasonable look into it.. the answer isn't as simple as language alone. It also has a fair bit to do with what you're programming. LAD might be faster in some respects but mostly people don't use conditional execution with it (jumps, ends etc). When your program has a significant amount of conditional execution (state machines, different code executing depending on what's happening) then ST starts to look really good because things like the CASE construct limit unnecessarily executing logic. I wrote a few test programs where ST ended up faster than LAD to do the same thing.

SFC is slower and more memory hungry comparatively but it does give you a lot for free as it removes a lot of the effort required to build/modify state machines. It depends how much performance you need.. I've seen it quite happily run high speed motion applications.

For heavy maths, I would suggest ST for your own sanity.. it's much nicer to write maths in especially if you're working with cases, loops and arrays.
paulengr
QUOTE (slcman @ Oct 19 2009, 09:06 PM) *
Hi all,
I want to do a large amount of math operation with a compactlogix processor. I wrote to Rockwell support and they told me the ladder is the faster programming language, second is statement list & sequential and the slowest is function block. I'm surprise...I was thinking statement list will be faster than ladder! Anyone have some experience with different programming language? Ladder is really the faster ?


ST is "structured text". Roughly speaking in terms of PC languages, it's most similar to Pascal/Modula/VHDL/Ada. There is another language called something similar to "statement list" that resembles machine code that is popular in Europe. I believe it is stack-based, and it looks very similar to most assembly codes. It is the 5th out of the 5 IEC languages. Rockwell does not support it, since structured text is pretty close to a superset.
Alaric
Well structured ST should be the fastest. It is however the least visual - which might be an issue for Bubba.

I ran a test some time ago for linearizing a non-standard thermocouple using six different fifth order polynomials. ST kicked Ladder's butt. The disadvantage ladder has for large computations is the necessity of storing every intermediate result in memory and then fetching that result again just to continue the computation. ST allows you to craft equations that don't need intermediate storage. Granted, ladder has the CPT instruction.

Another advantage is branching control and comparisons.
IF (A>B) THEN
do_this
ELSE
do_that
END_IF

requires only one comparison. In ladder two comparison would be required. GRT A B and LEQ A B.


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-2009 Invision Power Services, Inc.