Hi Eric,
The SNL compiler implements a version of the well-known finite state machine (FSM) known as a Mealy Machine. Each SNL state set in a program corresponds to a single FSM, comprising a set of states connected by transitions, which are made up of input (when) conditions and output actions. An entry block just provides a set of actions (i.e. FSM outputs) to be executed whenever its state is entered. Action sequences cannot contain state changes, those are determined only by the transition conditions which trigger the actions.
If you discover that an action sequence needs to change the transition it's implementing, you will usually have to add one or more states and transitions to properly model and code the result. The advantage of state programming is that (in theory) for any series of inputs you can determine exactly how the machine will respond. In practice state programs with lots of states can be complex beasts to follow; drawing up a corresponding state transition diagram can help in these circumstances, but I wouldn't try to detail all of the actions on the diagram.
HTH,
- Andrew
--
Sent from my iPad
> On Mar 13, 2015, at 7:36 PM, Eric Williams <[email protected]> wrote:
>
> I had put a state change statement in the entry block of one of my states and the 2.2.1 compiler kicked it out. Evidently it only allowed them in transition blocks. I re-arrange my code to get around the restriction but I was curious: What is the problem with having a state change statement in an entry block?
> --
> Eric Williams
> ALS Controls, LBL
- Replies:
- Re: SNL: state change statement in entry block Benjamin Franksen
- References:
- SNL: state change statement in entry block Eric Williams
- Navigate by Date:
- Prev:
SNL: state change statement in entry block Eric Williams
- Next:
StatusCreate class with Throwable Ricardo Herrero
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
<2015>
2016
2017
2018
2019
2020
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
SNL: state change statement in entry block Eric Williams
- Next:
Re: SNL: state change statement in entry block Benjamin Franksen
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
<2015>
2016
2017
2018
2019
2020
2021
2022
2023
2024
|