some cosmetic changes
This commit is contained in:
@ -0,0 +1,25 @@
|
||||
import epics as ep
|
||||
|
||||
################
|
||||
# Testing base class epics
|
||||
# The raw code is located in the file
|
||||
# bec_client_venv/lib64/python3.11/site-packages/epics/__init__.py
|
||||
# in bec start script by run -i
|
||||
# option -i ensures taht iphyjon shell and scritp are in same namespace
|
||||
# run -i BaseClass_Epics.py
|
||||
|
||||
|
||||
pvname='X07MB-OP2-SAI_07:INP-OFS'
|
||||
|
||||
print('ep.cainfo(pvname)')
|
||||
ep.cainfo(pvname)
|
||||
print('caget(pvname)')
|
||||
|
||||
ep.caput(pvname,0.5,wait=.1)
|
||||
res=ep.caget(pvname)
|
||||
print('1:',res)
|
||||
ep.caput(pvname,0.01,wait=.1)
|
||||
res=ep.caget(pvname)
|
||||
print('2',res)
|
||||
print('Start camon to see effect , change value of pv ')
|
||||
ep.camonitor(pvname)
|
@ -0,0 +1,40 @@
|
||||
from ophyd import Device, EpicsMotor, EpicsSignal, EpicsSignalRO
|
||||
from ophyd import Component as Cpt
|
||||
|
||||
#option I via direct acces to classes
|
||||
|
||||
ScanX = EpicsMotor(name='ScanX',prefix='X07MB-ES-MA1:ScanX')
|
||||
ScanY = EpicsMotor(name='ScanY',prefix='X07MB-ES-MA1:ScanY')
|
||||
DIODE = EpicsSignal(name='SI',read_pv='X07MB-OP2-SAI_07:MEAN')
|
||||
SMPL = EpicsSignal(name='SMPL',read_pv='X07MB-OP2:SMPL')
|
||||
CYCLES = EpicsSignal(name='SMPL',read_pv='X07MB-OP2:TOTAL-CYCLES',write_pv='X07MB-OP2:TOTAL-CYCLES')
|
||||
|
||||
# Option 2 using component
|
||||
|
||||
class StageXY(Device):
|
||||
x = Cpt(EpicsMotor, 'ScanX')
|
||||
y = Cpt(EpicsMotor, 'ScanY')
|
||||
|
||||
xy_stage = StageXY('X07MB-ES-MA1:', name='stage')
|
||||
|
||||
#############################################
|
||||
# This is basic bluesky
|
||||
# Epics motor def seems to use init params in device, whcih are
|
||||
# __init__(
|
||||
# self,
|
||||
# prefix="",
|
||||
# *,
|
||||
# name,
|
||||
# kind=None,
|
||||
# read_attrs=None,
|
||||
# configuration_attrs=None,
|
||||
# parent=None,
|
||||
# **kwargs,
|
||||
# ):
|
||||
#
|
||||
#########################################################
|
||||
|
||||
# to move motor use
|
||||
# stage.x.move(0)
|
||||
# to see all dict
|
||||
# stage.x.__dict__
|
Reference in New Issue
Block a user