Hi,
seqFlag is just a variable - just a location in RAM that contains a value. There is no machinery associated with it that would wake up the state set and cause it to execute the 'when' statement. pv1 has that machinery because it's assigned to a PV and you specified 'monitor'.
Tim
----- Original Message -----
From: "S. Stein" <[email protected]>
To: [email protected]
Sent: Saturday, December 31, 2011 5:43:06 PM
Subject: Peculiar SNL behaviour
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
}
}
--
Tim Mooney ([email protected]) (630)252-5417
Software Services Group (www.aps.anl.gov)
Advanced Photon Source, Argonne National Lab
- Navigate by Date:
- Prev:
Re: Peculiar SNL behaviour Carl Lionberger
- Next:
Re: Peculiar SNL behaviour Andrew Johnson
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
<2012>
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
Re: Peculiar SNL behaviour Carl Lionberger
- Next:
Re: Peculiar SNL behaviour Andrew Johnson
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
<2012>
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
|