04-01-2010 03:39 AM
Hi! I need to set the system clock with milliseconds precision. The Labwindows CVI SetSystemTime function use only seconds precision. How to get around the problem?
Thanks in advice!
Solved! Go to Solution.
04-01-2010 03:52 AM
Hi, why do you need such a functioanlity?
Are you trying to time an event's start/stop instants? I am not sure if Windows clock can be set to milliseconds.
I think a workaround can be found if you can clarify your needs.
04-01-2010 03:57 AM - edited 04-01-2010 04:05 AM
I talked too early,
Actually I found that the SDK version of the SetSytemTime function does accept milliseconds.
However, its usage is a little different.
You need to create an object of type SYSTEMTIME and set its members to the values you need.
Then, call the SetSystemTime function (of the WinSDK) to set the clock.
You need to add "windows.h" to the top of your include list.
(see SDK help, there is a sample code available there)
04-01-2010 04:29 AM
I need to change the PC system clock with milliseconds precision to synchronize the time with an instruments connected via TCP/IP.
Thanks for the tips!