LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

initialize Boolean control

Solved!
Go to solution

In a large VI i need to implement a subVI which chooses between 3 schemes (already existing subVI is attached). The problem is each time I start the simulation the scheme chosen from previous simulation is retained. How do I initialise the boolean controls such that all schemes are unselected at the start of new simulation.

0 Kudos
Message 1 of 6
(3,720 Views)

We don't have the RS_FlipFlop VI that this VI calls.  So I'm guessing those are what you want to initialize.  The simple way is to pass in a Reset boolean.  So you initialize the values when the Reset is set to TRUE.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 6
(3,712 Views)

Sorry my bad, I've now attached the RS Flip flop subVI. My query is what do you mean Reset Boolean? And since the SingleSelect subVI is in the somewhere in the middle state of the state machine, should the indicators be reset during the initial state?

Download All
0 Kudos
Message 3 of 6
(3,663 Views)

borth VIs are subVIs, so simply wire the desired starting values to the inputs in the calling VI.

0 Kudos
Message 4 of 6
(3,655 Views)

Yes but since the Single Select subVi is within a case structure within a while loop, every time u stop the program the values get cleared but when u restart the program and reach the state with the Single Select subVI the boolean controls get reinitialised to whatever the choice was in the previous iteration. How do I avoid this? Initialising the LEDs in the initial state doesn't help as the values are already set using the R-S flip flop.

0 Kudos
Message 5 of 6
(3,652 Views)
Solution
Accepted by topic author shreya005

Even your "singleselect.vi" is a subVI, as can be seen from the assigned connectors. Simple wire all false to the inputs when you call it. How are you calling it?

 

Du you want to initialize the shift register is the flipflop subVI? Use the "first call" primitive and some boolean logic.

0 Kudos
Message 6 of 6
(3,645 Views)