Main Content

Legacy Serial Port F

Send and receive data over mainboard baseboard serial port with FIFO

  • Legacy Serial Port F block

Libraries:
Simulink Real-Time / RS232 / Mainboard

Description

The Send/Receive FIFO block sets up the serial interface to send and receive character and binary streams. It transmits input data as does the Send/Receive block, but it propagates received data through First In, First Out (FIFO) outputs.

A model that contains a Send/Receive FIFO block and the FIFO Read block provides the same capability as the Send/Receive block. A model that contains a Send/Receive FIFO block and a FIFO Read HDRS or FIFO Read Binary block provides greater capability than the Send/Receive block.

For more information, see RS-232 Serial Communication and RS-232 Legacy Drivers.

Examples

Ports

Input

expand all

Vector of the data used to transmit over the port.

Data Types: int8 | int16 | int32 | uint8 | uint16 | uint32

Output

expand all

First In, First Out (FIFO) containing data that has been received from the serial port.

Parameters

expand all

Specify the serial port type for communications. Choose Legacy Serial Port or USB Serial Port to specify the type of port used. Or, choose Specify to manually specify the path of the port used. For more information about serial ports, see RS-232 Serial Communication.

Dependencies

Setting Serial port type to Legacy Serial Port or USB Serial Port displays the Serial port number parameter in which you can specify the port number.

Setting Serial port type to Specify displays the Serial port parameter in which you can specify the port path.

Programmatic Use

Block Parameter: portType

Specify the serial port number for communications.

If using USB-to-serial adapters, the target computer detects these adapters as ttySUSB0, ttySUSB1, and so on in the order that the adapters are connected to the serial devices.

The order of port assignment is retained through the power cycle of the target computer or serial device if there is no change in the connections to the ports.

Dependencies

This parameter is visible if Serial port type is set to Legacy Serial Port or USB Serial Port.

Programmatic Use

Block Parameter: portNum

Specify the serial port device path for communications. The path can be the device path of a Legacy Serial Port or USB Serial Port.

Dependencies

This parameter is visible if Serial port type is set to Specify.

Programmatic Use

Block Parameter: nodePath

Select a baud for transmitting and receiving data through the modem.

Programmatic Use

Block Parameter: baud

Select the number of bits that encode a character.

Programmatic Use

Block Parameter: width

Select the number of stop bits for the character stream.

Programmatic Use

Block Parameter: nstop

Select a parity for checking data integrity.

Programmatic Use

Block Parameter: parity

To enable the Request To Send/Clear To Send (RTS/CTS) handshake of the Universal Asynchronous Receiver-Transmitter (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. If your model gets FIFO overruns, select this check box.

Programmatic Use

Block Parameter: ctsmode

This parameter specifies the receive FIFO size in bytes.

Example: 1024

Programmatic Use

Block Parameter: fifosize

Data Types: int32

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 enables 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 terminates the character vector.

Programmatic Use

Block Parameter: idtype

Enter the base sample time or a multiple of the base sample time. -1 means that the sample time is inherited.

Programmatic Use

Block Parameter: sampletime

Version History

Introduced in R2008a

expand all