When is state 2 supposed to be entered? When the motor is moving, or done moving?
Event flags are very useful for detecting changes that may be too quick to catch by looking at the value.
If you put an event flag on DMOV you then can say:
int motor_stopped; assign motor_stopped to "{P}{R}.DMOV"; monitor motor_stopped;
evflag motor_stopped_mon; sync motor_stopped motor_stopped_mon;
when((efTestAndClear(motors_stopped_mon) && motors_stopped == 1))
This code will thus be entered when DMOV has changed and it is 1.
Mark
-----Original Message-----
From: Konrad, Martin [mailto:[email protected]]
Sent: Thursday, September 05, 2013 3:08 PM
To: [email protected]
Cc: Mark Rivers; [email protected]
Subject: Re: seq and synchronous writes
Hi Mark,
> The problem is that synchronous puts to the motor record wait for the
> motor to stop moving, or the timeout (10 seconds default) to occur.
> You don't want to use SYNC here.
So the solution would be something like this?
state state1 {
entry {
sprintf(stateMsg, "state 1");
pvPut(stateMsg);
}
when(foo) {
motor = bar;
pvPut(motor);
} state intermediate
}
state intermediate {
when(motorDMOV == 0) {
} state state2
}
state state2 {
entry {
sprintf(stateMsg, "state 2");
pvPut(stateMsg);
}
}
Can I be sure that this always works? Even in case the motor is
commanded to the same position again and DMOV is 0 only for a very short
time?
Martin
- References:
- seq and synchronous writes Konrad, Martin
- Re: seq and synchronous writes Konrad, Martin
- Navigate by Date:
- Prev:
Re: seq and synchronous writes Konrad, Martin
- Next:
Re: seq and synchronous writes Konrad, Martin
- 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: seq and synchronous writes Konrad, Martin
- Next:
Re: seq and synchronous writes Konrad, Martin
- 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
|