06-24-2011 06:57 AM
Hi
I have used a case instruction in my VI and I would like to compare the output from this case instruction with user input but the problem is when the condition of the case instruction is F my output becomes the default value "0" while I would like to keep the value in T situation .better to say I want to save the value of I and V (when case condition is true) in 2 variables out of the case instruction.Would you please help me how can I save these values?
06-24-2011 07:28 AM
Hi,
It is not very clear what you are actually trying to do. But what I undestood is you want to retain the value of a particular function when the case was true. For this you can pass that value into a shift register in the true case. Check the attached VI to know how to do it.
Regards,
Nitzz
(Give Kudos to good Answers and Mark it as a Solution if your Problem is Solved;))
06-24-2011 08:38 AM
If you uncheck "Use Default Value if Unwired" on the output tunnel, the box will be an open (white center) square rather than the partially filled box in your image and theVI will be broken, forcing you to wire something (such as the shift register suggested by NitzZ. Allowing Use Default if Unwired can result in unexpected behavior if you have not checked every case. Unless you are certain that that is the behavior you want, you will probably be better off without Use Default...
Lynn
06-24-2011 09:31 AM
Hi NitzZ
What you have done is exactly what I need to do just how can I use shift register out of my big case block.As you said I want to retain the value of I and V when the condition is true and keep the value unless I stop the vi manually.
06-24-2011 10:10 PM - edited 06-24-2011 10:13 PM
Exactly what NitzZ has done. Put your block diagram within a while loop and add shift registers to the while loop. You cannot create shift registers from a case structure. Considering your VI is not repeatable (looping), it is a sub-VI? In this case, wire a constant true to your conditional stop.