# How much memory?

R

#### 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

I

#### I-ASICC

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.

Cheers
Donald Pittendrigh

M

#### 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
etc.
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