Hi Mark,
On 09/13/2012 02:36 PM, Mark Rivers wrote:
Hi Hinko,
I'm not quite sure I understand what you are asking.
Thank you for replying, let me try to elaborate.
By default we wanted to use notifications from out application toward
the Asyn in order to get new values pushed to the PV as soon as
possible. This works like a charm for slow update rates. At higher rates
this burns too much CPU time, and other more relevant processing starves.
Currently SCAN is set to I/O Intr and PV value refreshes as expected. I
can also understand that setting SCAN to Passive would do all the
required magic in order to stop EPICS code from processing the record.
BUT, our code that talks to the application has no way of knowing that
user set EPICS PV to be scanned passively - and not on incoming
notification event from the application. Hence the Asyn part of the code
that talks to our application still receives large amounts of events,
that just hog CPU, memory and network, and does not update PV value as
expected. We want to get rid of those unwanted notifications from
arriving to the IOC when PV is not in SCAN=I/O Intr.
I have means to disable the application notifications from being
emitted, but I need to know when == thats is why I was asking how to
know what SCAN value is currently set for the record (PV) that this Asyn
param serves. By knowing if the SCAN is Passive or not I can register /
unregister EPICS IOC notification reception of application notify events.
For majority of PVs that are using I/O Intr and refresh upon
notification reception we want to keep things as are. But for some
exceptions we would need to have more information about the PV "state"
(i.e. SCAN field value).
HTH,
Hinko
Here is what I recommend:
- Use the standard asyn device support that comes with asyn. It automatically registers for callbacks with your driver when the record is set to SCAN=I/O Intr, and unregisters when SCAN is set to something else. That is registering/unregistering the record from your driver, not your driver from the application server.
- Your driver uses the normal asynManager functions for doing callbacks, which traverses a linked list of registered callback clients. If there are no records with SCAN=I/O Intr then your driver will find an empty list.
- One approach is to have your application server ALWAYS do callbacks to your driver, so your driver always has the latest value. If records are put into SCAN=1 second for example, then they will call the asynInt32->read() function in your driver (for example), where they will always get the latest value.
- An alternative approach is to have the asynInt32->read() function in your driver poll the application server, rather than always getting callbacks.
Which approach to use depends on the frequency with which values are changing in your application server. If they are changing very fast and there are no records with SCAN=I/O Intr then polling is more efficient. If they are changing slowly then callbacks is more efficient.
There is no mechanism for your driver to be asynchronously notified when the number of registered callback clients on an interface changes. However, you can use pasynManager->interrupt start to query the number of clients from the size of the linked list.
Mark
_______________________________________
From: [email protected] [[email protected]] on behalf of Hinko Kocevar [[email protected]]
Sent: Thursday, September 13, 2012 1:44 AM
To: Tech Talk
Subject: access record info from asyn
Hi,
I'm writing Asyn driver that will interface our application daemon
running on Linux OS.
Application daemon is capable of emitting notifications that can tell
the client (asyn) that there is a change in value. Asyn driver would
register a callback to receive this notifications - everything is nice
and running till now, assuming that record SCAN field is set to I/O Intr
(camonitor refreshes value as expected).
How can I detect if user wants to change the SCAN field value to
Passive? This would in turn mean that we need to unregister from the
notifications that our application is sending and expect the user to do
caget like access.
Thank you!
Hinko
--
Hinko Kocevar
Software development engineer
Instrumentation Technologies d.d.
Velika pot 22, SI-5250 Solkan - Slovenia
T:+386 5 3352600, F:+386 5 3352601
E-mail: [email protected]
http://www.i-tech.si
The information transmitted is intended solely for the
addressee and may contain confidential and/or privileged
information. Any review, retention, disclosure or other use
by persons other than the intended recipient is prohibited.
If you received this in error, please notify the sender and
delete all copies.
--
Hinko Kocevar
Software development engineer
Instrumentation Technologies d.d.
Velika pot 22, SI-5250 Solkan - Slovenia
T:+386 5 3352600, F:+386 5 3352601
E-mail: [email protected]
http://www.i-tech.si
The information transmitted is intended solely for the
addressee and may contain confidential and/or privileged
information. Any review, retention, disclosure or other use
by persons other than the intended recipient is prohibited.
If you received this in error, please notify the sender and
delete all copies.
- References:
- access record info from asyn Hinko Kocevar
- RE: access record info from asyn Mark Rivers
- Navigate by Date:
- Prev:
RE: access record info from asyn Mark Rivers
- Next:
StreamDevice release 2.6 Dirk Zimoch
- 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
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
Re: access record info from asyn Hinko Kocevar
- Next:
waveform changes using subArray Hinko Kocevar
- 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
2021
2022
2023
2024
|