Main Content

wt.radio.X300

Interface with USRP X300 radio

Since R2025a

Description

The wt.radio.X300 radio object provides an interface with a USRP™ X300 radio that corresponds to a radio setup configuration you saved using the Radio Setup wizard.

Refer to the radio object properties to get information about the radio setup configuration that the object corresponds to, such as the model number of the radio, the radio IP address, and the synchronization options.

Use object functions to:

  • Check the lock status of the reference clock, local oscillators, or GPS disciplined oscillator (GPSDO) on the radio.

  • Get time and GPS information from the radio.

  • Synchronize multiple devices by setting the radio time.

  • Schedule property updates on Wireless Testbench™ application objects.

You can use the wt.radio.X300 radio object to create a Wireless Testbench application object to configure your radio for baseband transmit and capture or spectrum monitoring applications.

Creation

To create a radio object, use the radioConfigurations function with the name of a radio configuration created using the Radio Setup wizard:

radio = radioConfigurations("MyRadio")

Properties

expand all

Identification and Network Properties

This property is read-only.

Radio setup configuration name, returned as a string. You specify this name when you save your radio setup configuration in the Radio Setup wizard.

Example: "MyRadio" indicates that you saved a radio setup configuration under the name MyRadio in the Radio Setup wizard.

Data Types: string

This property is read-only.

Model number of the radio, returned as "USRP X300".

For more information about radio support, see Supported Radio Devices.

Data Types: string

This property is read-only.

IP address of the radio, returned as a string scalar containing dotted-quad values.

Example: "192.168.10.2"

Data Types: string

Synchronization Properties

This property is read-only.

Time source of the radio, returned as one of these options:

  • "internal" — Use the internal pulse per second (PPS) signal source of the radio.

  • "external" — Use the PPS signal from an external signal generator.

  • "gpsdo" — Use the PPS signal from the onboard GPS disciplined oscillator (GPSDO).

For more information about synchronizing clock or time references, see Clock and Time References.

Data Types: string

This property is read-only.

Time source of the radio, returned as one of these options:

  • "internal" — Use the internal clock signal of the radio.

  • "external" — Use a clock signal from an external signal generator.

  • "gpsdo" — Use the clock signal from a GPSDO.

To check the lock status of the radio clocks to the configured 10 MHz reference clock, use the referenceLockedStatus function.

If the clock source of the radio is set to use the GPSDO, use the gpsLockedStatus function to check the lock status of the GPSDO to the GPS constellation.

For more information about synchronizing clock or time references, see Clock and Time References.

Data Types: string

This property is read-only.

Local oscillator (LO) source of the radio, returned as one of these options:

  • "internal" — Use the internal LO signal of the radio.

  • "external" — Use an LO signal from an external signal generator.

This setting applies to all LOs on the radio.

To check the lock status of the LOs, use the loLockedStatus function. The LOs are locked when they have stabilized at the desired frequency and phase.

For more information, see Phase Synchronize Operations on NI USRP Radios.

Data Types: string

Object Functions

expand all

referenceLockedStatusLock status of radio to 10 MHz reference clock
loLockedStatusLock status of local oscillators
gpsLockedStatusLock status of GPSDO to GPS constellation
getRadioTimeCurrent radio time
getTimeLastPPSRadio time of last pulse per second signal
setTimeNextPPSSet radio time on next pulse per second signal
getGPSTimeGPS time from GPSDO
getGPSNMEANMEA GGA sentence from GPSDO

expand all

setCommandTimeSet time for applying changes to RF properties
getCommandTimeCurrently set command time
clearCommandTimeClear currently set command time

Examples

collapse all

Call the radioConfigurations function to list all saved radio setup configurations.

configs = radioConfigurations;

Create a radio object by specifying the name of a saved radio setup configuration.

radioName = configs(1).Name
radioName = 
"MyRadio"
radio = radioConfigurations(radioName);

Create a radio object, specifying a radio setup configuration previously saved using the Radio Setup wizard.

radio = radioConfigurations("MyRadio");

Create a baseband transceiver object, specifying your radio object. Specify the Preload name-value argument as true to load the application onto the radio during object creation. Specify RF properties for the transmit and receive channels.

bbtrx = basebandTransceiver(radio, ...
    Preload=true, ...
    TransmitDataType="double", ...
    TransmitAntennas="RFA:TX/RX", ...
    TransmitCenterFrequency=2.4e9, ...
    TransmitRadioGain=10, ...
    CaptureAntennas="RFA:RX2", ...
    CaptureCenterFrequency=2.4e9, ...
    CaptureRadioGain=10);

Set the time for synchronously applying changes to RF properties as 2 seconds in the future.

cmdTime = getRadioTime(radio)+2
cmdTime = 
2.1484

Transmit a waveform continuously.

transmit(bbtrx,[-1;0;1;0],"continuous");

Schedule a 0.2 second long background capture to start 0.1 seconds before the scheduled command time.

capture(bbtrx,seconds(0.2),Background=true,StartTime=cmdTime-0.1);

Set the command time and verify.

setCommandTime(radio,cmdTime)
getCommandTime(radio)
ans = 
2.1484

Update the transmit and capture radio gains to 20 dB. These changes take effect synchronously at the command time.

bbtrx.TransmitRadioGain = 20;
bbtrx.CaptureRadioGain = 20;

Clear the command time. This takes effect immediately after the scheduled property updates take effect.

clearCommandTime(radio);

Wait for the capture operation to complete.

while isCapturing(bbtrx)
    pause(0.1)
end

Return the captured data to the workspace.

data = captureOutputs(bbtrx);

Plot the captured data. The plot shows the data captured 0.1 seconds either side of the command time.

plot(real(data))

Figure contains an axes object. The axes object contains an object of type line.

Version History

Introduced in R2025a