LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

stacked sequence with local sequence

hi,

   In my project i am using a while loop in which i have a stacked sequence,in one frame of the stacked sequence i get a max index value from array max and min function, based on that output value i am using a sequence local to send this output index to another frame in stacked sequence. In other frame of stacked sequence iam using a case structure with sequence local attached to it. But i am unable to go to the correct outputted value coming out from one frame to another. Can anyone guide me in this

0 Kudos
Message 1 of 7
(1,455 Views)

It is hard to help you with your specific problem without a screenshot or a copy of your .vi posted.

 

But you'd be better off not using a stacked sequence anyway.  Stacked sequences hide code, and cause wires to run from right to left whenever you use sequence locals.  So just avoid them.

 

Right click on the frame of your stacked sequence and pick Replace with Flat Sequence.  You might even find out that you don't need to use a sequence structure at all, or possibly could merge some frames of the sequence.

 

There are only a few situations in LabVIEW where flat sequence structures are useful or necessary.  In the vast majority of cases, proper use of error wires will allow you to enforce the proper flow of data entirely with wires.

0 Kudos
Message 2 of 7
(1,445 Views)

I would also like to add that I only use sequence (flat, never stacked) structures for code that can't be forced to follow the dataflow paradigm, such as FGVs (but I suppose I could force these as well, but typically don't)

-----------------------------------------------------------------------------------------
Reese, (former CLAD, future CLD)

Some people call me the Space Cowboy!
Some call me the gangster of love.
Some people call me MoReese!
...I'm right here baby, right here, right here, right here at home
0 Kudos
Message 3 of 7
(1,418 Views)

hi,

   Thank you for the intrest. Reason for using stacked sequence is,in my project i need to autofocus an image. For that process,i am taking a while loop in which i am taking one set of steps to take the focus score,get the highest focus score at that particular index and again go 2 steps in that particular directions and again the process continues,

so i need to get back every time till i attain the highest focus score. I tried many procedures and thought that would be the best and implemented it. If there are any other procedures can u guide me further

0 Kudos
Message 4 of 7
(1,410 Views)

Sounds to me like a race condition in the previous frame, causing you to send the wrong number forward. The structure variable cannot fail in itself. 🙂

Run the program in Highlight mode and Retain values and i'm sure you'll find the problem.

/Y

G# - Award winning reference based OOP for LV, for free! ADDQ VIPM Now on GitHub
"Only dead fish swim downstream" - "My life for Kudos!" - "Dumb people repeat old mistakes - smart ones create new ones."
Certified-LabVIEW-Developer
0 Kudos
Message 5 of 7
(1,400 Views)

continued here - or just a plain double post?

Best regards,
GerdW

using LV2011SP1 + LV2017 (+LV2020 sometimes) on Win10+cRIO
0 Kudos
Message 6 of 7
(1,397 Views)

A state machine would probably work for your application.  It's much more efficient and gives you far more control.

-----------------------------------------------------------------------------------------
Reese, (former CLAD, future CLD)

Some people call me the Space Cowboy!
Some call me the gangster of love.
Some people call me MoReese!
...I'm right here baby, right here, right here, right here at home
0 Kudos
Message 7 of 7
(1,385 Views)