实时信号记录与流传输
通过信号记录或流式传输,可视化实时应用程序运行中的实时信号
要评估信号在实时应用程序中的行为,您可以向模型中添加仪表,调整参数并显示结果。
仪表包含以下信号:通过仿真数据检查器或 Simulink® Scope 模块标记用于可视化的信号、连接至 File Log 模块的信号,以及通过仪表对象连接至图形化仪表的信号。您可以在实时应用程序中通过使用 Simulink Real-Time™ Explorer 或 MATLAB® 语言来对信号进行监控。
使用仿真数据检查器调整标量、向量或矩阵参数,并以数字形式或带时间戳的轨迹形式查看信号值。要确定需要调整的参数或需要观察的信号,请浏览模型层次结构或创建参数和信号组。
设计并运行包含图形仪表的 App Designer 仪表板。当运行仪表板时,它会持续与实时应用程序交互,并更新相关的参数和信号。
App
| Simulink Real-Time | 生成实时应用程序,用于在目标计算机上运行的仿真,并与目标计算机中的 I/O 设备进行交互。 |
| Simulink Real-Time Explorer | Interact with target computer and real-time application running on target computer |
| Simulink Real-Time TET Monitor | 观察在目标计算机上运行的实时应用程序的任务执行时间 |
| Simulink Real-Time App Generator | Generate instrument panel app to interact with target computer and real-time application running on target computer (自 R2022a 起) |
工具
| 仿真数据检查器 | 检查并比较数据与仿真结果,以验证和迭代模型设计 |
函数
slrtExplorer | 打开 Simulink Real-Time 资源管理器,并与目标计算机及实时应用程序进行交互 |
slrtTETMonitor | 打开 Simulink Real-Time 任务执行时间 (TET) 监控器 |
slrtAppGenerator | 生成仪表盘应用程序,用于与目标计算机及其上运行的实时应用程序进行交互。 (自 R2022a 起) |
discard | Delete file log data from target computer |
getAllFileLogBlocks | 返回应用程序中与 File Log 模块对应的模块路径 (自 R2022a 起) |
getFileLogDecimation | Returns decimation value of File Log block based on block path (自 R2022a 起) |
import | Import file log data from target computer |
list | 获取信号数据可用文件日志的相关信息 |
openImportDialog | 获取信号数据可用文件日志的相关信息 (自 R2023b 起) |
setFileLogDecimation | Sets decimation value on File Log blocks based on block path and input decimation value (自 R2022a 起) |
slrealtime.fileLogImport | After copying file logs from the target computer to the development computer, import file logs into Simulation Data Inspector (自 R2021a 起) |
slrealtime.fileLogList | After copying file logs from the target computer to the development computer, list available file logs for import into Simulation Data Inspector (自 R2021a 起) |
slrealtime.exportRun | Access data for Simulation Data Inspector run (自 R2023a 起) |
startRecording | 启动信号数据实时流传输和文件日志记录 (自 R2022a 起) |
stopRecording | 停止信号数据实时流传输和文件日志记录 (自 R2022a 起) |
模块
| File Log | 在目标计算机上写入信号数据文件日志 |
| Enable File Log | 启用或禁用目标计算机上信号的文件日志记录 |
主题
背景
- Real-Time Signal Logging and Streaming Basics
Acquire signal data while running a real-time application and transfer the data to the development computer for analysis. - Real-Time File Logging and Streaming Workflow
Control acquisition of signal data while running a real-time application by using logging enable and recording on/off interfaces. - 实时信号记录与参数调优
此示例演示了如何使用 Simulink® Real-Time™ 进行实时参数调优和数据记录。 - Internationalization Issues for Simulink Real-Time
Learn about Simulink Real-Time support for internationalization.
可视化信号
- Stream Real-Time Signals by Using Simulink Real-Time Explorer
Acquire non-time-stamped signal data and display it in text format. - Filter Hierarchical List of Signals and Parameters in Simulink Real-Time Explorer
Find and view signals and parameters with hierarchical path information. - Post-Process Real-time Signals Streamed to the Simulation Data Inspector
This example shows how to use a Simulink® Real-Time™ log of signal data and the Simulation Data Inspector. Signals are logged during model execution. - Add an Instrument to a Stateflow Subsystem
Use real-time application instrument to visualize Stateflow® states. - Enable Stateflow Chart Animation by Using Simulink External Mode
Display Stateflow state changes graphically in your model. - Stream Real-Time Signals by Using Simulink External Mode
Stream real-time signals by using the Simulink model as a user interface.
疑难解答
在使用 Simulink Real-Time 产品时遇到的问题的故障排除
Troubleshoot Signals Not Accessible by Name
Investigate issues for some signal types prevent file logging or streaming.

