LabVIEW Embedded

cancel
Showing results for 
Search instead for 
Did you mean: 

How to filter CAN messages on MCB2300?

Solved!
Go to solution

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?

0 Kudos
Message 1 of 11
(7,503 Views)

Howdy,

 

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.

Joshua B.
National Instruments
0 Kudos
Message 2 of 11
(7,495 Views)

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.

Download All
0 Kudos
Message 3 of 11
(7,488 Views)

I'll get my board and test this soon.

Joshua B.
National Instruments
0 Kudos
Message 4 of 11
(7,461 Views)

Hi Joshua,

 

Have you had a chance to test this out?  I have not been able to fix the issue yet.

0 Kudos
Message 5 of 11
(7,385 Views)

Hi jjgors,

 

I am sorry, but this has somehow slipped my work queue. I have not tested this yet.  I will be working on this now.

Joshua B.
National Instruments
0 Kudos
Message 6 of 11
(7,352 Views)

I am having trouble reproducing, can you attached your LabVIEW project and all your VIs as well, just to make sure I am not missing anything.

Joshua B.
National Instruments
0 Kudos
Message 7 of 11
(7,314 Views)

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.

0 Kudos
Message 8 of 11
(7,303 Views)

Hi jjgors,

 

I just wanted to update you that I am still looking into this and I haven't forgot about you...

Joshua B.
National Instruments
0 Kudos
Message 9 of 11
(7,233 Views)
Solution
Accepted by topic author jjgors

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.

0 Kudos
Message 10 of 11
(6,939 Views)