On Monday 12 January 2015 12:52:53 Silver wrote:
> On the website of
> EPICS Sequencer Home, there are several examples about SNL which use
> exit in two places.?
>
> The first one is
> in the example "Entry and exit action example" ,that exit part will
> execute one time when the state changes from high to low. and, if use
> "option -e" switch, the entry will be executed each time, not as
> expected. Without "option -e" switch, it will run as the document's
> behavior, did I make some mistake??
No, this is a bug in the Tutorial. It seems I mixed it up when I re-
wrote it. Thanks for the report, will fix this.
BTW, if in doubt, you should always consult the SNL Language Reference.
It says:
"""
+e
Execute `entry` blocks only if the previous state was
not the same as the current state. This is the default.
-e
Execute `entry` blocks even if the previous state was the same
as the current state.
+x
Execute `exit` blocks only if the next state is not the same as
the current state. This is the default.
-x
Execute `exit` blocks even if the next state is the same as
the current state.
"""
Just wrote a regression test to make sure this is really what's
happening.
> The second one is
> in the “Complex example “
> (http://www-csr.bessy.de/control/SoftDist/sequencer/Examples.html#exi
> t-procedure)
> Exit is a separate
> part out of state set,?I am wondering when that exit procedure will be
> executed??
The reserved words 'entry' and 'exit' are overloaded. Inside a state
they denote entry/exit actions executed when entering/leaving a state,
respectively. On the top level (i.e. outside state sets) they denote
entry/exit actions that are executed before state sets got to their
first state / after they finish executing, respectively. (The word
'exit' can be used in yet more contexts, see the language reference for
details.)
Cheers
Ben
--
"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