Experimental Physics and
| |||||||||||||||||
|
Hi Jamie,
On Wed, Mar 18, 2015 at 10:09 PM, Jameson Graef Rollins <[email protected]> wrote: On Wed, Mar 18 2015, Matt Newville <[email protected]> wrote: I'm not certain I can tell what you did, but I'll guess that you created a PV, set a callback, and are trying to run pv.get_ctrlvars() inside the callback. That won't work, basically because the get_ctrlvars() would have to do an Epics poll(), and inside a callback you're already "inside" an Epics poll(). But you can create a PV, get the ctrl vars, and then set a callback, or allow that the first few calls in the callback may not have the enum strings. I typically do this as pv = PV(pvname) pv.get(as_string=True) # make sure it's connected, has a value, and has CTRL values pv.add_callback(....) Alternatively, you can create the PV with "form=ctrl", in which case you'll get all the CTRL fields. If you're expecting that the enum strings (or limits...) aren't changing rapidly, getting the ctrl vars once early on is probably the way to go. --Matt Newville
| ||||||||||||||||
ANJ, 16 Dec 2015 |
·
Home
·
News
·
About
·
Base
·
Modules
·
Extensions
·
Distributions
·
Download
·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing · |