04-01-2021 10:54 AM
Using the NI-XNET C API Loopback Test Example, baud values of 125k or less work as expected receiving exactly what was transmitted. Whenever I change the baud rate in the CAN database to any value above 125k baud, the loopback no longer works (received payload is all 0's).
Driver used: NI_XNET 20.0
Hardware used: USB-8502
Using this Example Visual Studio Project:
C:\Users\Public\Documents\National Instruments\NI-XNET\Examples\MS Visual C\CAN\CAN_Loopback_Test
Using this Example CAN Database:
C:\Users\Public\Documents\National Instruments\NI-XNET\Examples\NIXNET_example.xml
I tried setting the following properties as well to no avail: nxPropClst_BaudRate64 nxPropSession_IntfBaudRate64
Solved! Go to Solution.
04-01-2021 10:57 AM
Hi,
you need to add termination to your CAN bus, either with external termination resistors or by setting the XNET Termination property to enabled on your two sessions before writing anything.
04-01-2021 11:06 AM
Thanks that solved it! Should have read the comment at the top of the file.
// Please make sure that the bus is properly terminated as this example does not
// enable the on-board termination. Also ensure that the transceivers are
// externally powered when using C Series modules.
08-07-2024 01:07 AM
Hi.
I have the 120Ohms resistor externally but, I still having the timeout. My usb8502 is one port only, should be this the issue? What is wrong? Thanks
08-07-2024 07:52 AM
You should make your own post. If you are new to CAN you should checkout my CAN Blog.
https://hooovahh.blogspot.com/2017/03/can-blog-introduction-and-downloads.html
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
16 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
08-07-2024 08:37 AM
Does it work for you at lower speeds?
08-07-2024 09:24 AM
Yes. I am new in CAN. That i why I am looking for answers to help me to understand. Thanks for the blog link I will read it all.Thanks
08-07-2024 10:52 AM
This is what I got from LabVIEW and the CAN 120ohm termination. is it ok?
Thanks
08-07-2024 11:33 AM
The example you showed will write on one port, then read it back on a second port that is wired together. You only have one port, so I'm not sure what you were expecting to happen. It timed out because it couldn't read anything.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
16 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
08-07-2024 12:00 PM
Hello.
Yes Hooovahh. At the beginning I was thinking about the second port but, I was expecting to see some response once I plugged the 120Ohm. As you may know I am a beginner and i am trying by practically to understand what is happening with this example. But It seems that it does not work. So, until I have a second port I will see the final response.