Byte Packing
Construct data frames
Libraries:
Simulink Real-Time /
Utilities
Description
The Byte Packing block converts one or more signals of user-selectable data types to a single vector of varying data types. The output of this block typically connects to an input port of a Send block.
The Byte Packing block and the Byte Unpacking block support the Simulink® Real-Time™ STF code generation targets and generate code that runs on Speedgoat target machines. Due to considerations such as endianness and addressable word size, these blocks can generate incorrect results for other code generation targets or target computers.
For example, suppose that you are packing three signals into a vector of
uint8
. The signals have the following attributes:
Dimension | Size | Type |
---|---|---|
Scalar | 1 | single |
Vector | 3 | uint8 |
Vector | 3 | uint8 |
Set the packed output port data type to
uint8
.Set the input port data type to a cell array encoding the data types:
{'single', ['uint8'], ['uint8']}
Use square brackets to represent vectors.
Set the byte alignment value to
1
.Connect the signals to the Byte Packing block.
Examples
Ports
Input
Output
Parameters
Extended Capabilities
Version History
Introduced in R2006a