Simulink CAN communication not restoring after disconnecting

1 次查看(过去 30 天)
Hello,
I have an infinitely long simmulation running in Simulink where I use CAN communication with a Peak USB PCAN device.
To read the CAN I use the simulink CAN Receive block together with the CAN Unpack block.
Now I saw that when I disconnect the CAN line from the PCAN while my simmulation is running the received CAN values obviously stopped working and were frozen to the last received value.
When I reconnect the CAN line (still while my simmulation is running) the CAN values are not restoring.
The CAN communication is only restoring when I stop my simmulation and start it again.
Is there a way to have the CAN communication in simulink working again without stopping and starting the simmulation again?

回答(1 个)

Divyanshu
Divyanshu 2023-12-12
Hi Damien,
I understand that you are using CAN communication with some USB PCAN device, and are looking for ways to reconnect the CAN Line without restarting the simulation, after disconnecting the CAN line.
There is no such direct way to get the CAN line connected without restarting the simulation.
However, you can try using 'ModelOperatingPoints' where you can store the states of model and can restore them. Please refer the following documentation for better understanding:

类别

Help CenterFile Exchange 中查找有关 Sources 的更多信息

标签

产品


版本

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by