Main Content

SCI Transmit

Configure host-side serial communications interface to transmit data to serial port

  • Library:
  • Embedded Coder / Embedded Targets / Host Communication

  • SCI Transmit block

Description

The SCI Transmit block specifies the configuration of a data package being transmitted to a target computer from this block.

Ports

Input

expand all

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 TypeByte Count
single4 bytes
int8 and uint81 byte
int16 and uint162 bytes
int32 anduint324 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

expand all

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.

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.

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

Introduced in R2011a