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  <20122013  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  2009  2010  2011  <20122013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: Peculiar SNL behaviour
From: Eric Norum <[email protected]>
To: "S. Stein" <[email protected]>
Cc: [email protected]
Date: Tue, 3 Jan 2012 10:00:08 -0800
Yes, the sequencer has no 'watchpoint' mechanism on which to wait between scanning the list if 'when' statements.  I have a feeling that handling this in a general way would be akin to solving the 'halting' problem.

Anyhow, the sequencer does provide events to be used in such state set synchronization applications.


On Dec 31, 2011, at 3:43 PM, S. Stein wrote:

> Last question for 2011 from me - I promise!
> 
> I have a sequence program with a couple of state sets running. To enable a state transition in one state-set, I set (or reset) a variable (which does not correspond to an EPICS PV) - see example below. here is my issue: I cannot seem to get the 'wait' state in stateset 2 to fire off without toggling 'pv1'.  
> 
> Here's what I do: assuming the PV  'epics:pv1C' is set to a BO record, I run the IOC. I see the console messages for the state sets firing off. I then set the VAL of 'epics:pv1C' to '1' and see that the ioc console responds with "PV Change state". After 2 seconds delay the internal variable 'seqFlag' is set to true, which _should_ (at least I think) fire off the 'wait' state in the second set, thus printing "Wait State Reached" on the IOC console. It does not. I have to set the PV 'epics:pv1C' to '0' and back to '1' to get the state transition to fire.
> 
> I don't think this behavior is appropriate - what say the community?
> 
> 
> Contrived example:
> 
> /* epics variables */
> short pv1; assign pv1 to "epics:pv1C"; monitor pv1;
> /* sequencer variables */
> short seqFlag = FALSE;
> 
> ss set1 {
> state init {
>  entry {
>   printf("Set 1 started\n");
>  }
>  when (pv1 == TRUE);{
>   printf("PV Change state\n");
>   } state seqHold
>  }
> 
> state seqHold {
>  when(delay(2)) {
>   seqFlag = TRUE;
>  } state done
> 
> state done {
>  when(FALSE) {
>  } state init
> }
> }
> 
> ss set2 {
> state init {
>  when(Delay(1){
>   printf("Set 2 started\n");
>  } state wait
> }
> 
> state wait {
> when ((pv1 == TRUE) && (seqFlag == TRUE)) {
>   printf("'Wait state' reached\n");
>  } state done
> 
> state done {
>  when(FALSE) {
>  } state init
> }
> }
> 

-- 
Eric Norum
[email protected]






Navigate by Date:
Prev: Re: Peculiar SNL behaviour Josh Stein
Next: Re: Peculiar SNL behaviour Carl Lionberger
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: Peculiar SNL behaviour Josh Stein
Next: Re: Peculiar SNL behaviour Carl Lionberger
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
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 ·