time-triggered CAN simulation
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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?
0 comentarios
Respuestas (1)
Dimitri MANKOV
el 5 de Sept. de 2023
Editada: Dimitri MANKOV
el 5 de Sept. de 2023
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
0 comentarios
Ver también
Categorías
Más información sobre Real-Time Simulation and Testing en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!