EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  <20152016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  <20152016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: SNL: state change statement in entry block
From: Eric Williams <[email protected]>
To: Benjamin Franksen <[email protected]>
Cc: EPICS tech-talk <[email protected]>
Date: Mon, 16 Mar 2015 10:05:34 -0700
It turned out to be useful in the case I was working on.  Thanks, and thanks for the explanation.
--
eric

On Sat, Mar 14, 2015 at 5:57 PM, Benjamin Franksen <[email protected]> wrote:
Hi Andrew

Since version 2.1 the sequencer deviates from the Mealy Machine model, in that
you can say

        state other_state;

in the middle of an action block. I called this a "state change statement"
(and it really is a statement, not an _expression_). It is only allowed inside
transitions, not in entry or exit blocks. This can be useful in situations
where determining the next state cannot be expressed as a closed formula in
SNL, for instance if it involves iteration.

Cheers
Ben

Am Samstag, 14. März 2015, 03:06:12 schrieb Johnson, Andrew N.:
> 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
>
> > 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

--
"Make it so they have to reboot after every typo." ― Scott Adams


________________________________

Helmholtz-Zentrum Berlin für Materialien und Energie GmbH

Mitglied der Hermann von Helmholtz-Gemeinschaft Deutscher Forschungszentren e.V.

Aufsichtsrat: Vorsitzender Prof. Dr. Dr. h.c. mult. Joachim Treusch, stv. Vorsitzende Dr. Beatrix Vierkorn-Rudolph
Geschäftsführung: Prof. Dr. Anke Rita Kaysser-Pyzalla, Thomas Frederking

Sitz Berlin, AG Charlottenburg, 89 HRB 5583

Postadresse:
Hahn-Meitner-Platz 1
D-14109 Berlin

http://www.helmholtz-berlin.de



References:
SNL: state change statement in entry block Eric Williams
Re: SNL: state change statement in entry block Johnson, Andrew N.
Re: SNL: state change statement in entry block Benjamin Franksen

Navigate by Date:
Prev: Re: MEDM issues Andrew Johnson
Next: Re: Questions about EPICSv4 (Ricardo Herrero) Marty Kraimer
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  <20152016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: SNL: state change statement in entry block Benjamin Franksen
Next: RE: state change statement in entry block Dalesio, Leo
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  <20152016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 16 Dec 2015 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·