I think that there are 2 questions:
a) can I synchronize TwinCAT with PTP ?
b) can I trasnport timestamps over ADS ?
Yes.
<
https://infosys.beckhoff.com/english.php?content=../content/1033/tc3_ads_intro/115883019.html&id=>
c) Is there an EPICS driver that support it ?
Yes:
https://github.com/epics-modules/twincat-ads/
But back to a)
TwinCAT has different clocks.
You can synchronize the TwinCAT time (TcTime ??) with NTP.
If you need PTP, then you can synchronize the distributed clock
("DC") with PTP.
All details are tooooo long to describe here.
If you want more details, I am happy to set up
a video meeting.
BR
/Torsten
On 2026-02-06 15:50, Majer Karel via Tech-talk wrote:
> Hello,
>
> We have a number of Beckhoff PLCs installed and we are using ADS device
> support (
https://epics.cosylab.com/documentation/adsDriver/index.html
> <
https://urldefense.us/v3/__https://epics.cosylab.com/documentation/
> adsDriver/index.html__;!!G_uCfscf7eWS!euLXnna7-qCt-D3EjV5-bjzosTfKt-
> sd4lVcov9BLro2tBUjLRx-ed8iuDCVso9vUKL04d9SoJjsUQ8dHHIoBcTCJ3EHAw$>) to
> talk to them. We have considered synchronizing them with PTP and
> timestamping PVs with PTP timestamps from the PLC, but it's not clear
> how to do that of if it's even possible.
> The ADS protocol does not carry data timestamp (https://
> infosys.beckhoff.com/english.php?content=../content/1033/
> tcinfosys3/11291871243.html&id= <
https://urldefense.us/v3/__https://
> infosys.beckhoff.com/english.php?
> content=..*content*1033*tcinfosys3*11291871243.html&id=__;Ly8vLw!!
> G_uCfscf7eWS!euLXnna7-qCt-D3EjV5-bjzosTfKt-sd4lVcov9BLro2tBUjLRx-
> ed8iuDCVso9vUKL04d9SoJjsUQ8dHHIoBcR89fZiHg$>) and the device support
> documentation doesn't mention possibility of using TSE field to obtain
> hardware timestamp.
> My idea was to convert PTP timestamp to double matching EPICS time
> format, publish it into ai record and use its VAL to set TIME fields of
> other records published by the ADS IOC. I found some tech talk on Soft
> Timestamp device support, but I understand it reads from other record's
> TIME field. Is there a way to use ai VAL field to set TIME of other records?
>
> Thanks,
>
> Karel Majer
>
> *Karel Majer | Senior software developer*
> Phone: +420 266 051 514
> E-mail: karel.majer at eli-beams.eu
>
>
>
>
> *ELI Beamlines Facility|The Extreme Light Infrastructure ERIC*
> Za Radnicí 835, 252 41 Dolní Břežany, The Czech Republic
>
www.eli-beams.eu <
https://urldefense.us/v3/__http://www.eli-beams.eu/
> __;!!G_uCfscf7eWS!euLXnna7-qCt-D3EjV5-bjzosTfKt-sd4lVcov9BLro2tBUjLRx-
> ed8iuDCVso9vUKL04d9SoJjsUQ8dHHIoBcTijQcDzg$>
>
>