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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to use RUN_TIME_ENGINE==TRUE ?

Solved!
Go to solution

I thought RUN_TIME_ENGINE==TRUE in the conditional disable diagram means that the code inside will only run after compiled as an application. But it turns out that the code will also run when I simply run the VI. What am I missing here?

0 Kudos
Message 1 of 5
(5,689 Views)

You need to set Conditional variable in Project properties. What you're after is probably easier to do with App-property node and check Application Kind.

ApplicationKind.png

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Message 2 of 5
(5,682 Views)
Solution
Accepted by topic author AuZn

yes, RTE==true means this code executes in application. Other case is RTE==false (and default). 

RTE detection.png

snippet is from vi (development mode), so this is grayed out.

PS. no need to set Conditional variables in project for this.

Message 3 of 5
(5,652 Views)

Make sure that you also created a case RUN_TIME_ENGINE==FALSE where there is no code (or whatever code you want to run when you are in the LabVIEW environment). If not, the RUN_TIME_ENGINE==TRUE will run by default.

 

Also, there is a benefit in using the conditional disable structures instead of App-property node and check Application Kind with a case structure. With the conditional disable structures, the code that is not run is not even compiled. It means that you can have missing drivers for example, and if the condition is not satisfied, your VI will still run.

Marc Dubois
0 Kudos
Message 4 of 5
(5,642 Views)

Thanks for the hint to check for greyed out code.

 

Apparently I mistook diagram disable structure for conditional disable structure. The former one does not work with RUN_TIME_ENGINE==TRUE for sure.

0 Kudos
Message 5 of 5
(5,639 Views)