Hi Hinko,
I'm not quite sure I understand what you are asking.
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.
- Replies:
- RE: access record info from asyn Mark Rivers
- Re: access record info from asyn Hinko Kocevar
- References:
- access record info from asyn Hinko Kocevar
- Navigate by Date:
- Prev:
waveform changes using subArray Hinko Kocevar
- Next:
RE: access record info from asyn Mark Rivers
- 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:
access record info from asyn Hinko Kocevar
- Next:
RE: access record info from asyn Mark Rivers
- 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
|