Skip to main content

Python APIs for interacting with RFmx Pulse Product

Project description

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

Table of Contents

About

The nirfmx-python repository generates Python bindings (Application Programming Interface) for interacting with the NI 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
Supported Python Versions Python 3.9+ (64-bit)
Documentation RFmx Instr Docs

RFmx Pulse Python API Status

Item Details
Driver Version Tested 2026 Q2
Supported Python Versions Python 3.9+ (64-bit)
Documentation RFmx Pulse Docs

Documentation

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

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 nirfmxpulse and install it.

$ python -m pip install nirfmxpulse

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.

RFmxPulse Example

import nirfmxinstr
import nirfmxpulse
import numpy

instr_session = None
pulse = None

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

    # Get Pulse signal configuration
    pulse = instr_session.get_pulse_signal_configuration()

    # Configure measurement
    instr_session.configure_frequency_reference(selector_string="",
        frequency_reference_source="OnboardClock", frequency_reference_frequency=10.0e6)
    pulse.configure_rf(selector_string="", center_frequency=1.0e9, reference_level=-10.0,
        external_attenuation=0.0)
    pulse.configure_iq_power_edge_trigger(
        selector_string="",
        iq_power_edge_source="0",
        iq_power_edge_slope=nirfmxpulse.IQPowerEdgeTriggerSlope.RISING,
        iq_power_edge_level=-20.0,
        trigger_delay=0.0,
        trigger_min_quiet_time_mode=nirfmxpulse.TriggerMinimumQuietTimeMode.AUTO,
        trigger_min_quiet_time_duration=5.0e-6,
        iq_power_edge_level_type=nirfmxpulse.IQPowerEdgeTriggerLevelType.RELATIVE,
        enable_trigger=True,
    )
    pulse.set_measurement_bandwidth(selector_string="", value=80.0e6)
    pulse.set_measurement_filter_type(selector_string="",
        value=nirfmxpulse.MeasurementFilterType.GAUSSIAN)
    pulse.set_acquisition_length(selector_string="", value=1.0e-3)
    pulse.select_measurements(selector_string="",
        measurements=nirfmxpulse.MeasurementTypes.PULSE, enable_all_traces=True)

    # Configure Pulse Detection Settings
    pulse.pulse_measurement.configuration.set_detection_reference(selector_string="",
        value=nirfmxpulse.PulseDetectionReference.REFERENCE_LEVEL)
    pulse.pulse_measurement.configuration.set_detection_threshold(
        selector_string="", value=-20.0)
    pulse.pulse_measurement.configuration.set_detection_hysteresis(
        selector_string="", value=1.0)
    pulse.pulse_measurement.configuration.set_detection_minimum_off_duration(
        selector_string="", value=50.0e-9)
    pulse.pulse_measurement.configuration.set_level_computation_method(selector_string="",
        value=nirfmxpulse.PulseLevelComputationMethod.MEDIAN)
    pulse.pulse_measurement.configuration.set_metrics_enabled(selector_string="",
        value=nirfmxpulse.PulseMetricsEnabled.TRUE)
    pulse.initiate(selector_string="", result_name="")
    pulse.wait_for_measurement_complete(selector_string="", timeout=10.0)

    # Retrieve results
    pulse_count, _ = pulse.pulse_measurement.results.get_pulse_count(selector_string="")
    rise_time, _ = pulse.pulse_measurement.results.get_rise_time(selector_string="")
    fall_time, _ = pulse.pulse_measurement.results.get_fall_time(selector_string="")
    pulse_width, _ = pulse.pulse_measurement.results.get_pulse_width(selector_string="")
    top_level, _ = pulse.pulse_measurement.results.get_top_level(selector_string="")
    base_level, _ = pulse.pulse_measurement.results.get_base_level(selector_string="")
    average_on_level, _ = pulse.pulse_measurement.results.get_average_on_level(
        selector_string="")
    amplitude = numpy.empty(0, dtype=numpy.float32)
    pulse.pulse_measurement.results.fetch_amplitude_trace(
        selector_string="", timeout=10.0, amplitude=amplitude)

    # Print results
    print(f"Pulse Count                            : {pulse_count}")
    for i in range(len(rise_time)):
        print(f"Rise Time (s)                          : {rise_time[i]:.11f}")
        print(f"Fall Time (s)                          : {fall_time[i]:.11f}")
        print(f"Pulse Width (s)                        : {pulse_width[i]:.9f}")
        print(f"Top Level (dBm)                        : {top_level[i]}")
        print(f"Base Level (dBm)                       : {base_level[i]}")
        print(f"Average On Level (dBm)                 : {average_on_level[i]}")

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

finally:
    # Close Session
    if pulse is not None:
        pulse.dispose()
        pulse = 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.

nirfmxpulse-26.3.0-py3-none-any.whl (118.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: nirfmxpulse-26.3.0-py3-none-any.whl
  • Upload date:
  • Size: 118.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for nirfmxpulse-26.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 19ea5b163aa14df2b2c0c461c8bb9cc24ecb65cfcd75e25ed01a6d35438edcd4
MD5 fe41177d2c78f167996a283650bcfa18
BLAKE2b-256 159de86e02f2b8fc9a842e21c24a62544e66bf650c741a618df77f7bd5a098a6

See more details on using hashes here.

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