Skip to content

MEASUREMENT_FILTER_DMM7510

Download Flojoy Studio to try this app
Changes the measurement filter settings for the DMM7510. Requires a CONNECT_DMM7510 block to create the connection. Params: connection : VisaConnection The VISA address (requires the CONNECTION_DMM7510 block). on_off : select, default=off Turn the filter on or off. avg_type : select, default=moving Use moving or repeating averaging. count : int, default=10 The number of counts to average. window : float, default=0 The size of the window, in percent. Returns: out : String Filter settings
Python Code
from typing import Optional, Literal
from flojoy import VisaConnection, flojoy, DataContainer, String


@flojoy(inject_connection=True)
def MEASUREMENT_FILTER_DMM7510(
    connection: VisaConnection,
    input: Optional[DataContainer] = None,
    on_off: Literal["on", "off"] = "off",
    avg_type: Literal["moving", "repeat"] = "moving",
    count: int = 10,
    window: float = 0,
) -> String:
    """Changes the measurement filter settings for the DMM7510.

    Requires a CONNECT_DMM7510 block to create the connection.

    Parameters
    ----------
    connection : VisaConnection
        The VISA address (requires the CONNECTION_DMM7510 block).
    on_off : select, default=off
        Turn the filter on or off.
    avg_type : select, default=moving
        Use moving or repeating averaging.
    count : int, default=10
        The number of counts to average.
    window : float, default=0
        The size of the window, in percent.

    Returns
    -------
    String
        Filter settings
    """
    assert 0.0 <= window <= 100.0, "The window must be between 0 and 100."
    assert count > 1, "The count must be greater than 1."

    dmm = connection.get_handle()

    if avg_type == "moving":
        dmm.commands.dmm.measure.filter.type = "dmm.FILTER_MOVING_AVG"
    else:
        dmm.commands.dmm.measure.filter.type = "dmm.FILTER_REPEAT_AVG"

    dmm.commands.dmm.measure.filter.count = count
    dmm.commands.dmm.measure.filter.window = window

    match on_off:
        case "off":
            dmm.commands.dmm.measure.filter.enable = "dmm.OFF"
        case "on":
            dmm.commands.dmm.measure.filter.enable = "dmm.ON"

    return String(s=f"Filter {on_off}")

Find this Flojoy Block on GitHub

Example App

Having problems with this example app? Join our Discord community and we will help you out!
React Flow mini map

In this example, a DC voltage measurement was extracted from a Keithley DMM7510.

First the necessary blocks were added:

  • CONNECT_DMM7510
  • RESET_DMM7510
  • FUNCTION_DMM7510
  • DIGITS_DMM7510
  • MEASUREMENT_PARAMS_DMM7510
  • MEASUREMENT_FILTER_DMM7510
  • READ_DMM7510
  • BIG_NUMBER

The instrument address was set for each DMM7510 block. The FUNCTION_DMM7510 block was changed in order to extract the correct measurement. The parameters in DIGITS_DMM7510, MEASUREMENT_PARAMS_DMM7510, and MEASUREMENT_FILTER_DMM7510 blocks were changed as necessary. The READ_DMM7510 block was connected to the BIG_NUMBER block in order to view the reading.

The blocks were connected as shown and the app was run.