예제 #1
0
    def __init__(self, *args, limits=None, **kwargs):
        """Static Analog output device for controlling the position of a Zaber stage.
        Can be added as a child device of `ZaberStageController`. Subclasses for
        specific models already have model-specific limits set for their values, but you
        may further restrict these by setting the keyword argument limits=

        Args:
            *args:
                Arguments to be passed to the  `__init__` method of the parent class
                (StaticAnalogQuantity).

            limits (tuple), default `None`
                a two-tuple (min, max) for the minimum and maximum allowed positions, in
                steps, that the device may be instructed to move to via a labscript
                experiment or the BLACS front panel. If None, the limits set as a class
                attribute will be used, which are set to the maximal positions allowed
                by the device if using one of the model-specific subclasses defined in
                this module, or is (0, inf) otherwise.

            **kwargs:
                Further keyword arguments to be passed to the `__init__` method of the
                parent class (StaticAnalogQuantity).

        """

        if limits is None:
            limits = self.limits
        StaticAnalogQuantity.__init__(self, *args, limits=limits, **kwargs)
예제 #2
0
    def __init__(self,name,parent_device,com_port='COM1',FMSignal=None,RFOnOff=None,freq_limits = None,freq_conv_class = None,freq_conv_params = {},amp_limits=None,amp_conv_class = None,amp_conv_params = {},phase_limits=None,phase_conv_class = None,phase_conv_params = {}):
        #self.clock_type = parent_device.clock_type # Don't see that this is needed anymore

        IntermediateDevice.__init__(self,name,parent_device)

        self.BLACS_connection = com_port
        self.sweep_dt = 2e-6

        self.RFSettings = {
            'freq': 0,
            'amp': 0,
            'phase': 0,
            'freq_dev':0 ##EE
        }

        self.sweep_params = {
#            'type': None,
            'low': 0,
            'high': 1,
            'duration': 0,
#            'falltime': 0,
            'sample_rate': self.sweep_dt
        }
        self.sweep = False
        self.ext_in = False


        self.frequency = StaticAnalogQuantity(self.name+'_freq',self,'freq',freq_limits,freq_conv_class,freq_conv_params)
        self.amplitude = StaticAnalogQuantity(self.name+'_amp',self,'amp',amp_limits,amp_conv_class,amp_conv_params)
        self.phase = StaticAnalogQuantity(self.name+'_phase',self,'phase',phase_limits,phase_conv_class,phase_conv_params)

        self.FMSignal = {}
        self.RFOnOff = {}

        if FMSignal:
            if 'device' in FMSignal and 'connection' in FMSignal:
                self.FMSignal = AnalogOut(self.name+'_FMSignal', FMSignal['device'], FMSignal['connection'])
            else:
                raise LabscriptError('You must specify the "device" and "connection" for the analog output FMSignal of '+self.name)
        else:
            raise LabscriptError('Expected analog output for "FMSignal" control')

        if RFOnOff:
            if 'device' in RFOnOff and 'connection' in RFOnOff:
                self.RFOnOff = DigitalOut(self.name+'_RFOnOff', RFOnOff['device'], RFOnOff['connection'])
            else:
                raise LabscriptError('You must specify the "device" and "connection" for the digital output RFOnOff of '+self.name)
        else:
            raise LabscriptError('Expected digital output for "RFOnOff" control')
예제 #3
0
 def __init__(self,
              name,
              parent_device,
              connection,
              freq_limits=None,
              freq_conv_class=None,
              freq_conv_params={},
              amp_limits=None,
              amp_conv_class=None,
              amp_conv_params={}):
     """This instatiates a static frequency output channel.
     
     Frequency and amplitude limits set here will supercede those dictated 
     by the device class, but only when compiling a shot with runmanager. 
     Static update limits are enforced by the BLACS Tab for the parent device.
     
     Args:
         name (str): Name to assign output channel
         parent_device (obj): Handle to parent device
         connection (str): Which physical channel to use on parent device.
                           Typically only 'Channel 0' is available.
         freq_limits (tuple): Set (min,max) output frequencies in BLACS front panel units.
         freq_conv_class (obj): Custom conversion class to use
         freq_conv_params (dict): Parameters to conversion class
         amp_limits (tuple): Set (min,max) output amplitude in BLACS front panel units.
         amp_conv_class (obj): Custom convsersion class to use
         amp_conv_params (dict): Parameters to conversion class
     """
     Device.__init__(self, name, parent_device, connection)
     self.frequency = StaticAnalogQuantity(self.name + '_freq', self,
                                           'freq', freq_limits,
                                           freq_conv_class,
                                           freq_conv_params)
     self.amplitude = StaticAnalogQuantity(self.name + '_amp', self, 'amp',
                                           amp_limits, amp_conv_class,
                                           amp_conv_params)
     # set default values within limits specified
     # if not specified, use limits from parent device
     if freq_limits is not None:
         self.frequency.default_value = freq_limits[0]
     else:
         self.frequency.default_value = parent_device.freq_limits[
             0] / parent_device.scale_factor
     if amp_limits is not None:
         self.amplitude.default_value = amp_limits[0]
     else:
         self.amplitude.default_value = parent_device.amp_limits[
             0] / parent_device.amp_scale_factor
예제 #4
0
 def __init__(self,
              name,
              parent_device,
              connection,
              freq_limits=None,
              freq_conv_class=None,
              freq_conv_params={}):
     Device.__init__(self, name, parent_device, connection)
     self.frequency = StaticAnalogQuantity(self.name + '_freq', self,
                                           'freq', freq_limits,
                                           freq_conv_class,
                                           freq_conv_params)
     self.frequency.default_value = 0.5e9
     self.gate = StaticDigitalOut(self.name + '_gate', self, 'gate')