time-triggered CAN simulation

3 次查看(过去 30 天)
Ruoshi Zhang
Ruoshi Zhang 2015-3-27
Hi everyone,
I would like to build a model to test my time-triggered CAN communication. so for example I got 3 messages and I would like to transmit them in such way: message 1 transmit a 2.5s; message 2 transmit at 3.5s; message 3 transmit at 4.5s. overall their period is 5s (like message 1 is been transmitted at 2.5s, 7.5s and so on).
so I use 3 CAN transmitting blocks and set their period as 5s. now how can I change the time offset so the transmission time sync with my message?
and also, how can I execute simulation in real time?

回答(1 个)

Dimitri MANKOV
Dimitri MANKOV 2023-9-5
编辑:Dimitri MANKOV 2023-9-5
Hi Ruoshi,
There are several approaches to real-time simulation, including Simulink Real-Time and Simulink Desktop Real-Time. Which one is best for your project will depend on your requirements and hardware available.
As to the sequencing of your CAN messages, maybe a modelling approach based on enabled subsystems containing your "CAN Transmit" blocks would be the easiest to implement. For example, you could build a state machine running at a higher frequency (e.g., every 0.5 second) that generates 3 pulses based on the current simulation time value, and use each of those pulses to enable the desired subsystem at the right time. Does this make sense?
Best,
Dimitri

类别

Help CenterFile Exchange 中查找有关 Real-Time Simulation and Testing 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by