예제 #1
0
time.sleep(2)

#change traj source of gap to external
print 'Set traj source to external for gap axis.'
epics.caput(gapMotor + '-TrajSourceType-Cmd', 1)
error = ecmcSlitDemoLib.getAxisError(gapMotor, 1)

#Enable all axis 5 (all axes should then be enabled)
print 'Enable  axis 5 (all axes should then be enabled).'
ecmcSlitDemoLib.setAxisEnable(masterMotor, 1)
error = ecmcSlitDemoLib.getAxisError(masterMotor, 1)
time.sleep(0.5)  #ensure enabled

#Jog master
print 'Jog master axis.'
error = ecmcSlitDemoLib.moveAxisVelocity(masterMotor, 10)

time.sleep(10)

#Move center to position 50
print 'Move center axis to position 20.'
done = ecmcSlitDemoLib.moveAxisPosition(centerMotor, 20, 100)
if not done:
    print "%s failed to position."
    sys.exit()

time.sleep(2)
print 'Move center axis to position -20.'
done = ecmcSlitDemoLib.moveAxisPosition(centerMotor, -20, 100)
if not done:
    print "%s failed to position."
예제 #2
0
error = ecmcSlitDemoLib.getAxisError(motorPvName, 1)

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

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

print('Move to switch')
error = ecmcSlitDemoLib.moveAxisVelocity(motorPvName, -velo, 0)

timeOut = 50
polltime = 1
wait_for_done = timeOut
while wait_for_done > 0:
    time.sleep(polltime)
    limitVal = limitPv.get()
    if not limitVal:
        print('Reached switch')
        wait_for_done = 0
    else:
        wait_for_done -= polltime
        if wait_for_done == 0:
            print('timeOut! Did not reach switch..')
            sys.exit()