LabVIEW Embedded

Showing results for 
Search instead for 
Did you mean: 
Reply

How to filter CAN messages on MCB2300?

Solved!
Go to Solution
Highlighted

How to filter CAN messages on MCB2300?

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 (3,683 Views)
Reply
0 Kudos

Re: How to filter CAN messages on MCB2300?

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.

0 Kudos
Message 2 of 11 (3,675 Views)
Reply
0 Kudos

Re: How to filter CAN messages on MCB2300?

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.

0 Kudos
Message 3 of 11 (3,668 Views)
Reply
0 Kudos

Re: How to filter CAN messages on MCB2300?

I'll get my board and test this soon.

0 Kudos
Message 4 of 11 (3,641 Views)
Reply
0 Kudos

Re: How to filter CAN messages on MCB2300?

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 (3,565 Views)
Reply
0 Kudos

Re: How to filter CAN messages on MCB2300?

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.

0 Kudos
Message 6 of 11 (3,532 Views)
Reply
0 Kudos

Re: How to filter CAN messages on MCB2300?

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.

0 Kudos
Message 7 of 11 (3,494 Views)
Reply
0 Kudos

Re: How to filter CAN messages on MCB2300?

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 (3,483 Views)
Reply
0 Kudos

Re: How to filter CAN messages on MCB2300?

Hi jjgors,

 

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

0 Kudos
Message 9 of 11 (3,413 Views)
Reply
0 Kudos
Solution
Accepted by topic author jjgors
‎08-27-2015 06:09 PM

Re: How to filter CAN messages on MCB2300?

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 (3,119 Views)
Reply
0 Kudos
//this script is to ensure MY ACCOUNT is loaded and then paste the info into the nav