Multiple messages have to be transferred by CAN Pack/Unpack

조회 수: 1 (최근 30일)
Saeed Soltani
Saeed Soltani 2016년 7월 7일
댓글: Walter Roberson 2022년 8월 11일
Hi,
If we have several messages to be sent, is there any possibility to set multiple messages on one CAN Pack/Unpack or the only way is to use several modules (for each message one)?
Thanks

답변 (1개)

Dimitri MANKOV
Dimitri MANKOV 2022년 8월 11일
Hi Saeed,
As far as I know, you should use one CAN Pack/Unpack block per CAN Message ID.
I hope this is helpful!
Dimitri
  댓글 수: 1
Walter Roberson
Walter Roberson 2022년 8월 11일
... well, you could in theory use your 64 bits of payload to pack additional messages, if they somehow fit within the 64 bits. However, you should not expect the receiving systems to be able to look inside the payload to recognize the additional packed messages. The CAN messages do not contain information about the meaning of or internal field lengths of the payload.
If, somehow, the information about the length of each sub-field was transmitted with the block, then the amount of memory requried to store the maximum subfield length would be 5 bits (length 0 is not meaningful, so encode (bitlength - 1)). There could be up to 64 fields, each of length 1. The naive storage requirement for such a description would then take 64 * 5 = 320 bits. You would have to start using data compression techniques to pack the length fields; you could definitely need at least 64 bits for the field lengths alone.... In other words, it would not be practical.

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

카테고리

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

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by