Effacer les filtres
Effacer les filtres

Trigger off of an exact time

2 vues (au cours des 30 derniers jours)
Nate Melster
Nate Melster le 28 Juil 2020
Modifié(e) : dpb le 29 Juil 2020
I want to trigger to do something at some real time. The idea is to trigger an event within milliseconds of a specific GPS time. I know I can use something like below, but that is not accurate enough.
[year, month, day, Hour, Minute, Second] = datevec(now + (UTC_offset/24) + (Leap_seconds/(24*3600))); % for GPS time
There are sites that 'time.gov' that can give you a more accurate time. How can I get an accurate time in Matlab? I would prefer to get GPS time, but if I do get UTC or local time, I can convert that.
  3 commentaires
Nate Melster
Nate Melster le 28 Juil 2020
The computer using Matlab is connected online, so I was hoping from something online like a website.
dpb
dpb le 29 Juil 2020
Modifié(e) : dpb le 29 Juil 2020
You can read the time to whatever precision you wish; you can't control the latency of the connection just over the internet, though. I think msec timing isn't in the cards that way; you would need some direct connection to the time server.
That's NTP and the NIST timeserver link is https://tf.nist.gov/tf-cgi/servers.cgi
Interesting Q? I've not thought about through MATLAB; just used the OS-supplied service; I'd guess passing to it is probably quickest/fastest route.

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Application Deployment dans Help Center et File Exchange

Produits


Version

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by