- Make sure S-function source file includes the necessary Simulink headers. Typically, you would include “simstruc.h”, which in turn includes “tmwtypes.h” where “real_T” and “time_T” are defined.
- Ensure that the include paths for the Simulink headers are correctly set up in project. This can be done by adding the include paths to your compiler's include directories. The paths typically include the directories where MATLAB and Simulink are installed.
- Ensure that compiler is correctly configured to use the Simulink libraries and header files. If you are using a makefile or a project file, add the necessary include paths and library paths.
- After ensuring that the necessary headers are included and the include paths are correctly set up, rebuild S-function
Error while creating s-function build related to real_T and time_T
조회 수: 4 (최근 30일)
이전 댓글 표시
I have C project and I'm trying to build a s-function for the C-project so that I can use the s-function for simulations in loop with some plant models. However I'm getting the following error
simstruc_types.h:134:5: error: unknown type name 'real_T' real_T** taskTime
rtw_solver.h:55:5: error: unknown type name 'time_T' time_T* stepSizePtr;
The same errors reflected in many other files. I just gave two examples just to explain the scenario. What should I do to get rid of the error?
댓글 수: 0
답변 (1개)
Vidhi Agarwal
2024년 7월 31일
Hi Setty,
I assume you are encountering an error. This error usually indicates that the types “real_T” and “time_T” are not defined in project. These types are typically defined in the Simulink header files, specifically in “tmwtypes.h”. To resolve these errors, ensure that the necessary Simulink header files are included in S-function code and that include paths are correctly set up.
Below are the steps that can help in resolving the issue:
Hope that helps!
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!