1

Topic: CAN - Reading several packets at once

Hello

I need to ready several CAN packets and process the results. In the documentation, the example is reading only one packet.
What would be the best way of doing the flow in Cannylogic to read several packets at once?

Thank you for your help!

2

Re: CAN - Reading several packets at once

Maybe attached diagram will be helpful. If not, please provide more details.

Post's attachments

Attachment icon 4ch.cfd 3.53 kb, 307 downloads since 2019-12-05 

3

Re: CAN - Reading several packets at once

Hello

Thank you, so 16 max.

Stephane.

4

Re: CAN - Reading several packets at once

lelsteph wrote:

so 16 max.

Only if you will use filtering mode.

If the filtering mode is not switched on, you will receive every message (adjusted for controller performance).

5

Re: CAN - Reading several packets at once

Hello

What do you mean?
Can I have many times a check on CAN RX IDL?
Then how this work? The Micro Controller receives all packets in a queue. How are they parsed? One packet per loop?

Stephane

6

Re: CAN - Reading several packets at once

You must check 'CAN Data Received' register.
If it =1 then CAN message reading registers set contain actual last received message.
You can proceed one message per diagram loop.
The loop time depends of diagram size, controller perfomance and driver's load.
For CANNY 7 the diagram loop time is from <1 ms for small diagrams to ~10 ms on biggest.
You can get last loop time in milliseconds in spetial register.
Please visit https://wiki.cannylogic.com for more information.

7

Re: CAN - Reading several packets at once

Hello

OK. So considering a CAN Bus at 500kbps, the loop time will be too slow so we will overflow? This is why it is far better to use the filters?

Steph

8

Re: CAN - Reading several packets at once

Better considering CAN utilization rate, not baudrate.
Anyway, you have CAN Overflow register for diagnostic.
Internal 16-messages deep CAN RX buffer may help in some cases.
Also filters can be changed on the fly.
What exactly are you going to do with the controller if you are going to?
Can you provide details of your task?

9

Re: CAN - Reading several packets at once

Hello

It will be connected to the CAN BUS of a car (so there are tons of packets) to create a security module.

Steph

10

Re: CAN - Reading several packets at once

CANNY are widely used in car security area. Maybe you should try it. You may not need as much different IDs to listen as it seems.

11

Re: CAN - Reading several packets at once

Yes so back to the point it is required to use the Filtering capability.
Steph.