Page 1 of 1

Clear Macro Calls

Posted: Wed Apr 06, 2016 7:11 pm
by JLeith
Hello All

I'm trying to find if there is a method or procedure to clear the Macro Call Lists

I have 3 steps in my project and I really would like to remove the "Main" Call Macro.

When I power up I run
Main --- Start ----Wait

In Main I establish the componets and parameters.
In Start I write the values into the LCD
In Wait I wait for a Interrupt and them call Macro's to resopnd to the Interrupt.

I don't need the Maco "Main" or "Start" to remain in the Macro listing ?

When I program runs it loops back to Main and clears my LCD values ?
After I do the Action Call to display values on the LCD I would loop back to "Wait" for another interrupt.

John

Re: Clear Macro Calls

Posted: Wed Apr 06, 2016 8:27 pm
by medelec35
Hi John,
What you are looking at it the Macro stack.
Since Main is the Main macro it will always be shown.
When a call macro is encountered, the Main macro will drop down the list by one.
When a another call macro is encountered, Main will drop down the list by another one place.
the two call macros are sub routines of Main.
Only when you exit both subroutines you will be back in Main.

So no you can never remove Main as that is part of C structure.
Flowcode converts flowchart symbols to C so Main will always play a part.
Don't forget the only macro that's currently active is the one that's at the top of the list.
All the others are just stored on the 'stack'

Martin

Re: Clear Macro Calls

Posted: Wed Apr 06, 2016 8:33 pm
by kersing
You can not remove main as it is where your program starts and which calls the other macros. If your code returns to main while it should stay in Wait there is an error in your flowchart or logic. I would personally move the code from the Wait macro to main if that is the main code (where your code spends most time) of your program.

Re: Clear Macro Calls

Posted: Wed Apr 06, 2016 11:50 pm
by JLeith
Thank you Martin & Kersing

I thought that was the fact that Main is always a fall back.

I will try and move my code around.

John

Re: Clear Macro Calls

Posted: Thu Apr 07, 2016 8:15 am
by lordhex
Main call => To do list value =0
if todo list value =0 ?
Yes = do something. then make value 1
No= Do nothing.
Can be help to you.