F.W. Bell 5080 Handheld Gaussmeter

class pymeasure.instruments.fwbell.FWBell5080(adapter, name='F.W. Bell 5080 Handheld Gaussmeter', **kwargs)

Bases: SCPIMixin, Instrument

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

Parameters:

port – The serial port of the instrument

meter = FWBell5080('/dev/ttyUSB0')  # Connects over serial port /dev/ttyUSB0 (Linux)

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
auto_range()

Enables the auto range functionality.

check_errors()

Read all errors from the instrument.

Returns:

List of error entries.

check_get_errors()

Check for errors after having gotten a property and log them.

Called if check_get_errors=True is set for that property.

If you override this method, you may choose to raise an Exception for certain errors.

Returns:

list – List of error entries.

check_set_errors()

Check for errors after having set a property and log them.

Called if check_set_errors=True is set for that property.

If you override this method, you may choose to raise an Exception for certain errors.

Returns:

list – List of error entries.

clear()

Clear the instrument status byte.

property complete: Any

Get the synchronization bit.

This property allows synchronization between a controller and a device. The Operation Complete query places an ASCII character 1 into the device’s Output Queue when all pending selected device operations have been finished.

property field: Any

Measure the field in the appropriate units (float).

fields(samples=1)

Returns a numpy array of field samples for a given sample number.

Parameters:

samples – The number of samples to preform (default: 1)

property id: Any

Get the identification of the instrument.

property next_error: Any

Get the next error in the queue. If you want to read and log all errors, use check_errors() instead.

property options: Any

Get the device options installed.

property range: Any

Control the maximum field range in the active units (int). The range unit is dependent on the current units mode (gauss, tesla, amp-meter). Value sets an equivalent range across units that increases in magnitude (1, 10, 100).

Value

gauss

tesla

amp-meter

0

300 G

30 mT

23.88 kAm

1

3 kG

300 mT

238.8 kAm

2

30 kG

3 T

2388 kAm

read()

Overwrites the Instrument.read method to remove semicolons and replace spaces with colons.

read_binary_values(**kwargs)

Read binary values from the device.

read_bytes(count, **kwargs)

Read a certain number of bytes from the instrument.

Parameters:
  • count (int) – Number of bytes to read. A value of -1 indicates to read the whole read buffer.

  • kwargs – Keyword arguments for the adapter.

Returns bytes:

Bytes response of the instrument (including termination).

Return type:

bytes

reset()

Resets the instrument.

shutdown()

Brings the instrument to a safe and stable state

Return type:

None

property status: Any

Get the status byte and Master Summary Status bit.

property units: Any

Get the field units (str), which can take the values: ‘gauss’, ‘gauss ac’, ‘tesla’, ‘tesla ac’, ‘amp-meter’, and ‘amp-meter ac’. The AC versions configure the instrument to measure AC.

wait_for(query_delay=None)

Wait for some time. Used by ‘ask’ to wait before reading.

Parameters:

query_delay (Optional[float]) – Delay between writing and reading in seconds. None is default delay. (default: None)

Return type:

None

write(command, **kwargs)

Write a string command to the instrument appending write_termination.

Parameters:
  • command (str) – command string to be sent to the instrument

  • kwargs – Keyword arguments for the adapter.

Return type:

None

write_binary_values(command, values, *args, **kwargs)

Write binary values to the device.

Parameters:
  • command (str) – Command to send.

  • values (Sequence[Union[int, float]]) – The values to transmit.

  • **kwargs (*args,) – Further arguments to hand to the Adapter.

Return type:

None

write_bytes(content, **kwargs)

Write the bytes content to the instrument.

Return type:

None