F41 & F71 Teslameters

The Lake Shore single-axis (F41) and multi-axis (F71) Teslameters provide highly accurate field strength measurements.

More information about the instrument can be found on our website including the manual which has a list of all SCPI commands and queries.

Example Scripts

Below are a few example scripts for the Teslameters that use the Lake Shore Python driver.

Streaming F41/F71 teslameter data to a CSV file

from lakeshore import Teslameter

# Connect to the first available Teslameter over USB
my_teslameter = Teslameter()

# Configure the instrument to be in DC field mode and give it a moment to settle
my_teslameter.command('SENSE:MODE DC')

# Query the probe serial number
probe_serial_number = my_teslameter.query('PROBE:SNUMBER?')

# Query the probe temperature
probe_temperature = my_teslameter.query('FETCH:TEMPERATURE?')

# Create a file to write data into.
file = open("teslameter_data.csv", "w")

# Write header info including the instrument serial number, probe serial number, and temperature.
file.write('Header Information\n')
file.write('Instrument serial number:,' + my_teslameter.serial_number + '\n')
file.write('Probe serial number:,' + probe_serial_number + '\n')
file.write('Probe temperature:,' + probe_temperature + '\n\n')

# Collect 10 seconds of 10 ms data points and write them to the csv file
my_teslameter.log_buffered_data_to_file(10, 10, file)

# Close the file so that it can be used by the function
file.close()

Instrument class methods

class lakeshore.teslameter.Teslameter(serial_number=None, com_port=None, baud_rate=115200, flow_control=True, timeout=2.0, ip_address=None, tcp_port=7777, **kwargs)

A class object representing a Lake Shore F41 or F71 Teslameter.

stream_buffered_data(length_of_time_in_seconds, sample_rate_in_ms)

Yield a generator object for the buffered field data.

Useful for getting the data in real time when doing a lengthy acquisition.

Args:
length_of_time_in_seconds (float):

The period of time over which to stream the data.

sample_rate_in_ms (int):

The averaging window (sampling period) of the instrument.

Returns:

A generator object that returns the data as datapoint tuples.

get_buffered_data_points(length_of_time_in_seconds, sample_rate_in_ms)

Returns a list of named tuples that contain the buffered data.

Args:
length_of_time_in_seconds (float):

The period of time over which to collect the data.

sample_rate_in_ms (int):

The averaging window (sampling period) of the instrument.

Returns:

The data as a list of datapoint tuples.

log_buffered_data_to_file(length_of_time_in_seconds, sample_rate_in_ms, file)

Creates or appends a CSV file with the buffered data and excel-friendly timestamps.

Args:
length_of_time_in_seconds (float):

The period of time over which to collect the data.

sample_rate_in_ms (int):

The averaging window (sampling period) of the instrument.

file (file_object):

Field measurement data will be written to this file object in a CSV format.

get_dc_field()

Returns the DC field reading.

get_dc_field_xyz()

Returns the DC field reading.

get_rms_field()

Returns the RMS field reading.

get_rms_field_xyz()

Returns the RMS field reading.

get_frequency()

Returns the field frequency reading.

get_max_min()

Returns the maximum and minimum field readings respectively.

get_max_min_peaks()

Returns the maximum and minimum peak field readings respectively.

reset_max_min()

Resets the maximum and minimum field readings to the present field reading.

get_temperature()

Returns the temperature reading.

get_probe_information()

Returns a dictionary of probe data.

get_relative_field()

Returns the relative field value.

tare_relative_field()

Copies the current field reading to the relative baseline value.

get_relative_field_baseline()

Returns the relative field baseline value.

set_relative_field_baseline(baseline_field)

Configures the relative baseline value.

Args:
baseline_field (float):

A field units value that will act as the zero field for the relative measurement.

configure_field_measurement_setup(mode='DC', autorange=True, expected_field=None, averaging_samples=20)

Configures the field measurement settings.

Args:
mode (str):

Modes are as follows: “DC”, “AC” (0.1 - 500 Hz), and “HIFR” (50 Hz - 100 kHz).

autorange (bool):

Chooses whether the instrument automatically selects the best range for the measured value.

expected_field (float):

When autorange is False, the expected_field is the largest field expected to be measured. It sets the lowest instrument field range capable of measuring the value.

averaging_samples (int):

The number of field samples to average. Each sample is 10 milliseconds of field information.

get_field_measurement_setup()

Returns the mode, autoranging state, range, and number of averaging samples as a dictionary.

configure_temperature_compensation(temperature_source='PROBE', manual_temperature=None)

Configures how temperature compensation is applied to the field readings.

Args:
temperature_source (str):

Determines where the temperature measurement is drawn from. Options are: “PROBE” (Compensation is based on measurement of a thermistor in the probe), “MTEM” (Compensation is based on a manual temperature value provided by the user), “NONE” (Temperature compensation is not applied).

manual_temperature (float):

Sets the temperature provided by the user for MTEMP (manual temperature) source in Celsius.

get_temperature_compensation_source()

Returns the source of temperature measurement for field compensation.

get_temperature_compensation_manual_temp()

Returns the manual temperature setting value in Celsius.

configure_field_units(units='TESLA')

Configures the field measurement units of the instrument.

Args:
units (str):

A unit of magnetic field. Options are: “TESLA”, or “GAUSS”.

get_field_units()

Returns the magnetic field units of the instrument.

configure_field_control_limits(voltage_limit=10.0, slew_rate_limit=10.0)

Configures the limits of the field control output.

Args:
voltage_limit (float):

The maximum voltage permitted at the field control output. Must be between 0 and 10V.

slew_rate_limit (float):

The maximum rate of change of the field control output voltage in volts per second.

get_field_control_limits()

Returns the field control output voltage limit and slew rate limit.

configure_field_control_output_mode(mode='CLLOOP', output_enabled=True)

Configure the field control mode and state.

Args:
mode (str):

Determines whether the field control is in open or closed loop mode. Options: “CLLOOP” (closed loop control), or “OPLOOP” (open loop control, voltage output).

output_enabled (bool):

Turn the field control voltage output on or off.

get_field_control_output_mode()

Returns the mode and state of the field control output.

configure_field_control_pid(gain=None, integral=None, ramp_rate=None)

Configures the closed loop control parameters of the field control output.

Args:
gain (float):

Also known as P or Proportional in PID control. This controls how strongly the control output reacts to the present error. Note that the integral value is multiplied by the gain value.

integral (float):

Also known as I or Integral in PID control. This controls how strongly the control output reacts to the past error history.

ramp_rate (float):

This value controls how quickly the present field set-point will transition to a new set-point. The ramp rate is configured in field units per second.

get_field_control_pid()

Returns the gain, integral, and ramp rate.

set_field_control_setpoint(setpoint)

Sets the field control setpoint value in field units.

get_field_control_setpoint()

Returns the field control setpoint.

set_field_control_open_loop_voltage(output_voltage)

Sets the field control open loop voltage.

get_field_control_open_loop_voltage()

Returns the field control open loop voltage.

set_analog_output(analog_output_mode)

Configures what signal is provided by the analog output BNC.

set_analog_output_signal(analog_output_mode)

Configures what signal is provided by the analog output BNC.

Args:
analog_output_mode (str):

Configures what signal is provided by the analog output BNC. Options: “OFF” (output off), “XRAW” (raw amplified X channel Hall voltage), “YRAW” (raw amplified Y channel Hall voltage), “ZRAW” (raw amplified Z channel Hall voltage), “XCOR” (Corrrected X channel field measurement), “YCOR” (Corrected Y channel field measurement), “ZCOR” (Corrected Z channel field measurement), or “MCOR” (Corrected magnitude field measurement)

configure_corrected_analog_output_scaling(scale_factor, baseline)

Configures the conversion between field reading and analog output voltage.

Args:
scale_factor (float):

Scale factor in volts per unit field.

baseline (float):

The field value at which the analog output voltage is zero.

get_corrected_analog_output_scaling()

Returns the scale factor and baseline of the corrected analog out.

get_analog_output()

Returns what signal is being provided by the analog output.

get_analog_output_signal()

Returns what signal is being provided by the analog output.

enable_high_frequency_filters()

Applies filtering to the high frequency RMS measurements.

disable_high_frequency_filters()

Turns off filtering of the high frequency mode measurements.

set_frequency_filter_type(filter_type)

Configures which filter is applied to the high frequency measurements.

Args:
filter_type (str):

Options: “LPASS” (low pass filter), “HPASS” (high pass filter), or “BPASS” (band pass filter).

get_frequency_filter_type()

Returns the type of filter that is or will be applied to the high frequency measurements.

get_low_pass_filter_cutoff()

Returns the cutoff frequency setting of the low pass filter.

set_low_pass_filter_cutoff(cutoff_frequency)

Configures the low pass filter cutoff.

Args:
cutoff_frequency (float):

Options: NONE, F10, F30, F100, F300, F1000, F3000, or F10000 F10 = 10 Hz, etc.

get_high_pass_filter_cutoff()

Returns the cutoff frequency setting of the low pass filter.

set_high_pass_filter_cutoff(cutoff_frequency)

Configures the high pass filter cutoff.

Args:
cutoff_frequency (float):

Options: NONE, F10, F30, F100, F300, F1000, F3000, or F10000 F10 = 10 Hz, etc.

get_band_pass_filter_center()

Returns the center of the band pass filter.

set_band_pass_filter_center(center_frequency)

Configures the band pass filter parameters.

Args:
center_frequency (float):

The frequency at which the gain of the filter is 1.

enable_qualifier()

Enables the qualifier.

disable_qualifier()

Disables the qualifier.

is_qualifier_condition_met()

Returns whether the qualifier condition is met.

enable_qualifier_latching()

Enables the qualifier condition latching.

disable_qualifier_latching()

Disables the qualifier condition latching.

get_qualifier_latching_setting()

Returns whether the qualifier latches.

set_qualifier_latching_setting(latching)

Sets whether the qualifier latches.

Args:
latching (bool):

Determines whether the qualifier latches.

reset_qualifier_latch()

Resets the condition status of the qualifier.

get_qualifier_configuration()

Returns the threshold mode and field threshold values.

configure_qualifier(mode, lower_field, upper_field=None)

Sets the threshold condition of the qualifier.

Args:
mode (str):

The type of threshold condition used by the qualifier. Options: “OVER”, “UNDER”, “BETWEEN”, “OUTSIDE”, “ABSBETWEEN”, or “ABSOUTSIDE”.

lower_field (float):

The lower field value threshold used by the qualifier.

upper_field (float):

The upper field value threshold used by the qualifier. Not used for OVER or UNDER.

command(*commands, check_errors=True)

Send an SCPI command or multiple commands to the instrument.

Args:
commands (str):

Any number of SCPI commands.

check_errors (bool):

Chooses whether to query the SCPI error queue and raise errors as exceptions. True by default. Optional Parameter.

connect_tcp(ip_address, tcp_port, timeout)

Establishes a TCP connection with the instrument on the specified IP address.

connect_usb(serial_number=None, com_port=None, baud_rate=None, data_bits=None, stop_bits=None, parity=None, timeout=None, handshaking=None, flow_control=None)

Establish a serial USB connection.

disconnect_tcp()

Disconnect the TCP connection.

disconnect_usb()

Disconnect the USB connection.

factory_reset()

Resets all system information such as settings, wi-fi connections, date and time, etc.

get_operation_event_enable_mask()

Returns the names of the operation event enable register bits and their values.

These values determine which operation bits propagate to the operation event register.

get_operation_events()

Returns the names of operation event status register bits that are currently high.

The event register is latching and values are reset when queried.

get_present_operation_status()

Returns the names of the operation status register bits and their values.

get_present_questionable_status()

Returns the names of the questionable status register bits and their values.

get_questionable_event_enable_mask()

Returns the names of the questionable event enable register bits and their values.

These values determine which questionable bits propagate to the questionable event register.

get_questionable_events()

Returns the names of questionable event status register bits that are currently high.

The event register is latching and values are reset when queried.

get_service_request_enable_mask()

Returns the named bits of the status byte service request enable register.

This register determines which bits propagate to the master summary status bit.

get_standard_event_enable_mask()

Returns the names of the standard event enable register bits and their values.

These values determine which bits propagate to the standard event register.

get_standard_events()

Returns the names of the standard event register bits and their values.

get_status_byte()

Returns named bits of the status byte register and their values.

modify_operation_register_mask(bit_name, value)

Gets the operation condition register mask, changes a bit, and sets the register.

Args:
bit_name (str):

The name of the bit to modify.

value (bool):

Determines whether the bit masks (false) or passes (true) the corresponding state.

modify_questionable_register_mask(bit_name, value)

Gets the questionable condition register mask, changes a bit, and sets the register.

Args:
bit_name (str):

The name of the bit to modify.

value (bool):

Determines whether the bit masks (false) or passes (true) the corresponding state.

modify_service_request_mask(bit_name, value)

Gets the service request enable mask, changes a bit, and sets the register.

Args:
bit_name (str):

The name of the bit to modify.

value (bool):

Determines whether the bit masks (false) or passes (true) the corresponding state.

modify_standard_event_register_mask(bit_name, value)

Gets the standard event register mask, changes a bit, and sets the register.

Args:
bit_name (str):

The name of the bit to modify.

value (bool):

Determines whether the bit masks (false) or passes (true) the corresponding state.

query(*queries, check_errors=True)

Sends an SCPI query or multiple queries to the instrument and return the response(s).

Args:
queries (str):

Any number of SCPI queries or commands.

check_errors (bool):

Chooses whether to query the SCPI error queue and raise errors as exceptions. True by default. Optional Parameter.

Returns:

The instrument query response as a string.

reset_measurement_settings()

Resets measurement settings to their default values.

reset_status_register_masks()

Resets status register masks to preset values.

set_operation_event_enable_mask(register_mask)

Configures the values of the operation event enable register bits.

These values determine which operation bits propagate to the operation event register.

Args:
register_mask ([Instrument]OperationRegister):

An instrument specific OperationRegister class object with all bits configured true or false.

set_questionable_event_enable_mask(register_mask)

Configures the values of the questionable event enable register bits.

These values determine which questionable bits propagate to the questionable event register.

Args:
register_mask ([Instrument]QuestionableRegister):

An instrument specific QuestionableRegister class object with all bits configured true or false.

set_service_request_enable_mask(register_mask)

Configures values of the service request enable register bits.

This register determines which bits propagate to the master summary bit.

Args:
register_mask (StatusByteRegister):

A StatusByteRegister class object with all bits configured true or false.

set_standard_event_enable_mask(register_mask)

Configures values of the standard event enable register bits.

These values determine which bits propagate to the standard event register.

Args:
register_mask (StandardEventRegister):

A StandardEventRegister class object with all bits configured true or false.

write(command_string)

Alias of command. Send a command to the instrument.

Args:
command_string (str):

A serial command.

Status register classes

This page outlines the objects and classes used to interact with registers in the Teslameter driver.

class lakeshore.teslameter.TeslameterOperationRegister(no_probe, overload, ranging, ramp_done, no_data_on_breakout_adapter)

Class object representing the operation status register.

class lakeshore.teslameter.TeslameterQuestionableRegister(x_axis_sensor_error, y_axis_sensor_error, z_axis_sensor_error, probe_eeprom_read_error, temperature_compensation_error, invalid_probe, field_control_slew_rate_limit, field_control_at_voltage_limit, calibration_error, heartbeat_error)

Class object representing the questionable status register.

class lakeshore.teslameter.StatusByteRegister(error_available, questionable_summary, message_available_summary, event_status_summary, master_summary, operation_summary)

Class object representing the status byte register.

__init__(error_available, questionable_summary, message_available_summary, event_status_summary, master_summary, operation_summary)
class lakeshore.teslameter.StandardEventRegister(operation_complete, query_error, device_specific_error, execution_error, command_error, power_on)

Class object representing the standard event register.

__init__(operation_complete, query_error, device_specific_error, execution_error, command_error, power_on)