Argonne National Laboratory

Experimental Physics and
Industrial Control System

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

Subject: Re: CALC record question
From: wright@luke.atdiv.lanl.gov (Rozelle Wright)
To: wright@LANL.GOV
Cc: tech-talk@aps.anl.gov
Date: Fri, 29 Mar 96 16:26:14 MST
ajf@ast.cam.ac.uk
> From ajf@ast.cam.ac.uk Fri Mar 29 10:50:35 1996
> Return-Path: <ajf@ast.cam.ac.uk>
> Date: Fri, 29 Mar 1996 17:48:19 +0000 (GMT)
> X-Sender: ajf@orc
> To: Epics Questions <tech-talk@aps.anl.gov>
> Subject: CALC record question
> Mime-Version: 1.0
> Content-Type> : > TEXT/PLAIN> ; > charset=US-ASCII> 
> Content-Length: 1361
> X-Lines: 39
> 
> 
> Can anyone help me with the following:
> 
> I am trying to reset a value used in a calculation record
> from a button on a 'dm' screen. The CALC field is set to
> A+1 and the VAL field is looped back to INPA, so that continual
> processing of the calculation record gives: 1, 2, 3, 4, etc.
> 
> I want a button on a 'dm' screen such that when it is pressed, the
> above calculation starts again at 0. I thought this should be easy
> but haven't managed it yet. 
> 
> I tried letting the button press put the
> value 0 into INPB and changing CALC to B*{A+1} so that, 
> normally B=1 and we have as before. When the button is
> pressed, the record processes once with B=0 and then the
> whole thing starts again. 
> 
> This doesn't work.
> I suppose because the above means that INPB needs to take two 
> inputs (the first, a hardwired 1, the second a 0 put into B when 
> the button is pressed). 
> In this case, how can the calculation record know which value it is 
> supposed to be using? Or am I going about this in totally the wrong way?
> 
> Any help would be greatly appreciated?
> 
> Cheers,
> 
> Andy 
> 
> ===================================================================================
> Andy Foster
> Royal Greenwich Observatory	Tel:       44 (0)1223 374899 (direct)
> Madingley Road			Fax:       44 (0)1223 374700
> Cambridge			E-mail:    ajf@ast.cam.ac.uk
> CB3 0HA				Home Page: http://www.ast.cam.ac.uk/~ajf
> UK
> 
> 
Hi Andy,
This may work for you.
I am using edd/dm version 2.2.

If the record is scanned periodically and
  CALC : B*(A+1),
Make a message button which addresses <your calculation record name>.B.
You can label it reset.
Make the press value 0 and the reset value 1.
To reset, you must hold the button down until the counter actually resets, because
when the channel processes it gets the last value written
and if your button goes down and up too fast
you will just get the 1.



If you want a counter to cycle instead
you can do the following.  
My channel is called "counter".

CALC: A<B?A+1:C
A:counter.val
B:<number before counter recycles>
C:0

To reset the counter. Make a message button
which addresses counter.B, with the press value 0
and the release value the original value of B.  

If your counter is not scanned periodically is passive because it is counting some other event,
then you may need something more complicated involving other records
such as Tim Mooney's suggestion.
 
Rozelle




Navigate by Date:
Prev: Re: CALC record question Tim Mooney
Next: Re: CALC record question Rozelle Wright
Index: 1994  1995  <19961997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020 
Navigate by Thread:
Prev: Re: CALC record question Tim Mooney
Next: Re: CALC record question Rozelle Wright
Index: 1994  1995  <19961997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020 
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 ·