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: counter of clients for specific PV in IOC
From: Andrew Johnson <[email protected]>
To: [email protected]
Date: Tue, 5 Jun 2012 10:11:02 -0500
Hi Yingbing,

On 2012-06-04 Yingbing Yan wrote:
> 
> Is there a function to get the counter of clients for specific PV?
> Such as:
> void casStatsFetch ( unsigned *pChanCount, unsigned *pConnCount );
> Using this function, we can only monitor the clients of the whole ioc
> rather than some channel.

There is an iocsh command 'dbel' which displays that information for all the 
fields of a named record, but unfortunately no function you can call to fetch 
that information directly from your code:

epics> help dbel
dbel 'record name' level
epics> dbel
epics> dbel anj:exit
1 PV Event Subscriptions ( monitors ).
epics> dbel anj:exit 1
1 PV Event Subscriptions ( monitors ).
 VAL { VALUE ALARM }
epics> dbel anj:exit 2
1 PV Event Subscriptions ( monitors ).
 VAL { VALUE ALARM }, thread=0x7f470c0095d0, queue empty

A subroutine record can get the number of clients that are monitoring its own 
fields using the expression
    prec->mlis.count
A subroutine can do this because the record's lock-set is locked while the 
record is processed and the subroutine is called; if you wanted to access that 
field outside of the subroutine you would need to lock the record's lock-set 
first using dbScanLock(prec) and dbScanUnlock(prec).

- Andrew
-- 
Never interrupt your enemy when he is making a mistake.
-- Napoleon Bonaparte

References:
counter of clients for specific PV in IOC Yingbing Yan

Navigate by Date:
Prev: RE: a MEDM replacement Mark Rivers
Next: Re: mask for bitwise operation in CALC record Eric Norum
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: counter of clients for specific PV in IOC Yingbing Yan
Next: ASYN 4-19 createParam return status Hinko Kocevar
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 ·