NI Home > Community > NI Discussion Forums

LabVIEW Embedded

Showing results for 
Search instead for 
Do you mean 
Reply
Member
jjgors
Posts: 38
0 Kudos
Accepted Solution

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?

Active Participant
DiscoBall
Posts: 288
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.

Member
jjgors
Posts: 38
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.

Active Participant
DiscoBall
Posts: 288
0 Kudos

Re: How to filter CAN messages on MCB2300?

I'll get my board and test this soon.

Member
jjgors
Posts: 38
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.

Active Participant
DiscoBall
Posts: 288
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.

Active Participant
DiscoBall
Posts: 288
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.

Member
jjgors
Posts: 38
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.

Active Participant
DiscoBall
Posts: 288
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...

Member
jjgors
Posts: 38
0 Kudos

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.