Serial Send

Send binary data over serial port

Library

Instrument Control Toolbox

Description

The Serial Send block sends binary data from your model to the specified remote machine using the serial protocol.

    Note:   You need a license for both the Instrument Control Toolbox™ and Simulink® software to use this block.

The Serial Send block has one input port and it accepts both 1-D vector and matrix data. This block has no output ports. The block inherits the data type from the signal at the input port. Valid data types are: single, double, int8, uint8, int16, uin16, int32, and uint32.

Dialog Box

Use the Sink Block Parameters dialog box to select your serial Send block configuration options.

    Note:   Configure your serial port parameters before you specify the source block parameters.

Communication port

Specify the serial port that you will use to send through. You have to select an available port from the list. If you have not configured a port, the block will prompt you to do so. You can select a port from the available ports and then configure the port using the Serial Configuration block. Each Serial Send block must have a configured serial port. If you use multiple ports in your simulation, you must configure each port separately.

Header

Specify supplemental data to be placed at the beginning of your data block. The Send block adds the header in front of the data before sending it over the serial port. By default none or no header is specified.

Terminator

Specify the supplemental data to be placed at the end of your data block. The Send blocks appends the terminator to the data before sending it over the serial port. By default <none> or no terminator is specified. Other available terminator formats are:

  • CR ('\r') — Carriage return

  • LF ('\n') — Line feed

  • CR/LF ('\r\n')

  • NULL ('\0')

Byte order

When you specify a data type other than int8 or uint8, you can specify the byte order of the device for the binary data. Your options are BigEndian or LittleEndian.

Enable blocking mode

Specify if you want to block the simulation while sending data. This option is selected by default. Clear this check box if you do not want the write operation to block the simulation.

Was this topic helpful?