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  <20112012  2013  2014  2015  2016  2017  2018  2019  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  <20112012  2013  2014  2015  2016  2017  2018  2019 
<== Date ==> <== Thread ==>

Subject: Re: question about state notation language logic for when() with delay
From: "Chestnut, Ronald P." <ronc@slac.stanford.edu>
To: Jay Steele <jsteele@xradia.com>
Cc: "tech-talk@aps.anl.gov" <tech-talk@aps.anl.gov>
Date: Wed, 10 Aug 2011 10:00:51 -0700
Jay,

The timer starts when the state containing the when clause is entered. There are some flags which determine if it restarts when the state loops back to itself or not.

So the order of elements in the when expression is irrelevant.

If you want some specific ordering, you need to use more states.

Ron

On Aug 10, 2011, at 9:01 AM, Jay Steele wrote:

Hi EPICS folks,
  For the state notation language, the when statement is mostly straightforward in that the code following the when statement occurs when the logical expression inside the when statement is true. However, I'm a little confused by the delay function in a when statement because something needs to start and monitor the timer for the delay. I need to understand this delay logic better for a EPICS robot control application I'm working on. When does the timer start and how is it monitored for the delay? For example, if I use the following when statement for a state transition,

when(A==1 && delay(1.0) && B==1),

  does the timer for the delay only start and continue after the A==1 logical condition is met and, after the delay is done, then it checks the B==1 logical condition? Thus, does the order of logical conditions in the when statement make a difference so that when(delay(1.0) && A==1 && B==1) behaves differently? Here is one possible interpretation of when(A==1 && delay(1.0) && B==1):

time     A     B    transition
-----    ---    ---   ----------
0         0      0    none
1         0      0    none
2         1      0    none
2.5      1      1    none
3         1      0    none
4         1      1    yes

  Or, does the timer for the delay only start and continue after both the A==1 and B==1 conditions are satisfied? In which case, we get the following result for when(A==1 && delay(1.0) && B==1):

time    A        B    transition
-----   ---      ---    ----------
0        0        0       none
1        0        0        none
2        1        0       none
2.5     1        1       none
3        1        0       none
4        1         1      none
5        1         1      yes

Or does the timer for the delay start as soon as the state containing the when statement becomes active and just continue? In this case, the results would be as follows for when(A==1 && delay(1.0) && B==1).

time    A     B    transition
-----   ---   ---   ----------
0        0      0      none
1        0      0      none
2        1      0      none
2.5     1      1      yes

  I will test these different situations out, but I wanted to understand the underlying logic intent so that my SNL implementation will not break with future software versions.

Cheers,
Jay Steele
Xradia Corporation

________________________________
The information in this email, including any attachments, is confidential and intended only for the recipient(s) listed. Any use of this email for any other purpose is prohibited. If you have received this email in error, please notify me immediately by reply email, delete this email, and do not disclose its contents to anyone.



Replies:
Re: question about state notation language logic for when() with delay Benjamin Franksen
References:
question about state notation language logic for when() with delay Jay Steele

Navigate by Date:
Prev: question about state notation language logic for when() with delay Jay Steele
Next: Re: question about state notation language logic for when() with delay Benjamin Franksen
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  <20112012  2013  2014  2015  2016  2017  2018  2019 
Navigate by Thread:
Prev: question about state notation language logic for when() with delay Jay Steele
Next: Re: question about state notation language logic for when() with delay Benjamin Franksen
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  <20112012  2013  2014  2015  2016  2017  2018  2019 
ANJ, 18 Nov 2013 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·