LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

what is difference between flat sequnce ad d stack sequnce

 
0 Kudos
Message 1 of 9
(3,724 Views)

As far as I know, the only difference is a flat sequence puts each frame in view -- one after the other so you can see each frame.  The stacked sequence only shows one frame at a time -- one on top of the other so you can only see one frame at a time.

 

The advantage of the flat sequence is no code is hidden -- you see each frame.  the advantage of the stacked sequence is it takes less space on your block diagram.

 

Hope this helps,

Tom

0 Kudos
Message 2 of 9
(3,720 Views)
Hi Tom and ezeemon,

there's another (quite important) difference:
In the flat sequence the outputs are not neccessarily at the last frame! You can have output in the first frame and any code that depends on these values will execute parallel to the rest of the sequence!
The same applies to inputs: when you have a wire at the 2nd frame, than the flat sequence will execute it's first frame immediatly and will wait for the 2nd frame until the input is available!


Message Edited by GerdW on 01-29-2008 01:51 PM
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 9
(3,716 Views)

Thanks GerdW,

 that's very good information.

 

Tom

0 Kudos
Message 4 of 9
(3,711 Views)

Tom Haggerty a écrit:

 The stacked sequence only shows one frame at a time -- one on top of the other so you can only see one frame at a time.


Therefore (extract from the LV help) :

Unlike in the Stacked Sequence structure, you do not need to use sequence locals to pass data from frame to frame in the Flat Sequence structure. Since the Flat Sequence structure displays each frame on the block diagram, you can wire from frame to frame without using sequence locals and without hiding code.

Since LV7, there is another difference between both structures when data is passed out of the sequence frame. See this link and attached example.
Message 5 of 9
(3,708 Views)
Some minutes to make a piece of code and meanwhile GerdW posted an answer... At least you have now an example that shows what we are speaking about.
0 Kudos
Message 6 of 9
(3,706 Views)

Thanks JB,

The example shows the advantage of the flat sequence very well!

 

Tom

0 Kudos
Message 7 of 9
(3,702 Views)


GerdW wrote:

when you have a wire at the 2nd frame, than the flat sequence will execute it's first frame immediatly and will wait for the 2nd frame until the input is available!

This is an important point to remember - it means that parts of a flat sequence can execute even if not all the input wired into the structure arrived. It even means that you can wire data out of the structure and back in. I believe this makes it a unique structure in LabVIEW.
 
There are some more details here.

___________________
Try to take over the world!
0 Kudos
Message 8 of 9
(3,684 Views)
Thank you tst for the link. I was looking for this exact info when writing my answer but I could not find it.
0 Kudos
Message 9 of 9
(3,665 Views)