# 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 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 of error entries.

  clear()

    Clear the instrument status byte.

  property complete

    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

    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

  property id

    Get the identification of the instrument.

  property next_error

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

  property options

    Get the device options installed.

  property range

    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).

  reset()

    Resets the instrument.

  shutdown()

    Brings the instrument to a safe and stable state

  property status

    Get the status byte and Master Summary Status bit.

  property units

    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 – Delay between writing and reading in seconds. None is default delay.

  write(command, **kwargs)

    Write a string command to the instrument appending write_termination.

    Parameters:

      - command – command string to be sent to the instrument

      - kwargs – Keyword arguments for the adapter.

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

    Write binary values to the device.

    Parameters:

      - command – Command to send.

      - values – The values to transmit.

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

  write_bytes(content, **kwargs)

    Write the bytes content to the instrument.