Get and Set RT System Time Programmatically Using System Configuration API
To set the time on the RT clock you traditionally have two options. First is to do it manually in MAX or run a VI on the target to set it locally.The System Configuration API now allows you to set the time over the network programmatically without having to do any clever VI server calls as you would have to do previously.
Attached are two VIs to get and set the time based from a System Configuration Session. This will point to the RT target and the code then finds the appropriate hardware resource to gain access to the clock.This can prove very useful as part of a automated deployment process where you can use this API to identify the target, download an image and then set the time correctly using this VI.This was written and tested using NI System Configuration Driver 5.0 and LabVIEW 2011 however I am not aware of any compatibility issues with previous versions.The system configuration API is supported in LabVIEW 8.6 and later and is a graduate of NI Labs. You can find the Labs page at Welcome to the NI System Configuration API and download the driver at http://joule.ni.com/nidu/cds/view/p/id/2613/lang/en.
Steps to Implement or Execute Code
Additional Information or References
VI Snippet of "Get System Time.vi"
VI Snippet of "Set System Time.vi"
**This document has been updated to meet the current required format for the NI Code Exchange.**
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.