Пример #1
0
print 'Reset error on all axes.'
ecmcSlitDemoLib.setAxisReset(leftMotor, 1)
ecmcSlitDemoLib.setAxisReset(rightMotor, 1)
ecmcSlitDemoLib.setAxisReset(gapMotor, 1)
ecmcSlitDemoLib.setAxisReset(centerMotor, 1)
ecmcSlitDemoLib.setAxisReset(masterMotor, 1)
time.sleep(0.5)
ecmcSlitDemoLib.setAxisReset(leftMotor, 0)
ecmcSlitDemoLib.setAxisReset(rightMotor, 0)
ecmcSlitDemoLib.setAxisReset(gapMotor, 0)
ecmcSlitDemoLib.setAxisReset(centerMotor, 0)
ecmcSlitDemoLib.setAxisReset(masterMotor, 0)

#ensure internal traj source of all axis
print 'Ensure internal trajectory source on all axes'
ecmcSlitDemoLib.setAxisEnable(leftMotor, 0)
ecmcSlitDemoLib.setAxisEnable(rightMotor, 0)
ecmcSlitDemoLib.setAxisEnable(gapMotor, 0)
ecmcSlitDemoLib.setAxisEnable(centerMotor, 0)
ecmcSlitDemoLib.setAxisEnable(masterMotor, 0)
time.sleep(0.5)  #ensure that enabled goes down
error = ecmcSlitDemoLib.getAxisError(leftMotor, 1)
error = ecmcSlitDemoLib.getAxisError(rightMotor, 1)
error = ecmcSlitDemoLib.getAxisError(gapMotor, 1)
error = ecmcSlitDemoLib.getAxisError(centerMotor, 1)
error = ecmcSlitDemoLib.getAxisError(masterMotor, 1)

epics.caput(centerMotor + '-TrajSourceType-Cmd', 0)
epics.caput(gapMotor + '-TrajSourceType-Cmd', 0)
epics.caput(leftMotor + '-TrajSourceType-Cmd', 0)
epics.caput(rightMotor + '-TrajSourceType-Cmd', 0)
if not homed:
    print("Motor not homed. Test will abort.")
    sys.exit()

maxPos = toPos
if fromPos > maxPos:
    maxPos = fromPos

minPos = fromPos
if toPos < minPos:
    minPos = toPos

testPv.put(testNumberBase)

print('Disable amplifier')
ecmcSlitDemoLib.setAxisEnable(motorPvName, 0)
time.sleep(0.2)  #ensure that enabled goes down
error = ecmcSlitDemoLib.getAxisError(motorPvName, 1)

#Reset error on all axis
print('Reset error axes.')
ecmcSlitDemoLib.setAxisReset(motorPvName, 1)
time.sleep(0.2)
ecmcSlitDemoLib.setAxisReset(motorPvName, 0)

print('Enable amplifier')
ecmcSlitDemoLib.setAxisEnable(motorPvName, 1)
time.sleep(0.2)  #ensure that enabled goes down
error = ecmcSlitDemoLib.getAxisError(motorPvName, 1)
counter = 0
Пример #3
0
from ../. import ecmcSlitDemoLib

leftMotor = 'MEBT-EMU:Axis1'
rightMotor = 'MEBT-EMU:Axis2'

#Reset error on all axis
print 'Reset error on all axes.'
ecmcSlitDemoLib.setAxisReset(leftMotor, 1)
ecmcSlitDemoLib.setAxisReset(rightMotor, 1)
time.sleep(0.5)
ecmcSlitDemoLib.setAxisReset(leftMotor, 0)
ecmcSlitDemoLib.setAxisReset(rightMotor, 0)

#ensure of all axis are enable 
print 'Enable Axes'
ecmcSlitDemoLib.setAxisEnable(leftMotor, 1)
ecmcSlitDemoLib.setAxisEnable(rightMotor, 1)
time.sleep(0.5) #ensure that axes are enabled 
error=ecmcSlitDemoLib.getAxisError(leftMotor,1)
error=ecmcSlitDemoLib.getAxisError(rightMotor,1);

y=0
x=0
Step = 1
while Step==1:
 if Step==1:
  LLS1 = int(epics.caget(leftMotor + '.LLS'))
  LLS2 = int(epics.caget(rightMotor + '.LLS'))
  print'LLS1 %d LLS2 %d' %(LLS1,LLS2)
  if LLS1 and LLS2:
    print 'Both axes are in the LLS'
Пример #4
0
ecmcSlitDemoLib.setAxisReset(Mtr6, 1)
ecmcSlitDemoLib.setAxisReset(gapMotor, 1)
ecmcSlitDemoLib.setAxisReset(centerMotor, 1)
time.sleep(0.5)
ecmcSlitDemoLib.setAxisReset(Mtr1, 1)
ecmcSlitDemoLib.setAxisReset(Mtr2, 1)
ecmcSlitDemoLib.setAxisReset(Mtr3, 1)
ecmcSlitDemoLib.setAxisReset(Mtr4, 1)
ecmcSlitDemoLib.setAxisReset(Mtr5, 1)
ecmcSlitDemoLib.setAxisReset(Mtr6, 1)
ecmcSlitDemoLib.setAxisReset(gapMotor, 1)
ecmcSlitDemoLib.setAxisReset(centerMotor, 1)

#disable axes
print 'Disable all axes'
ecmcSlitDemoLib.setAxisEnable(Mtr1, 0)
ecmcSlitDemoLib.setAxisEnable(Mtr2, 0)
ecmcSlitDemoLib.setAxisEnable(Mtr3, 0)
ecmcSlitDemoLib.setAxisEnable(Mtr4, 0)
ecmcSlitDemoLib.setAxisEnable(Mtr5, 0)
ecmcSlitDemoLib.setAxisEnable(Mtr6, 0)
ecmcSlitDemoLib.setAxisEnable(gapMotor, 0)
ecmcSlitDemoLib.setAxisEnable(centerMotor, 0)

print 'Ensure enable goes down'
time.sleep(0.5)  #ensure that enabled goes down
error = ecmcSlitDemoLib.getAxisError(Mtr1, 1)
error = ecmcSlitDemoLib.getAxisError(Mtr2, 1)
error = ecmcSlitDemoLib.getAxisError(Mtr3, 1)
error = ecmcSlitDemoLib.getAxisError(Mtr4, 1)
error = ecmcSlitDemoLib.getAxisError(Mtr5, 1)
maxPos = toPos
if fromPos > maxPos:
    maxPos = fromPos

minPos = fromPos
if toPos < minPos:
    minPos = toPos

#Disable softLimits
print('Set softlimits')
ecmcSlitDemoLib.setSoftLowLimt(motor, minPos - 10)
ecmcSlitDemoLib.setSoftHighLimt(motor, maxPos + 10)

print('Disable amplifier')
ecmcSlitDemoLib.setAxisEnable(motor, 0)
time.sleep(1)  #ensure that enabled goes down
error = ecmcSlitDemoLib.getAxisError(motor, 1)

#Reset error on all axis
print('Reset error axes.')
ecmcSlitDemoLib.setAxisReset(motor, 1)
time.sleep(0.5)
ecmcSlitDemoLib.setAxisReset(motor, 0)

print('Enable amplifier')
ecmcSlitDemoLib.setAxisEnable(motor, 1)
time.sleep(1)  #ensure that enabled goes down
error = ecmcSlitDemoLib.getAxisError(motor, 1)
counter = 0