merged master with work
Change-Id: Iedfb2bf7f28bfe45201adacec0645cc13abffe59
This commit is contained in:
48
secop_psi/SR_7270.py
Normal file
48
secop_psi/SR_7270.py
Normal file
@@ -0,0 +1,48 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
# *****************************************************************************
|
||||
# This program is free software; you can redistribute it and/or modify it under
|
||||
# the terms of the GNU General Public License as published by the Free Software
|
||||
# Foundation; either version 2 of the License, or (at your option) any later
|
||||
# version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
# details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along with
|
||||
# this program; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
# Module authors:
|
||||
# Daniel Margineda <daniel.margineda@psi.ch>
|
||||
# *****************************************************************************
|
||||
"""SIGNAL RECOVERY SR7270: lOCKIN AMPLIFIER FOR AC SUSCEPTIBILITY"""
|
||||
|
||||
from secop.core import FloatRange, HasIodev, \
|
||||
Parameter, Readable, StringIO, TupleOf
|
||||
|
||||
|
||||
class SR7270(StringIO):
|
||||
# end_of_line = '\x00' #termination line from maanual page 6.8
|
||||
end_of_line = '\n'
|
||||
|
||||
|
||||
class XY(HasIodev, Readable):
|
||||
value = Parameter('X, Y', datatype=TupleOf(FloatRange(unit='V'), FloatRange(unit='V')))
|
||||
freq = Parameter('exc_freq_int', FloatRange(0.001,250e3,unit='Hz'), readonly=False, default=100)
|
||||
|
||||
iodevClass = SR7270
|
||||
|
||||
def read_value(self):
|
||||
reply = self.sendRecv('XY.').split('\x00')[-1]
|
||||
return reply.split(',')
|
||||
|
||||
def read_freq(self):
|
||||
reply = self.sendRecv('OF.').split('\x00')[-1]
|
||||
return reply
|
||||
|
||||
def write_freq(self,value):
|
||||
self.sendRecv('OF. %g' % value)
|
||||
return value
|
||||
Reference in New Issue
Block a user