fixed worst bugs in FG Lecryo driver
Change-Id: Iab6b7e0f0838a42f1a4f4b484745cc7dd7089c6b
This commit is contained in:
@ -21,7 +21,8 @@
|
|||||||
"""WAVE FUNCTION LECROY XX: SIGNAL GENERATOR"""
|
"""WAVE FUNCTION LECROY XX: SIGNAL GENERATOR"""
|
||||||
|
|
||||||
from secop.core import Readable, Parameter, Override, Command, FloatRange, TupleOf, \
|
from secop.core import Readable, Parameter, Override, Command, FloatRange, TupleOf, \
|
||||||
HasIodev, StringIO, Done, Attached, IntRange, BoolType, EnumType,StringType, Module
|
HasIodev, StringIO, Done, Attached, IntRange, BoolType, EnumType, StringType, Module, \
|
||||||
|
Property
|
||||||
|
|
||||||
|
|
||||||
class Channel(Module):
|
class Channel(Module):
|
||||||
@ -29,157 +30,88 @@ class Channel(Module):
|
|||||||
'channel':Property('choose channel to manipulate',IntRange(1,2)),
|
'channel':Property('choose channel to manipulate',IntRange(1,2)),
|
||||||
}
|
}
|
||||||
parameters = {
|
parameters = {
|
||||||
'freq': Parameter('frequency',
|
'freq':
|
||||||
FloatRange(1e-6,20e6,unit='Hz'),
|
Parameter('frequency', FloatRange(1e-6,20e6,unit='Hz'),
|
||||||
poll=True, initwrite=True, default=1000),
|
poll=True, initwrite=True, default=1000),
|
||||||
'amp': Parameter('exc_volt_int',
|
'amp':
|
||||||
FloatRange(0.00,5,unit='Vrms'),
|
Parameter('exc_volt_int', FloatRange(0.00,5,unit='Vrms'),
|
||||||
poll=True, readonly=False, initwrite=True, default=0.1),
|
poll=True, readonly=False, initwrite=True, default=0.1),
|
||||||
'offset': Parameter('offset_volt_int',
|
'offset':
|
||||||
FloatRange(0.00,10,unit='V'),
|
Parameter('offset_volt_int', FloatRange(0.00,10,unit='V'),
|
||||||
'wave': Parameter ('type of wavefunction', StringType=('SINE','SQUARE','RAMP','PULSE','NOISE','ARB','DC'), poll=True, readonly=False, default='SINE'),
|
poll = True, readonly = False, initwrite = True, default = 0.0),
|
||||||
poll=True, readonly=False, initwrite=True, default=0.0),
|
'wave':
|
||||||
'phase': Parameter('signal phase', FloatRange(0,360,unit='deg'), poll=True, readonly=False, initwrite=True, default=0),
|
Parameter ('type of wavefunction',
|
||||||
'enabled': Parameter('enable output channel', datatype=StringType('OFF','ON'),readonly=False, default='OFF'),
|
EnumType('WaveFunction', SINE=1, SQUARE=2, RAMP=3, PULSE=4, NOISE=5, ARB=6, DC=7),
|
||||||
'symm': Parameter('wavefunction symmetry', FloatRange(0,100, unit=''), poll=True, readonly =False, default=0),
|
poll=True, readonly=False, default='SINE'),
|
||||||
|
'phase':
|
||||||
}
|
Parameter('signal phase', FloatRange(0,360,unit='deg'),
|
||||||
pollerClass = Poller
|
poll=True, readonly=False, initwrite=True, default=0),
|
||||||
|
'enabled':
|
||||||
|
Parameter('enable output channel', datatype=EnumType('OnOff', OFF=0, ON=1),
|
||||||
#update instruments values
|
readonly=False, default='OFF'),
|
||||||
"""
|
'symm':
|
||||||
def read_value(self):
|
Parameter('wavefunction symmetry', FloatRange(0,100, unit=''),
|
||||||
#response type: self._freq1_arg.value = self.freq(1) C1:BSWV TYPE', 'SINE', 'FRQ', '1000', 'AMP', '3', 'OFST', '3
|
poll=True, readonly =False, default=0),
|
||||||
# channel 1 status
|
}
|
||||||
reply=self.sendRecv('C1:BSWV?').split(',')
|
|
||||||
out=self.sendRecv('C1:OUTP?').split(',') #C1:OUTP ON,LOAD,HZ
|
|
||||||
self._freq1_arg.value = reply[3]
|
|
||||||
self._amp1_arg.value = reply[5]
|
|
||||||
self._off1_arg.value = reply[7]
|
|
||||||
self._out1_arg.value = out.split('')[1]
|
|
||||||
reply2=self.sendRecv('C2:BSWV?').split(',')
|
|
||||||
out2=self.sendRecv('C1:OUTP?').split(',')
|
|
||||||
self._freq2_arg.value = reply[3]
|
|
||||||
self._amp2_arg.value = reply[5]
|
|
||||||
self._off2_arg.value = reply[7]
|
|
||||||
self._out2_arg.value = out2.split('')[1]
|
|
||||||
return reply, out, reply2, out2
|
|
||||||
"""
|
|
||||||
|
|
||||||
def read_value(self):
|
def read_value(self):
|
||||||
reply = self.sendRecv('C%d:BSWV FRQ?' % self.channel)
|
return self.sendRecv('C%d:BSWV FRQ?' % self.channel)
|
||||||
|
|
||||||
return reply
|
|
||||||
|
|
||||||
|
|
||||||
def write_target(self,value):
|
def write_target(self,value):
|
||||||
self.sendRecv('C%d:BSWV FRQ, %g' % (self.channel, str(value)+'Hz'))
|
self.sendRecv('C%d:BSWV FRQ, %g' % (self.channel, str(value)+'Hz'))
|
||||||
|
|
||||||
#signal channel parameter
|
|
||||||
|
|
||||||
def read_channel(self):
|
|
||||||
reply=self.channel()
|
|
||||||
return reply
|
|
||||||
|
|
||||||
def write_channel(self,value):
|
|
||||||
|
|
||||||
return value
|
return value
|
||||||
|
|
||||||
#signal wavefunction parameter
|
#signal wavefunction parameter
|
||||||
|
|
||||||
def read_wave(self):
|
def read_wave(self):
|
||||||
ch=str(self.channel)
|
return self.sendRecv('C%d:BSWV WVTP?' % self.channel)
|
||||||
reply = self.sendRecv('C'+ch+':BSWV WVTP?')
|
|
||||||
|
|
||||||
|
|
||||||
return reply
|
|
||||||
|
|
||||||
def write_wave(self,value): #string value
|
def write_wave(self,value): #string value
|
||||||
ch=str(self.channel)
|
self.sendRecv('C%d:BSWV WVTP, %s' % (self.channel, value.name))
|
||||||
reply = self.sendRecv('C'+ch+':BSWV WVTP, %g' % value)
|
|
||||||
|
|
||||||
|
|
||||||
return reply
|
|
||||||
|
|
||||||
"""
|
|
||||||
#signal freq parameter
|
|
||||||
def read_freq(self):
|
|
||||||
ch=str(self.channel)
|
|
||||||
reply = self.sendRecv('C'+ch+':BSWV FRQ?')
|
|
||||||
|
|
||||||
return reply
|
|
||||||
|
|
||||||
def write_freq(self,value):
|
|
||||||
ch=str(self.channel)
|
|
||||||
self.sendRecv('C'+ch+':BSWV FRQ, %g' % str(value)+'Hz')
|
|
||||||
|
|
||||||
return value
|
return value
|
||||||
"""
|
|
||||||
|
#signal amplitude parameter
|
||||||
#signal amplitude parameter
|
|
||||||
def read_amp(self):
|
def read_amp(self):
|
||||||
ch=str(self.channel)
|
return self.sendRecv('C%d:BSWV AMP?' % self.channel)
|
||||||
reply = self.sendRecv'C'+ch+':BSWV AMP?')
|
|
||||||
|
|
||||||
return reply
|
|
||||||
|
|
||||||
def write_amp(self,value):
|
def write_amp(self,value):
|
||||||
ch=str(self.channel)
|
self.sendRecv('C%d:BSWV AMP, %g' % (self.channel, value))
|
||||||
reply = self.sendRecv('C'+ch+':BSWV AMP, %g' % str(value))
|
|
||||||
|
|
||||||
return value
|
return value
|
||||||
|
|
||||||
#offset value parameter
|
#offset value parameter
|
||||||
def read_offset(self):
|
def read_offset(self):
|
||||||
ch=str(self.channel)
|
return self.sendRecv('C%d:BSWV OFST?' % self.channel)
|
||||||
reply = self.sendRecv('C'+ch+':BSWV OFST?')
|
|
||||||
|
|
||||||
return reply
|
def write_offset(self, value):
|
||||||
|
self.sendRecv('C%d:BSWV OFST %g' % (self.channel, value))
|
||||||
def write_offset(self,ch,value):
|
|
||||||
ch=str(self.channel)
|
|
||||||
self.sendRecv('C'+ch+':BSWV OFST %g' % str(value))
|
|
||||||
|
|
||||||
return value
|
return value
|
||||||
|
|
||||||
|
|
||||||
# channel symmetry
|
# channel symmetry
|
||||||
def read_symm(self):
|
def read_symm(self):
|
||||||
ch=str(self.channel)
|
return self.sendRecv('C%d:BSWV SYM?' % self.channel)
|
||||||
reply = self.sendRecv('C'+ch+':BSWV SYM?')
|
|
||||||
|
def write_symm(self, value):
|
||||||
return reply
|
self.comm('C%d:BSWV SYM %g' % (self.channel, value))
|
||||||
|
|
||||||
def write_symm(self,ch,value):
|
|
||||||
ch=str(self.channel)
|
|
||||||
self.comm('C'+ch+':BSWV SYM %g' % str(value))
|
|
||||||
|
|
||||||
return value
|
return value
|
||||||
|
|
||||||
# wave phase parameter
|
# wave phase parameter
|
||||||
def read_phase(self):
|
def read_phase(self):
|
||||||
ch=str(self.channel)
|
return self.sendRecv('C%d:BSWV PHSE?' % self.channel)
|
||||||
reply = self.sendRecv('C'+ch+':BSWV PHSE?')
|
|
||||||
|
def write_phase(self, value):
|
||||||
return reply
|
self.sendRecv('C%d:BSWV PHSE %g' % (self.channel, str(value)))
|
||||||
|
|
||||||
def write_phase(self,value):
|
|
||||||
ch=str(self.channel)
|
|
||||||
self.sendRecv('C'+ch+':BSWV PHSE %g' % str(value))
|
|
||||||
|
|
||||||
return value
|
return value
|
||||||
|
|
||||||
|
|
||||||
# dis/enable output channel
|
# dis/enable output channel
|
||||||
def read_enabled(self):
|
def read_enabled(self):
|
||||||
ch=str(self.channel)
|
return self.sendRecv('C%d: OUTP?' % self.channel)
|
||||||
reply=self.sendRecv('C'+ch+': OUTP?')
|
|
||||||
|
|
||||||
return reply
|
def write_enabled(self, value):
|
||||||
|
self.sendRecv('C%d: OUTP %s' % (self.channel, value.name))
|
||||||
def write_enabled(self,ch,value):
|
return value
|
||||||
self.sendRecv('C'+ch+': OUTP %g' % str(value))
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# devices are defined as arg less output enable what is defined as arg2
|
# devices are defined as arg less output enable what is defined as arg2
|
||||||
|
Reference in New Issue
Block a user