How can I make sure that the Simulink CAN Replay block replays messages with correct timing?

4 次查看(过去 30 天)
I want to replay a CAN-log on a PEAK CAN-USB converter. Therefore I use the Simulink CAN-Replay block. It seems like it is working, but I'm not sure wether the messages are replayed with the correct timing.
The documentation says, that the CAN-Replay block uses the timestamp from the Vector .asc file where the messages are stored. But there is a "Sample Time" which can't be set to -1 (as inheritet from the file). If I adjust the sample time, the messages are replayed in a shorter time.
How can I make sure, that the messages are replayed following the original timestamp?
Thanks and regards,
Dietrich

回答(1 个)

Prashant Arora
Prashant Arora 2017-4-27
Hi Dietrich,
The block does use the timestamp from original file. However, when you replay to a network, the timestamps correlate to real time, and when you replay to the output port it correlates to simulation time. Using the Sample Time, Simulink decides on block execution rate during simulation. If you are playing messages in Simulink, you can force your model to "pace" like real-time using something like a Simulation Pace block.
Hope this helps!

Community Treasure Hunt

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

Start Hunting!

Translated by