2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 <2024> 2025 | Index | 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 <2024> 2025 |
<== Date ==> | <== Thread ==> |
---|
Subject: | RE: pC_->doCallbacksEnum() coming too early |
From: | Mark Rivers via Core-talk <core-talk at aps.anl.gov> |
To: | Torsten Bögershausen <tboegi at edom.se>, "core-talk at aps.anl.gov" <core-talk at aps.anl.gov> |
Date: | Tue, 27 Feb 2024 22:51:19 +0000 |
This Message Is From an External Sender
This message came from outside your organization.
Hi Torsten, Ø The PLC gives us some names for enmums, resulting in a call to Ø pC_->doCallbacksEnum() doCallbacksEnum() is only intended to be called when an enum value changes at run-time, i.e. after iocInit. For enums that the driver determines at initialization you should simply implement
the asynPortDriver::readEnum() method. Device support will call your driver during iocInit to read the enum values/strings/severities for all records with enum VAL fields. testAsynPortDriver has an example here: It also has an example of using doCallbacksEnum(), which it does when the vertical gain is changed at run time. Mark From: Core-talk <core-talk-bounces at aps.anl.gov>
On Behalf Of Johnson, Andrew N. via Core-talk Hi Torsten, I assume this an Asyn port driver; what is triggering the I/O that results in your code doing that callback? The callback shouldn't happen until after the EPICS global
interruptAccept is non-zero, any earlier than that and the IOC and records won't be ready for device support to call it. The asynPortDriver code looks like
it ignores all such calls before then. If the code needs something to trigger that processing it could register an initHook and wait for the value
initHookAfterInterruptAccept, which is only sent once (i.e. it doesn't get repeated if the IOC is paused), or for
initHookAfterDatabaseRunning which is repeated after an IOC pause is rescinded. HTH, - Andrew -- Complexity comes for free, Simplicity you have to work for. |