F.W. Bell 5080#

Control the F.W. Bell 5080 multimeter from Python with the FWBell5080 driver.

Driver: pymeasure
Type: Multimeters and source meters
Manufacturer: F.W. Bell

Represents the F.W. Bell 5080 Handheld Gaussmeter and provides a high-level interface for interacting with the instrument.

Publishing through instro#

instro publishes the commands you send to a FWBell5080 and the values you read from it, through any publisher. It takes two forms, both described in the pymeasure guide. Install with uv add "instro[pymeasure]".

With a PymeasureInstrument#

PymeasureInstrument wraps the driver in an instro instrument, with tags and background polling. The instrument is created inside the with block, and .device is the pymeasure instrument.

from pymeasure.instruments.fwbell import FWBell5080
from instro.pymeasure import PymeasureInstrument

with PymeasureInstrument(
    name="meter",
    instrument=FWBell5080('/dev/ttyUSB0'),
    dataset_rid="<dataset rid>",
) as meter:

    meter.device.units = 'gauss'               # Sets the measurement units to Gauss
    meter.device.range = 1                     # Sets the range to 3 kG
    print(meter.device.field)                  # Reads and prints a field measurement in G

    fields = meter.device.fields(100)          # Samples 100 field measurements
    print(fields.mean(), fields.std())  # Prints the mean and standard deviation of the samples

With existing pymeasure code (attach())#

attach() adds publishing to pymeasure code you already have. The imports, the attach() call after the instrument is created, and recorder.close() are all that instro adds.

from pymeasure.instruments.fwbell import FWBell5080
from instro.lib import NominalCorePublisher
from instro.pymeasure import attach

meter = FWBell5080('/dev/ttyUSB0')  # Connects over serial port /dev/ttyUSB0 (Linux)
recorder = attach(meter, "meter", [NominalCorePublisher(dataset_rid="<dataset rid>")])

meter.units = 'gauss'               # Sets the measurement units to Gauss
meter.range = 1                     # Sets the range to 3 kG
print(meter.field)                  # Reads and prints a field measurement in G

fields = meter.fields(100)          # Samples 100 field measurements
print(fields.mean(), fields.std())  # Prints the mean and standard deviation of the samples

recorder.close()  # flush and close the publishers

The examples are adapted from the pymeasure documentation for FWBell5080, which lists every property and method.