CAN message processing

Hi folks, first-time poster here. :slight_smile: I’m prototyping a project that needs to monitor the CAN and parse messages that are coming in. It appears that the current design of CANDW is to pull available messages off the underlying CAN object and post them to the dispatcher thread so anyone listening to the MessagesReceived event on CANDW can receive them. However, the issue I’m seeing is that any other activity on the dispatch thread will negatively impact the ability to handle messages fast enough resulting in the RX overruns. To try to combat this, I’ve modified the CANDW source to not post message back to the dispatch thread instead relying on a custom thread that reads message directly from the CANDW’s underlying CAN object. This helps somewhat but I’m worried that even on a FEZRaptor I may not be able to handle messages fast enough on a relatively loaded network with other non-CAN processing going on. Is the solution to this to move some processing into native code inside the CAN object and leave managed code to do my other non-CAN related tasks?

Does anybody have experience in CANW processing on a really busy (CAN) network in managed code? Is it feasible?

@ jterrell - What is, in your terms, “a really busy” bus? It is not clear which device you use, but Raptor can certainly parse thousands of messages per second, using GHI CAN implementation.

What is CAMDW?

Dispatcher thread? Are you using Gadgeteer?

@ Simon from Vilnius - I’m reading, currently, up to 400 message/sec. If the Raptor can read thousands, as you’ve stated, I’ll look to see whether my parsing routines are allocated memory unnecessarily.

Thanks for the response.