FIFO Write
编写简单的数据流
库:
Simulink Real-Time /
RS232
描述
FIFO Write 模块是 FIFO 读写对的写入侧。使用此模块生成简单的数据流。
有关详细信息,请参阅RS-232 串行通信和RS-232 Legacy Drivers。
示例
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.
端口
输入
包含要写入 FIFO 的数据的向量。
依赖关系
要确定此向量的数据类型,请设置参数 Input vector type。
数据类型: int8 | uint8 | int16 | uint16 | int32 | uint32
输出
连接到将数据写入串行端口的 FIFO。
如果 FIFO 中存在数据,则返回 true。
依赖关系
要使该端口可见,请设置参数 Max and Min read size ports 和 Enable passthrough。
参数
输入 FIFO 中可同时容纳的元素数量。若对 FIFO 的写操作导致元素数量超过 Size,则会发生错误。
编程用法
模块参数:size |
对于 16 位和 32 位数据类型,需在输入向量的首元素处包含后续元素的数量。计数器控制该模块复制到 FIFO 中的字节数。该模块不会将计数值本身复制到 FIFO 中。
对于 8 位数据类型,在输出向量中提供一个以 NULL 结尾的字符向量。该模块将数据复制到 FIFO 中,直至但不包括 NULL 终止符。
有关详细信息,请参阅RS-232 Legacy Drivers。
编程用法
模块参数:inputtype |
选中此复选框可创建布尔输出 DP。如果 FIFO 中存在数据,DP 将变为 true。发送/接收子系统的发送端使用此输出。该输出被提供给使能发射模块,从而启用发射缓冲区空闲中断。
此设置使输出端口 DP 可见。
编程用法
模块参数:present |
输入基本采样时间或其倍数。-1 表示采样时间继承自父级。
编程用法
sampletime
输入用户定义的 FIFO 溢出消息标识符。
编程用法
模块参数:id |
扩展功能
C/C++ 代码生成
使用 Simulink® Coder™ 生成 C 代码和 C++ 代码。
版本历史记录
在 R2020b 中推出
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
选择网站
选择网站以获取翻译的可用内容,以及查看当地活动和优惠。根据您的位置,我们建议您选择:。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
- América Latina (Español)
- Canada (English)
- United States (English)
欧洲
- 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)








