Keep track of how many times a function has been run

THANK YOU guys for all your help and advice, I appreciate it!

@alto777 - I'm trying to code a "Finite State Machine" for a prototype I'm working on.
I've already tried using Yakindu (software specifically designed for creating "FSM's") to help me with the control structure of my code. Unfortunately, it's not really user friendly; the learning curve is pretty sharp.
This is essentially what I'm trying to accomplish.

@markd833 I was asking how to keep track of how many times a function (successfully) has run because some of them will need to be repeated over and over until a "complete" flag would indicate otherwise.
I like your SD card idea though to keep track of what "state" my machine is in if it's powered down. That would be helpful.