配置参数、模块参数和输入端数据
基于 Simulink® 模型的实时应用程序创建
通过更新您的 Simulink 模型,为生成实时应用程序做好设计准备。选择固定步长求解器,并将 Simulink Real-Time™ 设为代码生成器目标。使用 Speedgoat I/O Blockset 或 Simulink Real-Time 模块库中的模块扩展您的 Simulink 模型。在模型中将这些驱动器模块与其他模块建立信号连接,然后构建实时应用程序。
请注意,Speedgoat® 没有可配置的 TLC 命令行选项。
模型设置
| Log level | 选择系统日志消息的过滤级别 |
| Force polling mode | Enables polling mode — instead of interrupt-driven mode — for clocking the real-time application |
| Max file log runs | Selects the number of file log runs to retain for the real-time application |
| Compile with GCC -ffast-math | 在编译实时应用程序代码时启用 GCC 编译器的 -ffast-math 选项 |
| Stop time | 仿真停止时间 |
对象
Application | Represent application files on development computer |
函数
addParamSet | 向实时应用程序添加参数集 (自 R2021a 起) |
coder.asap2.export | 根据 ASAM MCD-2 MC 标准生成 ASAP2 (A2L) 文件 (自 R2021a 起) |
extractASAP2 | Extract generated A2L file from real-time application file |
extractExecutable | 从实时应用程序文件中提取可执行文件 (自 R2025a 起) |
getInformation | 获取实时应用程序信息 |
getParameters | 获取实时应用程序参数 |
getRootLevelInports | 返回应用程序中的根级输入端口 (自 R2022a 起) |
getSignals | 获取实时应用程序信号 |
updateASAP2 | 将 ASAP2 文件打包到应用程序中 (自 R2022b 起) |
updateAutoSaveParameterSetOnStop | 更新应用程序停止时的自动保存参数集 (自 R2022b 起) |
updateRootLevelInportData | 在实时应用中用输入数据替换外部输入数据 |
updateStartupParameterSet | Update the startup parameter set for an application (自 R2021a 起) |
主题
- I/O 驱动程序模块
了解驱动程序模块的 Simulink Real-Time I/O 库。
- 向 Simulink 模型添加 I/O 模块
通过使用 Simulink Real-Time 库模块与电路板进行交互。
- 配置模块参数
配置模型模块。
- Define and Update Inport Data by Using Root Inport Mapper
Map root inports to source data.
- Simulink Real-Time Options Pane
Configure initial values for real-time application options.