Purpose

Gets timestamp information about the first/last send/received frame of the ISO TP for CAN and LIN.

Format

        void ndGetTimeStamp (
       TD1 *diagRef,
       unsigned long long *timeStampWriteFirst,
       unsigned long long *timeStampWriteLast,
       unsigned long long *timeStampReadFirst,
       unsigned long long *timeStampReadLast);
      

Input

diagRef

Specifies the diagnostic session handle, obtained from ndOpenDiagnosticOnCANFD or ndOpenDiagnosticOnLIN and passed to subsequent diagnostic functions. Normally, it is not necessary to manually manipulate the elements of this struct. Output

timeStampWriteFirst

Contains the timestamp of the first write frame. This is usually the FF or SF of the ISO TP.

timeStampWriteLast

Contains the timestamp of the last write frame. This is usually the CF or SF of the ISO TP.

timeStampReadFirst

Contains the timestamp of the first read frame. This is usually the FF or SF of the ISO TP.

timeStampReadLast

Contains the timestamp of the last read frame. This is usually the CF or SF of the ISO TP. Description

Use this function to get the first and last write CAN or LIN frame and the first and last read CAN or LIN frame if the ISO TP transport protocol is used. For all other transport protocols, the timestamps are always 0.
Note   The write timestamps are the approximate times of enqueuing the frame, not the times when the frame goes out on the bus.

The received timestamps should be converted to system time using the FileTimeToLocalFileTime and FileTimeToSystemTime functions. Add <windows.h> to your project for this.

The UDS Get DTCs example includes an example for getting the timestamp.