From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

GPS Time

Solved!
Go to solution

Hello everybody,

I'm working with a device which provide me with GPS time,

as far as I know, it should be time since the beginning of the week...

 

My question is:

Is there a built in functions to display GPS time in DD HH:MM:SS format or any other format??

 

Thanks in advance,

Aj

----------------------------
Amit Joseph,
Software Engineer
0 Kudos
Message 1 of 6
(3,519 Views)

What data type is the time in?

 

If it's a timestamp you can simply use the timestamp to string function.

 

You should know that GPS time is different than your computer's time - it's currently 16 seconds different.  Check this out for more information: http://en.wikipedia.org/wiki/Global_Positioning_System#Timekeeping

Chris
Certified LabVIEW Architect
Certified TestStand Architect
Message 2 of 6
(3,513 Views)

Chris,

thanks for the quick response...

 

in matter of fact, the data I recieve is string which I'm gonna translate to int (or what ever fit), unless there is a type of variable which I can use to ease the work 🙂

 

is there a way to convert this INT to timestamp?

 

thanks,

aj

----------------------------
Amit Joseph,
Software Engineer
0 Kudos
Message 3 of 6
(3,510 Views)

If you actually want a timestamp, you can use a combination of the Seconds to Date/Time and Date/Time to Seconds VIs - you can get the current timestamp, use the Seconds to Date/Time function to pull out the components (day, hour, minute, etc.), replace those with the values you get from your reading, and then bundle it back into a timestamp with the Date/Time to Seconds VI.

Chris
Certified LabVIEW Architect
Certified TestStand Architect
Message 4 of 6
(3,500 Views)
Solution
Accepted by topic author Amit_J

Well, coming to CVI world ( Smiley Wink ) you can take a look at CVITime functions from the Utility Library: if your instrument returns a string representation of time, you can use extract individual components from the string and pass them to CVIAbsoluteTimeFromLocalCalendar () function that returns time in National Instruments Binary Time Format.

Alternatively you can use Windows SYSTEMTIME format and associated functions.

You can finally use MakeDateTime () to obtain a double representation of date and time.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 5 of 6
(3,496 Views)

Darn it!  I keep forgetting to check which forum I'm on . . . 

 

Oh well, same idea I guess. . . Smiley Frustrated

Chris
Certified LabVIEW Architect
Certified TestStand Architect
Message 6 of 6
(3,493 Views)