Example #1
0
    def __init__(self,port=None,device_index=0,debug=0):
        self.debug = debug
        self.termination_character = '\n'
        self.port_settings = dict(baudrate=9600,
                                  bytesize=8,
                                  stopbits=1,
                                  parity='N',
                                  timeout=2,
                                  writeTimeout=2,
                                  xonxoff=False
        )

        SerialInstrument.__init__(self, port)
        Stage.__init__(self)
        self.ui = None

        #configure stage parameters
        if str(device_index) not in Thorlabs_ELL8K.VALID_DEVICE_IDs:
            raise ValueError("Device ID: {} is not valid!".format(device_index))
        self.device_index = device_index
        
        configuration = self.get_device_info()
        self.TRAVEL = configuration["travel"]
        self.PULSES_PER_REVOLUTION = configuration["pulses"]
        
        if self.debug > 0:
            print "Travel (degrees):", self.TRAVEL
            print "Pulses per revolution", self.PULSES_PER_REVOLUTION
            print "Device status:",self.get_device_status()
Example #2
0
    def __init__(self, port, smcID=(1, ), **kwargs):
        """
        If backlash_compensation is False, no backlash compensation will be done.
        If silent is False, then additional output will be emitted to aid in
        debugging.
        If sleepfunc is not None, then it will be used instead of time.sleep. It
        will be given the number of seconds (float) to sleep for, and is provided
        for ease integration with single threaded GUIs.
        Note that this method only connects to the controller, it otherwise makes
        no attempt to home or configure the controller for the attached stage. This
        delibrate to minimise realworld side effects.
        If the controller has previously been configured, it will suffice to simply
        call home() to take the controller out of not referenced mode. For a brand
        new controller, call reset_and_configure().
        """
        self.port_settings = dict(baudrate=57600,
                                  bytesize=8,
                                  stopbits=1,
                                  parity='N',
                                  xonxoff=True,
                                  timeout=0.050)

        SerialInstrument.__init__(self, port)
        Stage.__init__(self)
        # self._logger.debug('Connecting to SMC100 on %s' % (port))

        self.software_home = None
        self._last_sendcmd_time = 0
        if not hasattr(smcID, '__iter__'):
            smcID = (smcID, )
        self._smcID = list(smcID)
        self.axis_names = ()
        for id in self._smcID:
            self.axis_names += (str(id), )
            self._send_cmd('ID', id, '?', True)  # Just testing the connection
Example #3
0
 def __init__(self, port=None, integration_time=1):
     SerialInstrument.__init__(self, port=port)
     self.live_window = 100
     self._live_view = False
     self.int_time = integration_time
     self.write('FO')  #do not apply low pass filter
     self.write('Z5')  #for 50 Ohms impedance
Example #4
0
 def __init__(self, port=None):
     self.port_settings = {'baudrate': 19200,
                     'bytesize':serial.EIGHTBITS,
                     'stopbits':serial.STOPBITS_ONE,
                     'timeout':1, #wait at most one second for a response
                     'writeTimeout':1, #similarly, fail if writing takes >1s
                     }
     self.termination_character = "\r"
     SerialInstrument.__init__(self, port=port)
Example #5
0
    def __init__(self, address, **kwargs):

        self.port_settings = dict(baudrate=38400,
                                  bytesize=8,
                                  stopbits=1,
                                  parity='N',
                                  xonxoff=True,
                                  timeout=0.5,
                                  writeTimeout=0.5,
                                  rtscts=True)
        SerialInstrument.__init__(self, address)
        self.termination_character = '\r\n'
        Stage.__init__(self, unit="step")
Example #6
0
 def __init__(self, port):
     self.port_settings = {
         'baudrate': 19200,
         'bytesize': serial.SEVENBITS,
         'parity': serial.PARITY_ODD,
         'stopbits': serial.STOPBITS_ONE,
         'timeout': 1,  #wait at most one second for a response
         'writeTimeout': 1,  #similarly, fail if writing takes >1s
     }
     self.termination_character = "\r"
     SerialInstrument.__init__(self, port=port)
     ShutterWithEmulatedRead.__init__(self)
     self.query("ct")  #enable computer control
Example #7
0
 def __init__(self, port=None):
     self.port_settings = {
         'baudrate': 9600,
         'bytesize': serial.EIGHTBITS,
         'stopbits': serial.STOPBITS_ONE,
         'parity': serial.PARITY_NONE,
         'timeout': 1,  #wait at most one second for a response
         'writeTimeout': 1,  #similarly, fail if writing takes >1s
     }
     self.termination_character = "\r\n"
     SerialInstrument.__init__(self, port=port)
     LightSource.__init__(self)
     self.min_power = 12
     self.max_power = 70
Example #8
0
 def __init__(self, port=None):
     '''Set up baudrate etc and recenters the stage to the center of it's range (50um)
     
     Args:
         port(int/str):  The port the device is connected 
                         to in any of the accepted serial formats
         
     '''
     self.termination_character = '\n'
     self.port_settings = {
         'baudrate': 9600,
         #       'bytesize':serial.EIGHTBITS,
         'timeout': 2,  #wait at most one second for a response
     }
     self.termination_character = '\r\n'
     SerialInstrument.__init__(self, port=port)
Example #9
0
    def __init__(self, address, **kwargs):

        self.port_settings = dict(baudrate=9600,
                                  bytesize=8,
                                  stopbits=1,
                                  parity='N',
                                  xonxoff=True,
                                  timeout=0.5,
                                  writeTimeout=0.5,
                                  rtscts=True)
        SerialInstrument.__init__(self, address)
        self.termination_character = '\r\n'
        Stage.__init__(self)

        if 'offsetOrigin' in kwargs:
            self.offsetOrigin(kwargs['offsetOrigin'])  # 20000)

        if 'home_on_start' in list(kwargs.keys()):
            if kwargs['home_on_start']:
                self.MechanicalHome()
Example #10
0
 def __init__(self, port=None):
     SerialInstrument.__init__(self, port=port)  #this opens the port
     self.query("SYST:REMOTE")