EPICS Home

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  2021  2022  2023  2024  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  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Problem with a calc record
From: CAPOBIANCO Roberto via Tech-talk <[email protected]>
To: [email protected]
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  2021  2022  2023  2024 
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  2021  2022  2023  2024