Send and Change CAN messages periodically

4 次查看(过去 30 天)
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 :)

回答(1 个)

Urmila Rajpurohith
Urmila Rajpurohith 2019-8-23
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.

类别

Help CenterFile Exchange 中查找有关 Vehicle Network Toolbox 的更多信息

产品


版本

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by