Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

Timestamp of CAN Frame Sent Over Ethernet

Highlighted

Timestamp of CAN Frame Sent Over Ethernet

Hi All,

 

I am using a PXI chassis with an  PXIe-8840 embedded controller and PXIe-8510 card as my XNET hardware

 

I have a CAN frame which is sent over the CAN bus, it is then converted to an Ethernet packet using some serializer logic inside my DUT. I can connect to my Ethernet connection and see the serialized frame, but I need to be able to calculate the time it takes for the CAN frame to be tx'd over the bus until it is received by the Ethernet connection on the other side.
I have done this before with CAN to CAN where I used the trigger lines to sync the XNET devices all together and get a T0 to run my measurements off.


So my question is now, is there any Ethernet card that I could find for my PXI Chassis that would accept a Trigger as a sync the same as the XNET cards do? That way I would be able to accurately calculate the tx time since the XNET device and the Ethernet Card would be in sync.

 

Thanks for any help/ideas in advance!

0 Kudos
Message 1 of 10
(484 Views)

Re: Timestamp of CAN Frame Sent Over Ethernet

Anyone have any input/help on this topic??

0 Kudos
Message 2 of 10
(390 Views)

Re: Timestamp of CAN Frame Sent Over Ethernet

Hello,

 

NI's PXI Ethernet Modules can be viewed here:

http://www.ni.com/en-us/shop/select/pxi-ethernet-interface-module

 

However, I am not sure if those will work for your application. What path is the CAN frame taking once it gets to the DUT? Does it go through a CAN bus and then get converted to Ethernet?

 

Anson K

National Instruments

www.ni.com/support

0 Kudos
Message 3 of 10
(378 Views)

Re: Timestamp of CAN Frame Sent Over Ethernet

Hi Anson,

Basically I have a CAN frame which is sent over the XNET CAN bus to our DUT, it is then converted to an Ethernet packet by the DUT and transferred out as a UDP packet. Currently I read this Ethernet frame in Labview via the PXI controller. However I need a more deterministic approach to this which does not involve the overhead of windows to read the Ethernet packet.

 

It is easy to read the latency of CAN to CAN using the hardware timestamps provided by the XNET CAN frame, however when I leave the XNET world and try to read an Ethernet frame via LabVIEW running a windows OS the timestamps cannot be trusted anymore.

 

So do you know of any solution that allows me to read the timestamp of a received UDP packet which is in sync with the XNET timestamp in my PXI chassis?

 

Thanks

0 Kudos
Message 4 of 10
(372 Views)

Re: Timestamp of CAN Frame Sent Over Ethernet

The attached picture of my setup might help explain things better.

 

CAN to Ethernet Setup.png

0 Kudos
Message 5 of 10
(369 Views)

Re: Timestamp of CAN Frame Sent Over Ethernet

Although my expertise lies on the XNET side of things, I think the PXI-6683 might be able to provide an accurate timestamp for the Ethernet traffic. Assuming the PXI-6683 can detect and timestamp normal Ethernet traffic, it has multiple options for trigger import/export that work well with any XNET hardware.

Jeff L
National Instruments
0 Kudos
Message 6 of 10
(362 Views)

Re: Timestamp of CAN Frame Sent Over Ethernet

Thanks for your reply Jeff,

 

Is there any way to find out if the PXI-6683 will allow me to timestamp an incoming UDP packet? If so this is exactly what I need. I cant imagine I am the first to have this problem?

 

Thanks

0 Kudos
Message 7 of 10
(356 Views)

Re: Timestamp of CAN Frame Sent Over Ethernet

 

You might want to look into winpcap.  It provides a low level packet API, with a timestamp provided by the operating system.

0 Kudos
Message 8 of 10
(355 Views)

Re: Timestamp of CAN Frame Sent Over Ethernet

Hi JGruenberg,

 

Unfortunately I don't think Winpcap would work in my situation since that timestamp would still be relative to windows system time and completely out of sync with my XNET timestamps/clock. I wish the PXI 6683H could timestamp incoming packets, I cant believe this is so hard or hasnt been done before but still haven't found a solution.

0 Kudos
Message 9 of 10
(331 Views)

Re: Timestamp of CAN Frame Sent Over Ethernet

I agree that your use case seems like it should be relatively straightforward to implement. Unfortunately it is looking to be a bigger challenge than I expected.

 

I found this forum post which ask a very similar question. It seems the PXI-6683  isn't capable of time-stamping arbitrary Ethernet packets. It seems the suggested work-around is to obtain a network interface device that transmits a trigger signal when it receives a UDP packet. The trigger signal can then be used by XNET hardware to generate a timestamp frame.

Jeff L
National Instruments
0 Kudos
Message 10 of 10
(328 Views)