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  <20112012  2013  2014  2015  2016  2017  2018  2019  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  <20112012  2013  2014  2015  2016  2017  2018  2019 
<== Date ==> <== Thread ==>

Subject: Re: question about previous value of ai
From: "Steven M. Hartman" <hartmansm@ornl.gov>
To: tech-talk <tech-talk@aps.anl.gov>
Date: Wed, 09 Mar 2011 09:29:04 -0500
Ralph Lange wrote:
On 09.03.2011 08:55 Silver wrote:
   I use an ai record to retrive the value from hardware, in my SNL program, I want to compare the previous value of ai and the new value, then do some action.
   how can I get the previous of ai?

Either - in the SNL program - by assigning the current value to a local variable as part of your action.

Or - in the database - by adding another ai record that pulls the old value from your hardware-ai before processing it via FLNK. (Won't work for I/O scanned hardware ai.)

Or - in the database - by adding a compress record that is configured as a ring buffer, which can hold the arbitrary length history of an ai.

or . . .

record(ai,"MyAi") {
. . .
  field(FLNK,"MyCalc")
}
record(calc,"MyCalc") {
  field(DESC,"ai value increasing?")
  field(INPA,"MyAi")
  field(INPB,"MyCalc.LA")
  field(CALC,"A>B")
}


--
Steven Hartman
hartmansm@ornl.gov

References:
question about previous value of ai Silver
Re: question about previous value of ai Ralph Lange

Navigate by Date:
Prev: RE: Asyn/Modbus Delay Mark Rivers
Next: Re: EDM X/Y Eric Norum
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  <20112012  2013  2014  2015  2016  2017  2018  2019 
Navigate by Thread:
Prev: Re: question about previous value of ai Ralph Lange
Next: Waveform string and initialization emmanuel_mayssat
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  <20112012  2013  2014  2015  2016  2017  2018  2019 
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 ·