Main Content

getGPSTime

GPS time from GPSDO

Since R2025a

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

Description

time = getGPSTime(radio) returns the current GPS time time read from the GPS disciplined oscillator (GPSDO) on the radio associated with the radio object radio.

To obtain a GPS time, the radio must have a GPSDO and the GPSDO must be locked to the GPS constellation. To check the lock, use the gpsLockedStatus function.

example

Examples

collapse all

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

radio = radioConfigurations("MyRadio");

Check the lock status of the GPSDO on the radio to the GPS constellation.

status = gpsLockedStatus(radio)
status = logical
   1

Get the current GPS time.

time = getGPSTime(radio)
time = 
1416320540

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").

Output Arguments

collapse all

The current GPS time in seconds returned as a positive numeric scalar. The returned value is the current epoch time in seconds since January 1, 1970.

Data Types: double

Version History

Introduced in R2025a