Example Code

Synchronize PXI Time to PCs system with Windows OS

Code and Documents

Attachment

 

Overview

Demonstrates how to programmatically synchronize PXI Time to PCs system by calling the SetSystemTIme function from the Windows' kernel32.dll.

 

Description

First, this program initializes Target, then retrieve hardware handle and Current time and Time zone from the Target. The program defines Format Date/Time. (UTC format specifies if the output string is in Universal Time or in the configured time zone for the computer. ). Then set the date/time to this pc by Call SetSystemTimeFunction from Kernel32.dll. 

 

Requirements

Software:

LabVIEW 2015 (or compatible)

Steps to Execute Code

1. Run LabVIEW as Administrator.
2. Run the program.
3. Select Target.
4. Click the 'Change Time' boolean to change System Time.
5. Click 'Stop' boolean to stop running VI.

 

Additional Information or References
VI Snippet

2.png

 

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

Contributors