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

Subject: RE: Creating an error counter
From: Mark Rivers <[email protected]>
To: "'Ford, Christopher'" <[email protected]>, "Flewellen-Gore, Andrew (US)" <[email protected]>, "[email protected]" <[email protected]>
Date: Thu, 20 Jul 2017 17:57:54 +0000

VAL is a legal operand.  This is from the CALC record in the Record Reference Manual:  https://wiki-ext.aps.anl.gov/epics/index.php/RRM_3-14_Calculation

 

******************

The keyword VAL returns the current contents of the VAL field (which can be written to by a CA put, so it might not be the result from last time the _expression_ was evaluated).

******************

 

Mark

 

 

 

From: [email protected] [mailto:[email protected]] On Behalf Of Ford, Christopher
Sent: Thursday, July 20, 2017 12:53 PM
To: Flewellen-Gore, Andrew (US); [email protected]
Subject: Re: Creating an error counter

 

Hi Andrew,

I have not seen VAL used as an operand of a calc _expression_.

Please consider setting INPB to "$(P):$(R):DEBUG:COUNTER" and then simplifying the calc _expression_ to "A+B".

Thanks,

 -Chris Ford

  SLAC

 


From: [email protected] <[email protected]> on behalf of Flewellen-Gore, Andrew (US) <[email protected]>
Sent: Thursday, July 20, 2017 9:49 AM
To: [email protected]
Subject: Creating an error counter

 

Hello, and thanks for reading,

 

I’m having trouble keeping a counter for the number of errors coming in from an electron microscope (SEM). I’m using the Stream device driver to listen to incoming messages from the SEM, and when a message matches a certain format that identifies it as an error message, the PV processes and stores the new error message, overwriting the last. When this happens I would like to have a second record process and increment a counter, so that I can keep track of the number of error messages coming in.

 

My current setup gets the most recent error message correctly, but does not correctly increment the counter (the counter stays at zero). Here is the relevant code from the record definition file.

 

record(waveform,$(P):$(R):DEBUG:LISTEN)  {

    field(DESC,"Holds last SEM error")

    field(DTYP,"stream")

    field(NELM,"1000")

    field(FTVL,"CHAR")

    field(SCAN,"I/O Intr")

    field(FLNK,"$(P):$(R):DEBUG:COUNTER")

    field(INP, "@devhardware.proto debugListen() L5 0")

}

 

record(calc,$(P):$(R):DEBUG:COUNTER)  {

    field(DESC,"Counter of # of errors")

    field(SCAN,"Passive")

    field(INPA,"1")

    field(CALC,"VAL+A")

}

 

When the first record processes due to an interrupt on a received error message, it is supposed to forward-link the calc record to process, causing an increment to the counter.

 

Any help or insight is appreciated.

-Andrew


References:
Re: Creating an error counter Ford, Christopher

Navigate by Date:
Prev: Re: Creating an error counter Ford, Christopher
Next: Re: Creating an error counter Southern, Tim
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <20172018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: Creating an error counter Ford, Christopher
Next: autosave R5-8 release Mooney, Tim M.
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <20172018  2019  2020  2021  2022  2023  2024