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

Subject: Problem with a calc record
From: CAPOBIANCO Roberto via Tech-talk <tech-talk@aps.anl.gov>
To: tech-talk@aps.anl.gov
Date: Tue, 28 May 2019 13:25:52 +0200
Dear All,

I want to check if a counter is alive or not. I wrote these two simple simulation records:

record (calc, "CNT")
{
       field (INPA, "CNT")
       field (CALC, "A+1")
       field (DISV, "1")
}
record (calc, "CNT2")
{
       field (INPA, "CNT NPP")
       field (INPB, "CNT PP")
       field (CALC, "B-A")
      field (SCAN, "1 second")
}

Everything works, the calc record CNT2 returns 1 except when I decide to stop the counter CNT giving it DISA = 1. In this case it returns 0. When I do the same thing on my real hardware, the record calc doesn't work, it always returns 0 (INPA and INPB are incremented but equally).
The PLC sends data to the ai record each 100ms using s7nodave driver.

record (ai, "$(CU):CPC-CNT1")
{
    field (DESC, "Alive counter")
    field (DTYP, "s7nodave")
    field (INP, "@$(CU) DB1.DBD0 int32")
    field (PINI, "YES")
    field (VAL, "0")
}
record (calc, "CNT2")
{
       field (INPA, "$(CU):CPC-CNT1 NPP")
       field (INPB, "$(CU):CPC-CNT1 PP")
       field (CALC, "B-A")
      field (SCAN, "1 second")
}

What I'am doing wrong?
Roberto Capobianco

Replies:
Re: Problem with a calc record Ralph Lange via Tech-talk

Navigate by Date:
Prev: Re: Scanning 101 Hinko Kocevar via Tech-talk
Next: Re: Problem with a calc record Ralph Lange via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  <20192020 
Navigate by Thread:
Prev: Re: [EXTERNAL] FW: I/O Intr scanning Klemen Vodopivec via Tech-talk
Next: Re: Problem with a calc record Ralph Lange via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  <20192020 
ANJ, 28 May 2019 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·