Simulink coder TwinCAT issue

5 次查看(过去 30 天)
Soroush Azarian
Soroush Azarian 2022-4-6
回答: Chetan 2023-12-29
am trying to compile a S-function based model into Twincat object and I am getting the follwoing error. has anyone encountered the similar issue? Top model targets built: Mode
Top model targets built: Model Action Rebuild Reason ============================================================================= ConverterModelDUT Failed Code generation information file does not exist. 0 of 1 models built (0 models already up to date) Build duration: 0h 0m 5.212s
The call to TwinCatGrt_make_rtw_hook, during the after_make hook generated the following error: Dot indexing is not supported for variables of this type. The build process will terminate as a result.
Caused by:
  • Dot indexing is not supported for variables of this type.
Component:Simulink | Category:Block diagram error

回答(1 个)

Chetan
Chetan 2023-12-29
I Understand that you are facing an issue with the Simulink Coder TwinCAT target within MATLAB R2018b. The challenge seems to originate from the S-Function target generation process, involving a custom TMF that lacks a declaration for a mex file-compatible toolchain.
To begin addressing this, ensure the `tccert` file is correctly named:
File Naming and Location Verification:
  • Check that the `tccert` file has the correct name and is located in the directory MATLAB expects.
File Name Modification:
  • If necessary, rename the `tccert` file to conform to MATLAB's expected naming structure.
For more information you can refer the following MathWorks Documentation here:
If you are utilizing a version of MATLAB that predates R2018b, you may consider this as workaround:
1. Custom Toolchain Creation: Construct a custom toolchain derive it from MinGW64, but ensure the build actions are set to do nothing.
2. Toolchain Naming: Preface your custom toolchain's name with 'MinGW64' to sidestep any build issues within MATLAB.
3. Toolchain Registration: Register your new custom toolchain in MATLAB using the `coder.make.getToolchainInfoFromRegistry` function.
4. Toolchain Implementation: Adjust your model settings to build with the newly created custom toolchain.
Below is an example of how to register your custom toolchain:
tcInfo = coder.make.getToolchainInfoFromRegistry('YourCustomToolchain');
tcInfo.Name = ['MinGW64 ', tcInfo.Name];
Hope it helps !

类别

Help CenterFile Exchange 中查找有关 Build Configuration 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by