04-26-2011 12:59 PM - edited 04-26-2011 01:00 PM
I was editing an example and right clicked the Case Structure... to my surprise, LabVIEW 2010 offered a suggestion to replace it with a Stacked Sequence Structure...
Is this a good idea?
Many already know my answer... But what do others think?
04-26-2011 01:16 PM - edited 04-26-2011 01:25 PM
I agree that this is one of the most useless functions and I believe I pointed that out before several times. 🙂 (It probably goes all the way back to prehistoric LabVIEW versions).
More useful would be to convert between case and event structures, but it does not seem to be a very popular idea. 😞
(So... two ideas that need more votes!!!!)
04-26-2011 01:24 PM
I have not yet voted on your idea. It is certainly much better than converting to Stacked Sequence Structures.
I think the difficulty is the caveat that you pointed out in your idea thread. It cannot create event assignments... Which is the one issue holding me back from a vote... Maybe we can explore an alternative.. An suggest a change to the menu.. Or at least remove the Stacked Sequence from the selections.
04-26-2011 01:28 PM - edited 04-26-2011 01:29 PM
I edited my comment and added another link.
It seems since the inception of LabVIEW, there actually was a single person that used that option once according to the first reply. 😄
Maybe it's not totally useless after alll 😮 ...NOT!!!!
04-26-2011 03:46 PM
You got Kudoed..
I guess I am not the only one who thinks it is an idea that should be implemented.
04-27-2011 01:31 AM
I kudoed Christian's idea about 2 years ago. So I'm with you !
04-27-2011 01:19 PM
I just kudoed it but am having second thoughts after reading Aristos's comment. I have never needed that and didn't know it was possible. But I sometimes inherit code written by others and the more refactoring tools the better.
A better idea would be if the convert case structure to stacked sequence structure poped up a dialog asking why and posted the answer here.
04-27-2011 01:40 PM
A case structure is so fundamentally different from a stacked sequence structure that I have a hard time even imagining why we need to switch between them.
Sure, converting from a sequence to a case structure help in re-architecting a program to a state machine, but it typically cannot be cleanly done, for example because all sequence locals will disappear, potentially breaking a lot of code and making a tangled mess.
Converting from a case structure to a stacked sequence is really not needed, because the same functionality can be achieved by wrapping a FOR loop and wiring [i] to the case selector. This leaves the option open for a more full featured state machine in the future. Converting someting like this to a stacked sequence just because the cases execute in sequence is not reason enough to change it to a stacked sequence. There is no advantage! All we would do is painting outselves into a corner and making the existing code less flexible and less maintainable.
04-27-2011 02:08 PM
I totally agree and would be hard pressed to find a use for converting a case structure into a stacked sequence. The other way yes definately.
But it came in handy one time for one person. Since that will probably never happen again I am leaving my kudo on the idea
04-27-2011 03:26 PM
I totally agree with Christian.
The only case structure that would translate into a Stacked Sequence would be one that is indexed fromletys say 0 to n. But why would anyone ever want to do something silly like that? It's like taking a round wheel and making it square..!!!
D'euh!! (sarcasm intended)