From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
09-25-2014 10:19 AM
Hi,
I have a LabVIEW program that I have been building in 2012, but recently upgraded to 2013. The App.Kind Property Node sends the LV Environment to a Case Structure that determines whether to stop the program (Development Environment) or to close the program (Run Time Environment). Every build using 2012 closes the program without any issues, but when using 2013, the program stops, but my indicator output reads "Run Time System". Is anyone aware of a difference between 2012 and 2013 (Run Time or Development Environments) that would require I change something or that would suggest this would not work? Any help is much appreciated.
Below is an image of the Case Structure and the GUI's Indicator response during an Application execution.
Thanks,
Adam
Solved! Go to Solution.
09-25-2014 10:50 AM - edited 09-25-2014 10:51 AM
First of all, you should NOT be using the Quit LabVIEW primitive. That is like crashing LabVIEW to stop your executions. If this is your top level VI, just close the front panel with an Invoke Node and the LabVIEW Runtime Engine will close when all VIs are done running.
Secondly, use the Conditional Diagram Disable Structure instead. It is more efficient and uses less space (no need for the property node to get the execution system).
09-25-2014 10:55 AM
I would suggest a different way of exiting. Using that exit function is like pulling the plug on a computer before it shuts down. Let the program shutdown naturally when it has no more commands to process.
My suggestion is when your program first starts, check to see if the FP.Open is true. If so, that means you are in development system and you won't be closing it when exiting. If App.Kind is Runtime System, you will be closing. So set a variable at the initialization phase of your VI and when it comes time to exit, check this variable and if you want it to close, use the FP.Close command. Do nothing in the opposite case. You have to make sure that your VI does actually exit because closing the front panel doesn't mean that the VI stops running.
09-25-2014 11:32 AM
aputman wrote:
My suggestion is when your program first starts, check to see if the FP.Open is true. If so, that means you are in development system and you won't be closing it when exiting. If App.Kind is Runtime System, you will be closing. So set a variable at the initialization phase of your VI and when it comes time to exit, check this variable and if you want it to close, use the FP.Close command. Do nothing in the opposite case. You have to make sure that your VI does actually exit because closing the front panel doesn't mean that the VI stops running.
That sounds like way too much work. Conditional Diagram Disable does it all for you and has the benefit of being removed from the compilation when in the development system.
09-25-2014 11:35 AM
@crossrulz wrote:
aputman wrote:
My suggestion is when your program first starts, check to see if the FP.Open is true. If so, that means you are in development system and you won't be closing it when exiting. If App.Kind is Runtime System, you will be closing. So set a variable at the initialization phase of your VI and when it comes time to exit, check this variable and if you want it to close, use the FP.Close command. Do nothing in the opposite case. You have to make sure that your VI does actually exit because closing the front panel doesn't mean that the VI stops running.
That sounds like way too much work. Conditional Diagram Disable does it all for you and has the benefit of being removed from the compilation when in the development system.
OK.
09-25-2014 11:48 AM
Thank you both for your help. I replaced the Exit with the FP.Close Invoke Node and it works! I really have no concern with time or effeciencty at this part of my application, so I can't justify changing structures if it works as-is.