消息
在 Simulink® 模型组件之间建立基于消息的通信
消息用于对 Simulink 组件之间的通信建模,以实现系统集成。您可以使用消息在组合模型中建立通信,该模型的组件执行一组已定义的具有 I/O 边界的功能。
在控制系统架构中,由于系统的复杂性,集中式架构被分布式架构所取代,因此软件组件之间基于消息的通信是必需的。消息是有用的建模工件,它将具有相关数据的事件结合在一起。使用消息模块来管理消息的生成、使用和存储。
要了解有关 Simulink 消息的更多信息,请参阅Simulink Messages Overview。
模块
工具
主题
了解 Simulink 消息
- Simulink Messages Overview
Overview of the message-based communication for distributed architectures, code generation, and middleware modeling.
对消息发送和接收接口建模
- Animate and Understand Sending and Receiving Messages
Send, receive, visualize, and animate messages and display message data. - Establish Message Send and Receive Interfaces Between Software Components
Create message send and receive interfaces, and prepare components for C++ code generation. - Specify Queue Properties for Message Interface
Specify queue properties for individual model components and compositions. - Merge Message Lines Using a Message Merge Block
Route messages using a Message Merge block. - Use Virtual Buses with Message Elements for Component Communication
Send and receive virtual buses with message elements carrying nonvirtual bus as data. - Send and Receive Messages Carrying Bus Data
Send and receive messages with nonvirtual bus data. - Connect Message Receive Interface with Simulink Functions
This example shows how to synchronize execution with data availability in message-based systems.
基于消息的计算
- Temperature Control System Communicating with Messages
Distributed control of room temperatures by processing messages from room thermostats and communicating control commands using messages to different receivers. - Asynchronous Message Handling in Adaptive Cruise Control
An event-based Adaptive Cruise Control (ACC) using messages and message-triggered subsystems. - Using Message Polling and Message Triggered Subsystems
Demonstrate and compare Message Triggered Subsystems and Message Polling Subsystems. - 使用 MATLAB System 模块处理消息有效负载
此示例说明如何使用 MATLAB System 模块发送、接收和处理消息。使用 System object 创建模块以对发送和接收消息以及操作消息有效负载的自定义行为建模。 - Generate C++ Message Interfaces for Lane Following Controls and Sensor Fusion (Automated Driving Toolbox)
Generate code for message-based communication between components of a highway lane following system. - Wireless Tire Pressure Monitoring System with Fault Logging
Model a wireless tire pressure monitoring system with fault logging using message communication.
仿真中间件对分布式架构的影响
- Use a Queue Block to Manage Messages
Use FIFO queue, LIFO queue, and priority queue to sort and store messages and define queue policies. - Modeling Message Communication Patterns with SimEvents
Merge, broadcast, distribute, multicast, and delay messages using SimEvents®.