Third party s function Integration problems

1 回表示 (過去 30 日間)
Joe Holdsworth
Joe Holdsworth 2018 年 4 月 9 日
回答済み: Kanishk 2025 年 2 月 6 日
I have included an third party S Function in my model. From this model I need to generate source code and then integrate the source code within another application in another tool chain (Xilinx SDK IDE).
The code generation for the model with the sfunction completes with out error.
In the directory where the code has auto generated I run the following commands:
load('buildInfo.mat')
packNGo(buildInfo)
As far as I have understood the documentation this generates a Zip containing a flat file structure of all the files required to build the model externally.
I have copied the files into the other development environment and called the base model the same as I have in the past.
Now when I compile I get the following errors:
Description Resource Path Location Type
#error Must define one of RT, NRT, MATLAB_MEX_FILE, SL_INTERNAL, or FIPXT_SHARED_MODULE simstruc.h /Stage10_RTOS_Code/src/Application line 363 C/C++ Problem
I also recieve this error in multiword_types.h because the types are not recognised.
/*
* Definitions supporting external data access
*/
typedef int64_T chunk_T;
typedef uint64_T uchunk_T;
How do I put in custom types.

回答 (1 件)

Kanishk
Kanishk 2025 年 2 月 6 日
I understand you are facing issues while using relocated code in a different development environment. Relocating code generated by Simulink to a different development environment can sometimes be difficult due to differences in file structures and dependencies. Here are some suggestions that might help resolve the issues you're facing:
  • While generating code using Simulink Coder, in the Code generation Tab of Configuration Parameters, Select the 'Package code and artifacts' check box. This automatically runs the 'packNgo' process, creating a zip file that includes the executable and all necessary dependency files. This setup allows the executable to run without requiring MATLAB or Simulink.
  • When using 'packNgo', set the 'minimalHeaders' property to 'false'. This ensures that all header files on the include path are added to the zip file, which can help avoid issues with missing type definitions.
packNGo(buildInfo, 'minimalHeaders', false);
  • If your code relies on a specific folder structure, set the 'packType' property to 'hierarchical' when running 'packNGo'. This maintains the original folder structure, which is important if the generated makefile or code depends on the relative location of files.
packNGo(buildInfo, 'packType', 'hierarchical');
Here some links to MathWorks Documentation for relocating code for different development environment.
Hope this helps!

カテゴリ

Help Center および File ExchangeC Shared Library Integration についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by