Host Serial Receive
Configure host-side serial communications interface to receive data from serial port
Since R2020a
Libraries:
Motor Control Blockset /
Protection and Diagnostics
Description
The Host Serial Receive block specifies the configuration of the data that it receives from the target hardware.
The data package that the block receives is limited to 16 bytes of ASCII characters, including package headers and terminators. Calculate the size of a package by including the package header, or terminator, or both, and the data size. This table shows the number of bytes in each data type.
Data Type | Byte Count |
---|---|
| 4 bytes |
| 1 byte |
| 2 bytes |
| 4 bytes |
For example, if your data package has a package header 'S' (1 byte) and package terminator
'E' (1 byte), that leaves 14 bytes for the actual data. If your data is of type
int8
, there is space in the data package for 14
int8
s. If your data is of type uint16
, there is
space in the data package for 7 uint16
s. If your data is of type
int32
, there is space in the data package for only 3
int32
s, with 2 bytes left over. Even though you could fit two
int8
s or one uint16
in the remaining space, you
should not, because you cannot mix data types in the same package.
The number of data types that can fit into a data package determine the data size. In the
preceding example, the data size is 14 for int8
and 7 for
uint16
. When the data size exceeds 16 bytes, unexpected behavior,
including run-time errors, are likely to occur.
Ports
Output
Parameters
Extended Capabilities
Version History
Introduced in R2020a