#!/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 # ***************************************************************************** """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