EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  <20072008  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  <20072008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: C function in when() clause of sequencer
From: Eric Norum <[email protected]>
To: Dennis Nicklaus <[email protected]>
Cc: tech-talk tech-talk <[email protected]>
Date: Wed, 3 Jan 2007 12:02:43 -0600
For the example shown perhaps Dennis might get the source cleanup he wants by making 'softCheck' a C preprocessor macro?

On Jan 3, 2007, at 11:49 AM, Chestnut, Ronald P. wrote:

The simple answer is "no".

The long answer is that the SNL compiler sets up complex structures with linked events and such to cause retriggering of the WHEN clause in a structured manner. The compiler would just choke, and nothing reasonable would happen even if it didn't.

Ron Chestnut

-----Original Message-----
From: Dennis Nicklaus [mailto:[email protected]]
Sent: Wednesday, January 03, 2007 9:19 AM
To: [email protected]
Subject: C function in when() clause of sequencer

Hi,
Is it possible to call a C function to avoid having a very cumbersome when clause in my epics sequencer program? I get some compiler error or other when I try different variations, so I'm hoping someone can tell me the best way to handle this.



What I want is instead of this:
when ((vacuumReading >vacuum_high) ||(tempReading >tempCerm_high)
||(eminusReading >electron_high) ||(pmtReading >pmtlight_high))
{
} state backOff


I would like to do this:
%{
/*
    This function checks for exceeding any of the soft limits.
*/
static int softCheck()
{
    return(
    (vacuumReading >vacuum_high)
    ||(tempReading >tempCerm_high)
    ||(eminusReading >electron_high)
    ||(pmtReading >pmtlight_high)
    );
}
}%

...
      when (softCheck())
      } state backOff

Thanks,
Dennis




-- Eric Norum <[email protected]> Advanced Photon Source Argonne National Laboratory (630) 252-4793



References:
RE: C function in when() clause of sequencer Chestnut, Ronald P.

Navigate by Date:
Prev: RE: C function in when() clause of sequencer Chestnut, Ronald P.
Next: RE: C function in when() clause of sequencer Al Honey
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  <20072008  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 Chestnut, Ronald P.
Next: RE: C function in when() clause of sequencer Al Honey
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  <20072008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 10 Nov 2011 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·