From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

Nothing is happening when sending CAN packets with NI-XNET and USB-8502

Solved!
Go to solution

Hello,

 

We've been struggling with this issue for some time now and we eventually bought a CAN-USB adaptor from a different company, installed the drivers, and used PCAN to verify that it isn't the device or the connections.

 

It seems like I am using the exact same settings in NI-XNET as I am in PCAN and it just will not work. I think the issue might have something to do with the J1939 standard.

 

Here are the settings that I am using in PCAN:

 

Baud rate: 250k

Acceptance Filter: Extended (29-bit ID)

 

ID: 18EF7FFF

Length: 1

Data: 02

Message Type: Extended Frame

 

I transmit this over the bus and I get a message back without any issues when using PCAN.

 

I have attached screen shots of the settings that I am using in NI-XNET.

 

What am I doing incorrectly. Can someone provide some assistance?

 

Also, I have 2 USB-8502s; 1 is a single-port and the other is a dual-port. 

Download All
0 Kudos
Message 1 of 12
(2,427 Views)

In Image 2 of Interface and Database Settings window, under the Applicational Protocol, you need to choose J1939.

In Image 3, under the Frame Type, you might need to choose J1939 as well.

Senior Technical Support Engineer | CLD CTA | NI


DISCLAIMER: The attached Code is provided As Is. It has not been tested or validated as a product, for use in a deployed application or system, or for use in hazardous environments. You assume all risks for use of the Code and use of the Code is subject to the Sample Code License Terms which can be found at: http://ni.com/samplecodelicense

0 Kudos
Message 2 of 12
(2,386 Views)

I've played around with selecting "J1939" under the application protocol and selecting node names and node addresses but the transmit window disappears when I do that. The frame type options are "CAN FD" and "CAN FD + BRS", which I don't think apply. It's just odd that I don't have to select J1939 with the other adapter and software and I am able to transmit 1 byte of data. The hex identifier in Image 3 is in the 29-bit J1939 format.

Download All
0 Kudos
Message 3 of 12
(2,371 Views)

I turned on the error logging and after I transmit my message it is displaying 02 00 00 C9 00 00. I think this means that there is no ACK from another device, or something like that. I'm not sure how relevant this is. 

0 Kudos
Message 4 of 12
(2,346 Views)

Do you have any other devices attached to the bus?  CAN isn't like serial, in that you can't just wire the TX and RX together and be able to see what you are transmitting.  I go over a decent amount of the basics over in Part 1 of my CAN blog.  You need other devices on the CAN bus to basically say "Yeah I see your message and it is valid".  If you don't then the thing sending the message will never say it was sent.  The bus will have all kinds of constant traffic if you put an oscilloscope on it, but the transceiver won't say it was sent because no one was there to acknowledge it.  This acknowledgement feature is something the transceiver handles automatically and only requires that it is powered and wired correctly.

0 Kudos
Message 5 of 12
(2,330 Views)

Yes, I have 1 device on the bus that I was able to communicate with using the USB adapter and PCAN. I did this so I could rule out any issues with the wiring or device I am trying to communicate with. I'm using (I think) all of the same settings in NI-XNET for the USB-8502 but it won't do anything. I even have a second USB-8502 and it doesn't work either. 

0 Kudos
Message 6 of 12
(2,311 Views)

Does anyone have any suggestions? I'm still struggling with this.

0 Kudos
Message 7 of 12
(2,259 Views)
Solution
Accepted by topic author T_Black

Try using two 8502 ports, one reading and one writing. This would be just to verify the ports are working and they are properly connected and terminated (I saw you have switched the termination in the BusMonitor on).

0 Kudos
Message 8 of 12
(2,252 Views)

In theory I should be able to connect the two ports together on the 8502, open two instances of bus monitor, and be able to send and receive signals from one to the other, correct? If that is the case, it is not working. 

0 Kudos
Message 9 of 12
(2,244 Views)

@T_Black wrote:

In theory I should be able to connect the two ports together on the 8502, open two instances of bus monitor, and be able to send and receive signals from one to the other, correct? If that is the case, it is not working. 


If termination and wiring is correct between the two ports, then yes.  Pin 2 goes to pin 2, pin 7 goes to pin 7, and then two 120 ohm resistors between 2 and 7.  You'll need both instances of the test panel running, with the same baud rate.  Oh XNet does support termination so you can turn that on, and not need the resistors wired.

0 Kudos
Message 10 of 12
(2,231 Views)