Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014  2015  2016  2017  2018  2019  2020  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014  2015  2016  2017  2018  2019  2020 
<== Date ==> <== Thread ==>

Subject: Re: sequencer & button click
From: Wesley Moore <wmoore@jlab.org>
To: Martin Konrad <konrad@ikp.tu-darmstadt.de>
Cc: tech-talk@aps.anl.gov
Date: Fri, 20 Jul 2012 11:57:19 -0400 (EDT)
> From: "Martin Konrad" <konrad@ikp.tu-darmstadt.de>
> what's the recommended way to switch from one sequencer state to
> another
> if a button is clicked on the OPI? What type of record do you use for
> this? What does the "when" statement look like?

I'm following on Ben's recommendation of using bi/bo records.  I've found to be very flexible for later additions of "user commands" and it's easy to read/debug later.  Using bi/bo makes your GUI easy too.  Ben's example showed mbbo.  Here's using a bo for operations.


short scanBtn;   assign scanBtn to "scan";   monitor scanBtn;
short zeroBtn;   assign zeroBtn to "zero";   monitor zeroBtn;

ss ... {
  ...
  state idle {
    when (scanBtn) {
    } state makeScan

    when (abortBtn) {  
        /* bogus abort, just clear the button. */
        abortBtn = 0;
        pvPut(abortBtn);
    } state idle
  }

  state makeScan {
    when (scanBtn) {
      /* do stuff, check for abortBtn. */
      /* then make sure to reset button! */
      scanBtn = 0;
      pvPut(scanBtn);
    } state idle
  }
}

Hope this might help.

Wesley

Replies:
Re: sequencer & button click Martin Konrad
References:
sequencer & button click Martin Konrad

Navigate by Date:
Prev: Re: sequencer & button click Benjamin Franksen
Next: Re: sequencer & button click Martin Konrad
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014  2015  2016  2017  2018  2019  2020 
Navigate by Thread:
Prev: Re: sequencer & button click Benjamin Franksen
Next: Re: sequencer & button click Martin Konrad
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014  2015  2016  2017  2018  2019  2020 
ANJ, 18 Nov 2013 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·