Home
Prox / RFID
Verichips
Ladder Logic
[interfacing] †
Tube Joints
Key Code From Photo
SolveSpace (3d CAD)
SketchFlat (2d CAD)
Photographs
Miscellany
Resume / Consulting
Contact Me

LDmicro Forum - Out of Memory- Error?

(you are viewing a thread; or go back to list of threads)

Out of Memory- Error? (by Andrew M)
Hi,

I've created the attached program and when I go to compile the code, I get the "Out of memory" error. This is however very similar to a previous version which was only taking 34% of the available space and I was wondering, what it is I've done exactly, that has taken so much extra space?

Theres only a couple of extra timers and a new loop.

Could someone take a look and tell me what are the most memory intensive elements of the ladder so that I can streamline it a bit?

Best

Andrew M
Mon Aug 15 2016, 20:14:15, download attachment Bike 1.8.ld
Previous version (by Andrew M)
This is the previous version that compiles fine at 34% Why such a huge difference?
Mon Aug 15 2016, 20:17:48, download attachment Bike 1.7.ld
(no subject) (by MGP)
You use too many timers, I had this before, it eats up your 386 bytes RAM space not the program space (34%).

See rung 28, that is a waste of memory!
Tue Aug 16 2016, 02:27:43
(no subject) (by Andrew M)
Thank you, I'll have to do that another way! Is there a preferred way to do long duration counting without timers? Exact timing isn't important on this but it needs to be about 3mins
Tue Aug 16 2016, 04:35:30
(no subject) (by Ihor Nehrutsa)
to Andrew M

"Out of memory; simplify program or choose microcontroller with more memory."
This message indicates a lack of RAM memory, not a program memory.
All versions LDmicro use only the bank 0 of the RAM. In PIC16F876 it 96 bytes.

May be you can set PLC cycle time 10ms or more, instead 1ms. It allow create longer timer delays.

I try to use all banks of RAM. But it will be after 25 August.
Now I am in read only forum mode.

Best regards.
Tue Aug 16 2016, 08:22:04
A long timer example (only one variable) (by DanieH)
Dear Andrew M.

Attached a long timer example, full of comments.

Best regards,
DanielH
Tue Aug 16 2016, 11:04:21, download attachment timer_by_heartbeat.ld
(no subject) (by Andrew M)
Thank you for the example, I had to change the outputs to internal relays for it to work though.

Does this actually save on RAM then? Its still having to perform counting operations
Thu Aug 18 2016, 10:03:35
(no subject) (by Ihor Nehrutsa)
Internnal relay Rx use 1 bit of RAM, output Yx not use a RAM, only bit in port.
Fri Aug 19 2016, 20:18:21
(no subject) (by Ihor Nehrutsa)
to Andrew M

please test Bike 1.8.ld with

https://github.com/LDmicro/LDmicro/releases/tag/4.0.1

== Release 4.0.1 experimental

* All banks of RAM can be used.
Tue Aug 30 2016, 08:47:20
(no subject) (by Ihor Nehrutsa)
to Andrew M

If you have Proteus (v7.10) project I can test it.

Send it to [email protected]
Tue Aug 30 2016, 08:58:19
(no subject) (by Ihor Nehrutsa)
to Andrew M
As your byke1.8 project?
Wed Aug 31 2016, 17:16:09
Post a reply to this comment:
Your Name:
Your Email:
Subject:
(no HTML tags; use plain text, and hit Enter for a line break)
Attached file (if you want, 5 MB max):