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일

0 개 추천

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

카테고리

도움말 센터File Exchange에서 Real-Time Simulation and Testing에 대해 자세히 알아보기

태그

질문:

2015년 3월 27일

편집:

2023년 9월 5일

Community Treasure Hunt

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

Start Hunting!

Translated by