usrp
Add-On Required: This feature requires the Wireless Testbench™ Support Package for NI™ USRP™ Radios add-on.
Description
The usrp
System object™ streams samples from the radio front end of an NI™
USRP™ radio device with a custom FPGA image that you create by
using the Target NI USRP Radios Workflow.
To stream samples from the radio front end:
Create the
usrpobject and set its properties.Call the object with arguments, as if it were a function.
To learn more about how System objects work, see What Are System Objects?
The diagram shows an overview of the internal architecture of an
NI
USRP radio. The usrp
System object enables you to:
Configure the radio front end by setting the object properties.
Stream samples from the radio front end by calling the object with
device()as if the object were a function.Transmit a test waveform over the air by using the
transmitfunction. With this function, you can test the receive path on your DUT.Retrieve captured data from the PL DDR buffer by using the
capturefunction. With this function, you can test the transmit path on your DUT.
For details on how to use the usrp
System object with object functions to connect to, configure, and control
your NI
USRP radio device, see the call sequence in Object Functions.
For more information about time synchronization with a usrp
System object, see Time Synchronize Operations on NI USRP Radios.
Creation
Description
sets properties using one or more name-value arguments. For example,
device = usrp(radio,PropertyName=Value)TransmitCenterFrequency=2.4e9 specifies a center
frequency of 2.4 GHz on all DUT output and transmit antennas.
Input Arguments
Properties
Usage
Description
device() streams samples continuously from the radio front end
until you call the reset function.
device(
streams numSamples)numSamples samples from the radio front
end.
device(___, specifies
options using one or more name-value arguments in addition to the input arguments in the
previous syntaxes. For example,
Name=Value)startTime=getRadioTime(radio)+0.5 schedules the
streaming of samples to start 500 milliseconds in the future. (since R2025a)
Input Arguments
Name-Value Arguments
Object Functions
To use an object function, specify the
System object as the first input argument. For
example, to release system resources of a System object named obj, use
this syntax:
release(obj)
Use the following functions to connect to, configure, and control your NI USRP radio device. The diagram shows the call sequence.
Create the
usrpSystem object with a radio setup configuration or radio object that you specify with theradioinput argument. Set properties that you apply to configure the radio front end settings in a later step.Use the
programFPGAanddescribeFPGAfunctions to program the FPGA on the radio with your custom bitstream and describe the DUT interfaces with the hand-off information file. You generate these files are generated in Generate Bitstream and Program FPGA of the targeting workflow.Call
setupto connect to the radio, apply the radio front end properties, and validate that the block ID in the bitstream file matches the hand-off information file. You now have a live connection to your radio. You can update tunable properties and connect to your DUT by using thefpgaobject. You can read or write registers on the DUT by using thereadPortandwritePortfunction. This step enables you to start streaming samples into your radio with the DUT ports in a known state.Call the System object as a function or call the
stepfunction on the System object to start the radio front end. This step callssetupif you did not do so previously, and then starts requesting streaming samples from the radio front end into the FPGA. Specify thenumSamplesargument to request a specific number of samples, or stream samples continuously by specifying no input arguments.Call the
resetfunction to stop the radio front end and restore the radio to the initialized state beforesetup. This stops any ongoing transmit or write operation and flushes the receive buffers. Any streaming connections between the DUT and the radio front end may not be flushed.Call the
releasefunction to release the hardware resources. This stops any ongoing transmit or write operation and flushes the receive buffers. Any streaming connections between the DUT and the radio front end might not be flushed.
To use synchronization features, specify a radio object as the input. You can synchronize
the radio time on multiple radios after you call the setup function. For
more information, see Time Synchronize Operations on NI USRP Radios.