LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Compiled vi always runs when opened, Labview 2013 bug?

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.

0 Kudos
Message 11 of 23
(1,158 Views)

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.

Lars Melander
Uppsala Database Laboratory, Uppsala University
0 Kudos
Message 12 of 23
(1,152 Views)

Hi Lars,

 

it is not expected to "always and forever run", it is expected to "run when opened".

That's quite a difference!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 13 of 23
(1,150 Views)

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.

0 Kudos
Message 14 of 23
(1,145 Views)

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. 😄

 

From the help

 


Note  LabVIEW ignores this option in the following scenarios:

  • When you use the VI Server to load the VI. Use the Run VI method to run a VI you use the VI Server to load.
  • When you designate the VI as a startup VI in a built application. Startup VIs run when they are opened by default and LabVIEW overrides the option you set in this dialog box. You can configure a startup VI to not run when it is opened when you configure the build specification. On the Source File Settings page of theApplication Properties dialog box, click the Customize VI Properties button. In the VI Properties (Application Builder) dialog box, remove the checkmark from the Run when opened checkbox.

 

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.

0 Kudos
Message 15 of 23
(1,134 Views)

"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.

 

Lars Melander
Uppsala Database Laboratory, Uppsala University
0 Kudos
Message 16 of 23
(1,115 Views)

I agree that the help is somewhat contradictory 😉

 

 

0 Kudos
Message 17 of 23
(1,105 Views)

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,

 

 

Tom L.
Message 18 of 23
(1,084 Views)

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. 

Capture.PNG

 

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.

 

 


"Should be" isn't "Is" -Jay
Download All
Message 19 of 23
(1,083 Views)

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. 😮

Message 20 of 23
(1,075 Views)