Send and receive data over Mainboard Baseboard serial port
Simulink Real-Time / RS232 / Mainboard
The Send/Receive block sets up the serial interface to send and receive basic character streams. This block has basic FIFO Read blocks inside the subsystem. It generates output as an array of packed integers (settable at 8 bits, 16 bits, or 32 bits). Characters appear in the lower byte and received status information appears in the upper byte.
XMT— Vector of data to transmit
Vector of data to transmit over port.
RCV— Vector of data that has been received over serial port
Vector containing data that has been received from serial port.
Serial port— Specify port that is being accessed
Legacy Serial Port 1(default) | .. |
Legacy Serial Port 8
This parameter specifies the port for which you want to view or modify parameters.
Baud rate— Baud for transferring data
Select a baud for transmitting and receiving data through the modem.
Data bits— Number of bits per character
Select the number of bits that encode a character.
Stop bits— Number of stop bits for port
Select the number of stop bits for the character stream.
Parity— Parity for checking data transfer
Select a parity for checking data integrity.
Enable auto RTS/CTS— Enable RTS/CTS handshake
To enable the RTS/CTS handshake of the UART for flow control, select this check box. Serial controllers use the RTS/CTS handshake to prevent data loss due to hardware FIFO overflow on the device that you are sending to.
Usually, the interrupt service routine executes quickly enough to empty the FIFO. However, if your model gets FIFO overruns, select this check box.
Max Output count— Maximum number of elements for block to return
1024(default) | integer
Enter the maximum number of elements that you want returned by a single call to this block. The block uses this parameter to set the output vector width.
If the Read to delimiter check box is selected and if the block does not find the delimiter before it reads Receive maximum read characters, the output vector is empty.
Min Output count— Minimum number of elements for block to return
1(default) | integer
Enter the minimum number of characters to read. If the FIFO does not contain at least this number of characters, the output vector is empty.
Read to delimiter— Return characters including message delimiter
Select this check box to have this block return all characters in the FIFO, up to and including the specified delimiter.
If the buffer has errors, such as framing errors, the modem returns characters regardless of the presence of the delimiter. This special case helps diagnose errors such as mismatched baud rates.
If the block does not find the delimiter before it reads Receive maximum read characters, the output vector is empty.
Delimiter— Numeric value of message delimiter
13(default) | integer
Enter the numeric value of the character that is the message delimiter.
Any value from
255 is valid. The common case looks for
10 (line feed) or
Receive data type— Data type of receiver
8 bit int null terminated(default) |
8 bit uint null terminated|
count+16 bit int|
count+16 bit uint|
count+32 bit int|
count+32 bit uint
This parameter specifies the data type of the receiver. The 8-bit data types produce a NULL-terminated character vector in the output vector.
For 16-bit and 32-bit data types, the first element contains the number of valid elements in the rest of the output vector.
For 8-bit data types, only the character data is in the output vector, and a NULL terminator is appended. The 16-bit or 32-bit wide data types cause the error status from the UART to be placed in the second byte of each data element. (The error status contains the parity, overrun, framing, and break bits.) The character data is in the bottom 8 bits of each element; the first element of the vector contains the number of data elements that follow.
Transmit data type— Data type of transmitter
count+32 bit int(default) |
count+32 bit uint|
count+16 bit int|
count+16 bit uint|
8 bit int null terminated|
8 bit uint null terminated
This parameter specifies the data type of the transmitter. The 8-bit data types require a NULL-terminated character vector in the input vector.
The 16-bit and 32-bit data types reserve the first full element to contain the number of elements to expect in the rest of the input vector. Only the low-order byte of each data element is sent. Setting this data type allows a wider data type to hold the bytes.
If the data stream requires a NULL byte, select one of the 16-bit or 32-bit data types. Because the 8-bit data types are NULL terminated character vectors, the NULL byte would terminate the character vector.
Sample Time— Sample time
-1(default) | numeric
Enter the base sample time or a multiple of the base sample time.
-1 means that sample time is inherited.