Protocol Encoder
R2026bEncode input data into a uint8 byte stream by specifying the packet structure
Since R2024a
Add-On Required: This feature requires the Embedded Coder Support Package for STMicroelectronics STM32 Processors add-on.
Libraries:
Motor Control Blockset /
Signal Management
C2000 Microcontroller Blockset /
Target Communication
Description
The Protocol Encoder encodes input data into a uint8 byte stream as per the specified packet structure based on the communication protocol. You can use this block to encode the separate fields into a packet, by specifying the header, terminator, name of packet fields in sequence and their size. You can also generate checksum bytes for the packet for validating the packet.
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.
"mcblib/Signal Management/Protocol Encoder"
"c2000lib/Target Communication/Protocol Encoder"
Example: add_block("mcblib/Signal Management/Protocol Encoder","myModel/myBlock",MakeNameUnique="on")
More About
Extended Capabilities
Version History
Introduced in R2024a


