EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  <19971998  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  Index 1994  1995  1996  <19971998  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 
<== Date ==> <== Thread ==>

Subject: Error in State Notation Language or Sequencer Users Guide
From: "Oleg A. Makarov" <[email protected]>
To: [email protected]
Cc: [email protected]
Date: Thu, 11 Sep 1997 14:28:55 -0500
Dear Andy Kozubal,

Recently I have tried to use efSet() function in my program and find out
that it does not work according to its description: 
----
efSet

void  efSet(event_flag_name)

This function sets the event flag and causes the execution of the when
statements for all state sets that are
pending on this event flag.
----
I use "@(#)SNC/SEQ Version 1.9.2 : Mon Jul 14 09:13:18 1997" and 
find out that efSet() function sets the event flag but DOES NOT cause
the execution of the when statements for all state sets that are
pending on this event flag.

Below I include fragment of my program with state "ID_mgr".
Statement "when(delay(0.05)) {..." is executed 20 times a second and it
change event flag "err_flg". I expected that program should 
switch to the state "butt" as soon as second "when" statement becomes
"true". But id does not occur, until I'll change the database variable
to which a "rotary" variable is assigned.

Are there some other ways to trigger calculation of expressions inside
the "when" statements? Any suggestions are welcome.
  
Thank you in advance, 
----------------------------------------------------------------------
Oleg Makarov      Phone: 630 252-9138      Advanced Photon Source     
                  Fax:   630 252-9303      Argonne National Laboratory
                  [email protected]      9700 South Cass Avenue     
                                           Argonne, IL 60439-4800     
----------------------------------------------------------------------


Fragment of my program:

  state ID_mgr {
/* detection of the huge taper with motor controllers */
    when(efTestAndClear(trbl_flg)) {
      access_info1 = id_access; id_access = 1; pvPut(id_access);
tsLocalTime(&tmc);
      sprintf(desc_ds, "Call ID System Manager"); pvPut(desc_ds); 
      print_status(fd, "ID control error, gap =", gap_avg, tmc);
    } state ID_mgr

    when( efTestAndClear(err_flg) && (fabs(usm-dsm) <= 10.0)
          && (((usl_err <= 1.0) && (dsl_err <= 1.0)) || rotary) 
          && (((usr_err <= 1.0) && (dsr_err <= 1.0)) || !rotary)
          && (gap_us >= min_gap) && (gap_ds >= min_gap)
          && (gap_us <= max_gap) && (gap_ds <= max_gap) ) {
      id_access = access_info1; pvPut(id_access); tsLocalTime(&tmc);
      sprintf(desc_ds, "Error recovered"); pvPut(desc_ds); 
      print_status(fd, "ID control recovered, gap =", gap_avg, tmc);
    } state butt

/* if nothing to do, restart for encoder-chain readout */
    when(delay(0.05)) { pvPut(start); efClear(err_flg); taskDelay(2);
efSet(err_flg); } state ID_mgr

/* detect change of the encoder values */
    when(usl_ != usl){ usl_err = usl - usl_; usl_ = usl; calc_usm();
                       calc_dsm();} state ID_mgr
    when(dsl_ != dsl){ dsl_err = dsl - dsl_; dsl_ = dsl; calc_usm();
                       calc_dsm();} state ID_mgr
    when(usr_ != usr){ usr_err = usr - usr_; usr_ = usr; calc_usm();
                       calc_dsm();} state ID_mgr
    when(dsr_ != dsr){ dsr_err = dsr - dsr_; dsr_ = dsr; calc_usm();
                       calc_dsm();} state ID_mgr

  }

Navigate by Date:
Prev: Military Service. Help needed !!! Eric Boucher
Next: [no subject] Jeff Hill
Index: 1994  1995  1996  <19971998  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: Military Service. Help needed !!! Eric Boucher
Next: [no subject] Jeff Hill
Index: 1994  1995  1996  <19971998  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 
ANJ, 10 Aug 2010 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·