# HP 437B Power Meter

class pymeasure.instruments.hp.HP437B(adapter, name='Hewlett-Packard HP437B', **kwargs)

  Bases: `Instrument`

  Represents the HP437B Power Meters.

  Note

  Most command descriptions are taken from the document: ‘Operating Manual 437B Power Meter’

  activate_auto_range()

    The power meter divides each sensor’s power range into 5 ranges of 10 dB each. Range 1 is the most sensitive (lowest power levels), and Range 5 is the least sensitive (highest power levels). Range 5 can be less than 10 dB if the sensor’s power range is less than 50 dB. The range can be set either automatically or manually. ‘activate_auto_range’ automatically selects the correct range for the current measurement.

  property automatic_range_enabled

    Control the automatic range. The power meter divides each sensor’s power range into 5 ranges of 10 dB each. Range 1 is the most sensitive (lowest power levels), and Range 5 is the least sensitive (highest power levels). The range can be set either automatically or manually.

  calibrate(calibration_factor)

    Calibrate a sensor to the power meter with a ‘calibration_factor’ in percent.

  property calibration_factor

    Control the calibration factor of a specific power sensor at a specific input frequency. (A chart or table of CAL FACTOR % versus Frequency is printed on each sensor and an accompanying data sheet.) Calibration factor is entered in percent. Valid entries for ‘calibration_factor’ range from 1.0 to 150.0%.

  check_errors()

    Read all errors from the instrument and log them.

    Returns:

      List of error entries.

  property display_all_segments_enabled

    Set all segments of the display of the power meter active or resume normal state.

  property display_enabled

    Set the display of the power meter active or inactive.

  property display_output

    Get the current displayed string of values of the power meter.

        print(instr.display_output)
        -0.23  dB REL

  property display_user_message

    Set a custom user message up to 12 alpha-numerical chars. If the string is empty or None the user message gets disabled.

  property duty_cycle

    Control the duty cycle for calculation of a pulsed input signal. This function will cause the power meter to report the pulse power of a rectangular pulsed input signal. The allowable range of values for ‘duty_cycle’ is 0.00001 to 0.99999.

    Pulse power, as reported by the power meter, is a mathematical representation of the pulse power rather than an actual measurement. The power meter measures the average power of the pulsed input signal and then divides the measurement by the duty cycle value to obtain a pulse power reading.

  property duty_cycle_enabled

    Control whether the duty cycle is active or inactive. See `duty_cycle`

  property event_status

    Get the status byte and Master Summary Status bit.

        print(instr.request_service_conditions)
        StatusRegister.PowerOn|CommandError

  property filter

    Control the filter number for averaging. Setting a value implicitly enables the manual filter mode. Setting a value of 1 basically disables the averaging.

  property filter_automatic_enabled

    Control the filter mode. By switching over from automatic to manual (true to false) the instrument implicitly keeps (holds) the filter value from the automatic selection.

  property frequency

    Control the frequency of the input signal. Entering a frequency causes the power meter to select a sensor-specific calibration factor. The allowed range of ‘frequency’ values is from 0.0001 to 999.9999 GHz with a 100 kHz resolution. The unit is Hz.

  property group_trigger_mode

    Control the group execute trigger mode. When in remote and addressed to listen, the power meter responds to a Trigger message ( the Group Execute Trigger bus command [GET]) according to the programmed mode.

  property limit_high

    Control the upper limit for the builtin limit checking.

  property limit_high_hit

    Get if the upper limit check got triggered.

  property limit_low

    Control the lower limit for the builtin limit checking.

  property limit_low_hit

    Get if the lower limit check got triggered.

  property limits_enabled

    Control the limits checking function to allow the power meter to monitor the power level at the sensor and to indicate when that power is outside preset limits.

  property linear_display_enabled

    Control if the power meter displays or reports the power values in logarithmic or linear units. Set linear_display_enabled to ‘True’ to activate linear value readout.

        from pymeasure.instruments.hp.hp437b import LogLin

        instr.relative_mode_enabled = False
        instr.linear_display_enabled = True

  property measurement_unit

    Get the measurement unit the power meter is currently reporting the power values in.

    Depends on: `relative_mode_enabled` and attr:linear_display_enabled

        instr.relative_mode_enabled = False
        instr.linear_display_enabled = True

        print(instr.measurement_unit)
        MeasurementUnit.Watts

  property offset

    Control the offset applied to the measured value to compensate for signal gain or loss (for example, to compensate for the loss of a 10 dB directional coupler). Offsets are entered in dB. In case the `offset_enabled` is false this returns automatically 0.0

  property offset_enabled

    Control the offset being applied.

  property operating_mode

    Get the operating mode the power meter is currently in.

  property power

    Measure the power at the power sensor attached to the power meter in the corresponding unit. In case a measurement would be invalid the power meter responds with the value float(‘nan’).

  property power_reference_enabled

    Control the builtin reference power source 1mW @ 50 MHz.

  preset()

    Sets the power meter to a known state. Preset conditions are shown in the following table.

    Preset values
    Parameter | Value/Condition
    --- | ---
    Frequency | 50 MHz
    Resolution | 0.01 dB
    Duty Cylce | 1.000%, Off
    Relative | 0 dB, Off
    Power Reference | Off
    Range | Auto
    Unit | dBm
    Low Limit | -90.000 dBm
    High Limit | +90.000 dBm
    Limit Checking | Off
    Trigger Mode | Free Run
    Group Trigger Mode | Trigger with Delay
    Display Function | Display Enable

  property range

    Control the range to be selected manually. Valid range numbers are 1 through 5. See `automatic_range_enabled` for further information.

  property relative_mode_enabled

    Control the relative mode. In the relative mode the current measured power value will be used as reference and any further reported value from `power` will refer to this.

  reset()

    Resets the instrument.

  property resolution

    Control the resolution of the power meter’s measured value. Three levels of resolution can be set: 0.1 dB, 0.01 dB and 0.001 dB or if the selected unit is Watts 1%, 0.1% and 0.001%.

  sensor_data_clear(sensor_id)

    Clear the Sensor Data table of ‘sensor_id’ previous to entering new values.

  sensor_data_read_cal_factor_table(sensor_id)

    Read the Sensor Data calibration table. See `sensor_data_write_cal_factor_table()` Returns a tuple of frequencies as list and calibration factors as list.

  sensor_data_ref_cal_factor(sensor_id, ref_cal_factor)

    Set the power sensor’s reference calibration factor to the Sensor Data table.

  sensor_data_write_cal_factor_table(sensor_id, frequency_table, cal_fac_table)

    Write the ‘calibration_table’ for ‘sensor_id’ to the Sensor Data table. And write the reference calibration factor for the ‘sensor_id’. Frequency is given in Hz. Calibration factor as percentage.

    The power meter’s memory contains space for 10 tables, numbered 0—9. Tables 0-7 each contain space for 40 frequency /calibration factor pairs. Tables 8 and 9 each contain space for 80 frequency/calibration factor pairs.

    This function clears the sensor table before writing.

    Example table:

        calibration_table = {
            10e6: 100.0,
            1e9: 96.5,
            2e9: 97.0
        }

        instr.sensor_data_cal_factor_table(0, calibration_table.keys(),
        calibration_table.values())

  sensor_data_write_id_label(sensor_id, label)

    Set a particular power sensor’s ID label table to be modified. The sensor ID label must not exceed 7 characters. For example, to identify Sensor Data table #2 with an ID number of 1234567:

        instr.sensor_data_id_label(2, "1234567")

  property sensor_type

    Set the sensor type connected to the power meter to select the corresponding calibration factor.

        from pymeasure.instruments.hp.hp437b import SensorType

        instr.sensor_type = SensorType.HP_8481A

  store(register)

    The power meter can store instrument configurations for recall at a later time. The following information can be stored in the power meter’s internal registers:

    - reference calibration factor value

    - Measurement units (dBm or watts)

    - relative value and status (on or off)

    - power reference status (on or off)

    - calibration factor value

    - SENSOR ID (sensor data table selection)

    - offset value and status (on or off)

    - range (Auto or Set)

    - frequency value

    - resolution

    - duty cycle value and status (on or off)

    - Filter (number of readings averaged, auto or manual)

    - Limits value and status (on or off)

    Registers 1 through 10 are available for storing instrument configurations.

  trigger_delay()

    Trigger with delay.

    Triggering with delay is identical to `trigger_immediate()` except the power meter inserts a settling-time delay before taking the requested measurement. This settling time allows the internal digital filter to be updated with new values to produce valid, accurate measurement results. The trigger with delay command allows time for settling of the internal amplifiers and filters. It does not allow time for power sensor delay. In cases of large power changes, the delay may not be sufficient for complete settling. Accurate readings can be assured by taking two successive measurements for comparison. Once the measurement results are displayed and read onto the bus, the power meter reverts to standby mode.

  trigger_immediate()

    Trigger immediate.

    When the power meter receives the trigger immediate program code, it inputs one more data point into the digital filter, measures the reading from the filter, and then updates the display and HP-IB. (When the trigger immediate command is executed, the internal digital filter is not cleared.) The power meter then waits for the measurement results to be read by the controller. While waiting, the power meter can process most bus commands without losing the measurement results. If the power meter receives a trigger immediate command and then receives the GET (Group Execute Trigger) command, the trigger immediate command will be aborted and a new measurement cycle will be executed. Once the measurement results are read onto the bus, the power meter always reverts to standby/hold mode. Measurement results obtained via trigger immediate are normally valid only when the power meter is in a steady, settled state.

  property trigger_mode

    Control the trigger mode.

    The power meter has two modes of triggered operation; standby mode and free run mode. Standby mode means the power meter is making measurements, but the display and HP-IB are not updated until a trigger command is received. Free run means that Meter takes measurements and updates the display and HP-IB continuously.

  zero()

    Adjust the power meter’s internal circuitry for a zero power indication when no power is applied to the sensor.

    Note

    Ensure that no power is applied to the sensor while the power meter is zeroing. Any applied RF input power will cause an erroneous reading.