How to send n number of messages through standard can pack unpack and speedgoat IO blocks
77 views (last 30 days)
Show older comments
AKHILA
on 25 Nov 2024 at 5:55
Commented: Dimitri MANKOV
on 9 Dec 2024 at 17:39
Hi,
I am simulating my slx file having standard can pack unpack blocks along with J1939 blocks in real time using speedgoat IO blocks in loopback model. But having a delay in the receiving those signals when number of messages are more. I am chnaging in SLRT explorer but signal is not received in another block for a long time. But working fine wiht J1939 blocks, only standard CAN is having problem. Can someone explain why there is a delay and how to overcome those
Accepted Answer
Dimitri MANKOV
on 3 Dec 2024 at 16:43
Hi Akhila,
Could you please provide more details about that you mean by "I am changing in SLRT explorer but signal is not received in another block for a long time"? Do you mean there's a delay between the moment that you update a parameter value and the moment when...:
- ... that parameter gets updated on the target machine, or
- ... the corresponding signal change is refected on the CAN bus?
Does this affect any signals, or only signals that are fed to CAN blocks? Does this happen only when you try to send more than X messages? Have you considered the average load of your CAN bus?
To answer your main question, you can find examples showing how to send any desired number of messages through standard CAN Pack / Unpack and Speedgoat IO driver blocks on the Speedgoat website here.
Bear in mind that any CAN bus has a limited bandwidth, and that you cannot send more than a certain amount of messages per second. That number of messages depends on the payload of each CAN message, on the selected baudrate, on the other devices connected to the bus, etc. The "CAN Status" blocks from the Speedgoat I/O Blockset can help you estimate how far away you are from reaching the max. load / capacity of your bus.
I hope this is helpful!
Dimitri
2 Comments
Dimitri MANKOV
on 9 Dec 2024 at 17:39
Hi Akhila,
It sounds like you're using CAN Read blocks in a "Single read from FIFO buffer" mode: when more than one message is received every time step, you must empty the entire message buffer every time step to see all new messages. Otherwise, you will read less messages that you are receiving, causing the CAN messages to accumulate in the buffer, and you will see the new messages in your model several time steps too late.
Please have a look at the Usage Notes for CAN driver blocks in the Speedgoat documentation here:
More Answers (0)
See Also
Categories
Find more on Target Computer Setup in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!