LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Index the output of a stacked sequence

Solved!
Go to solution

Hi everyone,

 

I'm writing some code in which I instantiate many objects when I first start my code and place the objects into an array that is used as a lookup table later on in operation.  This takes up a lot of space on the block diagram and makes it difficult to understand for the user that is not familiar with the code.  Is it possible to create something like a flat sequence that can have a single indexed output tunnel?  I want something like what you would get when having a tunnel out of a for loop I just want each itteration to be unique (unlike the for loop).  I've included an image of what my diagram currently looks like for reference.  You can see that I create all of the objects with unique information (ID, control reference, etc.) and then build an array with them.  I would like to instantiate each of these objects in a frame of a stacked sequence with a single indexed output (if possible).  objects.PNG

 

 

Thanks for the advice!

 

-Eric

0 Kudos
Message 1 of 5
(2,964 Views)

You could make that whole thing there a sub-vi.  That way it is nice and clean at a higher level, but if you needed to look at the nuts and bolts, nothing is hidden...

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 2 of 5
(2,957 Views)
Solution
Accepted by topic author etridas

Option 1: use a subVI


Option 2: Use a FOR loop as a sequencer.  Instead of the stacked (or flat) sequence structure, put a case structure inside of a FOR loop and wire the i to the case selector.  Then in each case you can initialize a different class.  The output can then be autoindexed.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 5
(2,953 Views)

I had considered a sub vi but if you notice i have control references as inputs and so I would still end up having to create a cluster of references as an input to the sub vi.  I really like the idea of the for loop and the case structure.  I don't know if its really proper to do that but it will definitely clean up my code a lot.  Thanks.

 

-Eric

0 Kudos
Message 4 of 5
(2,949 Views)

@etridas wrote:

I had considered a sub vi but if you notice i have control references as inputs and so I would still end up having to create a cluster of references as an input to the sub vi.  I really like the idea of the for loop and the case structure.  I don't know if its really proper to do that but it will definitely clean up my code a lot.  Thanks.

 

-Eric


I actually like option 2 better, also.  That's why cross has all those logos.  😉

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 5 of 5
(2,944 Views)