Protocol Encoder
R2026bEncode input data into a uint8 byte stream by specifying the packet structure
Since R2023a
Libraries:
STM32 Microcontroller Blockset /
Utilities
C2000 Microcontroller Blockset /
Target Communication
Simulink Support Package for Arduino Hardware /
Common
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.
"stmutilitieslib/Protocol Encoder"
"c2000lib/Target Communication/Protocol Encoder"
"arduinolib/Protocol Encoder"
Example: add_block("stmutilitieslib/Protocol Encoder","myModel/myBlock",MakeNameUnique="on")
More About
Extended Capabilities
Version History
Introduced in R2023a



