LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
sbus

Splitting and exiting flat sequences

Status: Declined

Any idea that has received less than 2 kudos within 2 years after posting will be automatically declined. 

Right now when you create a flat sequence, you can use the right-click context menu to remove, add after, add before, or delete frames. You can also remove the flat sequence. The only way to exit the flat sequence is to process thru all frames in the sequence.

I run into the situation where I've created a flat sequence with lots of frames - and then in proicess of finishing my code, I either (1) detect an error condition in a frame that I would like to use to skip the remainder of the flat sequence, or (2) discover that I'd like the rest of the flat sequence to differ based on a case statement, or (3) come to an error or other condition that makes it necessary to exit the sequence without processing thru the rest of the frames.

There are several things I'd like to see added to flat sequences:

1. On the context menu, add "split sequence" before "remove sequence". This would only work when you right-click from a vertical frame divider and would separate the flat sequence at that point into two separate sequences. This solves the problem of wanting to do that manually - now you have to make a copy of the sequence you want to split, and delete the appropriate frames from each copy one-at-a-time. This is a pain.

2. Add a conditional terminal "exit sequence" that you pass a boolean to - if true, is skips the rest of the frames in the sequence.

There is no functionality added by my suggestions that can't be done manually now - these are user interface suggestions to make flat sequences more programmer-friendly.

 

 

6 Comments
rgvdh@rdf
Member

I'm kudoing the idea of the "split sequence" action.  There are times where I realize that some of the frames of a sequence aren't really needed, but I don't want to get rid of the whole thing and then have to rebuild the part(s) of it I still want. 

 

However, I don't really want to add terminals/functionality to what's currently a very easy-to-understand construct, I just want to make it easier to manipulate the current structure.

johnsold
Knight of NI

All of the reasons you suggest for modifying the sequence structure are actually easy to implement in a state machine.  The sequence structure has very few places where it is the choice of experienced LV programmers, while the state machine is very widely used.

 

Do not modify the sequence structure.  Use it only when truly necessary.

 

Lynn

sbus
Member

This is a user-interface idea to make code entry easier. It has nothign to do with functionality. I'd just like the option to split (and unsplit/join) sequence structures. This is an editing tool. It has nothing to do with the code itself. It's to make entering code easier.

Dennis_Knutson
Knight of NI

Adding the ability to exit a sequence structure early is certainly not an editing tool. I agree with Lynn and don't see much reason to modify the sequence structure. If you need to modify execution flow, then the state machine is what should be used.

AristosQueue (NI)
NI Employee (retired)

I'm going to throw my R&D two cents in here in support of "what Lynn said". You've built a flat sequence structure when what you need is a case structure inside a while loop. You can popup on the flat sequence and choose "Replace with Stacked Sequence" and then you can pop up on the stacked sequence and choose "Replace >> Replace Case Structure". Having done that, put a while loop around it and wire the [i] terminal to the ? terminal. Now you have a way to abort the loop at the end of any frame (by wiring out a True from that frame to the stop termnal of the while loop).

 

Adding editing support to the Flat Sequence is something I generally oppose because the vast majority of the time when someone wants something fancy on the Flat Sequence, what they really need is something entirely different, and the pain of editing the Flat Sequence is a big hint that "you're on a not-well-trod path and perhaps you should go another way."

Darren
Proven Zealot
Status changed to: Declined

Any idea that has received less than 2 kudos within 2 years after posting will be automatically declined.