LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Wiring data through multiple frames of a Flat Sequence

Solved!
Go to solution

Hi,

 

I'm wondering which way to wire data through multiple frames of a Flat Sequence is better. The top option is to just wire frame after frame, the bottom one is to 'exit' the sequence and reenter it later. The code shown is trivially simple, but imagine there are many variables being worked on in that sequence frame by frame, but some of the variables are only used closer to the beginning and then closer to the end of the sequence, as shown.

Flat_Seq.png

0 Kudos
Message 1 of 24
(302 Views)

Hi Vitek,

 


@VitekStepien wrote:

I'm wondering which way to wire data through multiple frames of a Flat Sequence is better.


The best option is to not use a sequence frame at all…

Best regards,
GerdW

using LV2011SP1 + LV2017 (+LV2020 sometimes) on Win10+cRIO
Message 2 of 24
(297 Views)

Most of us here will agree with GerdW.  Whatever you were planning to put in those frames is FAR better off in a subVI and wiring their error terminals  to sequence them.  Or, build a proper state machine so you have even more control.

 

It would be best if you tell us what you're trying to achieve so we can suggest the best architecture to implement.

LabVIEW 8.5.1 - 2019 Pro Dev
0 Kudos
Message 3 of 24
(280 Views)

Haha I kinda expected the "Never use a sequence dude" answer 🙂 I know it's suboptimal, honestly I'm mostly using it to visually organize the code, not to achieve a specific functionality. 

 

Answering your question, I'm using it in a subvi that executes one step of 4th order Runge Kutta on a set of 3 ODE's, on arrays of values. See the snippet below:

rk4.png

I realize that from dataflow standpoint, I probably don't need the Flat Sequence at all - my question is more conceptual than practical.

0 Kudos
Message 4 of 24
(268 Views)

If it is for "organizing code" then why not use

Structures -> Decorations -> Flat Frame

 

Frozen_1-1611245153222.png

 

 

---------------------------------------------
Certified LabVIEW Developer (CLD)
There are two ways to tell somebody thanks: Kudos and Marked Solutions
Message 5 of 24
(264 Views)

Well, the sequence structure forces LabVIEW to execute in a sub-optimal fashion, so there's a reason behind the advice.  Use the Flat Frame decoration to separate your code visually.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 6 of 24
(261 Views)

@Frozen wrote:

If it is for "organizing code" then why not use

Structures -> Decorations -> Flat Frame

 

Frozen_1-1611245153222.png

 

 


Dang, you beat me to it.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 7 of 24
(260 Views)

Frozen, that would certainly work. Does using Sequence automatically slow down the code or in any other way "harm" the performance? In my code there is really nothing that could cause variable race or ambiguity in the output values.

0 Kudos
Message 8 of 24
(259 Views)

Forcing your code to execute using a sequence structure is like forcing your car to fire its spark plugs at your discretion.  Best to leave the engine to do things the way it needs to - for both cases.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 9 of 24
(253 Views)

Bill, that makes sense. I guess my original question will remain unanswered, since Sequences are a taboo topic, but I appreciate your responses.

 

Thanks,

Vitek

0 Kudos
Message 10 of 24
(247 Views)