Interface LockIn

  • All Superinterfaces:
    FMeter, Instrument
    All Known Subinterfaces:
    DPLockIn
    All Known Implementing Classes:
    SR830

    public interface LockIn
    extends Instrument, FMeter
    Abstract class to define the standard functionality of lock-in amplifiers
    • Method Detail

      • getDescription

        static java.lang.String getDescription()
      • getRefMode

        LockIn.RefMode getRefMode()
                           throws java.io.IOException,
                                  DeviceException
        Returns whether the lock-in amplifier is using an internal or external reference signal.
        Returns:
        INTERNAL or EXTERNAL
        Throws:
        java.io.IOException - Upon communication error
        DeviceException - Upon compatibility error
      • setRefMode

        void setRefMode​(LockIn.RefMode mode)
                 throws java.io.IOException,
                        DeviceException
        Sets whether the lock-in amplifier is to use an internal or external reference signal
        Parameters:
        mode - INTERNAL or EXTERNAL
        Throws:
        java.io.IOException - Upon communication error
        DeviceException - Upon compatibility error
      • setOscFrequency

        void setOscFrequency​(double frequency)
                      throws java.io.IOException,
                             DeviceException
        Sets the frequency of the internal oscillator of the amplifier (eg for internal reference)
        Parameters:
        frequency - Frequency, in Hz
        Throws:
        java.io.IOException - Upon communication error
        DeviceException - Upon compatibility error
      • setOscPhase

        void setOscPhase​(double phase)
                  throws java.io.IOException,
                         DeviceException
        Sets the phase of the internal oscillator
        Parameters:
        phase - Phase, in degrees
        Throws:
        java.io.IOException - Upon communication error
        DeviceException - Upon compatibility error
      • setOscAmplitude

        void setOscAmplitude​(double level)
                      throws java.io.IOException,
                             DeviceException
        Sets the amplitude of the internal oscillator output.
        Parameters:
        level - Amplitude, in volts
        Throws:
        java.io.IOException - Upon communication error
        DeviceException - Upon compatibility error
      • getFrequency

        double getFrequency()
                     throws java.io.IOException,
                            DeviceException
        Returns the frequency of the reference signal
        Specified by:
        getFrequency in interface FMeter
        Returns:
        Frequency, in Hz
        Throws:
        java.io.IOException - Upon communication error
        DeviceException - Upon compatibility error
      • getRefPhase

        double getRefPhase()
                    throws java.io.IOException,
                           DeviceException
        Returns the phase of the reference signal
        Returns:
        Phase, in degrees
        Throws:
        java.io.IOException - Upon communication error
        DeviceException - Upon compatibility error
      • getRefAmplitude

        double getRefAmplitude()
                        throws java.io.IOException,
                               DeviceException
        Returns the amplitude of the reference signal
        Returns:
        Amplitude, in Volts
        Throws:
        java.io.IOException - Upon communication error
        DeviceException - Upon compatibility error
      • getLockedAmplitude

        double getLockedAmplitude()
                           throws java.io.IOException,
                                  DeviceException
        Returns the amplitude of the signal component locked on to by the amplifier
        Returns:
        Amplitude, in Volts
        Throws:
        java.io.IOException - Upon communication error
        DeviceException - Upon compatibility error
      • getTimeConstant

        double getTimeConstant()
                        throws java.io.IOException,
                               DeviceException
        Returns the set time constant, in seconds
        Returns:
        Time constant, in seconds
        Throws:
        java.io.IOException - Upon communication error
        DeviceException - Upon compatibility error
      • setTimeConstant

        void setTimeConstant​(double seconds)
                      throws java.io.IOException,
                             DeviceException
        Sets the time constant to use for locking onto a signal (or closest over-approximation for devices with discrete settings)
        Parameters:
        seconds - Time constant, in seconds
        Throws:
        java.io.IOException - Upon communication error
        DeviceException - Upon compatibility error
      • getRange

        double getRange()
                 throws java.io.IOException,
                        DeviceException
        Returns the maximum range, in Volts, that the instrument is measuring.
        Returns:
        +/- Range, in Volts
        Throws:
        java.io.IOException - Upon communication error
        DeviceException - Upon compatibility error
      • setRange

        void setRange​(double range)
               throws java.io.IOException,
                      DeviceException
        Sets the sensitivity of the instrument based on the maximum range of values you desire to measure.
        Parameters:
        range - +/- Range, in Volts
        Throws:
        java.io.IOException - Upon communication error
        DeviceException - Upon compatibility error (eg sensitivity greater than can be achieved by instrument)
      • isSyncFilterEnabled

        boolean isSyncFilterEnabled()
                             throws java.io.IOException,
                                    DeviceException
        Returns whether the lock-in is currently using synchronous filtering.
        Returns:
        Enabled?
        Throws:
        java.io.IOException - Upon communication error
        DeviceException - Upon compatibility error
      • setSyncFilterEnabled

        void setSyncFilterEnabled​(boolean flag)
                           throws java.io.IOException,
                                  DeviceException
        Instructs the lock-in to use synchronous filtering (removes higher harmonics of reference frequency from signal).
        Parameters:
        flag - Should this feature be enabled?
        Throws:
        java.io.IOException - Upon communication error
        DeviceException - Upon compatibility error
      • getFilterRollOff

        double getFilterRollOff()
                         throws java.io.IOException,
                                DeviceException
        Returns the filter roll-off used by the lock-in.
        Returns:
        Roll-off in dB/oct
        Throws:
        java.io.IOException - Upon communication error
        DeviceException - Upon compatibility error
      • setFilterRollOff

        void setFilterRollOff​(double dBperOct)
                       throws java.io.IOException,
                              DeviceException
        Sets the filter roll-off for the lock-in's input filter.
        Parameters:
        dBperOct - Roll-off in dB/oct
        Throws:
        java.io.IOException - Upon communication error
        DeviceException - Upon compatibility error
      • getCoupling

        Coupling getCoupling()
                      throws java.io.IOException,
                             DeviceException
        Returns the input coupling mode of the lock-in.
        Returns:
        AC or DC
        Throws:
        java.io.IOException - Upon communication error
        DeviceException - Upon compatibility error
      • setCoupling

        void setCoupling​(Coupling mode)
                  throws java.io.IOException,
                         DeviceException
        Sets the input coupling mode of the lock-in.
        Parameters:
        mode - AC or DC?
        Throws:
        java.io.IOException - Upon communication error
        DeviceException - Upon compatibility error
      • getShielding

        Shield getShielding()
                     throws java.io.IOException,
                            DeviceException
        Returns the currently used shielding mode for input connections.
        Returns:
        Shield.FLOAT or Shield.GROUND
        Throws:
        java.io.IOException - Upon communication error
        DeviceException - Upon compatibility error
      • setShielding

        void setShielding​(Shield mode)
                   throws java.io.IOException,
                          DeviceException
        Sets the shielding mode to use for input connections.
        Parameters:
        mode - Shield.FLOAT or Shield.GROUND
        Throws:
        java.io.IOException - Upon communication error
        DeviceException - Upon compatibility error
      • getInput

        Input getInput()
                throws java.io.IOException,
                       DeviceException
        Returns which input is currently being used by the lock-in.
        Returns:
        Input: A, B or DIFF (A - B)
        Throws:
        java.io.IOException - Upon communication error
        DeviceException - Upon compatibility error
      • setInput

        void setInput​(Input source)
               throws java.io.IOException,
                      DeviceException
        Sets which input the lock-in should use.
        Parameters:
        source - Input: A, B or DIFF (A - B)
        Throws:
        java.io.IOException - Upon communication error
        DeviceException - Upon compatibility error
      • getSource

        Source getSource()
                  throws java.io.IOException,
                         DeviceException
        Returns which quantity is being used for measurement (voltage or current).
        Returns:
        Source.VOLTAGE or Source.CURRENT
        Throws:
        java.io.IOException - Upon communication error
        DeviceException - Upon compatibility error
      • setSource

        void setSource​(Source source)
                throws java.io.IOException,
                       DeviceException
        Sets which source quantity to be using for measurement (voltage or current).
        Parameters:
        source - Source.VOLTAGE or Source.CURRENT
        Throws:
        java.io.IOException - Upon communication error
        DeviceException - Upon compatibility error
      • getImpedanceMode

        Impedance getImpedanceMode()
                            throws java.io.IOException,
                                   DeviceException
        Returns whether HIGH or LOW impedance mode is currently in use.
        Returns:
        Impedance.HIGH or Impedance.LOW
        Throws:
        java.io.IOException - Upon communication error
        DeviceException - Upon compatibility error
      • setImpedanceMode

        void setImpedanceMode​(Impedance mode)
                       throws java.io.IOException,
                              DeviceException
        Sets whether to use HIGH or LOW impedance mode for input signals.
        Parameters:
        mode - Impedance.HIGH or Impedance.LOW
        Throws:
        java.io.IOException - Upon communication error
        DeviceException - Upon compatibility error
      • getLineFilterHarmonics

        java.util.List<java.lang.Integer> getLineFilterHarmonics()
                                                          throws java.io.IOException,
                                                                 DeviceException
        Returns a list of all harmonics of the powerline frequency being filtered by the lock-in.
        Returns:
        List of harmonics (list of integers)
        Throws:
        java.io.IOException - Upon communication error
        DeviceException - Upon compatibility error
      • setLineFilterHarmonics

        void setLineFilterHarmonics​(int... harmonics)
                             throws java.io.IOException,
                                    DeviceException
        Attempts to set the lock-in to filter all the specified harmonics of the powerline frequency. Any unavailable harmonics will be ignored.
        Parameters:
        harmonics - Harmonics to filter, as integers (ie 1, 4, 5 for 1st 4th and 5th)
        Throws:
        java.io.IOException - Upon communication error
        DeviceException - Upon compatibility error
      • getOffset

        double getOffset()
                  throws java.io.IOException,
                         DeviceException
        Returns the offset currently being used by the lock-in.
        Returns:
        Offset as % of measurement range
        Throws:
        java.io.IOException - Upon communication error
        DeviceException - Upon compatibility error
      • setOffset

        void setOffset​(double offset)
                throws java.io.IOException,
                       DeviceException
        Sets the offset for input measurements.
        Parameters:
        offset - Offset as % of measurement range
        Throws:
        java.io.IOException - Upon communication error
        DeviceException - Upon compatibility error
      • getExpansion

        double getExpansion()
                     throws java.io.IOException,
                            DeviceException
        Returns the signal expansion factor being used
        Returns:
        Expansion factor
        Throws:
        java.io.IOException - Upon communication error
        DeviceException - Upon compatibility error
      • setExpansion

        void setExpansion​(double expand)
                   throws java.io.IOException,
                          DeviceException
        Sets the signal expansion factor to use. Will choose closest discrete option if not continuous.
        Parameters:
        expand - Expansion factor
        Throws:
        java.io.IOException - Upon communication error
        DeviceException - Upon compatibility error
      • autoOffset

        void autoOffset()
                 throws java.io.IOException,
                        DeviceException
        Instruct the lock-in to automatically determine the offset to use.
        Throws:
        java.io.IOException - Upon communication error
        DeviceException - Upon compatibility error
      • autoRange

        void autoRange​(double factor,
                       double integrationTime,
                       long waitTime)
                throws java.io.IOException,
                       DeviceException,
                       java.lang.InterruptedException
        Instruct the lock-in to automatically determine the measurement range to use for the currently measured input. This is done by picking the smallest range (multiplied by the supplied factor) within which the current value fits within after any offsetting. Does not return until completed.
        Parameters:
        factor - Multiplicative factor used to modify the range (i.e. 0.5 would mean the value must fit within half of the range selected)
        factor -
        Throws:
        java.io.IOException - Upon communication error
        DeviceException - Upon compatibility error
        java.lang.InterruptedException - Upon interruption error
      • autoRange

        default void autoRange()
                        throws java.io.IOException,
                               DeviceException,
                               java.lang.InterruptedException
        Throws:
        java.io.IOException
        DeviceException
        java.lang.InterruptedException
      • getExternalTriggerMode

        LockIn.TrigMode getExternalTriggerMode()
                                        throws java.io.IOException,
                                               DeviceException
        Returns the triggering mode used for external referencing (SINE, POS_TTL, NEG_TTL).
        Returns:
        Triggering mode
        Throws:
        java.io.IOException - Upon communication error
        DeviceException - Upon compatibility error
      • setExternalTriggerMode

        void setExternalTriggerMode​(LockIn.TrigMode mode)
                             throws java.io.IOException,
                                    DeviceException
        Sets the triggering mode used for external referencing (SINE, POS_TTL, NEG_TTL).
        Parameters:
        mode - Triggering mode
        Throws:
        java.io.IOException - Upon communication error
        DeviceException - Upon compatibility error
      • waitForStableLock

        default void waitForStableLock​(double pctMargin,
                                       long duration)
                                throws java.io.IOException,
                                       DeviceException,
                                       java.lang.InterruptedException
        Halts the current thread (ie pauses the program) until the lock-in has a stable lock (ie the locked-on amplitude has remained within the given percentage margin for at least the specified number of milliseconds).
        Parameters:
        pctMargin - Percentage margin within which to consider amplitude constant
        duration - Minimum duration to be considered stable, in milliseconds
        Throws:
        java.io.IOException - Upon communication error
        DeviceException - Upon compatibility error
        java.lang.InterruptedException - Upon interruption error
      • waitForStableLock

        default void waitForStableLock()
                                throws java.io.IOException,
                                       DeviceException,
                                       java.lang.InterruptedException
        Halts the current thread (ie pauses the program) until the lock-in has a stable lock (ie the locked-on amplitude has not varied by more than 0.1% in 5 seconds).
        Throws:
        java.io.IOException - Upon communication error
        DeviceException - Upon compatibility error
        java.lang.InterruptedException - Upon interruption error