11-20-2013 09:44 AM
If you want it to run continuously, then you need to have a while loop in it.
Please don't tell me that when you were creating this VI in the development environment you were using the "Run Continuously" button.
11-20-2013 09:48 AM
I was not using the "run continuously" button, no, but if a compiled vi is expected to always run, then that would be the logical behaviour.
11-20-2013 09:50 AM - edited 11-20-2013 09:50 AM
11-20-2013 10:01 AM
Your program, if it is not controlled by a loop, will only run once.
If you want continuous execution you need to program it that way. If you want something like when you press "Run continuously" in development mode, then you'll have to program that I'm afraid. The mode of execution in an EXE is comparable to a single click of the "run" button in the IDE.
Melander. It's a few years since I came across that name. It always sparks memories of the Snork Maiden and such.
11-20-2013 10:35 AM - edited 11-20-2013 10:49 AM
A LabVIEW executable should run when opened and close when done. A stopped program is pointless, since you cannot edit anyway. The easiest would be to look at the help. Takes 5 seconds and is much faster than posting here and waiting for an answer. 😄
Note LabVIEW ignores this option in the following scenarios:
As you can see, the option is ignored for startup VIs.
If you need to enter values before running the main code, a state machine is the answer. have the program start up in the idle state, then progress into a processing state.
11-20-2013 12:14 PM
"You can configure a startup VI to not run when it is opened when you configure the build specification."
The help text contradicts what you are writing. Maybe you should follow your own advice.
11-20-2013 12:43 PM - edited 11-20-2013 12:56 PM
11-20-2013 01:11 PM
I have to admit that I'm also a bit confused- the build option does seem to work, at least on my machine. Example attached. Built in 13.0.0. This KnowledgeBase also indicates that this should work:
KnowledgeBase 1MA7L97T: Why Does My LabVIEW Application Default to "Run When Opened"?
http://digital.ni.com/public.nsf/allkb/F5E0C938A602A7028625678D004B4F5A?OpenDocument
LarsM- Could you provide an example of a case where the option you're using fails?
Regards,
11-20-2013 01:12 PM
OK lets revisit it.
Yes you can get a startup vi to launch without running. note the two builds in the attached .zip
Why you would chose to launch an application without running the top-level vi is the point of our questions.
Christian got bit by a common miss-reading of that help file line- the "Run when opened" property cannot be set to "Use vi Property" this is the meaning behind "the setting is ignored. By default a start-up vi is set to run when opened irrespective of the vi properties. You can change it BUT, some would argue this should NEVER have been exposed since it is very bad programming practice. However: the attached zip contains a build of the same vi with each run when opened option set.
I hope I made it clear that this is a silly way to configure a build spec to get around coding a proper UI.
The source file is also attached.
11-20-2013 01:20 PM - edited 11-20-2013 01:21 PM
Yes, I got confused. Back in LabVIEW 8.2 (?) there was a bug that did not allow the setting work (exe runs even if told not to in the builder). I think I even posted a workaround, placing a small while loop with an USR, that would immediately stop the VI when it run for the first time, but not at later runs.
In any case, disabling "run when openend" only makes sense when exe debugging is enabled. Also applications typically have the toolbar and LabVIEW specific menu entries removed, in which case you would not even be able to run the exe if it start as not running. 😮