Out of memory on an ab compactlogic

BBarr

Member
Join Date
Feb 2016
Location
Wisconsin
Posts
28
I have an Allen Bradley 1769-L27ERM-QBFC1B and I have reached the program memory limit. The design is nearly done but i need 60K more space to finish. I have tons of I/O memory available if that helps.

I have already cleaned out all the unused tags I can. I am looking at converting oneshot bits to Dints to see if that will help.

Any other advice. I cant do much with tagnames as I am stuck with a strict naming convention.

Any direction would be a huge help.

Thanks!
:cry:
 
I would be leary of running 95+% usage on memory regardless. Sounds like the processor is undersized for the task.
 
I agree that the processor is likely undersized for the task, especially if you have a strict naming convention. In my experience those go hand-in-hand with mandatory use of unwieldy UDTs.

Rearranging one-shots into single elements of a DINT will help; when you declare a BOOL element it actually takes up 32 bits, while a DINT will give you 32 usable sub-elements with the same 32 bits.

But you're not going to recover 60K of program memory that way. I expect you need to upgrade to a 1769-L3x series controller.
 
widelto - did it... everything I can get rid of is gone.

Dravik - yes, yes it is. Sadly replacement is "not an option". Dont you hate inheriting projects.

Alot of the Old plc's used to let you assign memory like partioning a hard drive. Does anyone know if you can put tags or rarly used program files on external SD or somethihng? Scan time for the data collection program files is irrelivent.
 
Though, I think there is a small penalty to using INTs as the math has to convert them to DINTs? I may be mis-remembering this.

Edit - yeah looked up the design guide, use DINTs.
 
Last edited:
Is Dint the most efficent datatype?
are Ints better if you can use them.

Yes, DINT is the most efficient data-type, even if you only need to store a value that can only be 0, 1, or 2.

You would think that SINT would be the best choice, but not so.

The processor is a 32-bit machine, so all the in-built instructions, data-handling, math, etc., is built around that 32-bit architecture.

When you use a SINT or INT in an instruction it is converted to a DINT (or a REAL) for processing, then the instruction may need to back-convert it to store the result in the destination if it isn't a 32-bit type.

Use DINTs and REALs throughout, and you will achieve maximum efficiency in terms of scan time, and memory usage is optimised.

Only use SINT or INT if you are interfacing with other systems that don't support 32-bit Integers. Nearly always you will use arrays for this, and the processor/compiler will pack the SINTs or INTs into the memory space efficiently.
 
Last edited:
Update

Just an update and thank you to the guys who posted.

I removed all of my bit type oneshots and a ton of other bit level tags took a few unused chunks out of a string array and went digital on a camrea light to remove its communication logic and freed up 107K. I have close to 10% free now thanks to you guys!!!

Sooooo Thanks!!
 
Default String data type is 82 characters.
You should check if you actually need all 82 bytes and may be create user defined string that can be much shorter.
 
Did you know?...

If you create an array tag of data type BOOL[32] we know that each BOOL member will inefficiently use 32 bits each. So that's 1024 bits just to service a usable 32 bits.

However, if we create a User Defined Data Type (UDT) with a similar member of data type BOOL[32], then the UDT will efficiently pack the BOOLs in a byte-aligned fashion. The UDT is only 4 bytes in size which is the same as a DINT.

The byte alignment does also restrict the size of a UDT BOOL array from being anything other than aligned to a 32 bit boundary. So the minimum size of a BOOL array member you can create is BOOL[32] packed as 4 bytes. Then [64]...[96]...[128], and so on. This is no different than creating a DINT array to be used as more than 32 BOOLs.

Perhaps that is just a "useless piece of research for the day", but it is intended to get you thinking about what else you can pack up more efficiently using arrays within a UDT?

Another teaser...

Add an INT member to a UDT and what size is it?

Add an INT[2] member to a UDT and what is it?

Regards,
George
 
If you create an array tag of data type BOOL[32] we know that each BOOL member will inefficiently use 32 bits each. So that's 1024 bits just to service a usable 32 bits.


Regards,
George

I don't believe that to be true, George.

Whenever you create a BOOL array tag, it will automatically "snap-to" the next highest 32-element "boundary".

e.g. if you create a BOOL[10] tag, it enters the database as BOOL[32]

That indicates that it is using a single bit for each BOOL element.

As a test, I created a DINT[100] tag, and the memory usage increased by 496 bytes. I then created a BOOL[3200] tag, and the memory usage also increased by 496 bytes - the same as the DINT array. Proof that it doesn't use a 32-bit memory space for each BOOL member.
 
Ah pardonne moi,

I jumped ahead in my thinking. I meant to say while creating 32 individual BOOL tags, and not a BOOL[32] array, we would inefficiently be using 32 bits per BOOL. I seem to recall making the very same mistake here before and someone else correcting me? I obviously haven't learned my lesson!

Thank you Daba, that was silly of me.

Yes, BOOL arrays are more efficient than individual BOOLs, memory-wise. But are BOOL arrays more efficient than using DINT members as BOOLs?

BOOL arrays are not the most supported method of using BOOL addressing. For instance, basic file type instructions such as COP and MOV do not support BOOL arrays. This is where creating the BOOL array inside a UDT may be necessary.

If we take the COP instruction, and needing to copy one BOOL array to another, we cannot use a BOOL array tag as the Source or Destination operand. To get around this we can create UDTs to nest the BOOL arrays; one for the Source and one for the Destination. This way we can add the tags of the User Defined Data Type to the COP instruction's Source and Destination operands and the array data will be sucessfully copied.

So in that case the use of BOOL arrays is inefficient by having to create UDTs, which uses extra memory, to facilitate a relatively simple copy operation. If you don't need to be copying or moving BOOL arrays then it may not matter. But there is another slight disadvantage to using BOOL arrays over DINTs with regard to memory...

If you add a DINT tag how much memory does it consume?

If you add a BOOL[32] array how much memory does it consume?

When it comes to memory, every tag of varying data type we create consumes a certain amount of memory. But we have to consider, when trying to conserve precious memory, how much a particular tag actually consumes beyond the known data type "bit width". We say a tag of DINT data type is stored using 32 bits. That is correct for the data type, but there is also overhead for things like the tag name, which can be up to 40 characters. The tag name is compiled and stored in the processor for reference, so it consumes memory at runtime.

A tag of data type DINT, while we say executes using 32 bits, or 4 bytes of memory, is actually stored in the processor using 88 bytes, when we include the overhead.

A tag of data type BOOL[32], while we say also executes using 32 bits, or 4 bytes of memory, is actually stored in the processor using 96 bytes, when we include the overhead. The fact that this is an array adds a small bit more to the overhead.

Daba,

When you created the DINT[100] and BOOL[3200] arrays they both consumed 496 bytes. This is because they are both using the same data type bit width, the same tag name overhead, and the same array overhead.

So memory-wise, a single DINT tag will consume less memory if used for BOOL tags when compare to a BOOL[32] tag.

Geospark said:
...Add an INT member to a UDT and what size is it?

Add an INT[2] member to a UDT and what is it?...

Robobob said:
They are both 4 bytes in size.

Exactly.

A single tag of data type INT will consume 4 bytes in the UDT, the same as a single tag of data type DINT. This is a waste of 2 bytes. Whereas an INT[2] array inside the UDT will still consume 4 bytes, wasting nothing.

Of course, all these finer details don't really matter unless your fighting to retain or recoup precious memory.

Another simple, but not always possible, task is to perform another download. This will recompile the code into contiguous memory and if there were sufficient changes of the right nature made since the last download then this could be surprisingly useful in freeing up memory.

Regards,
George
 

Similar Topics

Is there a way to change the memory allocation in a CompactLogic processor. I am runing out of "Data and Logic" memory but have tons of unused I/O...
Replies
4
Views
2,424
Hi folks, I'm not as accustom with Siemens & WinCC, however I've been asked to increase the amount of data an existing application is logging...
Replies
2
Views
62
Hi, Yesterday, I was at a customer site. I made one little change. Changed a dummy bool output to an actual output. I didn't add any tags, or...
Replies
15
Views
324
I have a c-more micro with a three digit input box on one of the screens. This is being written to a memory location in a DL05. I don't have the...
Replies
3
Views
107
Hello PLC friends. I've been going through a saga of diagnosing and fixing an old PLC setup that I inherited. I am learning as I go. Initial...
Replies
14
Views
333
Back
Top Bottom