Send and Change CAN messages periodically

1 view (last 30 days)
Hello,
I want to send a CAN message and then open a function or sth. to change the message and send it again. But it is important for me that the CAN message is sent periodically e.g. in 100ms and in between i want to change the message.
I already have read this guide how to send can messages periodically:
But there is nothing mentioned about my problem.
Is there a way to have a variable that changes or an event that happens when an as periodic defined CAN message is sent?
Or is there an other (better) way to do this? In Simulink is the Vehicle Network Toolbox, maybe its possible to do this in Simulink?
Thank you for your help :)

Answers (1)

Urmila Rajpurohith
Urmila Rajpurohith on 23 Aug 2019
In Simulink using Vehicle Network Toolbox you can use “CAN Pack” block as it loads signal data into a message at specified intervals during the simulation. By setting “Data is input as" option to “manually specified signal” in block parameters of “CAN Pack” block.
And select the “Transmit messages Periodically” box in Block Parameters of “CAN Transmit” block.
You can refer to following documentation link for more information on “CAN Pack” block.

Products


Release

R2019a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!