FIFO Write
Libraries:
Simulink Real-Time /
RS232
Description
The FIFO Write block is the write side of a FIFO read/write pair. Use this block to generate simple data streams.
For more information, see RS-232 Serial Communication and RS-232 Legacy Drivers.
Examples
ASCII Encoding/Decoding Resync Loopback Test
Use the ability of the FIFO Read HDRS block to resynchronize after being repeatedly disabled and apply this ability to resolve errors such as when a message is only partially complete at the time the read is attempted.
Binary Encoding/Decoding Resync Loopback Test
Use the ability of the FIFO Read BINARY block to handle messages that are interrupted and only partially complete.
Simple ASCII Encoding/Decoding Loopback Test (with Baseboard Blocks)
Convert a single floating point number to ASCII and transmit the value over a serial link.
ASCII Encoding/Decoding Loopback Test (with Baseboard Blocks)
Send ASCII data over a serial link.
ASCII Encoding/Decoding Resync Loopback Test (with Baseboard Blocks)
Use the ability of the FIFO Read HDRS block to resynchronize after being repeatedly disabled and apply this ability to resolve errors such as when a message is only partially complete at the time the read is attempted.
Binary Encoding/Decoding Loopback Test (with Baseboard Blocks)
Send Binary data over a serial link.
Binary Encoding/Decoding Resync Loopback Test (with Baseboard Blocks)
Use the ability of the FIFO Read BINARY block to handle messages that are interrupted and only partially complete.
Ports
Input
D — Data to write to FIFO
vector
Vector containing the data to write to the FIFO.
Dependency
To determine the data type of this vector, set the parameter Input vector type.
Data Types: int8
| uint8
| int16
| uint16
| int32
| uint32
Output
F — FIFO vector
serialfifoptr
Connects to the FIFO that writes data to the serial port.
DP — True
if new data is present in the FIFO
true
| false
If data is present in the FIFO, returns
true
.
Dependency
To make this port visible, set parameters Max and Min read size ports and Enable passthrough.
Parameters
Size — Size of FIFO, in bytes
1024
(default) | integer
Enter the number of elements that can be held in the FIFO at one time. If a write operation to the FIFO causes the number of elements to exceed Size, an error occurs.
Programmatic Use
Block Parameter:
size |
Input vector type — Specify input data type
8 bit uint null
terminated
(default) | count+32 bit int
| count+32 bit uint
| count+16 bit int
| count+16 bit uint
| 8 bit int null terminated
For the 16-bit and 32-bit data types, include as first element the number of elements to expect in the rest of the input vector. The count controls how many bytes that the block copies into the FIFO. The block does not copy the count itself into the FIFO.
For the 8-bit data types, provide a NULL-terminated character vector in the output vector. The block copies data into the FIFO up to, but not including, the NULL terminator.
For more information, see RS-232 Legacy Drivers.
Programmatic Use
Block Parameter:
inputtype |
Data present output — Enables output DP
off
(default) | on
Select this check box to create the Boolean output DP
.
If data is present in the FIFO, DP
becomes
true
. The transmit side of the send/receive subsystem
uses this output. This output is given to the Enable TX block, which enables
the transmitter buffer empty interrupt.
This setting makes the output port DP
visible.
Programmatic Use
Block Parameter:
present |
Sample time — Sample time of block
-1
(default) | numeric
Enter the base sample time or a multiple of the base sample time. -1
means
that sample time is inherited.
Programmatic Use
sampletime
ID — Identifier for overflow messages
character vector
Enter a user-defined identifier for FIFO overflow messages.
Programmatic Use
Block Parameter:
id |
Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.
Version History
Introduced in R2020b
Comando MATLAB
Hai fatto clic su un collegamento che corrisponde a questo comando MATLAB:
Esegui il comando inserendolo nella finestra di comando MATLAB. I browser web non supportano i comandi MATLAB.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)