EPICS Controls 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  2019  <20202021  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  2019  <20202021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: aSub debug output
From: "Johnson, Andrew N. via Tech-talk" <tech-talk at aps.anl.gov>
To: Michael Davidsaver <mdavidsaver at gmail.com>
Cc: EPICS tech-talk <tech-talk at aps.anl.gov>, "Daykin, Evan" <daykin at frib.msu.edu>
Date: Wed, 2 Dec 2020 23:19:21 +0000
On Dec 2, 2020, at 2:39 PM, Michael Davidsaver <mdavidsaver at gmail.com> wrote:

On 12/2/20 11:42 AM, Daykin, Evan via Tech-talk wrote:
Hi again and thank you all for your suggestions.

I spent some time creating a minimal example, and it behaves, of course, as you all said it does – a simple printf works. The problem is that one of my input links was not resolved, so it did not call the subroutine. I didn’t think of this possibility since TPRO showed the record processing, but Martin pointed me to the documentation where it says:

·         If all input-link fetches succeeded, call the routine specified by SNAM.

Now my question becomes: is there a field that can be set such that this failure is not silent, e.g. raise LINK alarm or output some error message indicating which fetch failed?

Not a field, but you can (and imo. should) add the "MSI" modifier to all of your links.

I don’t think Evan needs to set MSI for the record to go into an INVALID/LINK alarm state if one or more of the links isn’t connected, that should be happening anyway. This example uses a subRecord but the same rules apply, the subroutine isn’t called if any of the input links aren’t connected:

woz$ softIoc -x anj
Starting iocInit
############################################################################
## EPICS R3.15.8.1-DEV
## EPICS Base built Nov 25 2020
############################################################################
iocRun: All initialization complete
epics> dbl
anj:BaseVersion
anj:exit
epics> dbpr anj:exit 1
A: 0                ADEL: 0             ASG:                B: 0                
BKPT: 00            BRSV: NO_ALARM      C: 0                D: 0                
DESC: Exit subroutine                   DISA: 0             DISP: 0             
DISS: NO_ALARM      DISV: 1             DTYP: <nil>         E: 0                
EGU:                EVNT:               F: 0                FLNK:CONSTANT 0     
G: 0                H: 0                HHSV: NO_ALARM      HIGH: 0             
HIHI: 0             HOPR: 0             HSV: NO_ALARM       HYST: 0             
I: 0                INAM:               INPA:CONSTANT       INPB:CONSTANT       
INPC:CONSTANT       INPD:CONSTANT       INPE:CONSTANT       INPF:CONSTANT       
INPG:CONSTANT       INPH:CONSTANT       INPI:CONSTANT       INPJ:CONSTANT       
INPK:CONSTANT       INPL:CONSTANT       J: 0                K: 0                
L: 0                LLSV: NO_ALARM      LOLO: 0             LOPR: 0             
LOW: 0              LSV: NO_ALARM       MDEL: 0             NAME: anj:exit      
PACT: 0             PHAS: 0             PINI: NO            PREC: 0             
PRIO: LOW           PUTF: 0             RPRO: 0             SCAN: Passive       
SDIS:CONSTANT       SEVR: INVALID       SNAM: exit          STAT: UDF           
TPRO: 0             TSE: 0              TSEL:CONSTANT       UDF: 1              
UDFS: INVALID       VAL: 0              
epics> dbpf anj:exit.INPA this-is-not-a-real-pv
DBR_STRING:          "this-is-not-a-real-pv NPP NMS"        
epics> dbpf anj:exit.PROC 1
DBR_UCHAR:          1         0x1                 
epics> dbpr anj:exit 1
A: 0                ADEL: 0             ASG:                B: 0                
BKPT: 00            BRSV: NO_ALARM      C: 0                D: 0                
DESC: Exit subroutine                   DISA: 0             DISP: 0             
DISS: NO_ALARM      DISV: 1             DTYP: <nil>         E: 0                
EGU:                EVNT:               F: 0                FLNK:CONSTANT 0     
G: 0                H: 0                HHSV: NO_ALARM      HIGH: 0             
HIHI: 0             HOPR: 0             HSV: NO_ALARM       HYST: 0             
I: 0                INAM:               
INPA:CA_LINK this-is-not-a-real-pv NPP NMS                  INPB:CONSTANT       
INPC:CONSTANT       INPD:CONSTANT       INPE:CONSTANT       INPF:CONSTANT       
INPG:CONSTANT       INPH:CONSTANT       INPI:CONSTANT       INPJ:CONSTANT       
INPK:CONSTANT       INPL:CONSTANT       J: 0                K: 0                
L: 0                LLSV: NO_ALARM      LOLO: 0             LOPR: 0             
LOW: 0              LSV: NO_ALARM       MDEL: 0             NAME: anj:exit      
PACT: 0             PHAS: 0             PINI: NO            PREC: 0             
PRIO: LOW           PUTF: 0             RPRO: 0             SCAN: Passive       
SDIS:CONSTANT       SEVR: INVALID       SNAM: exit          STAT: LINK          
TPRO: 0             TSE: 0              TSEL:CONSTANT       UDF: 1              
UDFS: INVALID       VAL: 0

Note that in the second dbpr output SEVR: INVALID STAT: LINK show that the record is in alarm state because the INPA field wasn’t connected. How you might flag that to a human when it happens is a different question though, records go into alarm state all the time and never announce that on the IOC console. Maybe some other parts of the database or its clients need to monitor the record’s alarm state if this situation can arise and needs to be known about?

Note that there is an iocsh command which tells you about any unconnected CA links in the database:

epics> dbcar
CA links in all records

Total 1 CA link; 0 connected, 1 not connected.
    0 can't read, 0 can't write.  (0 disconnects, 0 writes prohibited)

epics> dbcar * 1
CA links in all records

                    anj:exit.INPA --> this-is-not-a-real-pv         (0, 0)

Total 1 CA link; 0 connected, 1 not connected.
    0 can't read, 0 can't write.  (0 disconnects, 0 writes prohibited)


If you have devIocStats loaded that has PVs that report the connected and disconnected counts.

- Andrew

-- 
Complexity comes for free, simplicity you have to work for.


Replies:
Re: aSub debug output Michael Davidsaver via Tech-talk
RE: aSub debug output Daykin, Evan via Tech-talk
References:
aSub debug output Daykin, Evan via Tech-talk
Re: aSub debug output Johnson, Andrew N. via Tech-talk
RE: aSub debug output Daykin, Evan via Tech-talk
Re: aSub debug output Michael Davidsaver via Tech-talk

Navigate by Date:
Prev: RE: EPICS support for Harvard Pump 33 DDS Syringe Pump Mark Rivers via Tech-talk
Next: Re: aSub debug output Michael Davidsaver 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  2019  <20202021  2022  2023  2024 
Navigate by Thread:
Prev: Re: aSub debug output Michael Davidsaver via Tech-talk
Next: Re: aSub debug output Michael Davidsaver 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  2019  <20202021  2022  2023  2024 
ANJ, 03 Dec 2020 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·