Package jisa.devices.interfaces
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
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
LockIn.RefMode
Enumeration of reference modesstatic class
LockIn.TrigMode
Enumeration of reference triggering modes-
Nested classes/interfaces inherited from interface jisa.devices.interfaces.Instrument
Instrument.AutoQuantity<S>, Instrument.OptionalQuantity<S>, Instrument.Parameter<S>, Instrument.Setter<S>, Instrument.TableQuantity
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void
autoOffset()
Instruct the lock-in to automatically determine the offset to use.default void
autoRange()
void
autoRange(double factor, double integrationTime, long waitTime)
Instruct the lock-in to automatically determine the measurement range to use for the currently measured input.default java.util.List<Instrument.Parameter<?>>
getConfigurationParameters(java.lang.Class<?> target)
Coupling
getCoupling()
Returns the input coupling mode of the lock-in.static java.lang.String
getDescription()
double
getExpansion()
Returns the signal expansion factor being usedLockIn.TrigMode
getExternalTriggerMode()
Returns the triggering mode used for external referencing (SINE, POS_TTL, NEG_TTL).double
getFilterRollOff()
Returns the filter roll-off used by the lock-in.double
getFrequency()
Returns the frequency of the reference signalImpedance
getImpedanceMode()
Returns whether HIGH or LOW impedance mode is currently in use.Input
getInput()
Returns which input is currently being used by the lock-in.java.util.List<java.lang.Integer>
getLineFilterHarmonics()
Returns a list of all harmonics of the powerline frequency being filtered by the lock-in.double
getLockedAmplitude()
Returns the amplitude of the signal component locked on to by the amplifierdouble
getOffset()
Returns the offset currently being used by the lock-in.double
getRange()
Returns the maximum range, in Volts, that the instrument is measuring.double
getRefAmplitude()
Returns the amplitude of the reference signalLockIn.RefMode
getRefMode()
Returns whether the lock-in amplifier is using an internal or external reference signal.double
getRefPhase()
Returns the phase of the reference signalShield
getShielding()
Returns the currently used shielding mode for input connections.Source
getSource()
Returns which quantity is being used for measurement (voltage or current).double
getTimeConstant()
Returns the set time constant, in secondsboolean
isSyncFilterEnabled()
Returns whether the lock-in is currently using synchronous filtering.void
setCoupling(Coupling mode)
Sets the input coupling mode of the lock-in.void
setExpansion(double expand)
Sets the signal expansion factor to use.void
setExternalTriggerMode(LockIn.TrigMode mode)
Sets the triggering mode used for external referencing (SINE, POS_TTL, NEG_TTL).void
setFilterRollOff(double dBperOct)
Sets the filter roll-off for the lock-in's input filter.void
setImpedanceMode(Impedance mode)
Sets whether to use HIGH or LOW impedance mode for input signals.void
setInput(Input source)
Sets which input the lock-in should use.void
setLineFilterHarmonics(int... harmonics)
Attempts to set the lock-in to filter all the specified harmonics of the powerline frequency.void
setOffset(double offset)
Sets the offset for input measurements.void
setOscAmplitude(double level)
Sets the amplitude of the internal oscillator output.void
setOscFrequency(double frequency)
Sets the frequency of the internal oscillator of the amplifier (eg for internal reference)void
setOscPhase(double phase)
Sets the phase of the internal oscillatorvoid
setRange(double range)
Sets the sensitivity of the instrument based on the maximum range of values you desire to measure.void
setRefMode(LockIn.RefMode mode)
Sets whether the lock-in amplifier is to use an internal or external reference signalvoid
setShielding(Shield mode)
Sets the shielding mode to use for input connections.void
setSource(Source source)
Sets which source quantity to be using for measurement (voltage or current).void
setSyncFilterEnabled(boolean flag)
Instructs the lock-in to use synchronous filtering (removes higher harmonics of reference frequency from signal).void
setTimeConstant(double seconds)
Sets the time constant to use for locking onto a signal (or closest over-approximation for devices with discrete settings)default void
waitForStableLock()
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).default void
waitForStableLock(double pctMargin, long duration)
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).-
Methods inherited from interface jisa.devices.interfaces.FMeter
getFrequencyRange, setFrequencyRange
-
Methods inherited from interface jisa.devices.interfaces.Instrument
close, getAddress, getConfigurationParameters, getIDN, getLockObject, getName, setTimeout
-
-
-
-
Method Detail
-
getDescription
static java.lang.String getDescription()
-
getConfigurationParameters
default java.util.List<Instrument.Parameter<?>> getConfigurationParameters(java.lang.Class<?> target)
- Specified by:
getConfigurationParameters
in interfaceFMeter
- Specified by:
getConfigurationParameters
in interfaceInstrument
-
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 errorDeviceException
- 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 errorDeviceException
- 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 errorDeviceException
- 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 errorDeviceException
- 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 errorDeviceException
- Upon compatibility error
-
getFrequency
double getFrequency() throws java.io.IOException, DeviceException
Returns the frequency of the reference signal- Specified by:
getFrequency
in interfaceFMeter
- Returns:
- Frequency, in Hz
- Throws:
java.io.IOException
- Upon communication errorDeviceException
- 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 errorDeviceException
- 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 errorDeviceException
- 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 errorDeviceException
- 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 errorDeviceException
- 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 errorDeviceException
- 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 errorDeviceException
- 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 errorDeviceException
- 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 errorDeviceException
- 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 errorDeviceException
- 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 errorDeviceException
- 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 errorDeviceException
- 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 errorDeviceException
- 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 errorDeviceException
- 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 errorDeviceException
- 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 errorDeviceException
- 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 errorDeviceException
- 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 errorDeviceException
- 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 errorDeviceException
- 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 errorDeviceException
- 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 errorDeviceException
- 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 errorDeviceException
- 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 errorDeviceException
- 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 errorDeviceException
- 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 errorDeviceException
- 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 errorDeviceException
- 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 errorDeviceException
- 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 errorDeviceException
- 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 errorDeviceException
- 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 errorDeviceException
- Upon compatibility errorjava.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 errorDeviceException
- 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 errorDeviceException
- 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 constantduration
- Minimum duration to be considered stable, in milliseconds- Throws:
java.io.IOException
- Upon communication errorDeviceException
- Upon compatibility errorjava.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 errorDeviceException
- Upon compatibility errorjava.lang.InterruptedException
- Upon interruption error
-
-