Host Serial Setup

Configure communication ports used by Host Serial Receive and Host Serial Transmit blocks

  • Library:
  • Motor Control Blockset / Protection and Diagnostics

Description

The Host Serial Setup block is a standalone block that standardizes the serial communication (COM) port settings used by the Host Serial Receive and Host Serial Transmit blocks.

Setting the COM port configurations globally by using the Host Serial Setup block avoids conflicts. For example, the Host Serial Transmit block cannot use a COM1 port with settings different than those on the COM1 port of the Host Serial Receive block. You need to set the port configurations only once for each COM port.

Parameters

expand all

Select an available serial port that you want to configure. By default no port is selected and this field displays 'Please_select_a_port'. Use a configured port in the Host Serial Transmit and Host Serial Receive blocks. Both transmit and receive blocks must use a serial port that you configure using the Host Serial Setup block.

Enter the rate at which the model transmits the bits through the serial interface.

Enter the number of bits that the model uses to indicate the end of a byte.

Specify how you want to check parity bits in the data bits that the model transmits through the serial port.

  • none — Model does not perform parity check.

  • odd — Model sets the parity bit to 0 if the number of ones in a given set of bits is even.

  • even — Model sets the parity bit to 1 if the number of ones in a given set of bits is odd.

Enter values greater than or equal to zero (seconds). When the COM port involved is using the protocol mode, this value indicates how long the transmitting side waits for an acknowledgement from the receiving side or how long the receiving side waits for data.

The system displays a warning message every n number of seconds, when the transmit or receive block exceeds the Timeout value of n seconds.

Specify the byte order as either LittleEndian or BigEndian. If byte order is LittleEndian, the model stores the first byte in the first memory address. If byte order is BigEndian, the model stores the last byte in the first memory address. You should configure the byte order to an appropriate value before performing a read or write operation.

Introduced in R2020a