LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

cRIO and PC synchronisation

Hello, everyone!

The problem is: setting up time on cRIO with PC as a server with millisecond accuracy (if possible).

I have been looking through forum for solution of this problem, and the only thing I've found was one "method" on the official NI site.
There the syncronisation is made through writing down a string with timestamp data on the PC, and then sending it throug UDP to cRIO. But it does not work on cRIO side as cRIO does not support "UDP Multicast Read-Only Open" function.
And I can see that the accuracy is in seconds.

I tried with my own functions - I write timestamp data in shared variable on the PC, and then read it on the cRIO. But this is also in seconds.

With common sense, it seems to me that it is not even possible to have millisecond precision, due to network transfer and software timing that also takes time...

Can anyone give me a smart word, direction where to dig furhter, anything?

Maybe this solution I made is the best, as in this way we have, in difference of the UDP, the confirmation that cRIO received the data?

Thanks for your answers...

Toni
Stay well,
Toni Dropulic
0 Kudos
Message 1 of 6
(5,379 Views)
And yes, I am using LabVIEW 8.20 with DSC 8.2.

Toni
Stay well,
Toni Dropulic
0 Kudos
Message 2 of 6
(5,378 Views)
Hello Toni,

I believe the method that you have mentioned is actually the preferred means for setting up your time synchronization between your RT cRIO controller and your host PC. As I am sure you know, your cRIO and host both have different clocks. You will not be sharing these clocks, you are simply updating the cRIO's clock periodically from the Windows host clock. Essentially you can use the RT Set Date and Time VI to periodically update the time on your cRIO controller. Because you cannot guarantee how long a command will take to reach cRIO over Ethernet, it is hard to ensure that you will have millisecond accuracy. I might suggest performing some benchmarking to determine what this time difference might be. I hope this information is helpful for you!

Mike D.
Message 3 of 6
(5,351 Views)
Thanks, Duffman!

That is what I was thinking too. And I have made my software part on cRIO with this function RT Set Date and Time.

But another thing I thought of now is to actually synchronise PC according to cRIo, as its clock is more reliable.

Benchmarking - gut idea...

Helpful informations!


Stay well,
Toni Dropulic
0 Kudos
Message 4 of 6
(5,318 Views)
Hello Toni,

I am glad to help. You mentioned that you might want to synchronize your host PC's clock to your cRIOs clock. I have not previously considered an application such as this, but I would think that it can be coded. However, I do not think that you will see any added benefit because the RT clock is more reliable. I say this because the purpose of synchronizing the clocks is presumably correlation of data in time. Thus your synchronization accuracy would only be as good as your least reliable component. In any case, please post back if you find this method to be effective for you. Good luck with your application!

Mike D.
0 Kudos
Message 5 of 6
(5,288 Views)
Hello, Duffman!

After I wrote my last post on this subject, I found out that in LabVIEW there actually are no functions to set date/time on PC programmatically.
And apart from this, as we talked about accuracy, it will probably be enogh even to use a PC as a time-base for the whole system.

Anyway, I don't think I will dig any further with this, I will leave it as it is now.

Thank you for your reply,


Stay well,
Toni Dropulic
0 Kudos
Message 6 of 6
(5,266 Views)