主要内容

本页采用了机器翻译。点击此处可查看英文原文。

实时信号记录与流传输

通过信号记录或流式传输,可视化实时应用程序运行中的实时信号

要评估信号在实时应用程序中的行为,您可以向模型中添加仪表,调整参数并显示结果。

仪表包含以下信号:通过仿真数据检查器或 Simulink® Scope 模块标记用于可视化的信号、连接至 File Log 模块的信号,以及通过仪表对象连接至图形化仪表的信号。您可以在实时应用程序中通过使用 Simulink Real-Time™ Explorer 或 MATLAB® 语言来对信号进行监控。

使用仿真数据检查器调整标量、向量或矩阵参数,并以数字形式或带时间戳的轨迹形式查看信号值。要确定需要调整的参数或需要观察的信号,请浏览模型层次结构或创建参数和信号组。

设计并运行包含图形仪表的 App Designer 仪表板。当运行仪表板时,它会持续与实时应用程序交互,并更新相关的参数和信号。

App

Simulink Real-Time生成实时应用程序,用于在目标计算机上运行的仿真,并与目标计算机中的 I/O 设备进行交互。
Simulink Real-Time Explorer与目标计算机及其上运行的实时应用程序进行交互
Simulink Real-Time TET Monitor观察在目标计算机上运行的实时应用程序的任务执行时间
Simulink Real-Time App GeneratorGenerate instrument panel app to interact with target computer and real-time application running on target computer (自 R2022a 起)

工具

仿真数据检查器检查并比较数据与仿真结果,以验证和迭代模型设计

函数

全部展开

slrtExplorer打开 Simulink Real-Time 资源管理器,并与目标计算机及实时应用程序进行交互
slrtTETMonitorOpen Simulink Real-Time task execution time (TET) monitor
slrtAppGenerator生成仪表盘应用程序,用于与目标计算机及其上运行的实时应用程序进行交互。 (自 R2022a 起)
openImportDialog获取信号数据可用文件日志的相关信息 (自 R2023b 起)
discard从目标计算机中删除文件日志数据
getAllFileLogBlocks返回应用程序中与 File Log 模块对应的模块路径 (自 R2022a 起)
getFileLogDecimation根据模块路径返回 File Log 模块的取整值 (自 R2022a 起)
import将目标计算机上的文件日志数据导入“仿真数据检查器”
importToFolderImport file log data from target computer to folder on development computer (自 R2026a 起)
list获取信号数据可用文件日志的相关信息
setFileLogDecimation根据模块路径和输入降采样值,为 File Log 模块设置降采样值 (自 R2022a 起)
slrealtime.fileLogImportAfter copying file logs from the target computer to the development computer, import file logs into Simulation Data Inspector
slrealtime.fileLogList将文件日志从目标计算机复制到开发计算机后,列出可供导入到 Simulation Data Inspector 的文件日志
slrealtime.exportRun获取仿真数据检查器运行的数据 (自 R2023a 起)
startRecording启动信号数据实时流传输和文件日志记录 (自 R2022a 起)
stopRecording停止信号数据实时流传输和文件日志记录 (自 R2022a 起)
addForFileLogAdd an instrument to a target object for file logging (自 R2026a 起)
addForMATLABAdd an instrument to a target object for MATLAB data (自 R2026a 起)
addForSDIAdd an instrument to a target object for data in the Simulation Data Inspector (自 R2026a 起)
getAllForFileLogGet a list of instruments in a target object for file logging (自 R2026a 起)
getAllForMATLABGet a list of instruments in a target object for MATLAB data (自 R2026a 起)
getAllForSDIGet a list of instruments in a target object for data in the Simulation Data Inspector (自 R2026a 起)
removeAllForFileLogRemove the instruments from a target object that were for file logging (自 R2026a 起)
removeAllForMATLABRemove the instruments from a target object that were for MATLAB data (自 R2026a 起)
removeAllForSDIRemove the instruments from a target object that were for data in the Simulation Data Inspector (自 R2026a 起)
removeForFileLogRemove an instrument from a target object that was for file logging (自 R2026a 起)
removeForMATLABRemove an instrument from a target object that was for MATLAB data (自 R2026a 起)
removeForSDIRemove an instrument from a target object that was for data in the Simulation Data Inspector (自 R2026a 起)
viewOpen Instrument Viewer app (自 R2026a 起)

模块

File Log在目标计算机上写入信号数据文件日志
Enable File Log启用或禁用目标计算机上信号的文件日志记录

主题

背景

可视化信号

使用 MATLAB 语言

疑难解答

Simulink Real-Time 中的故障排除

在使用 Simulink Real-Time 产品时遇到的问题的故障排除

排查无法按名称访问信号的问题

调查导致某些信号类型无法进行文件记录或流式传输的问题。

精选示例