NI-USRP Examples
- Updated2025-07-18
- 5 minute(s) read
NI-USRP includes several example applications for LabVIEW. These examples serve as interactive tools, programming models, and as building blocks in your own applications. NI-USRP includes examples for getting started and other SDR functionality.
You can access the NI-USRP examples from the following locations:
- From the Start menu at .
- From the LabVIEW Functions palette at .
You can access additional examples from the Code Sharing Community at ni.com/usrp.
Refer to the following examples for more information about using the USRP-2920/2921/2922 as a receiver and establishing a digital link between USRP-2920/2921/2922 devices.
Using the USRP Device as a Receiver
The niUSRP EX One Shot Rx VI connects to a USRP device and uses it as a receiver.
-
Open the niUSRP EX One Shot Rx VI.
- Select to open the folder containing the example VIs.
- Double-click niUSRP EX One Shot Rx.vi to open the VI in LabVIEW.
Note Alternately, you can navigate to <Program Files>/National Instruments/LabVIEW/examples/instr/niUSRP/ and double-click niUSRP EX One Shot Rx.vi to open the VI in LabVIEW. If you are using a 64-bit operating system, open niUSRP EX One Shot Rx.vi from the <Program Files (x86)>/National Instruments/LabVIEW/examples/instr/niUSRP/ModulationToolkitExamples folder.The following figure shows the front panel of the VI:
Figure 1. niUSRP EX One Shot Rx VI Front Panel 
Note To run this example, your connected device must have an installed daughterboard that can act as a receiver. The default values shown in the preceding figure are appropriate for a USRP-2920 device. -
Examine the front panel input controls and specify values appropriate for your
device.
- Device Names—String control that specifies the IP address for a device connected to your computer. The default value 192.168.10.2 connects the instrument driver to the device at IP address 192.168.10.2. Update the string to match the IP address of your connected device.
- IQ Sampling Rate [S/sec]—Numeric control that specifies the baseband (I/Q) sampling rate, in samples per second (S/s), for the acquired signal. The device initially samples the incoming signal at the sample rate of your device and downconverts the resulting samples to the baseband (I/Q) sampling rate that you specify here.
- Carrier Frequency—Numeric control that specifies the carrier frequency, in hertz, for the acquired signal. Enter a valid value for your device. If you enter a value outside the available frequency range for your device, NI-USRP coerces the value to the closest available frequency.
- Gain [dB]—Numeric control that specifies the receiver gain setting for your device. Refer to the documentation for your device for the available range of settings. If your device does not have variable gain, NI-USRP ignores the value for this control.
- Active Antenna—String control that specifies the antenna connector to use for the receiver. Enter a string that corresponds to the designator for your device. For example, if you use the USRP-2920 device, enter RX1 or RX2.
-
Click the Run button on the toolbar, shown as follows,
to run the niUSRP EX One Shot Rx VI.

Establishing Digital Links Between USRP Devices
The ModulationToolkitExamples folder includes several pairs of VIs, such as the niUSRP EX QAM Rx VI and the niUSRP EX QAM Tx VI, that demonstrate how to establish a digital link between two devices to transmit (Tx) and receive (Rx) signals. These examples show one way you can use Modulation Toolkit VIs to establish digital communication links. Tx examples use Modulation Toolkit VIs to generate a PN sequence message, map the bits of this message to symbols, and apply a pulse-shaping filter. Rx examples use Modulation Toolkit VIs to demodulate the acquired signal, performing operations such as frequency/symbol synchronization, and bit recovery.
- Open the niUSRP EX QAM Rx and Tx VI from the <Program Files>/National Instruments/LabVIEW/examples/instr/niUSRP/ModulationToolkitExamples folder. If you are using a 64-bit operating system, open the niUSRP EX QAM Rx and Tx VI from the <Program Files (x86)>/National Instruments/LabVIEW/examples/instr/niUSRP/ModulationToolkitExamples folder.
-
Examine the front panel input controls for the VIs:
Figure 2. niUSRP EX QAM Rx/Tx VI Front Panel 
Both the Rx and Tx VIs include the device names string control, which specifies an IP address for the device connected to your computer. Set these controls for the separate devices connected to your computer. Use strings with the format: x.x.x.x, where x.x.x.x is the IP address that corresponds to your transmitter and/or receiver.
The values for Carrier Frequency [Hz], Gain [dB], and Active Antenna, shown in the previous two figures, are appropriate for the USRP-2920 device.
-
Modify the front panel controls according to the specifics of the device(s) and
antenna(s) installed in your setup. To establish a link between your transmitter
and receiver, set corresponding controls and indicators on the Rx and Tx VIs to
the following values:
- Set Carrier Frequency [Hz] to the same value on each VI.
- Set QAM M-ary to the same M-ary value on each VI.
- Set the Symbol Rate [symbols/sec] control on the
Rx VI to the same value as the Symbol Rate
[symbols/sec] indicator on the Tx VI. The symbol rate
for the transmitter is a function of the values that you specify for the
IQ Sampling Rate [S/sec] and
Samples per Symbol controls on the Tx VI, as
shown in the following equation:
-
Start the Tx VI, then start the Rx VI. Click the Run
button, shown as follows, on the toolbar of each VI to run the VIs.
