Configure host-side serial communications interface to transmit data to serial port
Embedded Coder®/ Embedded Targets/ Host Communication
Specify the configuration of data being transmitted to the target from this block.
The data package being sent is limited to 16 bytes of ASCII characters, including package headers and terminators. Calculate the size of a package by figuring in package header, or terminator, or both, and the data size.
Acceptable data types are single
, int8
, uint8
, int16
, uint16
, int32
,
or uint32
. The byte size of each data type is as
follows:
Data Type | Byte Count |
---|---|
single | 4 bytes |
int8 & uint8 | 1 byte |
int16 & uint16 | 2 bytes |
int32 & uint32 | 4 bytes |
For example, if your data package has 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 room in the data package for 14 int8
s.
If your data is of type uint16
, there is room in
the data package for only 7 uint16
s. If your data
is of type int32
, there is room 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 may 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 length (see Data length in the Dialog Box description). In the example just given, the 14 for data type int8 and the 7 for data type uint16 are the data lengths for each data package, respectively. When the data length exceeds 16 bytes, unexpected behavior, including run time errors, may result.
You may configure up to four COM ports (COM1 through COM4) for up to four host-side SCI Transmit blocks.
This field specifies the data located at the front of the transmitted data package, which is not part of the data being transmitted, and generally indicates start of data. The additional package header must be an ASCII value. You can use text or a number (0–255). You must put single quotes around text entered in this field, but the quotes are not sent nor are they included in the total byte count.
Note
Match additional package headers or terminators with those specified in the target SCI receive block.
This field specifies the data located at the end of the transmitted data package, which is not part of the data being sent, and generally indicates end of data. The additional package terminator must be an ASCII value. You can use text or a number (0–255). You must put single quotes around text entered in this field, but the quotes are not transmitted nor are they included in the total byte count.