LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Some Questions Regarding Case Structure

Hi Guys, sorry for the tons of question, need some help on this, i do not know if it is possible at all...

Please refer to image that i attached, I have a bigger case structure on the top of the image that has speed and distance, when i wire it out of the case structure, the output at point 'A' will give me 'zero' because the bigger case structure is false and it returns 'zero' because i have to set it to default if unwired.

What I wanted to ask is that is it possible to output the previous value instead of 'zero'? as there is alot of 0 inbetween the data that i will be receiving, I will get very weird XY Graph plot on the program.

Thank you!


Message Edited by Simmy on 05-21-2008 11:03 AM

Message Edited by Simmy on 05-21-2008 11:04 AM
0 Kudos
Message 1 of 5
(2,395 Views)
Since this is only a snapshot of a section of code, I can only guess what is going on elsewhere.  Is this part of a larger while loop?
 
If so, pass the data out of the case structure and send it to a shift register on the while loop.  Send the data from the left hand nodes of the shift register into the case structure.  Then, in the false case just wire through the shift register.  The shift register holds the value from the previous iteration of the loop and will keep sending that to the graph and updating the shift register in the false case.  In the true case, then the new value goes to the shift register and to the graph.
0 Kudos
Message 2 of 5
(2,391 Views)
wow, sounds like a solution, except that, it's too complex to me 😞 i'm still very very new to this software.... i have attached my VIs here, sorry for the mess. i'm still doing a prototype testing out various functionality. and yes you are right, it's inside a bigger while loop...



0 Kudos
Message 3 of 5
(2,389 Views)
I made a modification to your code to show the shift registers.  I also tried to clean it up a little bit.  It is very hard to determine what wires are going where as you have them flowing backwards.  Always try to have wires flowing from left to right and avoid having them going through the top or bottom of loops or case structures.  Try turning on autogrow on some of the structures such as the outermost while loop.  The read control quickly got hidden in the stucture by trying to move things around.  Autogrow option will prevent that.  With careful manipulation of your functions and structures, it should be possible to make it easier to read and take up less screen space.
 
I'm a little worried about the numerous stop buttons.  Unless the user knows the exact order to press them, they may get frustrated with trying to end the program.
 
Also, there is a >0 primitive that does the comparison in one step without having to wire in a zero.  Also, in one instance, you performed the same string manipulations and comparisons in parallel.  One of those can be eliminated.


Message Edited by Ravens Fan on 05-20-2008 11:47 PM
0 Kudos
Message 4 of 5
(2,380 Views)
WOW! so that's how it works! now i'm alot clearer! thank you!!!!!!!!! now i learn something today!(everyday!) thank you! everyone here is just so great!
0 Kudos
Message 5 of 5
(2,370 Views)