Skip to content

Instantly share code, notes, and snippets.

@prjemian
Last active April 29, 2019 21:04
Show Gist options
  • Select an option

  • Save prjemian/c43bdbec15dd80f715fb2196eef5ea5b to your computer and use it in GitHub Desktop.

Select an option

Save prjemian/c43bdbec15dd80f715fb2196eef5ea5b to your computer and use it in GitHub Desktop.
shows how to extend EpicsMotor to change soft limits
from ophyd import EpicsMotor, EpicsSignal, Component
from bluesky import RunEngine
from bluesky import plans as bp
RE = RunEngine({})
class MyMotor(EpicsMotor):
high_soft_limit = Component(EpicsSignal, '.HLM', kind='omitted')
low_soft_limit = Component(EpicsSignal, '.LLM', kind='omitted')
m1 = MyMotor("vm7:m1", name="m1")
m1.stage_sigs["high_soft_limit"] = 1000
m1.stage_sigs["low_soft_limit"] = -1000
print(m1.low_soft_limit.value, m1.high_soft_limit.value)
m1.stage()
print(m1.low_soft_limit.value, m1.high_soft_limit.value)
m1.unstage()
print(m1.low_soft_limit.value, m1.high_soft_limit.value)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment