Byte Reversal
R2026bReverse order of bytes in input word
Libraries:
Embedded Coder /
Embedded Targets /
Host Communication
Simulink Support Package for Arduino Hardware /
Utilities
Description
The Byte Reversal block changes the order of the bytes in data that you input to the block. Use this block when a process communicates between target computers that use different endianness, such as between Intel® processors that are little endian and other processors that are big endian. Texas Instruments® processors are little-endian by default.
To exchange data between processors that have different endianness, place a Byte Reversal block just before the send block and immediately after the receive block.
This model shows byte reversal for three inputs. The input and output ports match for each path.

Ports
Input
Output
Parameters
Programmatic Use: Add Block
To add the block programmatically, use the add_block function with one of these library block paths as the source.
"embeddedtargetslib/Host Communication/Byte Reversal"
"svdutilitieslib/Byte Reversal"
Example: add_block("embeddedtargetslib/Host Communication/Byte Reversal","myModel/myBlock",MakeNameUnique="on")
Version History
Introduced in R2011a