LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

question on stacked sequence

Solved!
Go to solution

Hi,

I have a question regarding stacked sequence.

I have a stacked sequence with 5 sequences (0,....,4). I would like to execute these in this form

0, 1, 2, 1, 3, 1, 4, 1  then again 0,..

I don't want to duplicate the 1 section since it contains many objets, variables,...One possibility would be to move out the objects then duplicate the sequence and use shift registers but I don't want to use this because in 1, I have some real time graphs to plot..

Is there another (easy) way to do this ?

Thanks for ideas,

Regards

 

0 Kudos
Message 1 of 5
(3,156 Views)
Solution
Accepted by topic author nitad54448

Why use a stacked sequence?  What you want is a state machine something like thisSmiley Wink

 

 

Message 2 of 5
(3,153 Views)

A state machine would work if state 1 knows where to go next.

 

Another answer is to use a FOR loop with a CASE structure inside.

 

You have a constant array structure, with  0, 1, 2, 1, 3, 1, 4, 1  in it, and the FOR loop autoindexes that array to get a single number and executes that case.

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

Message 3 of 5
(3,141 Views)

nitad54448 wrote:

I have a question regarding stacked sequence.


Sequences MUST execute in order until all frames are complete, and there is no escape. Don't use stacked sequences, they are too limiting.

 


nitad54448 wrote:

I don't want to duplicate the 1 section since it contains many objets, variables,...


You don't need to duplicate it. Create a simple state machine with cases 0,2,3,4 and add the code of state 1 right after the case, so it executes at each iteration of the loop after any of the states.

 

Here's a quick draft (LV 8.0) that would cycle through the states as you specified forever. See if it can give you some ideas.

 

Please show us your actual code, maybe we have a few better suggestions.

Message 4 of 5
(3,129 Views)

hi

thanks for the "state machine" suggestion. I just hoped there is a way to make sequences execute more than once (intercalate some, for instance). I can't see nor put the code now (I am at home, no LV here) but got the ideea.

thanks again,

0 Kudos
Message 5 of 5
(3,127 Views)