09-30-2010 05:27 PM
I have an application that is giving me a stack overflow error with too much CAN traffic. I only need to monitor one message, and if I only have that one message on the bus it works good. As soon as I add the other messages on the bus I get the error, so I figured I could just filter out the ones I don't wan't to read. I put the filter in my code, but I still get a stack overflow when all of the messages are being broadcast. How does the filter work? Do messages go to the memory stack first until a software routine has time to go through and filter unwanted messages?
Solved! Go to Solution.
10-01-2010 10:44 AM
Can you provide more information about your setup. What version of LabVIEW are you using? Perhaps attaching a simple version of your project that is having issues so we can understand the filtering you are doing, etc.
10-01-2010 01:40 PM
I have an update. I first found out that the filter was not working at all. Every message was getting passed through even though they should be filtered out. As I was deleting portions of the code, I noticed that the filter suddenly started working. After a number of iterations and deleting things one by I have it narrowed down. The code as is has a non-functioning filter. If I delete the COM port config's, then the filter starts working properly. If I leave the COM port configs in place and delete where I write messages on CAN2, then the filter works properly. I'm not sure how either one of these could be affecting my CAN1 filter. The attached code is in LabVIEW 2010.
10-27-2010 03:12 PM
11-01-2010 02:06 PM
11-02-2010 02:48 PM
Here is the project file. The two files are the only two in the test application that gave me problems. The test code I sent is a stripped down version of the main application, but the project file is used for both the full application and the test application so when you open the project some files will be missing, but the ones I posted earlier are the only two used for the test application.
11-15-2010 09:24 AM
01-10-2011 09:59 AM
The original application has 1 CAN channel without filtering, and 1 CAN channel with filtering. The order of initialization between the 2 CAN channels was not specified in code and was arbitrarily determined by the compiler. I forced the CAN channel without the filter to be initialize before the channel with the filter and then it works properly.