Skip to content

Connecting to Lakeshore 421 by Lakeshore in Python

Instrument Card

Flexible probe configurations to suit your application. Several sensor types available with different performance characteristics. Most suited for field levels from earth field to very large electromagnets. Application-specific probe customization available.

Lakeshore 421

Device Specification: here

Manufacturer card: LAKESHORE

LAKESHORE

Supporting advanced scientific research, Lake Shore is a leading global innovator in measurement and control solutions.

  • Headquarters: Westerville, Ohio, USA
  • Yearly Revenue (millions, USD): 21.4
  • Vendor Website: here

Connect to the Lakeshore 421 in Python

PROTOCOLS > SCPI

Here is a Python script that uses Pymeasure to connect to a Lakeshore 421 Power Meter:

from pymeasure.adapters import SerialAdapter
from pymeasure.instruments.lakeshore import LakeShore421
# Create a serial adapter for the instrument
adapter = SerialAdapter(port="COM1", baud_rate=9600)
# Create an instance of the LakeShore421 instrument
gaussmeter = LakeShore421(adapter)
# Connect to the instrument
gaussmeter.connect()
# Set the unit to Tesla
gaussmeter.unit = "T"
# Turn on auto-range
gaussmeter.auto_range = True
# Turn on fast-mode
gaussmeter.fast_mode = True
# Read the magnetic field
field = gaussmeter.field
print("Magnetic Field:", field)
# Set the field range to 300 Gauss
gaussmeter.field_range = 300
# Read the field range
field_range = gaussmeter.field_range
print("Field Range:", field_range)
# Disconnect from the instrument
gaussmeter.disconnect()

Note: Make sure to replace "COM1" with the appropriate serial port for your instrument.