Showing results for 
Search instead for 
Did you mean: 

best way to split a flat sequence

Go to solution
I have a long sequence, and I need to split it to encompass almost exactly one half into a while loop.  What is the best way to do this?  There is a lot of data flow in and out of each frame, so reconnecting everything would be messy and error prone.
0 Kudos
Message 1 of 3
Accepted by topic author pschmal

That is one reason sequences are not usually the best choice for a program architecture.  Dataflow can provide most of the "sequencing" that is required.  


Simply removing the sequence will leave the dataflow connections intact.  That may be all that is needed, if you are lucky.  Then you can stretch the loop over the part you want inside the loop.


SubVIs may be a good choice for  encapsulating related portions of the code.


Beyond that, without seeing the code it is difficult to recommend options. 


If you need to split it in half and do not want to rewrite everything, try duplicating the entire sequence.  Put the duplicate into the while loop.  Delete the last half of one sequence and the first half of the other.  If there are controls or indicators inside the sequence, they will get duplicated also and this can get messy.



0 Kudos
Message 2 of 3
Yes, I am doing what you are suggesting.  Unfortunately I am controlling multiple pieces of equipment (multiple movements and measures) and do not want the equipment moving during measurement.  I'm going to try to do a 'quick measure' VI where the equipment is moving during measurement, but I'm not sure if the error of delay of sending the measurement is repeatable, or even if I can access my stages to report their positions while moving.  Thanks for your help!
0 Kudos
Message 3 of 3