viSci Posted August 18, 2010 Report Share Posted August 18, 2010 I am trying to create a vi to servo the windows system time to match my cRIO clock which is disciplined by GPS. I was hoping to find a IEEE1588 stack for windows that would do this for me but in the meantime... It appears that the way to do this is by using a windows dll function called SetSystemTimeAdjustment which can speed up or slow down the windows tick time, with this in hand, you can implement a PID servo loop to gradually sync the clock to an external reference. I was wondering if anybody has gone down this path before and might have a few tips. Quote Link to comment
jhoskins Posted August 19, 2010 Report Share Posted August 19, 2010 You could try using the command from the comand line of the PC/cRIO system you want to sysnc to. net time \\ip address of the one you want to sync with / set this is what we use to sync all our PC time together to one PC Quote Link to comment
viSci Posted August 20, 2010 Author Report Share Posted August 20, 2010 The problem is that I do not have any master time servers on my network other than a GPS based IEEE1588 master clock node which is not supported by windows network time clients. Quote Link to comment
Christian_L Posted August 20, 2010 Report Share Posted August 20, 2010 The problem is that I do not have any master time servers on my network other than a GPS based IEEE1588 master clock node which is not supported by windows network time clients. You could build a simple SNTP server on your cRIO system and then have Windows sync to it using the built in NTP client. I haven't tried it, but I think it should work. There's example code for a SNTP client on ni.com; you'd have to build the opposite end in this case. Quote Link to comment
viSci Posted August 20, 2010 Author Report Share Posted August 20, 2010 Hi Christian, Thanks for the suggestion. I took a look at the SNTP client vi's and they look pretty simple (as the name implies). I think I can get a SNTP server going with this as a starting point. I hope that in a future release, NI will consider adding a 1588 windows client to the NI-SYNC driver. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.