eCAN received message status

조회 수: 8 (최근 30일)
Khashayar Olia
Khashayar Olia 2019년 5월 27일
답변: Venkatesh Chilapur 2019년 5월 31일
Hello,
I have a software in Simulink that reads and writes CAN messages using LAUNCHXL-F28069MLAUNCHXL-F28069M. Here is a snapshot of my CAN receive setup:
Untitled.jpg
An here is inside of the subsystem and eCAN RCV block settings:
Untitled1.jpg
Untitled2.jpg
The system works pretty well, the problem is when the transmitter node on the CAN bus stops sending the message, the CAN receive block shows the last value. I need to find out when the transmitter stops sending the message, so I can fault out or take an action.
I have enabled the "otuput status" from CAN Unpack block which gets activated when a message is received but it remains active even if the tranmistter stops sending the message.
Any advice would be appreciated,
Thanks,
Kash Olia

답변 (3개)

Venkatesh Chilapur
Venkatesh Chilapur 2019년 5월 28일
Hi,
You may probably try to use the C28x Hardware interrupt block and react to a recieved CAN message by reading the same. Use a counter to see how much time needs to elapse before you don't see next interrupt coming, based on which you can take a call that other Node has stopped transmitting the data.
An example where the HW interrupt block is used:
More info on the block itself.
Regards,
Venkatesh C
  댓글 수: 1
Khashayar Olia
Khashayar Olia 2019년 5월 28일
Hi,
Thanks for your reply.
The problem with interrupt is there are only two interrupts associated with CAN (ECAN0INTA and ECAN0INTB) while I have almost 25 messages for which I need to monitor the receive status.
--Kash

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


Venkatesh Chilapur
Venkatesh Chilapur 2019년 5월 29일
Hi,
Each of the available mail box can trigger the interrupt when they send/receive the CAN message.
The mail box that caused the interrupt can be decoded from CAN module registers which will hold the mail box number. So considering this approach, the ISR can be written to get the Mail box number first and then read the message from that location. Please refer the device technical reference manual for more details on the CAN interrupt functionality.
Regards,
Venkatesh C
  댓글 수: 1
Khashayar Olia
Khashayar Olia 2019년 5월 30일
Hi Venkatesh,
Thanks for your help, I modified the software to trigger an interrupt and then read the message. I had to locate the CAN UnPack block inside the Funtion Call Subsystem triggerd by interrupt. How can I access to CAN ISR registers inside the Simulink?
Thanks,
--Kash

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


Venkatesh Chilapur
Venkatesh Chilapur 2019년 5월 31일
Hi,
Here is the clue.
The same can be used to read from CAN registers.
Regards,
Venkatesh C

카테고리

Help CenterFile Exchange에서 Simulink Functions에 대해 자세히 알아보기

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by