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  <20122013  2014  2015  2016  2017  2018  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  <20122013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: Calcout using CA output link sometimes gets INVALID severity
From: "J. Lewis Muir" <[email protected]>
To: Andrew Johnson <[email protected]>
Cc: [email protected]
Date: Fri, 12 Oct 2012 10:45:33 -0500
On 10/12/12 10:09 AM, Andrew Johnson wrote:
> Hi Lewis,
> 
> On 2012-10-11 J. Lewis Muir wrote:
>> I've got a problem with a calcout record where, if I do a dbpf
>> after iocInit on an ao record that has a forward link to the
>> calcout record which in turn reads the ao record VAL field and
>> writes a calculated value to an ai record using a Channel Access
>> output link, sometimes the calcout record's SEVR field will be
>> INVALID, and it does not write the calculated value to the ai
>> record.  This doesn't happen every time, but I can usually get
>> it to happen within 5 tries.  If I change the output link type
>> from CA to PP, the problem goes away.  Does anyone know what's
>> wrong?
> 
> Is the dbpf that triggers this in the IOC's startup script, or being issued 
> manually?

Hi, Andrew.

It is in the IOC's start-up script.

> I'm guessing it's in the script, and I suspect what's happening 
> when you get the link alarm may be that the CA link hasn't finished connecting 
> up by the time the dbpf runs.  CA link processing involves several different 
> threads even when the target PV is local, and if they haven't all had a chance 
> to finish before the calcout runs and uses the link then the link operation 
> will fail and put the record into a LINK/INVALID alarm state.
> 
> Try inserting an epicsThreadSleep(2) delay between iocInit and the dbpf 
> command, which should be enough time for your local CA links to connect up.

Yes, inserting the delay makes the problem go away.

But this seems like a bug to me.  Isn't the IOC supposed to be
in the "running" state after iocInit completes?  I would expect
this to mean that any threads related to CA link processing have
completed starting and are in a state ready to service CA
requests.  I would not expect to have to insert epicsThreadSleep
calls after iocInit to make things work.

Also, I don't know exactly how the pause and run stuff works,
but if the IOC is paused and then run again at a later time,
will the same problem occur?  If so, I guess I'd have to add a
delay on coming out of the paused state to ensure my record will
process correctly.  That would be pretty lame.

Thanks,

Lewis

Replies:
Re: Calcout using CA output link sometimes gets INVALID severity Ralph Lange
Re: Calcout using CA output link sometimes gets INVALID severity Andrew Johnson
References:
Calcout using CA output link sometimes gets INVALID severity J. Lewis Muir
Re: Calcout using CA output link sometimes gets INVALID severity Andrew Johnson

Navigate by Date:
Prev: Re: Calcout using CA output link sometimes gets INVALID severity Andrew Johnson
Next: Re: Calcout using CA output link sometimes gets INVALID severity Ralph Lange
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: Calcout using CA output link sometimes gets INVALID severity Andrew Johnson
Next: Re: Calcout using CA output link sometimes gets INVALID severity Ralph Lange
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 18 Nov 2013 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·