Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

Disconnecting from RT target after sometimes downloading the NI-CAN program

Hi all,

I have a problem here. After several time downloading my VI onto RT target, the RT always disconnect, and I need to restart the RT with force (I can not reboot from MAX). I suspect because of the NI-CAN, but as far as I know I always close the channel (object).

Here's my sw & hw configuration:
LV RT 8.5
NI-CAN 2.5.2 (PXI-8461 2 ports)
PXI 8106 controller
CANOpen library

I really appreciate for your helps. Thank you

Bondhan




Message Edited by bono02 on 02-04-2008 01:05 AM
0 Kudos
Message 1 of 9
(8,661 Views)
Bondhan,

So this behavior only occurs after running your program multiple times?  I would recommend trying to isolate the problem by cutting out sections of code in your application.  If you remove all the CAN functions, does this behavior still occur?  If it does, then it might be something else in your real-time application.  If not, then we know that you must not be doing something write with your CAN code.
0 Kudos
Message 2 of 9
(8,638 Views)
This function only happen with the CANOpen function. Is it possible that some kind of buffer or memory in the CAN chip is full, or is it that the frames will always reside on the CAN chip until we turn off the PXI? Because it often occurs that Queue Overflow error and I can not switch to the "Stop Remote Node" which always produce error.

Thank you.
0 Kudos
Message 3 of 9
(8,632 Views)
Howdy bono02,

When do you use Stop Remote Node in your application? It sounds like it isn't called at the right time, which results in an eventual overflow. You should use the Stop Remote Node right before calling the final CANopen Close VI.

Since you mention a Queue Overflow error specifically, I thought it might be helpful to mention the following KnowledgeBase article, What Causes Queue Overflow with NI-CAN? It mentions the two common causes for overflowing queues and how to correct it.

If you want, you can post an simplified version of your application that exhibits the problem you see in your full-size application, and we would be happy to look it over with you.
Warm regards,

pBerg
0 Kudos
Message 4 of 9
(8,598 Views)
Hi pBerg, thank you for your response. I did like what you have told me, please find the attachment file.
Now the problem is, if I run the program for a short time the error is usually not coming out, but if I run the program
for quite long time the error occurs (please find the attachment).

Do you know what could be wrong in my program?

Thanks.

Bondhan
0 Kudos
Message 5 of 9
(8,498 Views)
Howdy bono02,

That screenshot tells me that your application results in a queue overflow error. I would advise trying the two suggestions listed to prevent this error: (a) Configure the Net Interface Object mask and comparators to filter out some frames, which will reduce the number of messages entering the queue, and/or (b) Reduce the overall traffic on the bus by sending less messages or decreasing the rate at which you send messages.
Warm regards,

pBerg
0 Kudos
Message 6 of 9
(8,404 Views)
Thanks pBerg for your reply,

I have been wondering how to do:
        "a) Configure the Net Interface Object mask and comparators to filter out some frames, which will reduce the number of messages entering the queue, and/or "
Since I am using can open library, and I can not find vi for this.

and for "(b) Reduce the overall traffic on the bus by sending less messages or decreasing the rate at which you send messages." I have already put every 5 ms delay to the while loop, but somehow the error is still happening if I run the program more than 5 minutes.

Can you help me with this problem?
0 Kudos
Message 7 of 9
(8,359 Views)

Unfortunately (a) doesn't work since this filter setting only works for the NI-CAN driver directly. The CANopen library cannot set these filter attributes.  Thus only option (b) makes sense here. My guess is that the "stop remote node" command still comes to late, thus you are facing this overflow issue, as pBerg mentioned earlier.

Try to stop the remote node before you stop or close anything else.

You could use the NI-SPY, which comes with the NI-CAN driver to log your api calls, thus you can see when the error exactly happens.

DirkW

0 Kudos
Message 8 of 9
(8,328 Views)
I can not use the NI-SPY since I am using the LV-RT. Smiley Sad
Btw, will there be any problem If I don't execute the stop remote node just by killing the PDO objects? Thx




Message Edited by bono02 on 03-01-2008 11:46 PM
0 Kudos
Message 9 of 9
(7,862 Views)