CATIA-Systems / FMIKit-Simulink

Import and export Functional Mock-up Units with Simulink
Other
157 stars 51 forks source link

Error exporting Simulink model with CAN blocks #395

Open iscopa opened 1 year ago

iscopa commented 1 year ago

Hello,

I am trying to export a FMU from a Simulink model containing the "CAN Unpack", "CAN Receive" and "CAN configure" blocks:

grafik

Setup: MATLAB r2021b with Vehicle Network Toolbox and FMIKit 3.0

Whereas the code generation with "grt.tlc" is successful, the code generation with "grtfmi.tlc" produces the error:

Generating code and artifacts to 'Model specific' folder structure Invoking Target Language Compiler on Read_CAN_simple.rtw Using System Target File: C:\MATLAB\FMIKit-Simulink-3.0\grtfmi\grtfmi.tlc Loading TLC function libraries Initial pass through model to cache user defined code Caching model source code Writing header file Read_CAN_simple_types.h Writing header file Read_CAN_simple.h Writing header file rtwtypes.h Writing header file multiword_types.h Writing source file Read_CAN_simple.c . Writing header file Read_CAN_simple_private.h Writing header file rtmodel.h Writing source file Read_CAN_simple_data.c TLC code generation complete. Writing modelDescription.xml Error: File: C:\MATLAB\FMIKit-Simulink-3.0\grtfmi\grtfmixml.tlc Line: 47 Column: 41 The argument for an [] operation must be a repeated scope symbol, a vector, or a matrix Main program: ==> [00] C:\MATLAB\FMIKit-Simulink-3.0\grtfmi\grtfmixml.tlc:<NONE>(47)

Could you please help on that? Thank you[](url)

u20p17 commented 8 months ago

i have the same issue - is the a solution available?

iscopa commented 8 months ago

I solved it exporting the Simulink model as FMU without CAN boxes, and then extending the Master-Alg -in my case a Python script- with a Python CAN module.