error: unknown type name 'mxArray'

12 views (last 30 days)
Aubrey
Aubrey on 20 Aug 2024
Edited: Aubrey on 30 Aug 2024
I added non-inlined s-functions to a simulink model, built the code, and am now trying to generate a2l file.
I am running into these errors. In what file do I define the type names and how do I define them?
Thanks,
simstruc.h:: error: unknown type name 'mxArray'
simstruc.h:: error: unknown type name 'mxArray'
simstruc.h:: error: unknown type name '_ResolveVarFcn'
error: unknown type name '_ssFcnCallExecArgInfo'
simstruc.h:: error: unknown type name '_ssFcnCallExecArgInfo'
error: unknown type name '_ssFcnCallExecArgs'
imstruc.h: error: unknown type name 'SSSimulinkFunctionPtr'
  2 Comments
Malay Agarwal
Malay Agarwal on 22 Aug 2024
Edited: Malay Agarwal on 22 Aug 2024
Could you please share the Simulink model so that I can reproduce the issue? Please also share the steps you took to build the code and to generate the A2L file.
Aubrey
Aubrey on 29 Aug 2024
I am unable to share the model due to confidentiality. The A2L file is generated using a custom software. I built the code using Simulink control b.

Sign in to comment.

Answers (1)

Udit06
Udit06 on 26 Aug 2024
Edited: Udit06 on 26 Aug 2024
Hi Aubrey,
You can refer to the following MATLAB answer which handles a similar issue:
The above answer suggests the following two approaches to resolve the issue:
  • Define the compile and link switches in your IDE based on the output of the Verbose build. You can refer to the following MathWorks documentation for more details related to the Verbose build:
  • The other suggestion was to inline the s function by wrapping it. You can refer to the following MathWorks documentation to understand more about wrapper S-functions.
You can get the R2017b release specific documentations using the following command on your MATLAB command window:
>> doc('Wrap User Code with TLC')
>> doc('Verbose build')
I hope this helps.
  2 Comments
Aubrey
Aubrey on 29 Aug 2024
Edited: Aubrey on 29 Aug 2024
Is there any sort of further training available or examples for generating a TLC file? The documentation has not helped to write the .tlc file. I would like to inline noninlined s-functions if possible.
Aubrey
Aubrey on 30 Aug 2024
Edited: Aubrey on 30 Aug 2024
Ok I found access to the tutorials in a different location.
I am primarily looking for information on how to generate the .TLC file as described here. https://www.mathworks.com/help/rtw/tlc/wrapping-user-code-with-tlc.html
I have a sfunction (X) with files X.c, X.h, X.mex. These were created using Simulink subsystem, right click, C, Generate S function.
In the example, there are two c files referenced, my_alg.c and wrapsfcn.c, no header. Is my S function X equivalent to wrapsfcn.c and wrapsfcn.mex, or do I need to copy my X.c to change_wrapsfcn.tlc as shown in the example?
Basically, is change_wrapsfcn.tlc a generic template where I need to add my C code from X.c to create the X.tlc? If not, where do I start for my .tlc file with X.c, X.h, and X.mex?

Sign in to comment.

Products


Release

R2017b

Community Treasure Hunt

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

Start Hunting!