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  2020  <20212022  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  2020  <20212022  2023  2024 
<== Date ==> <== Thread ==>

Subject: CALC record LINK INVALID status
From: Eric Norum via Tech-talk <tech-talk at aps.anl.gov>
To: Michael Davidsaver via Tech-talk <tech-talk at aps.anl.gov>
Date: Sat, 3 Jul 2021 15:23:53 -0700
Base R3.15.7     ASYN R4-38

My intent is to push output record values to an attached FPGA when the FPGA powers up or when communication to the FPGA is restored.  To do this I have a periodically-scanned record that monitors the FPGA power-up status and a CALC record that attempts to detect communication restoration or FPGA power-up:
#
# Value of this record is the FPGA power-up status.
#
record(bi, "$(P)$(R)FPGA:Powerup") {
    field(DESC, "Trigger sysmon read. FPGA power-up?")
    field(DTYP, "asynInt32")
    field(INP,  "@asyn($(PORT) 0x0000 0)")
    field(SCAN, "2 second")
    field(ZNAM, "Not restarted")
    field(ONAM, "Restarted")
    field(FLNK, "$(P)$(R)IOC:reconChk_")
}
#
# Monitor the status of the FPGA power-up status record (B) to detect
# reconnection and monitor the value (A) to detect FPGA power up.
# Push output record values to FPGA when required.
#
record(calcout, "$(P)$(R)IOC:reconChk_") {
    field(DESC, "Trigger push on reconnect or power up")
    field(INPA, "$(P)$(R)FPGA:Powerup NPP NMS")
    field(INPB, "$(P)$(R)FPGA:Powerup.STAT NPP NMS")
    field(INPC, "0")
    field(CALC, "B=0&&((C!=0)||A);C:=B")
    field(OOPT, "When Non-zero")
    field(TPRO, 1)
    field(OUT,  "$(P)$(R)IOC:recon_.PROC")
}
record(fanout, "$(P)$(R)IOC:reconA_") {
    field(PINI, "YES”)
. . . Here’s where I have the LNKx records that trigger output record processing . . .
    field(FLNK, “$(P)$(R)IOC:clrPwrup_")
}
record(longout, "$(P)$(R)IOC:clrPwrup_") {
    field(DESC, "Clear FPGA power-up status")
    field(DTYP, "asynInt32")
    field(OUT,  "@asyn($(PORT) 0x1000 0)")
}
 
But this doesn’t seem to work.  When communication is broken and restored (the ‘Dalesio Test’) the calcout record is in a weird state.  The problem is illustrated by monitoring a few things:
camonitor TEST:IOC:reconChk_ TEST:IOC:reconChk_.A TEST:IOC:reconChk_.B TEST:FPGA:Powerup
TEST:IOC:reconChk_         2021-07-03 14:57:04.957026 0
TEST:IOC:reconChk_.A       2021-07-03 14:57:04.957026 0
TEST:IOC:reconChk_.B       2021-07-03 14:57:04.957026 0
TEST:FPGA:Powerup          2021-07-03 14:57:04.957004 Not restarted
<<<< Here’s where I unplugged the network cable >>>>>
TEST:FPGA:Powerup          2021-07-03 14:57:11.573206 Not restarted READ INVALID
TEST:IOC:reconChk_.B       2021-07-03 14:57:11.573230 1
<<<<< Here’s where I reconnected the network cable >>>>>
TEST:FPGA:Powerup          2021-07-03 14:57:24.957220 Not restarted
TEST:IOC:reconChk_         2021-07-03 14:57:24.957249 1 LINK INVALID     <<<<< Why is this happening? Link has NMS
TEST:IOC:reconChk_.A       2021-07-03 14:57:24.957249 0 LINK INVALID
TEST:IOC:reconChk_.B       2021-07-03 14:57:24.957249 0 LINK INVALID
TEST:IOC:reconChk_         2021-07-03 14:57:26.957653 0
TEST:IOC:reconChk_.A       2021-07-03 14:57:26.957653 0
TEST:IOC:reconChk_.B       2021-07-03 14:57:26.957653 0

So even though the CALC record value is non-zero, the value isn’t pushed to the OUT link and the fanout and assorted downstream records don’t process.
I tried with OOPT=“Transition To Zero” and got the same result.
Why is the CALC record going into LINK INVALID state?  Do I misunderstand what NMS is supposed to do?
— 
Eric Norum





Navigate by Date:
Prev: Segmentation fault when Gateway calls ca_clear_channel: removing node from empty createReqPend linked list Paduan Donadio, Marcio via Tech-talk
Next: Re: EPICS compilation Adrian Martinez 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  2020  <20212022  2023  2024 
Navigate by Thread:
Prev: Segmentation fault when Gateway calls ca_clear_channel: removing node from empty createReqPend linked list Paduan Donadio, Marcio via Tech-talk
Next: pythonIoc is now a python package rather than an EPICS support module Cobb, Tom (DLSLtd,RAL,LSCI) 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  2020  <20212022  2023  2024 
ANJ, 05 Jul 2021 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·