Skip to content

Repository of application examples utilizing the USRP Hardware Driver (UHD)

License

Notifications You must be signed in to change notification settings

ni/labview-usrp-examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ettus Logo EMR NI Logo

Interfacing UHD-based USRPs from LabVIEW Host

Overview

This repository contains various example applications which demonstrate how to use NI LabVIEW with USRP devices via the USRP Hardware Driver (UHD) APIs. The main focus is to show how to interface and configure USRPs from LabVIEW. For data streaming it is recommended to implement an architecture based on Remote Streaming. These examples serve as a starting point for developing your own LabVIEW applications that interact with USRP hardware, including support for RF Network-on-Chip (RFNoC) features. By leveraging these examples, users can quickly get up and running with USRP devices in LabVIEW and extend the provided code to suit their specific needs.

Supported USRPs are the RFNoC enabled devices, which are the USRP X4x0 series, and all the Generation-3 USRPs in the X series (X3xx), E series (E3xx) and N series (N3xx). For more information about devices used for testing the examples, please refer to the documentation located in each example folder.

List of Examples

  • check-sw-env - Example for checking the Software Environment
  • tx-rx-loopback - Example for Tx/Rx Loopback using Python/RFNoC UHD API

Architecture

Software Stack

Software stack

The examples situated in this git repository are built on top of the released USRP Hardware Driver (UHD). In UHD, Python APIs provide access to interface with the USRP at high-level (Multi-USRP API) or more granular level (RFNoC API). The latter we use to implement the application-specific functionality as a Python program. This Python App abstracts the granular RFNoC implementation by common Python functions as App specific API. These are called from the top level USRP Control application (LV App) which finally integrates the RFNoC based USRP into the LabVIEW environment. Most of the examples only have one Python (*.py) and one LabVIEW (*.vi) file which can be used as a simple starting point to develop your own application. Refer to the Dependencies section for details on the required UHD software release.

General Workflow

The typical workflow for developing LabVIEW applications with USRP Python API integration involves the following steps:

  1. Start with a pure Python implementation
  • To get functionality working first, start with a Python-only application which interfaces the USRP using e.g. RFNoC API.
  • Verify operation on the command line.
  1. Refactor and modularize Python code
  • Re-organize the code from 1. to useful, application-specific API subfunctions.
  • It's recommended to implement session-specific information as an object, which can be used by those API subfunctions.
  • Test the call sequence of these subfunctions within the Python main function to ensure correctness.
  1. Integrate with LabVIEW
  • Use the LabVIEW Python Node, which allows LabVIEW to execute Python scripts and interact with Python functions, to call the app-specific Python API functions created in 2. directly from your LabVIEW application. For more details, refer to the LabVIEW Python Node documentation.
  • The input parameter function name of the Python Node needs to correspond to the respective function name specified in the Python implementation. See the figure below for more details:

Software Design Workflow

Software Design Considerations

When using the Python programming language in LabVIEW, the following design principles should be considered

  • When handing over data buffers to Python use the Marshal to NumPy Array option for these inputs as described here
  • For referencing LabVIEW clusters in Python use the Marshal to Named Tuple option for those inputs as described here
  • Prevent parallel running processing loops in LabVIEW which call into Python due to Python's Global Interpreter Lock (GIL) which can drastically impact the performance of your program.
  • Make sure that no GUI elements like controls and indicators are updated within the same loop which calls into Python due to the negative performance impact. Offload these updates to a separate loop using LabVIEW Channel Wires.

Hardware Setup

LabVIEW USRP examples are focussing on PXI based systems, configured with an Embedded Controller running Windows 10 or 11 operating system. To interface with USRP devices, PXI-based Ethernet Interface Modules are required.

More specific hardware-related information can be found within the respective example folder.

Software Setup

Dependencies

Note: The NI-USRP Driver for LabVIEW is not required for these examples.

Installation

NI LabVIEW should be installed via the NI Package Manager. Pick and choose a version that satisfies the dependency requirement. For Python, please refer to the installation instructions at https://www.python.org and also make sure the Python version satisfies the dependency requirement. The USRP Hardware Driver (UHD) needs to be installed following these instructions from the USRP Manual.

Verification

To verify successful installation, please refer to the check-sw-env example.

Troubleshooting

Schedule Windows Updates outside of experiment times, or temporarily pause updates if necessary, to avoid interruptions. If troubleshooting connectivity issues, you may temporarily disable firewall and antivirus software, but be sure to re-enable them promptly to maintain system security.

Debugging

  • Turn LV Python console on by adding the following key to the LabVIEW.ini
    • ShowConsoleForPythonNode=TRUE
  • For more advanced debugging of Python Code called from LabVIEW Python Node see this Link

Limitations

  • Throughput, Host to USRP - The IQ data streaming throughput between LV host application and USRP device is limited to a few MS/s only.

Bugs / Feature Requests

To report a bug or submit a feature request, please use the GitHub issues page.

License

labview-usrp-examples are licensed under an MIT-style license, see LICENSE for more details.

References

About

Repository of application examples utilizing the USRP Hardware Driver (UHD)

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages