EPICS Home

Experimental Physics and Industrial Control System


 
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  <20202021  2022  2023  2024  2025  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  <20202021  2022  2023  2024  2025 
<== Date ==> <== Thread ==>

Subject: Re: How can I use pvapy or p4p to monitor multiple PVS
From: "Veseli, Sinisa via Tech-talk" <tech-talk at aps.anl.gov>
To: tech-talk <tech-talk at aps.anl.gov>, "qt980319 at mail.ustc.edu.cn" <qt980319 at mail.ustc.edu.cn>
Date: Tue, 13 Oct 2020 14:32:13 +0000
Hello,

Here are the pvapy examples that monitor multiple channels: 

https://github.com/epics-base/pvaPy/blob/master/examples/scaleN.py
https://github.com/epics-base/pvaPy/blob/master/examples/spamN.py

The above should work for tens of thousands pv's that update at a rate of 1Hz or so.

Also, the latest pvapy documentation can be found here: https://epics.anl.gov/extensions/pvaPy/production/index.html.

Best Regards,

Sinisa



--
Siniša Veseli
Scientific Software Engineering & Data Management
Advanced Photon Source
Argonne National Laboratory
sveseli at anl.gov
(630)252-9182

From: Tech-talk <tech-talk-bounces at aps.anl.gov> on behalf of =?utf-8?b?56em5aSpIHZpYSBUZWNoLXRhbGsgPHRlY2gtdGFsa0BhcHMuYW5sLmdv?=@aps.anl.gov <=?utf-8?b?56em5aSpIHZpYSBUZWNoLXRhbGsgPHRlY2gtdGFsa0BhcHMuYW5sLmdv?=@aps.anl.gov>
Sent: Tuesday, October 13, 2020 7:18 AM
To: Rivers, Mark L. <rivers at cars.uchicago.edu>; Marty Kraimer <mrkraimer at comcast.net>; tech-talk <tech-talk at aps.anl.gov>
Subject: Re: How can I use pvapy or p4p to monitor multiple PVS
 
Thank you for your answer.I've solved my problem.
I need to loop to create an associated class object for each pv.Then use each class object to execute the monitor function.
For example
 |  for i in range(51):
 |	if pvnames[i] == 'xkSun:test50Scalar:aiExample1':
 |          globals()['pv' + str(i)] = pv_monitor(pvnames[i])
 |          globals()['pv' + str(i)].my_monitor()
 |  def my_monitor(self):
 |     ctxt.monitor(self.pv, self.onChanges)

-------------------------------------------------------------------------------------------------------------------------------------------------------
Subject:Re: How can I use pvapy or p4p to monitor multiple PVS
From:Marty Kraimer via Tech-talk <tech-talk at aps.anl.gov>
To:tech-talk at aps.anl.gov
Date:Tue, 13 Oct 2020 06:06:15 -0400
What Mark said should work.
Note that pvaPy also has methods: subscribe,unsubscribe,startMonitor,stopMonitor.
For example
 |             def echo(x):
 |                  print 'New PV value: ', x
 |              channel = Channel('exampleFloat')
 |              channel.subscribe('echo', echo)
 |              channel.startMonitor()

Marty
-------------------------------------------------------------------------------------------------------------------------------------------------------
Subject:Re: How can I use pvapy or p4p to monitor multiple PVS
From:Mark Rivers via Tech-talk <tech-talk at aps.anl.gov>
To:"qt980319 at mail.ustc.edu.cn" <qt980319 at mail.ustc.edu.cn>
Cc:"sunxk at ustc.edu.cn" <sunxk at ustc.edu.cn>, "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov>
Date:Tue, 13 Oct 2020 03:54:32 +0000
However, in the process of testing it, it was found that only a single PV can be monitored

In p4p can’t you just call the monitor() method multiple times, once for each PV that you want to monitor?

In pvapy can’t you just create a Channel object for each PV, and call it’s monitor() method?

Mark

References:
Re: How can I use pvapy or p4p to monitor multiple PVS 秦天 via Tech-talk <tech-talk at aps.anl.go

Navigate by Date:
Prev: Re: EPICS timestamp in the archiver appliance Shankar, Murali via Tech-talk
Next: Re: EPICS timestamp in the archiver appliance Brown, Garth via Tech-talk
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  <20202021  2022  2023  2024  2025 
Navigate by Thread:
Prev: Re: How can I use pvapy or p4p to monitor multiple PVS 秦天 via Tech-talk <tech-talk at aps.anl.go
Next: Re: How can I use pvapy or p4p to monitor multiple PVS 秦天 via Tech-talk <tech-talk at aps.anl.go
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  <20202021  2022  2023  2024  2025