Experimental Physics and Industrial Control System
>>> On 5/2/2002 at 13:42:32 -1000, Ian A Smith wrote:
> the snc manual says that the delay() function can only be used inside a
> when expression. Is this really true? Isn't it just a finction that
> returns true or false? I want to use it inside a for statement.
Sorry, you can't do that.
When a state containing delay() clauses is entered, a timer is started for
each one (in the context of the main sequencer task, I think) which is then
checked by the sequencer along with any other when() tests in that state.
There is a function that returns true when the timer expires, and you could
potentially make use of this mechanism by writing escaped C code, but you
would have to be very careful.
Keep in mind that if you do anything in a when() clause that blocks
execution, you will suspend *all* sequencers for that time. Using
taskDelay() will allow other tasks to continue, but not other sequencers.
Looking at the generated C code may make it clearer how this works.
----
Brian McAllister Controls Programmer/Beam Physicist
[email protected] MIT-Bates Linear Accelerator
(617) 253-9537 Middleton, MA
- References:
- snc delay() Ian A Smith
- Navigate by Date:
- Prev:
RE: snc delay() Chestnut, Ronald P.
- Next:
Re: EPICS Base Bug Report Marty Kraimer
- 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:
snc delay() Ian A Smith
- Next:
RE: snc delay() Chestnut, Ronald P.
- 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