Save Scan time

Join Date
Jun 2012
Location
Saudi Arabia
Posts
14
dear All,
If you want to save scan time of program in PLC,what are the procedures to do that?
is the language for writing programs reason to save scan time?
Best Regards
 
Basically you make a shorter scan time by either changing your program (consolidating it - removing redundant code - or creating better ways of achieving the same thing), or you put in a faster CPU....
 
This sounds like more of a student type generic question.

There are many ways to optimise code and much will depend on what PLC / programming tools are available to you. Some examples might be:

Not executing all the code on every scan - distribute execution over several scans.

Separate time critical tasks and run them on a timed interupt.

Avoid use of floating point arithmatic if Integer arithmatic will do.

Avoid dividing numbers.

Program in low level languages rather than ladder.

A common trick in S5 for dividing by 100 was to convert a number to BCD, shift right 8 and then convert the BCD back to an integer. This technique evolved because it executed faster than an integer divide.

Nick
 
saving scan time is done to make the response faster.
for example you can do things when events are happening (like an input is on.
or if variable is not changed you do not have to recalculate a subroutine.
 
SCL is a high level language that has much in common with other high level languages that many peopled learned in college. In previous years, people where taught assembly code in college and this leads them to be more comforatable with languages such as STL or IL. SCL is the language of choice where the manipulation of data is concered e.g. in arrays.

In terms of optimising S7 code, pay particular attention to how UDTs are used. When a UDT is passed to a function, it is passed as a pointer and every time the UDT is accessed within the function it must be de-referenced this adds (invisibly) to the size of the code and the execution time. A more efficient method of passing a UDT to a function is to copy the UDT data to local data at the beginning of the function, execute the function and then copy the local data UDT data back to its original location.

Nick
 
A more efficient method of passing a UDT to a function is to copy the UDT data to local data at the beginning of the function, execute the function and then copy the local data UDT data back to its original location.

Didn't know this Nick. Thanks for the tip.

As for the OP, this sounds like a list of homework questions to me.

Shaker, it's better for you if you post the question and what YOU think the answer is. Then people on the board can correct/help you to fine tune or answer or point you to where you are going wrong.

I think you'll benefit a lot more this way (if, indeed, this is a list of assignment questions).
 

Similar Topics

Hi; First of all, I am sorry that my post is not relevant with this forum. I have recently purchased Samsung cell phone. I have alreay saved...
Replies
1
Views
67
Hello! I have a datablock in a PLC witch contains about 700 variables. I must save this data once a day on a Windows PC in a XML or CSV file. Eg...
Replies
1
Views
460
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
761
I'm a bit stuck again... See the redacted picture. At the moment, pressing F7 saves the "live" laser measurement into the boxes indicated by the...
Replies
9
Views
1,058
On my HMI-1200, I'm trying to assign the image of a floppy disk ("save" icon) to a function key. I couldn't find one in the default drop-down...
Replies
5
Views
554
Back
Top Bottom