05-07-2014 06:28 AM
I have a true/false case structure as below. I am using it to run some code when an input is true. False condition is empty.
after performing some calcs I tunnel the value out, I wish the false condition to hold the same value,
how do I achieve this?
Use default if unwired returns a 0 value which I don't want.
Thanks
Solved! Go to Solution.
05-07-2014 06:52 AM
Use a feedback node or a shift register to hold the value. The value from the FB Node can then go into the structure. In the false case, just wire up the input and output tunnels.
05-07-2014 06:58 AM - edited 05-07-2014 07:01 AM
Can you please further explain.
The while loop is only available in the true case, the false case is empty.
where do I create the shift register?
05-07-2014 07:28 AM
You create a shift register on the case structure.
05-07-2014 07:37 AM - edited 05-07-2014 07:38 AM
hydzik wrote:where do I create the shift register?
I assume that this is running inside of another loop. You would put the shift register on the loop. If not, then use a feedback node.
05-07-2014 08:29 AM
Why not just use a local variable in the false case?
05-07-2014 08:33 AM
Hi aputman,
in LabVIEW you trust the DATAFLOW! And the wire is the variable!
So shift registers (or feedback nodes) are the preferred way to store data from one iteration to the next.
Local variables create data copies (as they don't follow the DATAFLOW) and are prone to race conditions…
05-07-2014 08:38 AM
@aputman wrote:
Why not just use a local variable in the false case?
Let me go ahead and answer that: There are a few reasons:
The FBN is the preferable change
05-07-2014 08:43 AM
I understand dataflow just fine. However i didn't know that FBN could be used outside of loops. Makes sense now.