Hi also- it's not a problem to include the escaped C code
in the same file as the sequence code; it just becomes part
of the file written by snc. I usually insert it before any
state code to avoid the need for forward references.
Note that when()'s are evaluated only when something happens
to wake up the corresponding thread, e.g. a monitored/sync'd
PV update or a delay() expiring; if a state has only when()'s
that wait on C functions, there's not going to be any way for
it to continue (unless one of the when()'s triggers immediately
on initial entry to the state). There needs to be at least one
reference to a sync'd PV or a delay() in some when() in each
state for the seq() task loop to wake up. It doesn't need to
be the one with the C function, since ALL when()'s in a state
are evaluated on ANY event "registered" for that state, but
that also means your C function when() may not happen when you
think it will. In particular, checking a PV _only_ in the escaped
code won't make the compiler notice that you want to wake up
when that PV changes.
What sort of compiler errors were you getting?
Mike
-----Original Message-----
From: Al Honey [mailto:[email protected]]
Sent: Wednesday, January 03, 2007 11:32 AM
To: Dennis Nicklaus; [email protected]
Subject: RE: C function in when() clause of sequencer
Hi
At the Keck observatory, most of our sequencers call 'C' functions
(hmmm these are sequencers running on vxWorks with EPICS 3.13.10).
Seems to me it is just a matter of linking and loading.
What you proposed should be functional except, I think, the static
for the softCheck function may be a problem as it will exist in a C
source file separate from the SNL file and may not be resolved correctly
(you might have to experiment).
.....
- References:
- RE: C function in when() clause of sequencer Al Honey
- Navigate by Date:
- Prev:
RE: C function in when() clause of sequencer Al Honey
- Next:
caRepeater must run before casr Dennis Nicklaus
- 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: C function in when() clause of sequencer Al Honey
- Next:
caRepeater must run before casr Dennis Nicklaus
- 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
|