Main Content

clearCommandTime

Clear currently set command time

Since R2025a

Add-On Required: This feature requires the Wireless Testbench™ Support Package for NI™ USRP™ Radios add-on.

Description

clearCommandTime(radio) clears the currently set command time on the radio associated with the radio object radio.

The command time is the time for applying any subsequent changes to RF properties, which you can set using the setCommandTime function.If no command time is set, the radio executes commands that set RF properties when they reach the front of the command queue.

For details about radio support for this function, see Limitations.

example

Examples

collapse all

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.

Input Arguments

collapse all

Radio object, specified as a radio object that corresponds to a radio setup configuration you saved using the Radio Setup wizard.

To create a radio object, call the radioConfigurations function with the name of your radio setup configuration. For example, for a radio setup configuration named MyRadio, call radio = radioConfigurations("MyRadio").

Limitations

The clearCommandTime function is honored on a limited set of supported NI™ USRP™ radios.

Radio DeviceCommand Time Support

USRP E320

Yes

USRP N300

No

USRP N310

No

USRP N320

Yes

USRP N321

Yes

USRP X300

Yes

USRP X310

Yes

USRP X410

No

Version History

Introduced in R2025a