add reading of slave currents and voltages
with fast polling
This commit is contained in:
parent
12cb0cdade
commit
c3f55435da
@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
from secop.core import Parameter, EnumType, FloatRange, BoolType
|
from secop.core import Parameter, EnumType, FloatRange, BoolType
|
||||||
from secop.lib.enum import Enum
|
from secop.lib.enum import Enum
|
||||||
from secop.errors import BadValueError
|
from secop.errors import BadValueError, HardwareError
|
||||||
from secop_psi.magfield import Magfield
|
from secop_psi.magfield import Magfield
|
||||||
from secop_psi.mercury import MercuryChannel, off_on, Mapped
|
from secop_psi.mercury import MercuryChannel, off_on, Mapped
|
||||||
|
|
||||||
@ -37,6 +37,12 @@ class Field(MercuryChannel, Magfield):
|
|||||||
setpoint = Parameter('field setpoint', FloatRange(unit='T'), default=0)
|
setpoint = Parameter('field setpoint', FloatRange(unit='T'), default=0)
|
||||||
voltage = Parameter('leads voltage', FloatRange(unit='V'), default=0)
|
voltage = Parameter('leads voltage', FloatRange(unit='V'), default=0)
|
||||||
atob = Parameter('field to amp', FloatRange(0, unit='A/T'), default=0)
|
atob = Parameter('field to amp', FloatRange(0, unit='A/T'), default=0)
|
||||||
|
I1 = Parameter('master current', FloatRange(unit='A'), default=0)
|
||||||
|
I2 = Parameter('slave 2 current', FloatRange(unit='A'), default=0)
|
||||||
|
I3 = Parameter('slave 3 current', FloatRange(unit='A'), default=0)
|
||||||
|
V1 = Parameter('master voltage', FloatRange(unit='V'), default=0)
|
||||||
|
V2 = Parameter('slave 2 voltage', FloatRange(unit='V'), default=0)
|
||||||
|
V3 = Parameter('slave 3 voltage', FloatRange(unit='V'), default=0)
|
||||||
forced_persistent_field = Parameter(
|
forced_persistent_field = Parameter(
|
||||||
'manual indication that persistent field is bad', BoolType(), readonly=False, default=False)
|
'manual indication that persistent field is bad', BoolType(), readonly=False, default=False)
|
||||||
|
|
||||||
@ -46,6 +52,10 @@ class Field(MercuryChannel, Magfield):
|
|||||||
slave_currents = None
|
slave_currents = None
|
||||||
__init = True
|
__init = True
|
||||||
|
|
||||||
|
def doPoll(self):
|
||||||
|
super().doPoll()
|
||||||
|
self.read_current()
|
||||||
|
|
||||||
def read_value(self):
|
def read_value(self):
|
||||||
self.current = self.query('PSU:SIG:FLD')
|
self.current = self.query('PSU:SIG:FLD')
|
||||||
pf = self.query('PSU:SIG:PFLD')
|
pf = self.query('PSU:SIG:PFLD')
|
||||||
@ -104,7 +114,11 @@ class Field(MercuryChannel, Magfield):
|
|||||||
current = self.query('PSU:SIG:CURR')
|
current = self.query('PSU:SIG:CURR')
|
||||||
for i in range(self.nslaves + 1):
|
for i in range(self.nslaves + 1):
|
||||||
if i:
|
if i:
|
||||||
self.slave_currents[i].append(self.query('DEV:PSU.M%d:PSU:SIG:CURR' % i))
|
curri = self.query('DEV:PSU.M%d:PSU:SIG:CURR' % i)
|
||||||
|
volti = self.query('DEV:PSU.M%d:PSU:SIG:VOLT' % i)
|
||||||
|
setattr(self, 'I%d' % i, curri)
|
||||||
|
setattr(self, 'V%d' % i, volti)
|
||||||
|
self.slave_currents[i].append(curri)
|
||||||
else:
|
else:
|
||||||
self.slave_currents[i].append(current)
|
self.slave_currents[i].append(current)
|
||||||
min_i = min(self.slave_currents[i])
|
min_i = min(self.slave_currents[i])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user