memory location already used ?

NULS_DT

New Member
I have a student who is using a 40X device, and has written quite a large programme, he is using multiple subroutines ( 15 ) though none of these are nested. When he tries to programme the device it gives an error message " memory location already used" The programme indicator shows there is still a reasonable amount of memory left.

We reduced the number of subs used, and the problem went away, but to make the programme work using fewer subs he put decision commands into the remaining subroutines, and the same error message came up. Can anyone help me please.
 

hippy

Technical Support
Staff member
Welcome to the PICAXE Forum.

Is it possible for you to load a Flowchart file (.plf) to the forum which demonstrates the problem then we can take a look at it.
 

nick12ab

Senior Member
What version of Logicator are you using?

There was a previous case of that message appearing but it was related to EEPROM being shared with the program memory which it is not on the 40X.

I also just created a test flowsheet with 15 subprocedures (you can find it attached) which did not create any error message.

Older versions of Logicator didn't work well with big programs and for that the workaround was to use the 'Convert to BASIC' feature in Logicator and download the code using Programming Editor or AXEPAD. Try upgrading to the latest version of Logicator.

If these suggestions don't fix the issue, upload the flowsheet in question using the attachments feature.
 

Attachments

NULS_DT

New Member
We are using version 3 build 5.1

I will try loading via basic first, and send a copy of the programme on Friday
 

nick12ab

Senior Member
Corruption?

Have you tried reconstructing the flowsheet from scratch? From the sound of your quote below from this thread, your flowsheet is corrupted.
Hi,
I read this with interest, I have had this problem many times. It is almost as though a section of the page becomes like the bermuda triangle, when the programme flows through it it just disappears. The only way I found around it was by making the screen size huge and moving the programme to another area.
Recently basil60 was getting an "Error in flowsheet" message in a flowsheet that looked like it was OK. (Click here to view relevant thread) I reconstructed the flowsheet from scratch and it worked so his version must have been corrupted. The odd behaviour you're experiencing (in the quote) strongly suggests that your flowsheet is corrupted so I strongly recommend that you rebuild the flowsheet from scratch.

We reduced the number of subs used, and the problem went away, but to make the programme work using fewer subs he put decision commands into the remaining subroutines, and the same error message came up. Can anyone help me please.
It's likely that the subprocedures you deleted are affected by the corruption.

If after reconstruction your flowsheet still does not work, upload your flowsheet as an attachment. If you do not know how to do this then see the attached image for reference. If the flowsheet is too big, put the .plf file into a zipped folder and upload that.
 

Attachments

nick12ab

Senior Member
Update

Hippy has talked about the corruption issue before as being where the connection lists get shaken up.
The problem seems to be where connections have been made, deleted, and re-made multiple times so cutting and pasting may 'shake up' the connection lists so they make sense again when they did not before, or at least reveal those which 'don't make sense'.

We are investigating what the cause of the problem is but this is not that easy as it's a rare occurrence and, when we have an example of failure, it's not possible to see the history which led up to it.

Logicator is primarily an educational tool and for more advanced, complicated, and significantly complex programs it may be worth considering the Programming Editor and using the BASIC-style programming language. IMO, there comes a point where program complexity makes flowcharts less understandable and the program more difficult to follow or modify than the equivalent textual programming language.
That last bit is the important bit. If it's a large program then your student should move onto BASIC programming. As you say that it's a large flowchart, then your student will end up struggling to fit the flowchart in his paperwork.

big flowchart.jpg

I switched two years ago and have never returned to Logicator to write programs for myself.
 

nick12ab

Senior Member
Has the problem been fixed? If so, please post how you fixed it. If not, can you upload your .plf PIC-Logicator flowsheet?

If you stumble across the solution yourself, it's still important to post the solution in order to help others who may experience the same problem in the future.
 
Top