Example Code

Synchronizing Your PC Clock to a NIST Time Server using LabVIEW

Code and Documents

Attachment

Download All

The National Institute of Science and Technology (NIST) provide accurate time servers that you can synchronize your system with. In LabVIEW, you can poll the information from the server via TCP and then use the kernel32.dll to appropriately set your system clock. The code below demonstrates this behavior. A full listing of all the available time servers can be found here: http://tf.nist.gov/tf-cgi/servers.cgi and more information about programmatic control of Windows can be found here: http://en.wikipedia.org/wiki/Windows_API.

NIST Time Synch.png

Verne D. // Software R&D // National Instruments

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
Ryan_Griffin
Member
Member
on

Thanks for posting this, VerneD! Saved me a lot of research for a handy snippet

Contributors