01-14-2008 09:29 AM
01-14-2008 10:53 AM - edited 01-14-2008 10:53 AM
01-14-2008 11:27 AM - edited 01-14-2008 11:28 AM
01-14-2008 12:07 PM
JeffOverton wrote:
"Not programmatic" means that I know exactly what and when everything will be written. There is no user input. However, I figured out that my problem was just sloppinessIf there is no user input, then I would be more inclined to call it "programmatic"!!3/4 of the way through the code was the final major step except for cleanup, and I had unwittingly left a boolean in from testing earlier that ended the codeThat could do it.The overall problem, and I'm still not sure about this, was that I apparently wasn't closing the subVI reference in the shell properly. There had to be some data or reference still open to the FG after one of the subvis ended, because I explicity closed all my references and solved my problem. I'm still not sure why that would matter, since the subvi ran and ended and should have dropped all calls to the global. Does any of this make sense to you?Functional global sub VI's maintain a presence in memory along with their previous states of the uninitialized shift registers as long as the calling VI's are open. So all VI's and subVI's would have had to ended and been completely unloaded from memory in order for the functional global to also be unloaded. That is pretty unlikely to happen with most common programming practices. If you need to have a FGV start fresh at some point, the best practice would be to be sure to have an "Initialize" case that you can call when needed to reset all the uninitalized shift registers back to some default values.
Message Edited by JeffOverton on 01-14-2008 11:28 AM
01-14-2008 02:41 PM
Thanks for the clarification on the FG memory usage. Those are the kinds of tips I really appreciate, because they let me get a more intuitive feel for LabVIEW, reducing the number of times I have to bother you nice folks. I actually have it initialize at the beginning of a for loop in the shell, so I guess my good practices are getting better.
Also, you're probably right on the "programmatic" thing. I guess it was the word that popped into my head because non-UI controls are easy to code compared to accounting for all the various things a user can do wrong (hence a lot of programming).
01-14-2008 03:29 PM
01-15-2008 07:31 AM - edited 01-15-2008 07:32 AM
01-15-2008 07:49 AM
Oh, I also just noticed this. Given the FG below, will this blank/delete/reinitialize all data that's not wired on a "write" command?
01-15-2008 08:18 AM - edited 01-15-2008 08:19 AM
Alright, never mind, I guess. If I force the VI to invoke Default Vals.Reinit All before I close the reference to it, it resets the boolean that ends screen updates.
Which actually brings up a good question. How was the boolean not resetting to its default value when the VI had finished running and I had closed all the references to it? Does it stay in memory in the same way that a functional global does?