Hi Martin
On Thursday, September 05, 2013 22:30:44 Konrad, Martin wrote:
> > Event flags are very useful for detecting changes that may be too
> > quick to catch by looking at the value.
>
> I looked into them as well but the sequencer documentation says:
>
> "Neither testing the value of a monitored channel in a when clause nor
> associating the channel with an event flag and then testing the event
> flag can guarantee that the sequence is aware of all monitors posted on
> the channel."
Strictly speaking this is true. However, the only situation where an event can
be lost to the sequencer is when events follow in rapid succession: your state
set may 'see' only the last event. In case of the DMOV field, testing for DMOV
in a when-clause:
when(motorDMOV) {
} state done
after causing a move (by writing to the record) should work reliably, if you
can ensure that no other agent (state set, record, CA client program) causes
the motor record to process and start moving right after the previously
initiated movement is complete (which would cause DMOV to be reset to zero).
BTW, using an event flag in addition to testing the value of a (assigned and
monitored) variable is redundant, except when you associate the event flag
with several distinct PVs.
> But going through the documentation again revealed that this issue can
> be fixed using queuing monitors:
> http://www-csr.bessy.de/control/SoftDist/sequencer/Tutorial.html#queuing-mon
> itors
>
> However the easiest way seems to be using asychronous pvPuts together
> with pvPutComplete. Unfortunately all these solutions require an
> additional state. But I think I can live with that...
The asynchronous put method works, too, but it relies on the same assumptions
as testing for DMOV. This is because asynchronous pvPut will immediately
'complete' (actually fail, but this is not easily detectable) if one of the
records in the processing chain is already active. Also note that the ASYNC
versions of pvPut and pvGet never time out. If the motor record somehow gets
stuck and never completes processing, your program gets stuck, too. (But this
is true for testing DMOV, too.) If you have already acquired a healthy
paranoia ;-) you can guard against such a possibility with a second when-
clause that contains a delay call e.g.
when(pvPutComplete(motor)) {
} state done
when (delay(timeout)) {
} state error
Cheers
Ben
--
"Make it so they have to reboot after every typo." ― Scott Adams
Attachment:
signature.asc
Description: This is a digitally signed message part.
- Replies:
- RE: seq and synchronous writes Mark Rivers
- References:
- seq and synchronous writes Konrad, Martin
- Re: seq and synchronous writes Konrad, Martin
- Navigate by Date:
- Prev:
RE: PMAC VME card base address issue Emma Shepherd
- Next:
RE: seq and synchronous writes Mark Rivers
- 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 Mark Rivers
- 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
|