Experimental Physics and
| |||||||||||||||||
|
Hi Zhefu, I realize you did not ask about using pyepics, but having different callbacks with different PVs definitely works with pyepics. I think your example would translate to
epics import PV class myDriver(Driver): def __init__(self): Driver.__init__(self) self.chan_left = PV ('caLab:okok_left', callback= self.value_callback_left) self.chan_right = PV ('caLab:okok_right', callback= self.value_callback_right)def value_callback_left(self, name=None, value=None, **kws ):value_left= value print "monitor caLab:okok_left" def value_callback_right(self, name=None, value=None, **kws): value_right= value print "monitor caLab:okok_right" if __name__ == '__main__': server = SimpleServer() server.createPV(prefix, pvdb) driver = myDriver() while True: server.process(0.1) That assumes that "server.process(0.1)" is not blocking I/O by, for example, having a 'time.sleep()' or a call to "ca_pend_event()' somewhere. I would imagine this situation is similar for CaChannel, though you might want to make sure it is set up for asynchronous Channel Access. It also assumes that the channels really connect -- you might want to double check that. Hope that helps, --Matt On Thu, Jul 19, 2018 at 9:45 AM lzf neu <[email protected]> wrote:
| ||||||||||||||||
ANJ, 19 Jul 2018 |
·
Home
·
News
·
About
·
Base
·
Modules
·
Extensions
·
Distributions
·
Download
·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing · |