Back: 6.5 Gaussmeter Functions Forward: 6.7 Digitizer Functions   FastBack: 6. Device Functions Up: 6. Device Functions FastForward: 7. Other Modules         Top: fsc2 Contents: Table of Contents Index: Index About: About This Document

6.6 Lock-In Functions

Modules for the following lock-in amplifiers exist:

sr510

Stanford Research SR510

sr530

Stanford Research SR530

sr810

Stanford Research SR810

sr830

Stanford Research SR830

er023m

Bruker ER023M Signal Channel (used in spectrometers of the ESP series)

To use a module in an experiment put its name into the DEVICES section of the EDL script.

Because the models have different capabilities, some of the functions are either only defined for parts of the models or may expect slightly different parameters.

Several of the following functions can be called both to query the current settings of the lock-in amplifier and to set a new value. In the first case the function usually has to be called with no argument, while to set a parameter an argument has to be passed to the function. Because of these different modes of calling the functions one should carefully check the arguments to achieve the desired results.

List of lock-in functions:

`lockin_name()'
`lockin_get_data()'
`lockin_auto_setup()'
`lockin_auto_acquisition()'
`lockin_get_adc_data()'
`lockin_dac_voltage()'
`lockin_sensitivity()'
`lockin_time_constant()'
`lockin_phase()'
`lockin_ref_freq()'
`lockin_ref_level()'
`lockin_ref_mode()'
`lockin_harmonic()'
`lockin_lock_keyboard()'
`lockin_conversion_time()'
`lockin_resonator()'
`lockin_is_overload()'
`lockin_is_locked()'
`lockin_has_reference()'
`lockin_rg()'
`lockin_tc()'
`lockin_ma()'
`lockin_ct()'
`lockin_mf()'

Descriptions of lock-in functions:

`lockin_name()'

Returns a string with the name of the lock-in amplifier being used.

`lockin_get_data()'

This is a function only to be used in queries, i.e. to fetch measured values from the lock-in amplifier. This function can only be called in the EXPERIMENT section. The parameters that may be passed to the function differ according to the model:

`SR510'

No argument is allowed - the function returns the measured value of the only channel as a floating point number (i.e. in Volts).

`SR530'

If no argument is specified the measured value at channel 1 is returned. Alternatively, one parameter may be passed to the function with a value of either 1 or 2, in which case the measure value from channel 1 or 2 is returned. Finally, two arguments can be given, with values of 1 or 2. In this case a 1-dimensional array with two elements is returned, containing the measured values of the corresponding channels.

`SR810'
`SR830'

If no argument is specified the 'X' signal is returned. If a parameter is passed to the function the value at the corresponding channel is returned. Possible channel numbers and their meaning are (please note that some of these can only be used when in auto-acquisition mode, see below in the explanation of the functions lockin_auto_setup() and lockin_auto_acquisition() and some even then with the SR830 only):

`1'

'X' signal

`2'

'Y' signal - in auto-acquisition mode only available for the SR830

`3'

Amplitude 'R' of data from X channel (1) and Y channel (2) in polar coordinates

`4'

Phase 'theta' of data from channel 1 and 2 (relative to reference) in polar coordinates - in auto-acquisition mode only available for the SR830

`5'

Voltage at rear panel auxiliary ADC input 1

`6'

Voltage at rear panel auxiliary ADC input 2

`7'

Voltage at rear panel auxiliary ADC input 3 - in auto-acquisition mode only available for the SR830

`8'

Voltage at rear panel auxiliary ADC input 4 - in auto-acquisition mode only available for the SR830

`9'

X noise data - this is only allowed when the lock-in-amplifier is running in auto-acquisition mode and the CH1 display is set to display X noise.

`10'

Y noise data - only available for the SR830 and only allowed when the lock-in-amplifier is running in auto-acquisition mode and the CH2 display is set to display Y noise.

A maximum of 6 different channels can be passed to the function (which must be be different). If there is more than one argument an 1-dimensional array is returned with as many data as there were arguments (in the same sequence as the arguments).

`ER023M'

No argument is allowed - the function returns a floating point value.

`lockin_auto_setup()'

This function is only available for the Stanford Research lock-in amplifiers SR810 and SR830. Both lock-in amplifiers can automatically acquire data at fixed time intervals (or on receiving an external trigger) and store the data into an internal buffer. By using this acquisition mode one can be sure that the data have been sampled at well-defined times (in contrast to normal measurements where the exact timing can vary slightly depending on how busy the computer is). Data can be acquired in this mode only from the channel(s) displayed at the front side, which means that the sr810 can only sample one data type in this mode (because it only has one displayable channel), while the sr830 can sample two data channels simultaneously.

lockin_auto_setup() must be invoked to setup auto-acquisition (if not called auto-acquisition can't be started). The first parameter passed to the function is the sample time, i.e. the time interval at which data are sampled. Sample times can range between 1.953125 ms (512 Hz) and 16 s. Allowed values are powers of 2, multiplied by the shortest sample time (i.e. only sample rates of 512 Hz, 256 Hz, 128 Hz etc. can be used). Instead also an integer value of 0 or -1 can be passed to the function. For0 the nearest allowed sample time equal to or larger than the lock-in's time constant is used while for -1 it is assumed that an external trigger, applied to the rear trigger input, is going to be used - the user has to take care that the trigger input rate is not larger than 512 Hz.

The next one or two parameter define which data type should be sampled in auto-acquisition mode (the SR810 only accepts one data type arguments while the SR830 accepts two). You may specify integer numbers with exactly the same meaning as the arguments to the function lockin_get_data(). This will also automatically switch the type of data displayed on the front side channels to the specified values. Not all combinations are possible, the following list shows which combinations are possible:

1st argument2nd argument
1 (X)2 (Y)
3 (R)4 (theta)
5 (ADC 1)6 (ADC 3)
7 (ADC 2)8 (ADC 4)
9 (X noise)10 (Y noise)

For the SR810 only the first column is relevant.

Additionally, you also may specify a value of 0, indicating that the function to be displayed should not be changed, i.e. the data type already set manually should be used.

This function can be used in all sections of an EDL script. If the auto-acquisition setup is changed during an already running auto-acquisition all data stored in the lock-in's internal buffer are discarded before the measurement continues using the new settings.

`lockin_auto_acquisition()'

This function is only available for the Stanford Research lock-in amplifiers SR810 and SR830. It allows to start or stop the automatic acquisition of data at constant time intervals. Before this function can be used auto-acquisition must be initialized by a call of the function lockin_auto_setup().

When called with an argument of 1 (or a string "ON") auto-acquisition is started. If you now request data from one of the channels configured to be used in lockin_auto_setup() via the function lockin_get_data() the next data sample from the internal buffer of the lock-in amplifier will be returned (instead of returning the value at the moment of the call of the function).

When called with an argument of 0 (or a string "OFF") auto-acquisition is stopped and the internal buffer of the lock-in is cleared. Following calls of lockin_get_data() will then return values measured in the 'normal' way.

Please note:

The sizes of the internal buffers of the lock-in amplifiers are restricted: while the SR830 can store up to 16383 data points for each of the two channel, the SR810 can only store a maximum of 8191 samples. If the program detects when fetching new data that the maximum number of data have already been fetched from the lock-in the internal buffer is cleared. In this case data which should have been acquired between the time the lock-in's internal buffer got filled up and the moment the program noticed that the buffers are full will be lost and an error message will be printed. Thus prudence dictates to stop auto-acquisition, thereby automatically clearing the lock-in's internal buffers, whenever possible.

`lockin_get_adc_data()'

The function returns the voltage at one of the ADC ports at the back side of the lock-in amplifier. Allowed values of the required argument are between 1 and 4, corresponding to the port numbering.

This function can only be used with the Stanford Research lock-in amplifiers (SR510, SR530, SR810, SR830) and can only be called in the EXPERIMENT section.

`lockin_dac_voltage()'

The function can be used to set or query the voltage at one of the DAC ports at the back side of the Stanford Research lock-in amplifiers While for the models SR510 and SR530 the allowed values for the required arguments are 5 or 6, for the models SR810 and SR830 the values can range from 1 to 4, corresponding to the different numbers of DAC ports and their numbering printed on the back side. If no further argument is given the function returns the current voltage applied to the DAC port (which is automatically set to 0 V at the initialization of the lock-in amplifier if no voltage has been set previously in the PREPARATIONS section using this function). If a second argument is given the DAC will be set to the corresponding voltage. The function returns the voltage that has been set.

For the models SR510 and SR530 this voltage has to be in the range between -10.24 V and +10.24 V while for the models SR810 and SR830 the allowed voltage range is -10.5V to +10.5 V.

This function can only be used with the Stanford Research lock-in amplifiers (SR510, SR530, SR810, SR830).

In the PREPARATIONS section this function can only be called with two argument, i.e to set the output voltage of one of the DACs to be used in the initialization of the device.

`lockin_sensitivity()'

This function can be used to query or set the sensitivity of the lock-in amplifier. If no argument is passed to the function the current sensitivity is returned. For the models SR510 and SR530 a 10 times higher sensitivity than the sensitivity set on the front panel is returned when the EXPAND button is switched on.

When called with a second argument the corresponding sensitivity is set. This value has to be positive. If the argument does not coincide with one of the possible sensitivity settings the sensitivity is set to the nearest available sensitivity setting and a warning is printed. The function will return the sensitivity that has been set.

Valid sensitivity settings for the SR510 and SR530 are in the range between 10 nV and 500 mV in steps of about 3 dB, i.e. you can use 10 uV, 20 uV, 50 uV, 100 uV etc. To achieve the two highest sensitivity settings the EXPAND button is automatically switched on.

For the SR810 and the SR830 valid sensitivity settings range from 2 nV up to 1 V, using the same system of steps as the SR510 and SR530.

For the ER023M Signal Channel the function does not set the sensitivity in units of the output voltage but sets the receiver gain. Valid receiver gains are in the range between 2.0E+1 and 1.0E+7 and in increments of about 2 dB. Thus in this range the following multiplier steps can be used: 1.0, 1.25, 1.5, 2.0, 2.5, 3.0, 4.0, 5.0, 6.0 and 8.0.

In the PREPARATION section this function can't be called in query mode, i.e. without an argument.

`lockin_time_constant()'

The function queries or sets the time constant of the lock-in amplifier. If no argument is passed to the function the current time constant is returned. If there's an argument the time constant is set accordingly. The argument has to be positive. If there is no time constant setting fitting the argument the nearest available setting is used and a warning is printed. The function will return the time constant setting that has been set.

For the SR510 and SR530 lock-ins valid time constant settings are 1 ms and 100 s with steps of about a factor of 3, i.e. you can use 10 ms, 30 ms, 100 ms etc. The POST time constant is set to a value equal or lower than the time constant.

For the SR810 and SR830 lock-ins valid time constants range from 10 us up to 30,000 s, using the same system of steps as the SR510 and the SR530.

For the ER023M Bruker Signal Channel the following (approximate) time constant settings can be used: 2.5 ms, 5 ms, 10 ms, 20 ms, 40 ms, 80 ms, 160 ms, 320 ms, 640 ms, 1.25 s, 2.5 s and 5 s.

In the PREPARATIONS section this function can't be called as a query, i.e. without an argument.

`lockin_phase()'

The function queries or sets the phase of the lock-in amplifier. If called with no argument it will return the current phase setting in the interval between 0 and 360 degrees. If called with an argument the phase is set accordingly.

In the PREPARATIONS section this function can't be called without an argument, i.e. as a query.

`lockin_ref_freq()'

The function can be used to query the modulation frequency and, for the SR810, SR830 and ER023M, also to set the modulation frequency (both the other Stanford Research models require external modulation). If called with no argument the current modulation frequency is returned. If called with an argument the modulation frequency is set.

If for the SR810 and SR830 the frequency is not within the admissible range an error message is printed and the experiment is stopped. The admissible range depends on the harmonics setting, see the manuals for full details.

For the ER023M only certain modulation frequencies can be set, these are 100 kHz, 50 kHz, 25 kHz, 12.5 kHz, 6.25 kHz and 3.125 kHz. If a modulation frequency is specified that does not fit one of these values the nearest valid frequency is used.

In the PREPARATIONS section this function can't be called in query mode, i.e. without an argument.

`lockin_ref_level()'

This function can be only used with the models SR810, SR830 and the ER023M. It queries (if called with no argument) or sets (if called with an argument) the level of the modulation frequency. For the Stanford Research lock-in amplifiers (SR510, SR530, SR810, SR830) the allowed levels are between 4 mV and 5 V, if the argument is not within this range an error message is printed and the experiment is stopped. For the Bruker ER023M signal channel the range is (as long as no calibration has been done) between 10 mG and 100 G (but don't expect the values to have any real meaning without a calibration).

In the PREPARATIONS section this function can't be called in query mode, i.e. without an argument.

`lockin_ref_mode()'

This function can be only used with the models SR810, SR830. It returns the modulation mode, i.e. if the internal modulation or an external modulation input is used. In the first case the function returns an integer value of 1 while in the second case 0 is returned.

`lockin_harmonic()'

SR8[13]0: 1-19999 ER023M: 1-2

`lockin_lock_keyboard()'

Usually, during an experiment the keyboard of the lock-in amplifier is locked. But for situations where it would be useful to be able to control the lock-in also via its keyboard it can be unlocked (and also re-locked) from within the script. To unlock the keyboard call this function with an argument of 0 or "OFF", to re-lock the keyboard call it again with a non-zero argument, "ON" or no argument at all.

This function can only be used with the Stanford Research lock-in amplifiers (SR510, SR530, SR810, SR830).

`lockin_conversion_time()'

This function exists for the qBruker ER023M signal channel only and either queries or sets the time that the built-in ADC takes to convert a voltage into a binary data value. The voltage resolution is higher for longer conversion times. Possible conversion times are integer multiples of 320 us in the range between 10 and 9999, thus allowing conversion times between 3.2 ms and ca. 3.2 s.

Unfortunately, according to my tests, for conversion times between 40 ms and 64 ms the data the signal channels sends for large signal amplitudes are garbled. For this reason the function will not accept conversion times in this range but will instead set the nearest conversion time for which correct data are delivered.

If no argument is supplied to the function the current conversion time is returned. If there is an argument this is used as the new conversion time. If the argument is not an integer multiple of 320 us (within the possible range) the nearest allowed conversion time is used.

In the PREPARATIONS section this function can't be called without an argument, i.e. as a query.

`lockin_resonator()'

This function exists for the Bruker ER023M signal channel only and queries or returns the selected resonator. If called without an argument it returns either 1 or 2 for the first or second resonator. It accepts the same values as arguments to select a resonator.

In the PREPARATIONS section this function can't be called without an argument, i.e. as a query.

`lockin_is_overload()'

This function can only be used as a query, i.e. it does not allows arguments. It can be called before a new data value is fetched from the lock-in to find out if an overload has occurred since the start of the experiment or since the function was called the last time. A return value of 1 indicates that an overload happened, otherwise 0 is returned. Calling this function (or in the case of the Bruker ER023M fetching the data value) will reset the overload condition and calls of the function will return 0 as long as no further overloads occur.

The function can only be used in the EXPERIMENT section.

`lockin_is_locked()'

This function can only be used with the SR510, SR530, SR810 and SR830 lock-in amplifiers and only as a query, i.e. it does not allows arguments. If called it returns if the lock-in's reference input is locked to the reference input.

The function can only be used in the EXPERIMENT section.

`lockin_has_reference()'

This function can only be used with the SR510 and SR530 lock-in amplifiers and only as a query, i.e. it does not allows arguments. If called it returns if the lock-in detects a reference input.

The function can only be used in the EXPERIMENT section.

`lockin_rg()'

This function exists for the Bruker ER023M signal channel only. It can be used to set or query the receiver gain. If called with an argument the receiver gain can be set. In this case the argument must be an integer in the range between 0 and 57 where 0 sets the receiver gain to the lowest possible value of 2.0E+2 and 57 sets it to the highest of 1.0E+7. An increment of the argument by 1 represents an increase of the receiver gain by 2dB. If called without an argument the function returns an integer for the current setting of the receiver gain.

The function can only be used in the EXPERIMENT section.

`lockin_tc()'

This function exists for the Bruker ER023M signal channel only. It can be used to set or query the time constant. If called with an argument the time constant can be set. In this case the argument must be an integer in the range between 0 and 19 where 0 sets the time constant to the lowest possible value of 10 us and 19 sets it to the highest of 5 s. An increment of the argument by 1 represents an increase of the time constant by a factor of 2. If called without an argument the function returns an integer for the current setting of the time constant.

The function can only be used in the EXPERIMENT section.

`lockin_ma()'

This function exists for the Bruker ER023M signal channel only. It can be used to set or query the attenuation of the modulation amplitude. If called with an argument the modulation amplitude attenuation can be set. In this case the argument must be an integer in the range between 0 and 80. 0 sets minimum attenuation and thus maximum modulation amplitude while 79 sets the maximum attenuation of the modulation. 80 switches modulation off. The modulation attenuation is a logarithmic setting, the attenuation is 10 to the power of one twentieth of the negative of the argument (this then has to be multiplied by the maximum modulation amplitude, which should be in the order of 100 G. If called with no argument the current setting for the modulation attenuation is set.

The function can only be used in the EXPERIMENT section.

`lockin_ct()'

This function exists for the Bruker ER023M signal channel only. It can be used to set or query the conversion time of the digital-to-analog converter (longer conversion times result in a better voltage resolution). If called with an argument the conversion time can be set. In this case the argument must be an integer in the range between 10 and 9999 where 10 sets the conversion time to the lowest possible value of 3.2 ms and 9999 sets it to the highest of about 3.2 s - multiply the argument by 320 us to arrive at the conversion time.

Unfortunately, according to my tests, for conversion times between 123 and 200 the data the signal channels sends for large signal amplitudes were garbled, so it might be prudent to avoid values from this range!

If the function is called without an argument the current setting of the conversion time isn returned.

The function can only be used in the EXPERIMENT section.

`lockin_mf()'

This function exists for the Bruker ER023M signal channel only. It can be used to set or query the modulation frequency. If called with an argument the modulation frequency can be set. In this case the argument must be an integer in the range between 0 and 6. 0 sets maximum modulation frequency of 100 kHz and 6 sets the minimum frequency of 1.5625 kHz. An increment of 1 of the argument decreases the modulation frequency by a factor of 2. If called with no argument the value for the currently set modulation frequency gets returned.

The function can only be used in the EXPERIMENT section.


Back: 6.5 Gaussmeter Functions Forward: 6.7 Digitizer Functions   FastBack: 6. Device Functions Up: 6. Device Functions FastForward: 7. Other Modules

This document was generated by Jens Thoms Toerring on September 6, 2017 using texi2html 1.82.