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

16 lines
426 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.write_field('stop', 1)
motor.write_field('reseterrorpv', 1)
motor.write_field('enable', 1)
motor.move_and_wait(target)
assert motor.at_target(target)
assert not motor.has_error()