Simulink CAN timeout on embedded coder

조회 수: 2 (최근 30일)
Marek Laszlo
Marek Laszlo 2016년 8월 14일
댓글: Marek Laszlo 2018년 3월 26일
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
Marek Laszlo
Marek Laszlo 2017년 10월 25일
Hello,
Unfortunately I Didnt but I havent been looking for long because the project stopped at that time. So its still actual and would be happy if someone found how to deal with it.
Birdman
Birdman 2017년 10월 25일
Hi Marek,
Can you share the simulink model(export to R2017a)?

댓글을 달려면 로그인하십시오.

채택된 답변

Marek Laszlo
Marek Laszlo 2018년 3월 11일
편집: Marek Laszlo 2018년 3월 11일
I used TI F28337 MCU that unfortunately doesnt have enhanced CAN module. Only the CAN module. This is unfortunately the reason why you cant receive a message timestamp even if you check it in your receive block.

추가 답변 (1개)

Venkatesh Chilapur
Venkatesh Chilapur 2018년 3월 13일
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.
  댓글 수: 1
Marek Laszlo
Marek Laszlo 2018년 3월 26일
Thank You. I tried this and similar solutions but all failed on the function caller. The problem I could not solve and found other poeple asking for is how to reset the counter if you have only the function caller signal. The ports are imcompatible.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Timers and Scheduling에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by