def test(motor_record='XF:31IDA-OP{Tbl-Ax:X1}Mtr'): config.setup_logging([__name__, 'pypvserver.motor']) server = config.get_server() mrec = EpicsMotor(motor_record) # give the motor time to connect time.sleep(1.0) logger.info('--> PV Positioner, using put completion and a DONE pv') # PV positioner, put completion, done pv pos = PVPositioner( mrec.field_pv('VAL'), readback=mrec.field_pv('RBV'), done=mrec.field_pv('MOVN'), done_val=0, stop=mrec.field_pv('STOP'), stop_val=1, put_complete=True, limits=(-2, 2), ) ppv_motor = PypvMotor('m1', pos, server=server) print(ppv_motor.severity) record_name = ppv_motor.full_pvname for i in range(2): epics.caput(record_name, i, wait=True) print(pos.position) return ppv_motor
from ophyd.controls import PVPositioner, EpicsMotor #motors for xrf, tomo, etc. go here #High Flux KB mirrors ##pseudo motors (should these be in the 'endstation' or in the 'pseudomotor' configuration?) m2_pitch = EpicsMotor('XF:05IDD-OP:1{Mir:2-Ax:P}Mtr', name='m2_pitch') m2_roll = EpicsMotor('XF:05IDD-OP:1{Mir:2-Ax:R}Mtr', name='m2_roll') m2_vertical = EpicsMotor('XF:05IDD-OP:1{Mir:2-Ax:Y}Mtr', name='m2_vertical') #m2_x, m3_x, m3_pitch will need to be added here ##real motors m2_xu = EpicsMotor('XF:05IDD-OP:1{Mir:2-Ax:XU}Mtr', name='m2_xu') m2_xd = EpicsMotor('XF:05IDD-OP:1{Mir:2-Ax:XD}Mtr', name='m2_xd') m2_z = EpicsMotor('XF:05IDD-OP:1{Mir:2-Ax:Z}Mtr', name='m2_z') #m2_yui, m2_ydo, m2_ydi, m2_ydo are not included here yet; they should no be scanned independently m3_xu = EpicsMotor('XF:05IDD-OP:1{Mir:3-Ax:XU}Mtr', name='m3_xu') m3_xd = EpicsMotor('XF:05IDD-OP:1{Mir:3-Ax:XD}Mtr', name='m3_xd') m3_y = EpicsMotor('XF:05IDD-OP:1{Mir:3-Ax:Y}Mtr', name='m3_y') #High flux sample stages #Aero_x = EpicsMotor('XF:05IDD-ES:1{Stg:XY-Ax:X}Mtr', name = 'Aero_x') Aero_x = EpicsMotor('XF:05IDD-ES:1{Stg:Smpl1-Ax:X}Mtr', name='Aero_x') Aero_y = EpicsMotor('XF:05IDD-ES:1{Stg:Smpl1-Ax:Y}Mtr', name='Aero_y') #PI = EpicsMotor('XF:05IDD-OP:1{Stg:Smpl1-Ax:Z}Mtr', name = 'PI') PI = EpicsMotor('XF:05IDD-ES:1{Stg:Smpl1-Ax:Z}Mtr', name='PI')
name='m1b2_rol', **kwargs) m1b2 = [m1b2_z, m1b2_y, m1b2_x, m1b2_pit, m1b2_yaw, m1b2_rol] # VLS-PGM pgm_energy = PVPositioner('XF:23ID1-OP{Mono}Enrgy-SP', readback='XF:23ID1-OP{Mono}Enrgy-I', stop='XF:23ID1-OP{Mono}Cmd:Stop-Cmd', stop_val=1, put_complete=True, name='pgm_energy', limits=(200, 2200)) pgm_mir_pit = EpicsMotor('XF:23ID1-OP{Mono-Ax:MirP}Mtr', name='pgm_mir_pit') pgm_grt_pit = EpicsMotor('XF:23ID1-OP{Mono-Ax:GrtP}Mtr', name='pgm_grt_pit') pgm_mir_x = EpicsMotor('XF:23ID1-OP{Mono-Ax:MirX}Mtr', name='pgm_mir_x') pgm_grt_x = EpicsMotor('XF:23ID1-OP{Mono-Ax:GrtX}Mtr', name='pgm_grt_x') pgm_energy_sp = EpicsSignal('XF:23ID1-OP{Mono}Enrgy-SP', name='pgm_energy_sp') pgm_energy_i = EpicsSignal('XF:23ID1-OP{Mono}Enrgy-I', name='pgm_energy_i') # M3A Mirror m3a_x = EpicsMotor('XF:23ID1-OP{Mir:3-Ax:XAvg}Mtr', name='m3a_x') m3a_pit = EpicsMotor('XF:23ID1-OP{Mir:3-Ax:P}Mtr', name='m3a_pit') m3a_bdr = EpicsMotor('XF:23ID1-OP{Mir:3-Ax:Bdr}Mtr', name='m3a_bdr') # Fast CCD Shutter
# args = ('XF:23IDA-OP:1{Mir:1-Ax:Z}Mtr_POS_SP', # {'readback': 'XF:23IDA-OP:1{Mir:1-Ax:Z}Mtr_MON', # 'act': 'XF:23IDA-OP:1{Mir:1}MOVE_CMD.PROC', # 'act_val': 1, # 'stop': 'XF:23IDA-OP:1{Mir:1}STOP_CMD.PROC', # 'stop_val': 1, # 'done': 'XF:23IDA-OP:1{Mir:1}BUSY_STS', # 'done_val': 0, # 'name': 'm1a_z', # }) # m1a_z = PVPositioner(args[0], **args[1]) # Slits slt_wb_tb = EpicsMotor('XF:05IDA-OP:1{Slt:1-Ax:T}Mtr', name='slt_wb_tb') slt_wb_bb = EpicsMotor('XF:05IDA-OP:1{Slt:1-Ax:B}Mtr', name='slt_wb_bb') slt_wb_ib = EpicsMotor('XF:05IDA-OP:1{Slt:1-Ax:I}Mtr', name='slt_wb_ib') slt_wb_ob = EpicsMotor('XF:05IDA-OP:1{Slt:1-Ax:O}Mtr', name='slt_wb_ob') slt_pb_ib = EpicsMotor('XF:05IDA-OP:1{Slt:2-Ax:I}Mtr', name='slt_pb_ib') slt_pb_ob = EpicsMotor('XF:05IDA-OP:1{Slt:2-Ax:O}Mtr', name='slt_pb_ob') # HFM Mirror hfm_x = EpicsMotor('XF:05IDA-OP:1{Mir:1-Ax:X}Mtr', name='hfm_x') hfm_y = EpicsMotor('XF:05IDA-OP:1{Mir:1-Ax:Y}Mtr', name='hfm_y') hfm_pit = EpicsMotor('XF:05IDA-OP:1{Mir:1-Ax:P}Mtr', name='hfm_pit') hfm_bdr = EpicsMotor('XF:05IDA-OP:1{Mir:1-Ax:Bend}Mtr', name='hfm_bdr')
from ophyd.controls import PVPositioner, EpicsMotor # Diffo angles delta = EpicsMotor('XF:23ID1-ES{Dif-Ax:Del}Mtr', name='delta') gamma = EpicsMotor('XF:23ID1-ES{Dif-Ax:Gam}Mtr', name='gamma') theta = EpicsMotor('XF:23ID1-ES{Dif-Ax:Th}Mtr', name='theta') # Sample positions sx = EpicsMotor('XF:23ID1-ES{Dif-Ax:X}Mtr', name='sx') sy = PVPositioner('XF:23ID1-ES{Dif-Ax:SY}Pos-SP', readback='XF:23ID1-ES{Dif-Ax:SY}Pos-RB', stop='XF:23ID1-ES{Dif-Cryo}Cmd:Stop-Cmd', stop_val=1, put_complete=True, name='sy') sz = PVPositioner('XF:23ID1-ES{Dif-Ax:SZ}Pos-SP', readback='XF:23ID1-ES{Dif-Ax:SZ}Pos-RB', stop='XF:23ID1-ES{Dif-Cryo}Cmd:Stop-Cmd', stop_val=1, put_complete=True, name='sz') cryoangle = PVPositioner('XF:23ID1-ES{Dif-Cryo}Pos:Angle-SP', readback='XF:23ID1-ES{Dif-Cryo}Pos:Angle-RB', name='cryoangle') # Nano-positioners
TWO_THETA_DIODE_IN = 100.0 TWO_THETA_DIODE_OUT = 60.0 X_HOME = 11.0 Y_HOME = 41.0 gas = XPDGasSwitcher(requested_pos='XF:28IDC-ES:1{Env:02}Pos-SP', current_pos='XF:28IDC-ES:1{Env:02}Pos-I', gasdict={ 1: 'O2', 2: 'N2', 3: 'He' }) th_cal = EpicsMotor('XF:28IDC-ES:1{Dif:2-Ax:Th}Mtr', name='th_cal') tth_cal = EpicsMotor('XF:28IDC-ES:1{Dif:2-Ax:2Th}Mtr', name='tth_cal') th = EpicsMotor('XF:28IDC-ES:1{Dif:1-Ax:Th}Mtr', name='th') tth = EpicsMotor('XF:28IDC-ES:1{Dif:1-Ax:2ThI}Mtr', name='tth') diff_x = EpicsMotor('XF:28IDC-ES:1{Dif:1-Ax:X}Mtr', name='diff_x') diff_y = EpicsMotor('XF:28IDC-ES:1{Dif:1-Ax:Y}Mtr', name='diff_y') cs700 = PVPositioner( 'XF:28IDC-ES:1{Env:01}T-SP', readback='XF:28IDC-ES:1{Env:01}T-I', #done='XF:28IDC-ES:1{Env:01}Cmd-Busy', done_val=0, stop='XF:28IDC-ES:1{Env:01}Cmd-Cmd', stop_val=13, put_complete=True, name='cs700')
from ophyd.controls import EpicsMotor # A Hutch ## Filter fltr6_y = EpicsMotor('XF:28IDA-OP:0{Fltr:6-Ax:Y}Mtr', name='fltr6_y') ## DLM dlm_c1_bnd_bi = EpicsMotor('XF:28IDA-OP:1{Mono:DLM-C:1-Ax:BndBI}Mtr', name='dlm_c1_bnd_bi') dlm_c1_bnd_bo = EpicsMotor('XF:28IDA-OP:1{Mono:DLM-C:1-Ax:BndBO}Mtr', name='dlm_c1_bnd_bo') dlm_c1_bnd_ti = EpicsMotor('XF:28IDA-OP:1{Mono:DLM-C:1-Ax:BndTI}Mtr', name='dlm_c1_bnd_ti') dlm_c1_bnd_to = EpicsMotor('XF:28IDA-OP:1{Mono:DLM-C:1-Ax:BndTO}Mtr', name='dlm_c1_bnd_to') dlm_c1_p = EpicsMotor('XF:28IDA-OP:1{Mono:DLM-C:1-Ax:P}Mtr', name='dlm_c1_p') dlm_c1_xi = EpicsMotor('XF:28IDA-OP:1{Mono:DLM-C:1-Ax:XI}Mtr', name='dlm_c1_xi') dlm_c1_xo = EpicsMotor('XF:28IDA-OP:1{Mono:DLM-C:1-Ax:XO}Mtr', name='dlm_c1_xo') dlm_c2_bnd_bi = EpicsMotor('XF:28IDA-OP:1{Mono:DLM-C:2-Ax:BndBI}Mtr', name='dlm_c2_bnd_bi') dlm_c2_bnd_bo = EpicsMotor('XF:28IDA-OP:1{Mono:DLM-C:2-Ax:BndBO}Mtr', name='dlm_c2_bnd_bo') dlm_c2_bnd_ti = EpicsMotor('XF:28IDA-OP:1{Mono:DLM-C:2-Ax:BndTI}Mtr', name='dlm_c2_bnd_ti') dlm_c2_bnd_to = EpicsMotor('XF:28IDA-OP:1{Mono:DLM-C:2-Ax:BndTO}Mtr', name='dlm_c2_bnd_to') dlm_c2_p = EpicsMotor('XF:28IDA-OP:1{Mono:DLM-C:2-Ax:P}Mtr', name='dlm_c2_p') dlm_c2_r = EpicsMotor('XF:28IDA-OP:1{Mono:DLM-C:2-Ax:R}Mtr', name='dlm_c2_r') dlm_c2_xi = EpicsMotor('XF:28IDA-OP:1{Mono:DLM-C:2-Ax:XI}Mtr',