Stack error

Technoman

Senior Member
#1
Hi,

I am testing a solution to choose between 5 speeds using some basic code embedded within a Basic Cell.
The downloaded program seems to work (without led flashing), but when I add a call to a subroutine to flash a LED at every change in speed, I've got an error message, during simulation, saying that there is a stack error.:(
Stack error.jpg

I tried using a different variable... still the same!
View attachment Test pwmout 2.plf
 
Last edited:

nick12ab

Senior Member
#2
It's Logicator's fault. The error message goes away when the SPEED_TEST gosub cell is changed to execure more than once and the variable is manually set to something else.
 

Technoman

Senior Member
#3
Thanks.

I set the variable to an another letter : it works. Still working when I reset the number of times to 1.
Then I retried to set it back to H (variable by default), I got the same error. I discovered that you have to change the number of to run first to be able to set the variable.

Question : when the gosub is set to execute once, does-it use any variable (the letter is greyed out)? I guess not...
 

Technoman

Senior Member
#5
Obviously there is no apparent reason for getting an error message.
I noticed than varH is affected to b7 and varI is affected to b14 ; b8 to b13 are skipped. A reserved memory space?
symbol var.jpg
 

nick12ab

Senior Member
#6
I noticed than varH is affected to b7 and varI is affected to b14 ; b8 to b13 are skipped. A reserved memory space?
The skipped variables are used for commands that are hidden from the user but require additional variables (e.g. bintoascii, used by the LCD cell) and older versions of Logicator only have user accessable variables that go up to varH so when the extra variables were implemented a gap was left to maintain compatibility with flowcharts using these variables in BASIC cells.
 
Top