Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

How to determine the latency time?

Hi
How do I determine the latency time?
I need to connect 3 CAN nodes onto the CAN bus and need to know how to determine the delay(latency) time needed between the transmission of a message from one node and reception at the other,
The latency time and Bandwidth both play a role in the transmission, right?
 
Thanks
Ekta
0 Kudos
Message 1 of 4
(3,904 Views)
Hi Ekta,

The latency normally depends on the length of the cable you are using, and you can measure it using timestamps. If you turn on self reception, you'll have the timestamps from both the receiver and transmitter ends. You can enable self reception with the ncSetAttr VI by selecting "Self Reception?" as the AttrId, and 1 as the AttrValue. Please note that since you are transmitting from three nodes, the message with the highest priority(lower arbitration ID) will be transmitted first. Because of this, you might see a higher latencies with lower priority messages.  Hope this helps.

Regards,
Ebele O.
National Instruments
0 Kudos
Message 2 of 4
(3,875 Views)

Hi Ebele,

Thanks for your reply.

Since this is my first experience in setting up the nodes from scratch, I would need more help in this matter.I am not really aware of these commands "ncSetAttr VI by selecting "Self Reception?" as the AttrId, and 1 as the AttrValue. " and where and how to set them.

As of now, we just have 3 can cards and connectors to connect the same.What is the software needed to set up these attributes of these commands? Please elaborate more lower level basic details on the same as it will be helpful.

I do know that CAN protocol supports priority based transmission where a lower value message identifier has higher priority but how to set what messages will a node transmit and their message identifiers and also how to set the nodes to receive some of them from the bus?

Also, what would be the approach if these are not NI cards as well.

Thanks,
Ekta

0 Kudos
Message 3 of 4
(3,869 Views)
Hi Ekta,

The software you need if you are using an NI board is NI-CAN, and you can look at the driver download page for the appropriate version for your operating system. I'll suggest you take a look at the example programs that install with that driver to get you started. If you are developing using LabVIEW or LabWindows/CVI, go to Help>>Find Examples>>Hardware Input and Output>>CAN for examples. If you are using Visual Basic or C, go to ...\National Instruments\NI-CAN for examples. I have also attached a LabVIEW example below that shows how to enable self reception.
If you are using another vendor's CAN board, you will need to install their driver, and see if they have any examples to get you started. I assume the approach for measuring the latency will be similar to what I suggested. Hope this helps. Goodluck!

Regards,

Message Edited by _Belle on 04-28-2006 07:42 AM

Ebele O.
National Instruments
0 Kudos
Message 4 of 4
(3,853 Views)