Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

In setting up xnet code (CAN J1939) on 9860 it will only transmit about 20 times and then stops

Solved!
Go to solution

Good afternoon,

I am working to implement a CAN bus control of a piece of construction equipment useing the NI-9860 CAN module and the XNET database which I setup through he editor.  I been through most of the tutorials and have it setup mostly but I have hit an issue. 

I run a simple program just to test my messages and I see the message I expect (I am connected directly to a PCAN adapter).  But I it only send about 20 messages then stops.  I get no errors in the code.  I can't post the database and the code is pictured below.

Basically I have my message setup as Cyclic,

I am writing to just one DB (the only one that the data changes in)

I expect the message to be sent at my Cyclic Rate Until I stop the APP and send the Default values for the rest of the frame which it does but only about 20 times.

 

Thanks in advance for any help!

Gene

CodeCodeSession SetupSession SetupFrame Setup in DBFrame Setup in DB

0 Kudos
Message 1 of 5
(3,470 Views)


Interesting. Nothing about your VI or DB immediately jumps out at me as problematic. I would expect it to send cyclic messages indefinitely. 

 

Do you see the same results if you create a session with the create session VIs instead of the I/O control?

CreateSession.PNG

Jeff L
National Instruments
0 Kudos
Message 2 of 5
(3,448 Views)

I will give it a try.  My only other theory is I dont have a termination resistor and this causes some sort of errors at the HW level that adds up.  I am connected directly from my 9860 to the PCAN adapter.  But now that I think about it I do have my equipment connected also and it is not powered.  Still seems like a stretch.  

0 Kudos
Message 3 of 5
(3,446 Views)
Solution
Accepted by topic author GeneHancock

You can throw a property node into the code immediately after the create session to turn on Interface:CAN:Termination and rule it out.

 

Failing that my thoughts are that we may have a bug or something in the Session I/O Controls which my sample code should help us confirm or reject.

Jeff L
National Instruments
Message 4 of 5
(3,445 Views)

Thanks Jeff!  All I had to do was enable the termination resistor wit the property node and all is well.  I suppose it is possible that it was still sending messages and the PCAN adapter gave up due to to many errors.  But I think the 9860 stopped sending but I couldn't find a way to tell that at run time

0 Kudos
Message 5 of 5
(3,434 Views)