09-09-2014 04:15 AM
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.
Solved! Go to Solution.
09-09-2014 04:25 AM
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.
09-09-2014 09:17 PM
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?
09-09-2014 09:34 PM
borth VIs are subVIs, so simply wire the desired starting values to the inputs in the calling VI.
09-09-2014 09:41 PM
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.
09-09-2014 10:10 PM - edited 09-09-2014 10:10 PM
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.