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.
Device Specification: here
Manufacturer card: 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
Read our guide for turning Python scripts into Flojoy nodes.
PROTOCOLS > SCPI
Here is a Python script that uses Pymeasure to connect to a Lakeshore 421 Power Meter:
from pymeasure.adapters import SerialAdapterfrom pymeasure.instruments.lakeshore import LakeShore421
# Create a serial adapter for the instrumentadapter = SerialAdapter(port="COM1", baud_rate=9600)
# Create an instance of the LakeShore421 instrumentgaussmeter = LakeShore421(adapter)
# Connect to the instrumentgaussmeter.connect()
# Set the unit to Teslagaussmeter.unit = "T"
# Turn on auto-rangegaussmeter.auto_range = True
# Turn on fast-modegaussmeter.fast_mode = True
# Read the magnetic fieldfield = gaussmeter.fieldprint("Magnetic Field:", field)
# Set the field range to 300 Gaussgaussmeter.field_range = 300
# Read the field rangefield_range = gaussmeter.field_rangeprint("Field Range:", field_range)
# Disconnect from the instrumentgaussmeter.disconnect()
Note: Make sure to replace "COM1"
with the appropriate serial port for your instrument.