How much memory?


Thread Starter

Rene Venter

What I would like to know is this:
If I write a program for a Siemens S5 (any one of the S5 PLC's), is there any way for me to know how much memory I will need for the program? Is there any way of determining that by counting the
amount of I/O's that I will use? Can anyone please help me with this?
Hi All

There is a trick which you can use when you have written the program, you do a cross reference of the whole program, it doesn't matter for what, and
before the data is printed, the PG unit analyses all the blocks and prints out a confirmation of each block as it finishes, when this is done it lists a summary of all the block lengths and then you have your answer. Of course you could also load the program into a different PLC with enough RAM to party with, then do an output of system parameters, it will list the length of all the blocks, or you can work it out from the last used address in RAM, (if you know how)

There is no way to predict other than writing the program or gut feeling, as every time you use an input in an and gate etc. you use another line of
code. How long is a piece of string.

Donald Pittendrigh

Michael Griffin

This has been discussed before on this list. The general conclusion seemed to be that I/O count alone won't tell you much, because it doesn't
say what you do with that I/O. A good estimate though can be made by taking a program from a roughly similar machine and extrapolating from that according to the relative complexity of the two machines.

The manuals for the S5 series have an appendix listing the size of each instruction. If you are comparing two different brands of PLC, this
information may be useful.

Something I have done was to divide an existing program into functional areas (hopefully this corresponds to individual program and function blocks) and measure the size of each block. I would then estimate the functions required in the new machine, and add up the required blocks.
For example:

Operator interface handling - xxx bytes
Conveyor control - yyy bytes
Weld controller interface - zzz bytes
Pick and Place sequence (number of steps time bytes per step) www bytes
Total = vvv bytes

This works reasonably well if you are dealing with equipment that is fairly similar to something you have previously done. However, a 20 percent error in your estimate would not be surprising. Make sure you take into account any standard blocks which you need to include in your program (e.g. FB51 for OP communications).

Something to keep in mind if you have not had any previous experience with S5 PLCs is that you can't really use all the memory which is present. A certain amount of free memory is required for editing purposes. If you load a new version of a block (OB, PB, FB, DB, SB) into memory, it is added to the end of the program, and the previous version is marked as invalid. After you have done this a few times, you need to do a "compress" on the memory to free up the areas the old blocks occupied. If you filled up the memory completely, you won't be able to edit except by reloading the
entire program.

Michael Griffin
London, Ont. Canada
[email protected]

Tony Sizemore

ANSWER: Using STEP5 v7.x, perform a Blocks Directory (File > Blocks > Directory) of the Program File. Below the directory list, you will see this text, "Total Blocks / MC5 Blocks : ### / ### words." The first number represents the size of the Program File (ST.S5D) - including documentation - in words. The second number represents the size of the Program File (ST.S5D) - without documentation - in words. Double the second number & you know how large the program is in KiloBytes. Only the ST.S5D file (logic) is loaded into the S5 PLC. If I can be of further assistance, I will be glad to help. I represent the Siemens Simatic S5 PLC Hotline, Johnson City, TN. Tony Sizemore Solutions Support Center Industrial Solutions & Software Division SIEMENS Energy & Automation, Inc. PO Box 1255 MS532, Johnson City, TN 37605 Phone: (423)461-2414 Fax: (423)461-2289 [email protected]