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)
-------------------------------------------------------------------------------------------------------------------------------------------------------
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 ------------------------------------------------------------------------------------------------------------------------------------------------------- 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
- Replies:
- Re: How can I use pvapy or p4p to monitor multiple PVS Veseli, Sinisa via Tech-talk
- Navigate by Date:
- Prev:
RE: EPICS timestamp in the archiver appliance Abdalla Ahmad via Tech-talk
- Next:
Re: EPICS timestamp in the archiver appliance Shankar, Murali 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
<2020>
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
Re: How can I use pvapy or p4p to monitor multiple PVS Michael Davidsaver via Tech-talk
- Next:
Re: How can I use pvapy or p4p to monitor multiple PVS Veseli, Sinisa 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
<2020>
2021
2022
2023
2024
|