SCI Transmit
Configure host-side serial communications interface to transmit data to serial port
- Library:
Embedded Coder / Embedded Targets / Host Communication
Description
The SCI Transmit block specifies the configuration of a data package being transmitted to a target computer from this block.
Ports
Input
data
— Data package
scalar (default) | vector
Data package, specified as a scalar or vector, sent to a target computer. The package can consist of headers, terminators, and data elements. The package size is limited to 16 bytes of ASCII characters, including headers and terminators. Calculate the size of a package by adding the byte sizes of headers, terminators, and the data.
This table lists the number of bytes for supported data types.
Data Type | Byte Count |
---|---|
single | 4 bytes |
int8 and uint8 | 1 byte |
int16 and uint16 | 2 bytes |
int32 anduint32 | 4 bytes |
For example, if your data package includes a 1-byte package header,
'S'
, and a 1-byte package terminator, 'E'
, 14
bytes remain for data. If your data is of type int8
, the data can
consist of up to 14 data elements. If your data is of type uint16
,
the data can consist of up to 7 data elements. If your data is of type
int32
, the data package can consist of up to 3 data elements with
2 bytes left over. Because you cannot mix data types in a package, the remaining 2
bytes are not used.
The number of data elements that can fit into a data package determine the data
length (see the Data length parameter). In the
preceding example, the 14 data elements of type int8
and the 7 data
elements of type uint16
are the data lengths for each data package,
respectively. When the data length exceeds 16 bytes, unexpected behavior, including
run-time errors, can result.
Data Types: single
| int8
| int16
| int32
| uint8
| uint16
| uint32
Parameters
Port name
— Name of COM port
COM1 (default) | COM2 | COM3 | COM4
Specify the name of the COM port that you are configuring for this SCI Transmit block. You can configure up to four COM ports for a model, one COM port for each SCI Transmit block in the model.
Additional package header
— Header of transmitted data package
'S' (default) | 'ASCII value'
Specify the header of the transmitted data package as an ASCII value in single quotes. The value can be text or a number in the range 0 to 255. The quotes are not transmitted and are not included in the package byte count.
The header is not part of the data being transmitted. Typically, the header marks the start of the data. The header that you specify must match the header specified for the corresponding target computer SCI Receive block.
Additional package terminator
— Terminator of transmitted data package
'E' (default) | 'ASCII value'
Specify the terminator of the transmitted data package as an ASCII value in single quotes. The value can be text or a number in the range 0 to 255. The quotes are not transmitted and are not included in the package byte count.
The terminator is not part of the data being transmitted. Typically, the terminator marks the end of the data. The terminator that you specify must match the terminator specified for the corresponding target computer SCI Receive block.
Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.
This block does not support code generation. The block is supported for simulations on a host development computer only.
Version History
See Also
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)