update FG and SR drivers

these drivers should now include the last changes before
the syntax change. To be tested ...
This commit is contained in:
l_samenv
2021-03-01 11:24:30 +01:00
parent 452eb00417
commit f861701fc2
2 changed files with 181 additions and 24 deletions

View File

@ -21,21 +21,20 @@
"""WAVE FUNCTION LECROY XX: SIGNAL GENERATOR"""
from secop.core import Readable, Parameter, FloatRange, \
HasIodev, IntRange, BoolType, EnumType, Module, Property
IntRange, BoolType, EnumType, Module, Property
class Channel(HasIodev, Module):
class Channel(Module):
channel = Property('choose channel to manipulate', IntRange(1, 2))
freq = Parameter('frequency', FloatRange(1e-6, 20e6, unit='Hz'),
poll=True, initwrite=True, default=1000)
amp = Parameter('exc_volt_int', FloatRange(0.00, 5, unit='Vrms'),
poll=True, readonly=False, initwrite=True, default=0.1)
offset = Parameter('offset_volt_int', FloatRange(0.00, 10, unit='V'),
offset = Parameter('offset_volt_int', FloatRange(0.0, 10, unit='V'),
poll=True, readonly=False, initwrite=True, default=0.0)
wave = Parameter('type of wavefunction',
EnumType('WaveFunction', SINE=1, SQUARE=2, RAMP=3, PULSE=4, NOISE=5, ARB=6, DC=7),
poll=True, readonly=False, default='SINE'),
poll=True, readonly=False, default='SINE')
phase = Parameter('signal phase', FloatRange(0, 360, unit='deg'),
poll=True, readonly=False, initwrite=True, default=0)
enabled = Parameter('enable output channel', datatype=EnumType('OnOff', OFF=0, ON=1),
@ -47,7 +46,7 @@ class Channel(HasIodev, Module):
return self.sendRecv('C%d:BSWV FRQ?' % self.channel)
def write_target(self, value):
self.sendRecv('C%d:BSWV FRQ, %g' % (self.channel, str(value)+'Hz'))
self.sendRecv('C%d:BSWV FRQ, %gHz' % (self.channel, value))
return value
# signal wavefunction parameter
@ -87,8 +86,7 @@ class Channel(HasIodev, Module):
return self.sendRecv('C%d:BSWV PHSE?' % self.channel)
def write_phase(self, value):
self.sendRecv('C%d:BSWV PHSE %g' % (self.channel, str(value)))
self.sendRecv('C%d:BSWV PHSE %g' % (self.channel, value))
return value
# dis/enable output channel
@ -104,11 +102,9 @@ class Channel(HasIodev, Module):
class arg(Readable):
pollerClass = None
value = Parameter(datatype=FloatRange(unit=''))
class arg2(Readable):
pollerClass = None
value = Parameter(datatype=BoolType())