ophyd_async.epics.motor#

Support for EPICS motor record.

https://github.com/epics-modules/motor

Module Contents#

Classes#

Motor

Device that moves a motor record.

InstantMotorMock

Mock behaviour that instantly moves readback to setpoint.

OffsetMode

In Set mode, determine what to do when the motor setpoint is written.

UseSetMode

Determine what to do when the motor setpoint is written.

API#

exception ophyd_async.epics.motor.MotorLimitsError[source]#

Bases: Exception

Exception for invalid motor limits.

class ophyd_async.epics.motor.Motor(prefix: str, name='')[source]#

Bases: ophyd_async.core.StandardReadable, bluesky.protocols.Locatable[float], bluesky.protocols.Stoppable, bluesky.protocols.Flyable, bluesky.protocols.Preparable, bluesky.protocols.Subscribable[float]

Device that moves a motor record.

set_name(name: str, *, child_name_separator: str | None = None) None[source]#

Set name of the motor and its children.

async check_motor_limit(abs_start_pos: float, abs_end_pos: float)[source]#

Check the positions are within limits.

Will raise a MotorLimitsException if the given absolute positions will be outside the motor soft limits.

async prepare(value: FlyMotorInfo)[source]#

Move to the beginning of a suitable run-up distance ready for a fly scan.

async kickoff()[source]#

Begin moving motor from prepared position to final position.

complete() WatchableAsyncStatus[source]#

Mark as complete once motor reaches completed position.

async set(new_position: float, timeout: CalculatableTimeout = CALCULATE_TIMEOUT)[source]#

Move motor to the given value.

async stop(success=False)[source]#

Request to stop moving and return immediately.

async locate() Location[float][source]#

Return the current setpoint and readback of the motor.

subscribe_reading(function: Callback[dict[str, Reading[float]]]) None[source]#

Subscribe to reading.

subscribe#

None

clear_sub(function: Callback[dict[str, Reading[float]]]) None[source]#

Unsubscribe.

class ophyd_async.epics.motor.InstantMotorMock(name: str = '', parent: DeviceMock | None = None)[source]#

Bases: ophyd_async.core.DeviceMock[Motor]

Mock behaviour that instantly moves readback to setpoint.

async connect(device: Motor) None[source]#

Mock signals to do an instant move on setpoint write.

class ophyd_async.epics.motor.OffsetMode[source]#

Bases: ophyd_async.core.StrictEnum

In Set mode, determine what to do when the motor setpoint is written.

VARIABLE#

‘Variable’

Change the offset so the readback matches the setpoint.

FROZEN#

‘Frozen’

Tell the controller to change the readback without changing the offset.

class ophyd_async.epics.motor.UseSetMode[source]#

Bases: ophyd_async.core.StrictEnum

Determine what to do when the motor setpoint is written.

USE#

‘Use’

Tell the controller to move to the setpoint.

SET#

‘Set’

Change offset (in record or in controller) when setpoint is written.