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 | 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 |
<== Date ==> | <== Thread ==> |
---|
Subject: | Re: Sequencer seem to skip states with EPICS 3.16.1 |
From: | Ralph Lange <[email protected]> |
To: | EPICS Tech Talk <[email protected]> |
Date: | Wed, 31 Jan 2018 10:15:15 +0100 |
On 01/31/2018 09:42 AM, Ralph Lange wrote:
Sorry, the C== part is external and should not influence the code. Forgot, what I just said.
Sorry, you lost me there.
The SNL compiler takes SNL source and produces C code. What do you mean by "the state machine is implemented in C++"?
Here it goes:In your original message you said that the 'camonitor' utility only shows READY -> RUNNING. So you seem to have a PV (I assume a local EPICS record) that is supposed to show the state.In your SNL code excerpt there is no mention of such PV or when and how it is updated.Please show all handling of that status PV in order to get feedback on it.
#define SET_PV(pv_variable, value) \
{ \
pv_variable = value; \
pvPut(pv_variable); \
}
%%enum { State_UNKNOWN = 0, State_NOT_READY = 1, State_READY = 2, State_RUNNING = 3, State_LOADING=4, State_UNLOADING=5, State_STARTING=6, State_STOPPING=7, State_ABORTING=8, State_ERROR=11 };
int ERROR = FALSE;
ss onsenhw {
state S_READY {
entry {
SET_PV(pv_state_current, State_READY);
ERROR = FALSE;
}
when(pv_state_requested == State_RUNNING) {
} state S_STARTING
}
state S_STARTING {
entry {
SET_PV(pv_state_current, State_STARTING);
}
when(!ERROR && pv_allow_running) {
} state S_RUNNING
when(pv_state_requested == State_READY) {
} state S_STOPPING
}
state S_RUNNING {
entry {
SET_PV(pv_state_current, State_RUNNING);
ERROR = FALSE;
}
...
}
I hope, this helps.
Cheers,
Simon