motor

motor("name")

The object which allows to script individual motor motions, where name is name of the motor. (Motor script source code)

In Pylatus Script editor the motor object is already imported into Python interpreter, but if you have external .py files, then you can import it as:

from auxygen_motors import PyMotors

motor = PyMotors()

Macros example https://git.3lp.cx/dyadkin/bm31macros/src/branch/master/mono.py

Instance methods:

Usage Examples


move

motor("name").move(position, *, now=False)

creates a sequence action for the motor name to move it to the absolute position.

If now=True, then it does not create the sequence action but moves the motor immediately (recommended only for very advanced users).


moveRelative

motor("name").moveRelative(position, *, now=False)

creates a sequence action for the motor name to move it to the relative position.

If now=True, then it does not create the sequence action but moves the motor immediately (recommended only for very advanced users).


wait

motor.wait(*, now=False)

Creates a sequence action to wait until all the moving motors reach desirable positions.

If now=True blocks the script immediately and waits until all the motor finish (recommended only for very advanced users). It does not need a motor name.


position

motor('name').position() -> float

Returns current position of the motor name. (recommended only for very advanced users)


isAt

motor('name').isAt(position) -> bool

Calculates whether the motor name is at the position taking into account the motor precision. (recommended only for very advanced users)


Usage examples:

# move motors to the starting positions
motor('omega').move(0)
motor('phi').move(90)
motor('kappa').move(-55)
motor('gon1').move(-55)
# wait until all the motor reach starting positions
motor.wait()
# make a scan
diffractometer.scan()