CAN bus unpack Big Endian Format

8 visualizaciones (últimos 30 días)
Kyriakos Sampatakakis
Kyriakos Sampatakakis el 27 de Oct. de 2017
Editada: Kyriakos Sampatakakis el 2 de Nov. de 2017
Hi all,
I am trying to adjust the CAN unpack block, from the Embedded Coder Support Package for Texas Instruments C2000 Processors lib, so that the unpacking method will be based on the Big Endian format. I can't figure it out why I get an error.Bellow there's a screenshot of my problem:
Any help will be appreciated!

Respuesta aceptada

Sebastian Castro
Sebastian Castro el 30 de Oct. de 2017
Hi Kyriakos,
If you look at the block documentation, you will see a diagram of how the "Big Endian" (BE) format fills up the bytes.
If you start at bit 15 in BE format, then the bits will be filled in the order
15 0 1 2 3 4 5 6 7
... which means that starting at bit 15 only gives you up to data length 9.
If you want to throw a 16-bit value in the first 2 bytes with BE format, you need to start at bit 8 such that the order is
8 9 10 11 12 13 14 15 0 1 2 3 4 5 6 7
Try it out!
- Sebastian
  1 comentario
Kyriakos Sampatakakis
Kyriakos Sampatakakis el 2 de Nov. de 2017
Editada: Kyriakos Sampatakakis el 2 de Nov. de 2017
Hi, Sebastian
Thank you very much for your accurate and quick response!
Best regards, Kyriakos Sampatakakis

Iniciar sesión para comentar.

Más respuestas (0)

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by