Closed marciodo closed 8 years ago
I have a patch for this from December, but tests suggested it was not correct. I'll post them next week.
Nothing happens, as expected. But for now on:
It should have raised an exception.
@marciodo Good catch! I thought that this was covered but unfortunately we were basing the software limits on the LVIO which will be 1 even when we want to move on the opposite direction.
@hdante I fixed this issue with this first approach. Please let me know if you see any problem.
I tested with simMotors, more tests are required.
((py4syn)) ➜ test python test.py
105.0
-100.0
0.0
101.0
exception: Can't move motor motor 1 (HHS:m1) to desired position: 200, Target beyond value for software high limit.
test.py is:
from py4syn.epics.MotorClass import Motor
mtop = Motor("HHS:m1", "mtop")
print(mtop.getHighLimitValue())
#105.0
print(mtop.getLowLimitValue())
#-100.0
print(mtop.getValue())
#0
mtop.setAbsolutePosition(101, waitComplete=True)
print(mtop.getValue())
#101.0
try:
mtop.setAbsolutePosition(200)
except Exception as e:
print("exception: ", e)
# Nothing happens, as expected. But for now on:
mtop.setAbsolutePosition(90)
I tested and it seems it is ok, now.
Nothing works from this point: absolute/relative movements inside the soft limits and position redefinition inside soft limits. One must move the motor using caput in a terminal and, after that, Py4Syn starts to move motors again.