Skip to main content

Python APIs for interacting with RFmx WLAN Product

Project description

Info Contains Python APIs for interacting with RFmx WLAN Product.
Author National Instruments

Table of Contents

About

The nirfmx-python repository generates Python bindings (Application Programming Interface) for interacting with the RFmx Products.

nirfmx-python follows Python Software Foundation support policy for different versions.

RFmx Instr Python API Status

Item Details
Driver Version Tested 2026 Q2
PyPI Package Version v19.1
Supported Python Versions Python 3.9+ (64-bit)
Documentation RFmx Instr Docs

RFmx WLAN Python API Status

Item Details
Driver Version Tested 2026 Q2
PyPI Package Version v19.1
Supported Python Versions Python 3.9+ (64-bit)
Documentation RFmx WLAN Docs

Documentation

You can find the latest API documentation for the nirfmx-python package on Read the Docs

Refer to the RFmx User Manual for an overview of RFmx, system requirements, troubleshooting, key concepts, etc.

Operating System Support

nirfmx-python supports Windows systems where the supported drivers are installed. Refer to NI Hardware and Operating System Compatibility for which versions of the driver support your hardware on a given operating system.

Installation

You can use pip to download nirfmxwlan package and install it.

$ python -m pip install nirfmxwlan

Upgrade

You can use pip to upgrade nirfmxwlan package using following command:

$ python -m pip install nirfmxwlan --upgrade

License

This project is licensed under the MIT License. While the source code is not publicly released, the license permits binary distribution with attribution.

Note: This Python driver depends on several third-party components that are subject to separate commercial licenses. Users are responsible for ensuring they have the appropriate rights and licenses to use those dependencies in their environments.

gRPC Features

For driver APIs that support it, passing a GrpcSessionOptions instance as a parameter to nirfmxinstr.Session.init() is subject to the NI General Purpose EULA.

SSL/TLS Support

The server supports both server-side TLS and mutual TLS. Security configuration is accomplished by setting the server_cert, server_key and root_cert values in the server's configuration file. The server expects the certificate files specified in the configuration file to exist in a certs folder that is located in the same directory as the configuration file being used by the server. For more detailed information on SSL/TLS support refer to the Server Security Support wiki page.

Support and Feedback

For support with Python API, hardware, the driver runtime or any other questions, please visit NI Community Forums.

RFmxWLAN Example

import nirfmxinstr
import nirfmxwlan
import numpy

instr_session = None
wlan_signal = None

try:
    # Create a new RFmx Session
    instr_session = nirfmxinstr.Session(resource_name="RFSA", option_string="")

    # Get WLAN Signal
    wlan_signal = instr_session.get_wlan_signal_configuration()
    
    # Configure measurement
    instr_session.configure_frequency_reference(
        selector_string="", frequency_reference_source="PXI_CLK",
        frequency_reference_frequency=10e6
    )
    wlan_signal.configure_frequency(selector_string="", center_frequency=2.412e9)
    wlan_signal.configure_reference_level(selector_string="", reference_level=0.0)
    wlan_signal.configure_external_attenuation(selector_string="", external_attenuation=0.0)
    wlan_signal.configure_iq_power_edge_trigger(
        selector_string="",
        iq_power_edge_source="0",
        iq_power_edge_slope=nirfmxwlan.IQPowerEdgeTriggerSlope.RISING_SLOPE,
        iq_power_edge_level=-20.0,
        trigger_delay=0.0,
        trigger_min_quiet_time_mode=nirfmxwlan.TriggerMinimumQuietTimeMode.AUTO,
        trigger_min_quiet_time_duration=5.0e-6,
        iq_power_edge_level_type=nirfmxwlan.IQPowerEdgeTriggerLevelType.RELATIVE,
        enable_trigger=True,
    )
    wlan_signal.configure_standard(selector_string="",
      standard=nirfmxwlan.Standard.STANDARD_802_11_AG)
    wlan_signal.configure_channel_bandwidth(selector_string="", channel_bandwidth=20e6)
    wlan_signal.select_measurements(selector_string="",
      measurements=nirfmxwlan.MeasurementTypes.SEM, enable_all_traces=True)
    wlan_signal.sem.configuration.configure_mask_type(selector_string="",
      mask_type=nirfmxwlan.SemMaskType.STANDARD)
    wlan_signal.sem.configuration.configure_averaging(
        selector_string="", 
        averaging_enabled=nirfmxwlan.SemAveragingEnabled.FALSE, 
        averaging_count=10, 
        averaging_type=nirfmxwlan.SemAveragingType.RMS
    )
    wlan_signal.sem.configuration.configure_sweep_time(selector_string="",
      sweep_time_auto=nirfmxwlan.SemSweepTimeAuto.TRUE, sweep_time_interval=1.0e-3)
    wlan_signal.sem.configuration.configure_span(selector_string="",
      span_auto=nirfmxwlan.SemSpanAuto.TRUE, span=66.0e6)

    error_code = wlan_signal.initiate(selector_string="", result_name="")

    # Retrieve results
    measurement_status, error_code = wlan_signal.sem.results.fetch_measurement_status(
      selector_string="", timeout=10.0)

    absolute_power, relative_power, error_code = (
        wlan_signal.sem.results.fetch_carrier_measurement(selector_string="", timeout=10.0)
    )

    (
        lower_offset_measurement_status,
        lower_offset_margin,
        lower_offset_margin_frequency,
        lower_offset_margin_absolute_power,
        lower_offset_margin_relative_power,
        error_code,
    ) = wlan_signal.sem.results.fetch_lower_offset_margin_array
          (selector_string="", timeout=10.0)

    (
        upper_offset_measurement_status,
        upper_offset_margin,
        upper_offset_margin_frequency,
        upper_offset_margin_absolute_power,
        upper_offset_margin_relative_power,
        error_code,
    ) = wlan_signal.sem.results.fetch_upper_offset_margin_array
          (selector_string="", timeout=10.0)

    spectrum = numpy.empty(0, dtype=numpy.float32)
    composite_mask = numpy.empty(0, dtype=numpy.float32)
    
    (
        x0, 
        dx,
        error_code 
    ) = wlan_signal.sem.results.fetch_spectrum
          (selector_string="", timeout=10.0, spectrum=spectrum, composite_mask=composite_mask)

    # Print Results
    print(f"Measurement Status                          : {measurement_status}")
    print(f"Carrier Absolute Power (dBm)                : {absolute_power}\n")

    print("----------Lower Offset Measurements----------\n")
    for i in range(len(lower_offset_margin)):
        print(f"Offset {i}")
        print(f"Measurement Status              : {lower_offset_measurement_status[i]}")
        print(f"Margin (dB)                     : {lower_offset_margin[i]}")
        print(f"Margin Frequency (Hz)           : {lower_offset_margin_frequency[i]}")
        print(f"Margin Absolute Power (dBm)     : {lower_offset_margin_absolute_power[i]}\n")

    print("\n----------Upper Offset Measurements----------\n")
    for i in range(len(upper_offset_margin)):
        print(f"Offset {i}")
        print(f"Measurement Status              : {upper_offset_measurement_status[i]}")
        print(f"Margin (dB)                     : {upper_offset_margin[i]}")
        print(f"Margin Frequency (Hz)           : {upper_offset_margin_frequency[i]}")
        print(f"Margin Absolute Power (dBm)     : {upper_offset_margin_absolute_power[i]}\n")

except Exception as e:
    print("ERROR: " + str(e))

finally:
    # Close session
    if wlan_signal is not None:
        wlan_signal.dispose()
        wlan_signal = None
    if instr_session is not None:
        instr_session.close()
        instr_session = None

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nirfmxwlan-26.3.0-py3-none-any.whl (289.6 kB view details)

Uploaded Python 3

File details

Details for the file nirfmxwlan-26.3.0-py3-none-any.whl.

File metadata

  • Download URL: nirfmxwlan-26.3.0-py3-none-any.whl
  • Upload date:
  • Size: 289.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for nirfmxwlan-26.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 90aa895ce5d45288657a0f3421f6f9d51f7c5df7798aae0ebf019c1272589a59
MD5 f048eaf7c808aee3da734de14eb47a4c
BLAKE2b-256 a0461fe04075d6260f12550454d2667437c9109ff15fafcb9a6fc4c049ee340b

See more details on using hashes here.

Provenance

The following attestation bundles were made for nirfmxwlan-26.3.0-py3-none-any.whl:

Publisher: Publish-Package.yml on ni/nirfmx-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page