Simulink CAN timeout on embedded coder
7 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Marek Laszlo
el 14 de Ag. de 2016
Comentada: Marek Laszlo
el 26 de Mzo. de 2018
Hello,
I am coding in Simulink using c2800x package, Embedded coder and Vehicle Networks Toolbox. I am using CAN bus in my application. What I could not solve is how to detect that I didnt receive message in some time (timeout. My code model is encapsulated in function call block of 100hz. Each eCAN receive block has its function call that calls can unpack. I tried to use CAN unpack timestamp or cantimeout block but it doesnt work on target. So I was trying to run some type of down counter outside of the can handling function block and reset it always when can message is received. Actually I didnt found any way to reset the counter out of the CAN receive function call. Mostly it wanted to use transition block which is not suitable. Any suggestions how to get some type of normal simulink signal out of that call or other way around?
Thank You for help.
3 comentarios
Respuesta aceptada
Más respuestas (1)
Venkatesh Chilapur
el 13 de Mzo. de 2018
You can create a counter and reset it when you get a CAN message (from the function call of the CAN block or an interrupt). If the counter reaches the timeout value before a CAN message is received, then we can trigger a specific subsystem.
Ver también
Categorías
Más información sobre Timers and Scheduling en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!