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  <20092010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  <20092010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: state notation code flags
From: Benjamin Franksen <[email protected]>
To: [email protected]
Date: Mon, 5 Oct 2009 22:47:18 +0200
On Montag, 5. Oktober 2009, Andrew Johnson wrote:
> I suspect it would be a good idea to try and get the the SNL compiler to
> issue a warning whenever it sees someone calling pvPut() on a variable
> which has a monitor on it, since this is IMHO an unsafe practice.

It is not if you do it right. I have never observed any problems with it. 
You just have to make sure that the value your SNL program writes is 
different from what the outside writes. Typically I reserve some value 
(usually 0) for 'done' (a.k.a. 'idle'). The outside is not allowed to write 
this value (this can be enforced using yet another record). Then I have 
some SNL code like

int cmd;
assign cmd to "whatever";
monitor cmd;

state idle {
    when (cmd==DO_SOMETHING) {
        setup_execution();
    } state first_intermediate_state
    ...
    when () {
    } state done
}
...intermediate states...
state done {
    when ... {
        cmd = 0;
        pvPut(cmd);
    } state idle
}

The advantage is that I don't need event flags which I always found to be 
unreliable.

Cheers
Ben


Replies:
Re: state notation code flags Benjamin Franksen
References:
state notation code flags Patrick Thomas
RE: state notation code flags Mark Rivers
Re: state notation code flags Andrew Johnson

Navigate by Date:
Prev: Re: EPICS Python client application survey Matt Newville
Next: Re: Channel access and ca_element_count Benjamin Franksen
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  <20092010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: RE: state notation code flags Mark Rivers
Next: Re: state notation code flags Benjamin Franksen
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  <20092010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 31 Jan 2014 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·