06-25-2012 08:31 AM
I have a few pre-built state machine templates, one of which is a 3 state Init/Run/Exit. It is much quicker to save a working copy of that .vit than create a new VI and drop a sequence structure.
06-25-2012 08:44 AM
@P Anand wrote:
Yes if my design has Init >> Execute code >> Re-init and exit do you think it is necessary to use state machine?. Because this sequence of execution is never going to change and I feel it is unnecessary to bring a state machine into play.
A state machine would be an idea application for this. Although the code is rather static, it may eventually scale up to something larger. Most likely after someone else takes over the code.
06-25-2012 08:49 AM
@Ben wrote:
NO!
Don't get rid of the Stacked Sequence!
I will use a Stacked Sequence in my very often.
Frame 1 - contains all of the code.
Frame 2 - Contains an image of the State Diagram that documents the code flow. All I have to do is flip to frame 2 to see the design.
Of course if NI would restore the State Diagram Editor to its former glory I would not need the stack sequence.
Ben
Ben,
I would agree with your use of the Stacked Sequence Structure, as you are not using it for program control.
Unfortunately, all code that I inherit which uses SSS, it is a bloody mess full of abuse. (ie: 64 fames of SSS full of nested layers of SSS, sometimes 3 layers deep! 😮 )
Now if it was possible to have a "structure" which resembles the Stacked Sequence, but was used for the purpose you described (1st frame for code, other for documentation, only), then that would be fantastic. I don't know if that was already proposed as an idea.. I think so, a long time ago..
06-25-2012 09:16 AM
@Darin.K wrote:
There is absolutely nothing wrong with the Stacked Sequence Structure. All problems stem from the abomination known as the sequence local.
Then why not just use a State machine to begin with.
06-25-2012 09:18 AM
I like Ben's use of the stacked sequence as a place holder for his documentation. A Stacked sequence may have it's uses, but it can be too easily abused which is why most people warn against it.