Ton Plomp Posted May 2, 2006 Report Share Posted May 2, 2006 Hi all, in addition to the 'exit for loop' discussion over at NI, i have the following wishes: 'Merge Flat sequence structure', this would allow to merge two sperate sequence structures into one, 'Split Flat sequence structure', allow you to ad a sequence based on selected items 'swap sequence structure', swaps sequences 'dynamic select case', maybe based on rings any other options? Ton Quote Link to comment
Phillip Brooks Posted May 2, 2006 Report Share Posted May 2, 2006 Why not use a state machine? I can appreciate your desire for additional functionality, but sequence structures are not as flexible as a state machine. Do you continue to use sequences regularly in your code If you use state machines, you can do much of what you want. Use typdef'ed enums to drive the cases in your state machine. If you need to add a case, edit the typdef, add the case in your while structure and voila! You can rename your cases by editing the typdef, you can duplicate a case intead of add, then delete redundant parts from each to "split" the "frame". I can't begin to imagine the problems merging two sequences with their own locals especially if each contained controls, indicators and local variables (as they too often do ) The sequence structure reminds me a bit of line numbers from BASIC, they continue to exist primarily for compatability. One of the things I've noticed on the NI discussion forums you reference is that most people say "don't mess with what works". Sequence structures ARE useful when you need to control data flow, but don't try to turn them into a state machine or you'll go crazy. I've debugged too many sequences inside sequences inside sequences with 15+ frames each. The inner most sequences are often cut/paste from previous upper level frames. These are much more easily handled and modified using sub-vis, loops and a state machine. "Queued State Machines: Where do you want to go today?" (Oops, that slogan is already taken ) Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.