From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

help with connecting to NIST NTP server on port 123

Solved!
Go to solution

The codes works fine. Set the version to 3 and mode to 3 to match with the server, and remove the Optional key identifier field to make data packet 56 bytes. Thanks,

Message 11 of 19
(3,130 Views)

Here is an ntp client that works in Labview 2012

Message 12 of 19
(2,817 Views)

Just so this gets out there, there is a plugin for a simple NTP implementation that works on cRIO.  In my testing, I saw it keep the device synchronized within 10ms of one of the NIST servers.  It runs in the background and is easy to configure.

 

https://decibel.ni.com/content/docs/DOC-14480

 

Also, I suspect the NIST servers do not respond to any NTP packets that were not sent from port 123.  At least that was my experience, and why I could get some examples to work on the cRIO but not on my pc.

0 Kudos
Message 13 of 19
(2,805 Views)

 

Hey,

I´ve tryed to implement the NTP Query VI as shown above.. there is a things I am struggeling with..

The thing is, the UDP read block is delivering an error 56.. my first guess was the server which i´m using does not respond, but i am was able to ping the server successfully, so there has to be some other mistake within the programm.

 

It would be great if someone is able to help me.

 

Tanks

0 Kudos
Message 14 of 19
(2,441 Views)

What's the purpose of the while loop?
Being able to ping a target does not say anything about a running NTP server.

What is the server IP you are using?

 

  • Are you correctly using my type cluster? Why did you change the formatting of the last item (Key identifier)?
  • You are potentially hammering the server at port 123 as fast as the computer allows until an error occurs at which time you return the data of the errored out function. Seems pretty pointless! Do you know how many times the loop iterates? Maybe it works for a few iteration then you get blocked as a side effect of DOS protection code on the server.
  • What's up with all the overlapping and right-to-left wires?
  • Please attach actual code. We cannot debug or verify images.

 

Does it work if you use my code unchanged?

0 Kudos
Message 15 of 19
(2,431 Views)

Thanks for the fast reply!

 

The programm works now, after:

 

  • I had removed the while loop. I thought it was nessesary to constantly request new data from the server, but thats of cause non sense if you just need one timestamp to synchronize your system clock.
  • Formatted the Key Identifier. I simply overlooked that.

The only thing that does not work so far is to use another server. For now i am using the IP-Address from your progamm, but if i try any NTP-Server of these Lists i am getting error 56....

 

NIST-List

NTP Servers in Germany

 

I am really thankful for your help!

 

0 Kudos
Message 16 of 19
(2,395 Views)

Well, the format of the key identifier is irrelevant, but the datatype matters.

 

I don't know if the german NTP servers have any restrictions. Also make sure that the address entry does not contain any extra characters, such as linefeeds, etc. Make sure the entry field is set to "limit to single line").

0 Kudos
Message 17 of 19
(2,360 Views)

Yes, some servers work, some don't.

 

You migh also want to ask around if your company or institute offers a local NTP server.  (For example UCLA here runs it's own).

0 Kudos
Message 18 of 19
(2,350 Views)

Yeah for the final impelemtation it is planed to sychronize the System Clock over a local NTP-Server, but for some test a extern server is also fine.

 

Tanks again for your help!

0 Kudos
Message 19 of 19
(2,323 Views)