Hi,
Is there anyway to determine the time since the last CAN message was received?
Thank you,
Fernando
解決済! 解決策の投稿を見る。
Hello fernando.barrios@uwaterloo.ca,
I get where are you coming from now - for this I would suggest you use the Get bus tick block - you can find it in the Utility Blocks section. I would suggest you do like this:
Let us know if you find this approach satisfying.
Kind regards,
Razvan.
That is exactly what I need, thank you for the help!
Fernando
Hola Fernando,
I haven't tested this yet, but from what I can see the FCAN_Isr block has the Timestamp output, this should give you the timestamp for each CAN message received depending on the Event you have selected. I assume you are using the "Rx Complete" event. If that's the case, you should be able to read each timestamp and compare with the previous message and determine if it arrived within the time you expected.
Hello fernando.barrios@uwaterloo.ca,
As always gramirezv is right! Sorry for the delayed message. You can compare the timestamp with the previous message timestamp and get the difference. Thanks again Gustavo for the quick reply!
Kind regards,
Razvan.
Hi constantinrazvan.chivu and gramirezv,
I appreciate the suggestions, however I would like to determine if a system has failed by raising a flag if no message has arrived from that system after a certain amount of time. I could just compare it to the most recent CAN message received in general (from another system on the bus), but its not that accurate. Do you have any suggestions?
Thanks,
Fernando
Hello fernando.barrios@uwaterloo.ca,
I get where are you coming from now - for this I would suggest you use the Get bus tick block - you can find it in the Utility Blocks section. I would suggest you do like this:
Let us know if you find this approach satisfying.
Kind regards,
Razvan.
Dear All,
I need to detect whether I am getting heartbeat of other components that is connected through CAN communication. If not, I should give error after a timeout.
So while I am searching for a solution I have run into that thread. And I just wanted to implement recommended solution by @constantinrazva .
My block is here as it seems. I have put one Get_Bus_Tick in RX_Complete and One in Subsystem and substracted them to find timedifference. I am taking TIMEOUT as zero everytime.
I have also attached that part of my model lke and excel file in attachment. You should convert attached file to .slx from xlsx.
How can I solve that?
Thanks.
Also, I have tried another model to try your advised solution. It did not work out. What I am missing?
Thanks.
fernando.barrios@uwaterloo.ca - I'd like to add a suggestion I would make if you're going with this method - you should not waste time computing the values back to us/ms at every check loop; you could just convert beforehand the failure_time to bus ticks, and save it as such in the model.
Kind regards,
Razvan.