使用VeriStand Model Generation Support插件时出现错误2

更新 Dec 19, 2023

适用于

软件

  • VeriStand
  • MATLAB
  • Simulink

问题详述

我正在使用Matlab 2022b和VeriStand 2023 Q4。我安装了VeriStand Model Generation Support 1.0和NI GCC Cross-Compiler for NI Linux Real-Time targets来编译Matlab/Simulink模型,但总是出现错误2:
gmake: *** No rule to make target `C:/Users/xiaoming.Li/AppData/Roaming/MATHWO~1/MATLAB~1/TOOLBO~1/VERIST~1/RUNTIM~1/veristand_model_capi.cpp', needed by `veristand_model_capi.obj'. Stop.
E:\517\3.Sim\4.RTTest\Test_veristand_rtw>echo The make command returned an error of 2
The make command returned an error of 2
E:\517\3.Sim\4.RTTest\Test_veristand_rtw>exit /B 1
Test  Failed  Code generation information file does not exist.  
0 of 1 models built (0 models already up to date)
Build duration: 0h 2m 1.1525s
Error: Error(s) encountered while building "Test"
我确定VeriStand Generation Support 1.0和Matlab 2022b是兼容的。

解决方案

出现此错误的原因是模型名称、模型路径或VeriStand Model Generation Support插件使用的文件路径中存在空格。您可以参考Gmake Error 2 When Building Simulink Model for Use in VeriStand来解决此问题。
如果错误仍然存在,您可以按照以下步骤解决此错误:
  1. 卸载VeriStand Model Geneation Support插件。
  2. 更改插件的默认安装路径。
捕获.JPG
  1. 将不包含任何空格的新路径添加到Matlab路径中。
  2. 重新启动Matlab。
  3. 安装VeriStand Model Generation Support插件并关闭Matlab。
  4. 将插件的安装路径从D:\MATLABAddOns\Toolboxes\VeriStand Model Generation Support\runtime_support更改为D:\MATLABAddOns\Toolboxes\VeriStand_Model_Generation_Support\runtime_support(不带空格)。
  5. 将新路径添加到Matlab路径列表中。
捕获.JPG
  1. 最后,重新启动Matlab并尝试编译模型。