Serial Receive
Receive binary data over serial port
Libraries:
Instrument Control Toolbox
Motor Control Blockset /
Protection and Diagnostics
Description
The Serial Receive block configures and opens an interface to the specified serial port. The configuration and initialization occur once at the start of the model's execution. The block acquires data from the serial port during the model's run time. You can use only one Serial Receive block at a time to receive data from a specific serial port.
Note
You must configure your serial port parameters using the Serial Configuration block before you specify the Serial Receive block parameters.
This block has no input ports. It has one or two output ports based on whether you select blocking or non-blocking mode. If you select blocking mode, the block has one output port, Data, corresponding to the data it receives. If you do not select blocking mode, the block has two output ports, Data and Status.
This block uses a First In, First Out (FIFO) buffer to receive data from the serial port.
At each time step, the Data port returns the requested values from the
buffer. In non-blocking mode, the Status port indicates if the block has
received new data. If the Status port displays 1
, new
data is available and if the Status port displays
0
, no new data is available.
Other Supported Features
The Serial Receive block supports the use of Simulink® Accelerator mode, but not Rapid Accelerator. This feature speeds up the execution of Simulink models.
The Serial Receive block supports the use of model referencing. This feature lets your model include other Simulink models as modular components.
The Serial Receive block supports C/C++ code generation. This feature allows you to generate C and C++ code using Simulink Coder™.
For more information on these features, see the Simulink documentation.
Ports
Output
Parameters
Extended Capabilities
Version History
Introduced in R2008a