S7-Graph vs STL or FBD execution times...

Jirrr

Member
Join Date
Jan 2009
Location
Czech
Posts
167
Hi,
I would like to known if there is a difference in execution times of the same programs made in Graph and STL or FBD?
Is here anybody who examined it....
Thank You...Have a nice day J
 
No experience with GRAPH, but I do have a lot of experience with SCL.
LAD, FBD and SCL puts in some branching and formatting code that may not be necessary for the intended function. The LAD, FBD, GRAPH and SCL generate STL code, but you probably mean to compare against STL code that is manually optimised by the programmer.
My estimate is that LAD and FBD adds 25% more code than optimised STL.
And I estimate that SCL adds 50-100% more code than optimised STL, but a lot of the added code consists of jumps, so it will not mean that the execution of the code is 50-100% longer.

But I also think that it is not very relevant to optimise code as it used to be in the past. Todays CPUs are 10-20 times faster than they were 10 years ago. And this development will continue. It is more important that the code is easy to maintain, than that it is optimised for speed.
(Peter Nachtwey who make code for motion controllers will disagree.)
 
The problem is that we got an older machine with CPU 315 DP and it is programed mostly in Graf....And we have second machine which program was changed from graf to STL and FBD some time ago by outside programmer,and i was told that it is much faster in comparison with older program/I am not sure about it,do not have old program and the speed can be affected by something else/ but I was not in the company that time,so I must belive my boss.Now I was asked to reprogram this,for us new machine,without using Graf to make it faster...It will be no problem but I would like to known if it is worth doing...
I use mostly new CPUs and they are really fast so I have newer problem with program execution....
 
I've never had a Graph7 Program that was simple enough for it to be worthwhile comparing with an STL version but I would think it will probably be similar to the situation Jesper mentioned about SCL - the programs are frighteningly large (which in itself could be a problem in older CPUs) but if you look at the code in STL in consists almost entirely of JLs. There is a bit more overhead than with an SCL program because the Graph7 program also has to call a control FB, but I would think it would only be around 10% - 20% and not the 100% or more (that's just a guess) that you might expect from looking at the size of the programs.

On a newer CPU I wouldn't even waste the time to consider not using Graph7 for an appropriate job - it's worth it alone for how much easier it is to understand what the program is doing - especially when troubleshooting!
 
Depending on the age of the 315-2DP CPU, a new CPU may be 10x faster.
What is the old CPUs type number exactly ?
I am guessing that rewriting a large GRAPH program in STL is not worth the effort.
 
That is a 315-2DP belonging to S7-300 "2nd generation".
The current 315-2DP belongs to S7-300 "3rd generation" and is somewhere between 3 and 5 times faster.
 
Oh, and by the way, if there are certain parts of the program that must operate at a much faster speed than the rest of the program, you can update these via a timed interrupt (OB35).
It is an option worth investigating if the parts of the program that must update especially fast are relatively small.
 
It is an option worth investigating if the parts of the program that must update especially fast are relatively small.
The whole thing made me wonder what in fact is too slow about the program? (How) can they tell the program is slow or that it's something in the machine that is slowing down?
 
This situation came from that technology depatment in our factory known nothing about PLC and before changing program an article on was finished in for example 60s and after changing to STL it is finished in 50s and that is why They are persuaded that it is the trick...and as I said I have non old program so I can not analyze it...
 
Example data to save 10s:

If, STL implementation scan time=50ms
and Graph implementation scan time=150ms

Then Process requires 100 steps.

How many steps are involved in your process?
 
If you really get a 17 % reduction in total cycle time (20% increase in production), then why dont you pursue every possible cycle time reduction that you can find. I would first get a new fast CPU, and if that is not enough I would get consider other optimisations such as rewriting in STL.
 
First of all you can take a look at the properties for the Graph and make sure that you need everything that is programmed. Changing these properties will affect the scan time but also they way the graph behaves. If the plc has a lot of graphs the difference can be many ms even with a new CPU.
attachment.php
 

Similar Topics

Hi, Is it possible to convert Graph program to STL or something like this which is modifiable by programmer.
Replies
7
Views
5,050
Does anybody know an easy way to open up an S7-GRAPH Block directly in the STL-Editor. That is without going to the trouble of either...
Replies
8
Views
6,062
Hello Folks! I have an issue and its very often but in this case i applied all the tricks and tips that i always do in similiar issues but in this...
Replies
2
Views
772
Hi all - Considering using S7 GRAPH for some sequencing. I have a few questions which I am having difficulty finding clear answers to in the...
Replies
0
Views
573
Can someone explain the order of processing the actions of a step...is it top - bottom see attachment for reference. Does it process the blkmov...
Replies
1
Views
2,069
Back
Top Bottom