Files
motorDriverTests/tests/sinqMotor/masterMacs/reset.py

16 lines
411 B
Python
Executable File

def reset(motor, target):
"""
Reset the motor for the next test. This means the following things:
1) Stopping the motor
2) Resetting all errors
3) Enabling the motor
4) Moving to zero
"""
motor.put_pv('stop', 1)
motor.put_pv('reseterrorpv', 1)
motor.put_pv('enable', 1)
motor.move_and_wait(target)
assert motor.at_target(target)
assert not motor.has_error()