g+
g+ Communities
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  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014 
<== Date ==> <== Thread ==>

Subject: Re: Peculiar SNL behaviour
From: Josh Stein <stein@aps.anl.gov>
To: tech-talk@aps.anl.gov
Date: Tue, 03 Jan 2012 11:59:14 -0600
All,

The tech-talk mail exploder just came back up, and my query was caught in the queue. Andrew has pointed me to the correct way of handling this issue by using event flags (evflag type) instead of short, and the function 'efTestAndClear' to monitor the change of state.

--J


On 12/31/11 5: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
  }
}


Navigate by Date:
Prev: RE: The crash of Matlab using LabCA Jeff Hill
Next: Re: Peculiar SNL behaviour Eric Norum
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014 
Navigate by Thread:
Prev: RE: The crash of Matlab using LabCA Mark Rivers
Next: Re: Peculiar SNL behaviour Eric Norum
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014 
ANJ, 18 Nov 2013 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· EPICSv4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·