The above should work for tens of thousands pv's that update at a rate of 1Hz or so.
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