def __init__(self): MagnetController.__init__(self) self.newline_str = '\r' self.read_timeout = 1.0 self.check_errors = False """ the serial to gpib converter is on the fourth port at MAGIK, which is /dev/ttyUSB3 """ self.settings = { 'serial_port': '/dev/ttyUSB4', 'gpib_addr': '5', 'comm_mode': 'gpib', 'serial_to_gpib_port': '/dev/ttyUSB3', 'volt_change_rate': 2.0, # volts/second 'curr_change_rate': 1.0 # amps/second } self.valid_settings = { 'serial_port': dict([('/dev/ttyUSB%d' % i, 'Serial port %d' % (i+1)) for i in range(4, 16)]), 'gpib_addr': dict([(i, str(i)) for i in range(5, 32)]), 'comm_mode': {'gpib': 'gpib', 'serial': 'serial'}, 'serial_to_gpib_port': dict([('/dev/ttyUSB%d' % i, 'Serial port %d' % (i+1)) for i in range(3, 16)]), 'volt_change_rate': dict([(i, str(i)) for i in [1,2,5,10]]), 'curr_change_rate': dict([(i, str(i)) for i in [1,2,5,10]]) } self.gpib = None self.serial = None self.getVoltage = self.getVoltageMeasured self.getCurrent = self.getCurrentMeasured self.setCommunications()
def __init__(self): MagnetController.__init__(self) """ the serial to gpib converter is on the fourth port at MAGIK, which is /dev/ttyUSB3 """ self.serial_eol = '\n' self.settings = { 'serial_port': '/dev/ttyUSB4' } self.valid_settings = { 'serial_port': dict([('/dev/ttyUSB%d' % i, 'Serial port %d' % (i+1)) for i in range(4, 16)]), } self.setCommunications() self.field_multipliers = {'μ': 1e-6, 'm': 1e-3, ' ': 1.0, 'k': 1e3}
def __init__(self): MagnetController.__init__(self) """ the serial to gpib converter is on the fourth port at MAGIK, which is /dev/ttyUSB3 """ self.serial_eol = '\r' self.settings = { 'serial_port': '/dev/ttyUSB4', 'gpib_addr': '5', 'comm_mode': 'gpib', 'serial_to_gpib_port': '/dev/ttyUSB3', } self.valid_settings = { 'serial_port': dict([('/dev/ttyUSB%d' % i, 'Serial port %d' % (i+1)) for i in range(4, 16)]), 'gpib_addr': dict([(str(i), '') for i in range(1, 32)]), 'comm_mode': {'gpib': 'GPIB or HPIB', 'serial': 'RS232 connection'}, 'serial_to_gpib_port': dict([('/dev/ttyUSB%d' % i, 'Serial port %d' % (i+1)) for i in range(3, 16)]), } self.setCommunications()