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 make a boolean switch come back to its original off position when the simulation is stopped?

It is always easier to show (or explain) how to do something if you provide an example VI with the control you want.

 

There are two ways to do this.  One is as your program is about to exit, set the value of the Boolean Control (or Indicator) to False.  You can use a Local Variable to do this, though you may need to "anchor" it somehow (remember the Principle of Data Flow), or you can create a Value Property for this Control (which gives you an Error Line as an "anchor") and wire False to it.

 

The other way is to leave it alone when the program exits, and be sure to initialize it when the program starts (using the techniques in the previous paragraph).

 

Bob Schor

0 Kudos
Message 2 of 4
(1,923 Views)

Does the simulation stop by itself or are you stopping it with a control? How do you start the simulation? What else does the program do? What is the code architecture? What do you know about "mechanical action"?

 

Please attach some simplified code (VI, not pictures!) so we can give more specific advice.

0 Kudos
Message 3 of 4
(1,899 Views)

Hi Neha,

 

I guess this is still related to your other thread!? Either ask in that thread or provide a link to it…

 

To change a control value programmatically you can write a new value to a local variable of that control.

 

Did you already finish the Training resources?

Best regards,
GerdW


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