SR850 lock-in amplifier module¶
Stanford Research Systems SR850 DSP Lock-In Amplifier
-
class
place.plugins.sr850_amp.sr850_amp.
SR850
(config, plotter)[source]¶ PLACE module for controlling the SRS SR850 lock-in amplifier.
-
config
(metadata, total_updates)[source]¶ Configure the amplifier.
Typically, the amplifier will be configured at the beginning of an experiment, so the majority of the activity will happen in this method.
Parameters: - metadata (dict) – metadata for the experiment
- total_updates (int) – the number of update steps that will be in this experiment
-
Basic driver functions for the SR850
-
class
place.plugins.sr850_amp.sr850_driver.
SR850Driver
(serial_port)[source]¶ Lower level access to the lock-in amp settings
Reference and phase commands for the SR850 lock-in amplifier
-
class
place.plugins.sr850_amp.sr850_ref_phase.
SR850ReferenceAndPhaseCmds
(serial_port)[source]¶ Reference and phase commands
-
phas
(shift=None)[source]¶ Set or query the reference phase shift.
Parameters: shift (float or None) – phase (real number of degrees) rounded to 0.001 deg, between -360 and 719.999 (will be wrapped around at +/- 180 deg. Returns: if shift is None, then returns the current shift value Return type: float or None
-
fmod
(source=None)[source]¶ Queries and returns reference source.
Parameters: source (str or None) – the reference source: “internal”, “internal sweep”, or “external” Returns: if source is None, then returns the current source Return type: str or None Raises: ValueError – if source value is invalid
-
freq
(frequency=None)[source]¶ Sets the frequency of the internal oscillator.
Only allowed when reference source is internal.
Parameters: frequency (float or None) – frequency in Hz. Rounded to 5 digits or 0.0001 (whichever is greater). Range 0.001 to 102000. If harmonic number > 1, range harmonic number*f <= 102 kHz. Returns: if frequency is None, then returns the current frequency Return type: float or None
-
swpt
(sweep=None)[source]¶ Sets the type of frequency sweep.
Must be in internal sweep mode.
Parameters: sweep (str or None) – “linear” or “logarithmic” Returns: if sweep is None, returns the current sweep Return type: str or None Raises: ValueError – if sweep value is invalid
-
sllm
(start=None)[source]¶ Sets the starting frequency of internal frequency sweep.
Parameters: start (float or None) – frequency in Hz (rounded to 5 digits or 0.0001 Hz, whichever is greater. Range 0.001 to 102000 Hz. If harmonic number > 1, range harmonic number*f <= 102 kHz. Returns: if start is None, returns the current starting frequency Return type: float or None
-
sulm
(stop=None)[source]¶ Sets the stop frequency of internal frequency sweep.
Parameters: stop (float or None) – frequency in Hz (rounded to 5 digits or 0.0001 Hz, whichever is greater. Range 0.001 to 102000 Hz. If harmonic number > 1, range harmonic number*f <= 102 kHz. Returns: if stop is None, returns the current stop frequency Return type: float or None
-
rslp
(slope=None)[source]¶ Sets reference slope when using external reference mode.
At frequencyies < 1 Hz, a TTL reference must be used.
Parameters: slope (str or None) – “sine zero crossing”, “TTL rising edge”, or “TTL falling edge” Returns: if slope is None, returns the current slope Return type: str or None Raises: ValueError – if the slope value is invalid
-
harm
(harmonic=None)[source]¶ Sets the detection harmonic.
Parameters: harmonic (int or None) – an integer from 1 to 32767. Sets the lock-in to detect at the i^(th) harmonic of the reference frequency. Range i*freq < 102 kHz. If detection frequency > 102 kHz, harmonic number will be set to largest value in this range. Returns: if harmonic is None, returns the current setting Return type: int or None
-
Input and filter commands for the SR850 lock-in amplifier
-
class
place.plugins.sr850_amp.sr850_input_filter.
SR850InputFilter
(serial_port)[source]¶ Input and filter commands for the SR850 lock-in amplifier
-
isrc
(source=None)[source]¶ Sets input configuration.
Parameters: source (str or None) – “A”, “A-B”, or “I” Returns: if source is None, returns the current setting Return type: str or None Raises: ValueError – if source value is invalid
-
igan
(gain=None)[source]¶ Sets conversion gain of current input.
Only relavent if input configured to measure current.
Parameters: gain (str or None) – “1 Mohm”, or “100 Mohm” Returns: if gain is None, returns the current setting Return type: str or None Raises: ValueError – if gain value is invalid
-
ignd
(grounding=None)[source]¶ Sets shield grounding.
Parameters: grounding (str or None) – “Float”, or “Ground” Returns: if grounding is None, returns the current setting Return type: str or None Raises: ValueError – if grounding value is invalid
-
icpl
(coupling=None)[source]¶ Sets input coupling.
Parameters: coupling (str or None) – “AC”, or “DC” Returns: if coupling is None, returns the current setting Return type: str or None Raises: ValueError – if coupling value is invalid
-
ilin
(filters=None)[source]¶ Sets input line notch filter.
Parameters: filters (str or None) – “Out or no filters”, “Line notch in”, “2x Line notch in”, or “Both notch filters in” Returns: if filters is None, returns the current setting Return type: str or None Raises: ValueError – if filters value is invalid
-
Gain and time constant commands
-
class
place.plugins.sr850_amp.sr850_gain_time.
SR850GainTime
(serial_port)[source]¶ Gain and time constant commands
-
rsrv
(reserve=None)[source]¶ Sets or queries dynamic reserve.
Sets or queries dynamic reserve to i^(th) available reserve (between 0 and 5). Must be in Manual reserve mode 0 (minimum reserve for present sensitivity and time constant 1 (next highest reserve) … 5 (always sets reserve to max.) Reserve increases by 10 dB for each successive value of i.
-
Output and offset commands
-
class
place.plugins.sr850_amp.sr850_output_offset.
SR850OutputOffset
(serial_port)[source]¶ Output and offset commands
-
oexp
(output, offset=None, expand=None)[source]¶ Sets output offset and expand.
If offset and expand parameters are both None, then this method returns the current offset and expand for the given output.
Otherwise, this method will set the parameters based on the arguments provided.
Parameters: - output (str) – the output to be set or queried (‘X’, ‘Y’, or ‘R’)
- offset (float) – the offset in percent (-105.00 <= offset <= 105.00)
- expand (int) – the expand value (1 <= expand <= 256)
Returns: the current offset and expand values for the output, or None if offset or expand are not None
Return type: (float, int) or None
Raises: ValueError – if a given argument is invalid
-
aoff
(output)[source]¶ Automatically sets X, Y, or R offset to zero.
Equivalent to pressing the Auto softkey in the Offset & Expand menu box. This method does not allow query.
Parameters: output (str) – the output to be set or queried (‘X’, ‘Y’, or ‘R’) Raises: ValueError – if a given argument is invalid
-
Trace and scan commands
-
class
place.plugins.sr850_amp.sr850_trace_scan.
SR850TraceScan
(serial_port)[source]¶ Trace and scan commands
-
trcd
(trace_number, j_value=None, k_value=None, l_value=None, store=None)[source]¶ Sets or queries the trace definitions.
The valid strings for j, k, and l are as shown here:
j,k,l
- 1
- X
- Y
- R
- theta
- Xn
- Yn
- Rn
- Al1
- Al2
- Al3
- Al4
- F
l only
- X^2
- Y^2
- R^2
- theta^2
- Xn^2
- Yn^2
- Rn^2
- Al1^2
- Al2^2
- Al3^2
- Al4^2
- F^2
For example, for following command defines trace 1 as X*Y/R and stores trace 1:
SR850TraceScan().trcd(1, 'X', 'Y', 'R', store=True)
The following command is used to query the current settings for trace 1:
j, k, l, stored = SR850TraceScan().trcd(1)
In this example, j, k, and l will be string values and stored with be a boolean value.
Parameters: - trace_number (int) – selects the trace number (1, 2, 3, or 4) and is required
- j_value (str) – defines the trace as quantity j times quantity k divided by quantity l
- k_value (str) – defines the trace as quantity j times quantity k divided by quantity l
- l_value (str) – defines the trace as quantity j times quantity k divided by quantity l
- store (bool) – trace is stored or not stored
Returns: Nothing or current settings
Return type: (str, str, str, bool) or None
Raises: ValueError – if provided values are found to be invalid
-
srat
(sample_rate=None)[source]¶ Sets or queries the scan sample rate.
Sample rates
- 62.5 mHz
- 125 mHz
- 250 mHz
- 500 mHz
- 1 Hz
- 2 Hz
- 4 Hz
- 8 Hz
- 16 Hz
- 32 Hz
- 64 Hz
- 128 Hz
- 256 Hz
- 512 Hz
- Trigger
Parameters: sample_rate (str) – the scan sample rate Returns: Nothing or current setting Return type: str or None
-
slen
(length=None)[source]¶ Sets scan length.
Set to closest allowed time given sample rate and stored number of traces. Max is buffer size / sample rate. Min is 1.0 sec.
This method does not validate the input data, but will query the device settings and return them in case validating the setting is desired by the user.
Parameters: length (float) – the scan length Returns: the scan length returned from the device Return type: float
-
Display and scale commands
-
class
place.plugins.sr850_amp.sr850_display_scale.
SR850DisplayScale
(serial_port)[source]¶ Display and scale commands
-
ascl
()[source]¶ Auto scale the active display.
This is just like pressing the (AUTO SCALE) key. Only Bar and Chart displays are affected.
-
adsp
(display=None)[source]¶ Select the active display.
The selected display must be presently displayed on the screen otherwise an error will result.
Parameters: display (str) – ‘Full’, ‘Top’, or ‘Bottom’ Returns: the current display Return type: str
-
smod
(format_=None)[source]¶ Sets or queries the screen format.
Parameters: format (str) – ‘Single’ (full screen) or ‘Up/Down’ (dual display) Returns: the current format Return type: str
-
mntr
(mode=None)[source]¶ Sets or queries the monitor display mode.
Parameters: mode (str) – ‘Settings’ or ‘Input/Output’ Returns: the current mode Return type: str
-
dtyp
(display, type_=None)[source]¶ Sets or queries the display type.
Warning
Unexpected behavior may occur if tryng to set the display type of a display that is not on screen.
Parameters: - display (str) – ‘Full’, ‘Top’, or ‘Bottom’
- type (str) – ‘Polar’, ‘Blank’, ‘Bar’, or ‘Chart’
Returns: the current type
Return type: str
-
dtrc
(display, trace=None)[source]¶ Sets or queries the displayed trace number.
Warning
Unexpected behavior may occur if tryng to set the trace of a display that is not on screen.
Parameters: - display (str) – ‘Full’, ‘Top’, or ‘Bottom’
- trace (int) – the trace number (1, 2, 3, or 4)
Returns: the trace number
Return type: int
-
dscl
(display, range_=None)[source]¶ Sets or queries the display range
Warning
Unexpected behavior may occur if tryng to set the display range of a display that is not on screen.
Parameters: - display (str) – ‘Full’, ‘Top’, or ‘Bottom’
- range (float) – the display range (real number in units of displayed trace)
Returns: the display range
Return type: float
-
doff
(display, center=None)[source]¶ Sets or queries the display center value or offset
Warning
Unexpected behavior may occur if tryng to set the center of a display that is not on screen.
Parameters: - display (str) – ‘Full’, ‘Top’, or ‘Bottom’
- center (float) – the display center (real number in units of displayed trace)
Returns: the display center
Return type: float
-
dhzs
(display, scale=None)[source]¶ Sets or queries the display horizontal scale.
Valid scales:
time/div
- 2 mS
- 5 mS
- 10 mS
- 20 mS
- 50 mS
- 0.1 S
- 0.2 S
- 0.5 S
- 1.0 S
- 2.0 S
- 5.0 S
- 10 S
- 20 S
- 50 S
- 1 min
- 100 S
- 2 min
- 200 S
- 5 min
- 500 S
- 10 min
- 1 kS
- 20 min
- 2 kS
- 1 hour
- 5 kS
- 2 hour
- 10 kS
- 3 hour
- 20 kS
- 50 kS
- 100 kS
- 200 kS
The minimum scale is related to the sample rate. The minumum scale is (1/sample rate) per division. This displays a minimum of 10 points on the chart. The maximum scale is also related to the sample rate. The scale cannot exceed that which would display the entire buffer on the chart at once.
Warning
Unexpected behavior may occur if tryng to set the scale of a display that is not on screen.
Parameters: - display (str) – ‘Full’, ‘Top’, or ‘Bottom’
- scale (str) – the display scale
Returns: the display scale
Return type: str
-
rbin
(display)[source]¶ Queries the bin number at the right edge of the chart display.
The selected display must be a chart display.
This method along with cbin() can be used to position the time window of the active chart display over a specific trace region.
Parameters: display (str) – ‘Full’, ‘Top’, or ‘Bottom’ Returns: the bin number Return type: int
-
Cursor commands
-
class
place.plugins.sr850_amp.sr850_cursor.
SR850Cursor
(serial_port)[source]¶ Cursor commands
-
csek
(mode=None)[source]¶ Sets or queries the cursor seek mode.
Seek mode can either be ‘Max’, ‘Min’, or ‘Mean’. Each display has it’s own cursor seek mode. Use the atrc() or smod() methods to select the desired display. Only chart displays have a cursor.
Parameters: mode (str) – the seek mode to use Returns: the current seek mode Return type: str
-
cwid
(width=None)[source]¶ Sets or queries the cursor width of the active display.
Cursor width can either be ‘Off’, ‘Narrow’, ‘Wide’, or ‘Spot’. Each display has its own cursor width. Use the atrc() or smod() methods to select the desired display. Only chart displays have a cursor.
Parameters: width (str) – the cursor width to use Returns: the current cursor width Return type: str
-
cdiv
(divisions=None)[source]¶ Sets or queries the vertical divisions of the active display.
Vertical divisions can be 0, 8, or 10. Each display has its own vertical divisions mode. Use the atrc() or smod() methods to select the desired display. This only affects chart displays.
Parameters: divisions (int) – the vertical divisions to use Returns: the current vertical divisions for the active display. Return type: int
-
clnk
(mode=None)[source]¶ Sets or queries the cursor control mode.
Control mode can be ‘Linked’ or ‘Separated’. Only chart displays have a cursor.
Parameters: mode (str) – the cursor control mode to use Returns: the current cursor control mode Return type: str
-
cdsp
(mode=None)[source]¶ Sets or queries the cursor readout mode of the active display.
The readout mode can be ‘Delay’, ‘Bin’, ‘Fsweep’, or ‘Time’. Only chart displays have a cursor.
Parameters: mode (str) – the cursor readout mode to use Returns: the current readout mode Return type: str
-
cmax
()[source]¶ Move cursor to max or min of data.
This is just like pressing the CURSOR MAX/MIN key. Only effective if the active display is a chart display.
-
curs
(display)[source]¶ Queries the cursor position of the display.
Display can be ‘Full’, ‘Top’, or ‘Bottom’. The selected display must be a chart display.The returned values are those diaplyed in the cursor readout above the selected chart display.
Parameters: display (str) – the display to use Returns: the horizontal and vertical position Return type: (float, float)
-
cbin
(position=None)[source]¶ Sets or queries the cursor bin position of the active chart display.
The active display must be a chart display.
Remember that this method references the center of the cursor region.
Parameters: position (int) – the bin position to which the cursor should be moved Returns: the current bin posiiton Return type: int
-
Mark commands
-
class
place.plugins.sr850_amp.sr850_mark.
SR850Mark
(serial_port)[source]¶ Mark commands
Aux input and output commands
-
class
place.plugins.sr850_amp.sr850_aux_input_output.
SR850AuxInputOutput
(serial_port)[source]¶ Aux input and output commands
Math commands
-
class
place.plugins.sr850_amp.sr850_math.
SR850Math
(serial_port)[source]¶ Math commands
-
smth
(width)[source]¶ Smooth the data trace of the active display.
This command may take some time to complete. If a scan is in progress, this method will pause the scan.
Parameters: width (str) – the smoothing width
-
copr
(operation=None)[source]¶ Sets or queries the type of math operation selected.
Parameters: operation (str) – the math operation Returns: the math operation Return type: str
-
cagt
(type_=None)[source]¶ Sets or queries the argument type.
Parameters: type (str) – the argument type Returns: the argument type Return type: str
-
ctrc
(trace=None)[source]¶ Sets or queries the trace argument number.
The selected trace must be stored.
Parameters: trace (int) – the trace number Returns: the trace number Return type: int
-
carg
(value=None)[source]¶ Sets or queries the constant argument value.
Parameters: value (float) – the constant argument value Returns: the constant argument value Return type: float
-
ftyp
(fit=None)[source]¶ Sets or queries the type of fit.
Parameters: fit (str) – the type of fit Returns: the type of fit Return type: str
-
fitt
(start, end)[source]¶ Starts the fitting calculation.
The fit takes place between start% and end% and end must be larger than start. This fit may take some time. If a scan is in progress, it will be paused.
Parameters: - start (int) – the start point from the left side of the screen (percentage)
- end (int) – the end point from the left side of the screen (percentage)
-
pars
(parameter)[source]¶ Queries the fit parameters after a curve fit has been performed.
If no fit has been performed or the selected parameter is unused in the fit, this could return invalid data.
Parameters: parameter (str) – the fit parameter Returns: the fit parameter value Return type: float
-
stat
(start, end)[source]¶ Starts the statistics calulations.
Only the data within the chart region defined between start% and end% (end must be larger than start) are analyzed. The analysis may take some time.
Parameters: - start (int) – the start point from the left side of the screen (percentage)
- end (int) – the end point from the left side of the screen (percentage)
-
Store and recall file commands
-
class
place.plugins.sr850_amp.sr850_store_recall_file.
SR850StoreRecallFile
(serial_port)[source]¶ Store and recall file commands
-
fnam
(filename=None)[source]¶ Sets or queries the active file name.
Parameters: filename (str) – the name of the file Returns: the name of the file Return type: str
-
sdat
()[source]¶ Saves the active display data trace.
This is the same as pressing the Data Save softkey.
-
sasc
()[source]¶ Saves the active disaply’s data trace in ascii format.
This is the same as pressing the Ascii Save softkey.
-
Setup commands
-
class
place.plugins.sr850_amp.sr850_setup.
SR850Setup
(serial_port)[source]¶ Setup commands
-
outx
(output)[source]¶ Sets the output interface.
Note
The outx() method should be called before any query commands to direct the responses to the interface in use.
Parameters: output (str) – the interface to which data should be sent Returns: the interface currently being used Return type: str
-
thrs
(hour=None)[source]¶ Set or query the hours setting of the clock.
Parameters: hour (int) – the hour Returns: the hour Return type: int
-
tmin
(minute=None)[source]¶ Set or query the minutes setting of the clock.
Parameters: minute (int) – the minute Returns: the minute Return type: int
-
tsec
(second=None)[source]¶ Set or query the seconds setting of the clock.
Parameters: second (int) – the second Returns: the second Return type: int
-
dmth
(month=None)[source]¶ Set or query the month setting of the clock.
Parameters: month (int) – the month Returns: the month Return type: int
-
dday
(day=None)[source]¶ Set or query the day setting of the clock.
Parameters: day (int) – the day Returns: the day Return type: int
-
dyrs
(year=None)[source]¶ Set or query the year setting of the clock.
Parameters: year (int) – the year Returns: the year Return type: int
-
pltm
(mode=None)[source]¶ Set or query the plotter mode.
Parameters: mode (str) – the plotter mode interface Returns: the plotter mode interface Return type: str
-
pltb
(baud_rate=None)[source]¶ Set or query the RS232 plotter baud rate.
Parameters: baud_rate (int) – the communication baud rate Returns: the communication baud rate Return type: int
-
plts
(speed=None)[source]¶ Sets or queries the plot speed.
Parameters: speed (str) – the plot speed Returns: the plot speed Return type: str
-
pntr
(pen=None)[source]¶ Sets or queries the trace pen number.
Parameters: pen (int) – the trace pen number Returns: the trace pen number Return type: int
-
pngd
(pen=None)[source]¶ Sets or queries the grid pen number.
Parameters: pen (int) – the grid pen number Returns: the grid pen number Return type: int
-
pnal
(pen=None)[source]¶ Sets or queries the alphanumeric pen number.
Parameters: pen (int) – the alphanumeric pen number Returns: the alphanumeric pen number Return type: int
-
Print and plot commands
-
class
place.plugins.sr850_amp.sr850_print_plot.
SR850PrintPlot
(serial_port)[source]¶ Print and plot commands
Data transfer commands
-
class
place.plugins.sr850_amp.sr850_data_transfer.
SR850DataTransfer
(serial_port)[source]¶ Data transfer commands
Interface commands
-
class
place.plugins.sr850_amp.sr850_interface.
SR850Interface
(serial_port)[source]¶ Interface commands
Status reporting commands
-
class
place.plugins.sr850_amp.sr850_status_reporting.
SR850StatusReporting
(serial_port)[source]¶ Status reporting commands
-
ese
(register=None)[source]¶ Sets or queries the standard event enable register.
Valid values for the register are 0-255.
Parameters: register (int) – the value the register should be set to Returns: the value of the register Return type: int
-
ese_bit
(bit, value=None)[source]¶ Sets or queries bits from the standard event enable register.
Valid bits are 0-7 and they can be set to either 0 or 1.
Parameters: - bit (int) – the bit to change
- value (int) – the value for the bit
Returns: the value of the bit (0 or 1)
Return type: int
-
sre
(register=None)[source]¶ Sets or queries the serial poll enable register.
Valid values for the register are 0-255.
Parameters: register (int) – the value the register should be set to Returns: the value of the register Return type: int
-