Hello! I'm on my 4th re-code of a program (re-doing the code as I learn better methods) and I have two questions. First...here is my setup.
IThe front panel of my main VI contains several boolean indicators as well as several text indicators. The program runs 5 looping state machines, each of which updates corresponding boolean and text indicators on the front panel. I originally passed one reference for each indicator to each of the subvi/state machines and used that to update the front panel. The state machines run continuously and I'm worried that I'm eating up memory (how much I'm not sure) by not closing these individual references. Not to mention my state machines look like porcupines with all the references being passed to the subVIs.
So what is the best way for this application? In my search on here I discovered some people were passing an array of references. My question is since my state machines keep running in cycles, I'll never close these array references. Do they use up more memory everytime a reference is used to change a value? What happens when I use a reference to change a value in a few different states of the machine?
Lastly the other question I have is what is a good method to set initial values for controls and indicators on the front panels? I have been just using a stacked sequence where the first sequence is all the default values being passes to all the indicator/control via references. This seems clunky to me. Does anyone really trust "Set as Default Values"?
Thanks for the help! I'm also aware that I'm dancing on a line of "these questions have already been answered" but the fact that my state machines never stop unless the entire program stops running has put a bit of a twist of it (at least it is my belief that it did).