MATLAB Answers

0

Send and Change CAN messages periodically

Asked by Mario Seiler on 19 Aug 2019
Latest activity Answered by Urmila Rajpurohith on 23 Aug 2019
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 :)

  0 Comments

Sign in to comment.

1 Answer

Answer by 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.

  0 Comments

Sign in to comment.