Protocol Encoder
R2026bEncode input data into a uint8 byte stream by specifying the packet structure
Libraries:
C2000 Microcontroller Blockset /
Target Communication
Motor Control Blockset /
Signal Management
STM32 Microcontroller Blockset /
Utilities
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.
"c2000lib/Target Communication/Protocol Encoder"
"mcblib/Signal Management/Protocol Encoder"
"stmutilitieslib/Protocol Encoder"
"arduinolib/Protocol Encoder"
Example: add_block("c2000lib/Target Communication/Protocol Encoder","myModel/myBlock",MakeNameUnique="on")
More About
Version History
Introduced in R2021b


