LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

initialize Boolean control

Solved!
Go to solution
Highlighted

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
(1,455 Views)
Highlighted

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
0 Kudos
Message 2 of 6
(1,447 Views)
Highlighted

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
(1,398 Views)
Highlighted

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


LabVIEW Champion. It all comes together in GCentral GCentral
What does "Engineering Redefined" mean??
0 Kudos
Message 4 of 6
(1,390 Views)
Highlighted

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
(1,387 Views)
Highlighted
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.


LabVIEW Champion. It all comes together in GCentral GCentral
What does "Engineering Redefined" mean??
0 Kudos
Message 6 of 6
(1,380 Views)