04-25-2009 02:42 PM
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
Solved! Go to Solution.
04-25-2009 02:54 PM
Why use a stacked sequence? What you want is a state machine something like this
04-25-2009 03:44 PM
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.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
04-25-2009 05:07 PM
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.
04-25-2009 05:18 PM
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,