06-27-2024 12:16 AM
I'm trying to understand how the cDAQ Ethernet TSN systems with PTP.
Is there any way to get the PTP timestamps associated with the data samples?
I don't want host computer time or anything but the hardware PTP timestamp from the cDAQ.
I have looked through both the nidaqmx Python and C APIs, and can find the sample read functions, but am less sure about PTP timestamps.
I have a PTP-aware network with other devices that are sending out PTP timestamps with the data they are acquiring.
I'd like to integrate analog and digital input acquisition into this network synced to these PTP timestamps.
I am assuming that the cDAQ-9185/9189 can be synced to a third-party PTP server. Is this correct?
I have read through these two documents:
https://www.ni.com/docs/en-US/bundle/ni-daqmx/page/timestamps.html
https://www.ni.com/docs/en-US/bundle/ni-daqmx/page/firstsampletimestamp.html
and it would seem like the "first sample timestamp" may be what I am looking for, but it is not terribly clear.
In my ideal world, I would do this with Python.
It seems like the Timing.first_samp_timestamp_val property may be what I am looking for.
Is this the PTP timestamp of the first sample returned from a given task?
Thank you for any guidance!
Solved! Go to Solution.
06-27-2024 11:20 PM
Just to provide an update here, I heard back from NI tech support and the above described understanding is indeed correct.
The cDAQ 9185/9189 systems (and probably all the network-synchronized devices listed here) support PTP syncing. Once PTP syncing is turned on, the first sample timestamp for a given task will be set to the PTP time of that sample. The nidaqmx Python library has access to this value of a given task through the nidaqmx.task.Timing.first_samp_timestamp_val read-only property.