update SR_7270
This commit is contained in:
@ -20,8 +20,8 @@
|
||||
# *****************************************************************************
|
||||
"""SIGNAL RECOVERY SR7270: lOCKIN AMPLIFIER FOR AC SUSCEPTIBILITY"""
|
||||
|
||||
from secop.core import Readable, Parameter, Override, FloatRange, TupleOf, HasIodev, StringIO, \
|
||||
Done, Attached, IntRange, BoolType
|
||||
from secop.core import Readable, Parameter, Override, Command, FloatRange, TupleOf, \
|
||||
HasIodev, StringIO, Done, Attached, IntRange, BoolType
|
||||
|
||||
|
||||
class SR7270(StringIO):
|
||||
@ -35,31 +35,33 @@ class SR7270(StringIO):
|
||||
|
||||
|
||||
|
||||
class XY(HasIodev, Readable):
|
||||
class XY(HasIodev, Readable):
|
||||
properties = {
|
||||
'x': Attached(),
|
||||
'y': Attached(),
|
||||
'freq_arg': Attached(),
|
||||
'amp_arg': Attached(),
|
||||
'tc_arg': Attached(),
|
||||
}
|
||||
}#parameters required an initial value but initwrite write the default value for polled parameters
|
||||
parameters = {
|
||||
'value': Override('X, Y', datatype=TupleOf(FloatRange(unit='V'), FloatRange(unit='V'))),
|
||||
'freq': Parameter('exc_freq_int',
|
||||
FloatRange(0.001,250e3,unit='Hz'),
|
||||
poll=True, readonly=False, default=100),
|
||||
poll=True, readonly=False, initwrite=True, default=1000),
|
||||
'amp': Parameter('exc_volt_int',
|
||||
FloatRange(0.00,5,unit='Vrms'),
|
||||
poll=True, readonly=False, default=5),
|
||||
poll=True, readonly=False, initwrite=True, default=1),
|
||||
'range': Parameter('sensitivity value', FloatRange(0.00,1,unit='V'), poll=True, default=1),
|
||||
'irange': Parameter('sensitivity index', IntRange(0,27), poll=True, readonly=False, default=25),
|
||||
'autorange': Parameter('autorange_on', BoolType(), readonly=False, default=True),
|
||||
'tc': Parameter('time constant value', FloatRange(10e-6,1,unit='s'), poll=True, default=0.1),
|
||||
'itc': Parameter('time constant index', IntRange(0,30), poll=True, readonly=False, default=12),
|
||||
'itc': Parameter('time constant index', IntRange(0,30), poll=True, readonly=False, initwrite=True, default=14),
|
||||
'nm': Parameter ('noise mode',BoolType(), readonly=False, default=0),
|
||||
'aphase': Parameter('autophase',BoolType(), readonly=False, default=0),
|
||||
# FloatRange(0.00,5e6,unit='uVrms'),
|
||||
# poll=True, readonly=False, default=100),
|
||||
'phase': Parameter('Reference phase control', FloatRange(-360,360,unit='deg'), poll=True, readonly=False, initwrite=True, default=0),
|
||||
'vmode' : Parameter('Voltage input configuration', IntRange(0,3), readonly=False, default=3),
|
||||
}
|
||||
commands = {
|
||||
'aphase': Command('auto phase'),
|
||||
}
|
||||
iodevClass = SR7270
|
||||
|
||||
@ -82,6 +84,7 @@ class XY(HasIodev, Readable):
|
||||
self.write_irange(self.irange-1)
|
||||
self._x.value = x # to update X,Y classes which will be the collected data.
|
||||
self._y.value = y
|
||||
# print(x,y)
|
||||
self._freq_arg.value = self.freq
|
||||
self._amp_arg.value = self.amp
|
||||
self._tc_arg.value =self.tc
|
||||
@ -151,22 +154,43 @@ class XY(HasIodev, Readable):
|
||||
|
||||
return reply
|
||||
|
||||
#autophase
|
||||
def read_aphase(self):
|
||||
reply = self.comm('AQN')
|
||||
|
||||
#phase and autophase
|
||||
|
||||
|
||||
def read_phase(self):
|
||||
reply = self.comm('REFP.')
|
||||
|
||||
return reply
|
||||
|
||||
def write_aphase(self,value):
|
||||
self.comm('AQN')
|
||||
self.read_aphase()
|
||||
def write_phase(self,value):
|
||||
self.comm('REFP %d' % round(1000*value,0))
|
||||
self.read_phase()
|
||||
return value
|
||||
|
||||
|
||||
def do_aphase(self):
|
||||
self.read_phase()
|
||||
reply = self.comm('AQN')
|
||||
self.read_phase()
|
||||
|
||||
#voltage input configuration 0:grounded,1=A,2=B,3=A-B
|
||||
# def read_vmode(self):
|
||||
# reply = self.comm('VMODE')
|
||||
# return reply
|
||||
|
||||
def write_vmode(self,value):
|
||||
self.comm('VMODE %d' % value)
|
||||
# self.read_vmode()
|
||||
return value
|
||||
|
||||
|
||||
class Comp(Readable):
|
||||
pollerClass = None
|
||||
parameters = {
|
||||
'value': Override(datatype=FloatRange(unit='V')),
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
class arg(Readable):
|
||||
|
Reference in New Issue
Block a user