CATIA-Systems / FMIKit-Simulink

Import and export Functional Mock-up Units with Simulink
Other
159 stars 53 forks source link

Can't FMU export 2 #319

Open jesmitty opened 3 years ago

jesmitty commented 3 years ago

I can't generate an FMU export either but set this up as a different thread because the reasons seem different. I was just trying to get anything to work so I tried this you-tube: https://www.youtube.com/watch?v=Qd1XkrYnYiE but I am using FMIKit-Simulink-2.9 VS FMIKit-Simulink-2.6. on windows 10 and VS Studio 2019. I used the same Simulink model as in the video but get this same error no matter what the Simulink model is. Is this a known problem with a known solution or am I missing something. I did build the distribution first and initialized the toolkit.


Top Model Build 1 Elapsed: 4 sec

Generating code and artifacts to 'Model specific' folder structure

Generating code into build folder: C:\Users\jeff.smith\Documents\MATLAB\FMUexportTest_grt_fmi_rtw

Invoking Target Language Compiler on FMUexportTest.rtw

Using System Target File: C:\Users\jeff.smith\Documents\MATLAB\FMIKit-Simulink-2.9\grtfmi\grtfmi.tlc

Loading TLC function libraries

Initial pass through model to cache user defined code

.

Caching model source code

### Writing header file FMUexportTest_types.h
### Writing header file FMUexportTest.h
### Writing header file rtwtypes.h
### Writing header file multiword_types.h
### Writing source file FMUexportTest.c
### Writing header file FMUexportTest_private.h
### Writing header file rtmodel.h

.

Writing source file FMUexportTest_data.c

TLC code generation complete.

Writing modelDescription.xml

Error: File: C:\Users\jeff.smith\Documents\MATLAB\FMIKit-Simulink-2.9\grtfmi\grtfmilib.tlc Line: 76 Column: 24 Undefined identifier Units Main program: ==> [00] C:\Users\jeff.smith\Documents\MATLAB\FMIKit-Simulink-2.9\grtfmi\grtfmilib.tlc:MinMaxAttributes(76) [01] C:\Users\jeff.smith\Documents\MATLAB\FMIKit-Simulink-2.9\grtfmi\grtfmilib.tlc:VariableFMI2(113) [02] C:\Users\jeff.smith\Documents\MATLAB\FMIKit-Simulink-2.9\grtfmi\grtfmixml.tlc:(226) Error: File: C:\Users\jeff.smith\Documents\MATLAB\FMIKit-Simulink-2.9\grtfmi\grtfmilib.tlc Line: 76 Column: 30 The left-hand side of a . operator must be a valid scope identifier Main program: ==> [00] C:\Users\jeff.smith\Documents\MATLAB\FMIKit-Simulink-2.9\grtfmi\grtfmilib.tlc:MinMaxAttributes(76) [01] C:\Users\jeff.smith\Documents\MATLAB\FMIKit-Simulink-2.9\grtfmi\grtfmilib.tlc:VariableFMI2(113) [02] C:\Users\jeff.smith\Documents\MATLAB\FMIKit-Simulink-2.9\grtfmi\grtfmixml.tlc:(226) Error: File: C:\Users\jeff.smith\Documents\MATLAB\FMIKit-Simulink-2.9\grtfmi\grtfmilib.tlc Line: 76 Column: 39 The argument for an [] operation must be a repeated scope symbol, a vector, or a matrix Main program: ==> [00] C:\Users\jeff.smith\Documents\MATLAB\FMIKit-Simulink-2.9\grtfmi\grtfmilib.tlc:MinMaxAttributes(76) [01] C:\Users\jeff.smith\Documents\MATLAB\FMIKit-Simulink-2.9\grtfmi\grtfmilib.tlc:VariableFMI2(113) [02] C:\Users\jeff.smith\Documents\MATLAB\FMIKit-Simulink-2.9\grtfmi\grtfmixml.tlc:(226) Error: File: C:\Users\jeff.smith\Documents\MATLAB\FMIKit-Simulink-2.9\grtfmi\grtfmilib.tlc Line: 76 Column: 49 The left-hand side of a . operator must be a valid scope identifier Main program: ==> [00] C:\Users\jeff.smith\Documents\MATLAB\FMIKit-Simulink-2.9\grtfmi\grtfmilib.tlc:MinMaxAttributes(76) [01] C:\Users\jeff.smith\Documents\MATLAB\FMIKit-Simulink-2.9\grtfmi\grtfmilib.tlc:VariableFMI2(113) [02] C:\Users\jeff.smith\Documents\MATLAB\FMIKit-Simulink-2.9\grtfmi\grtfmixml.tlc:(226) Build Summary 1 Elapsed: 0.3 sec Top model targets built:

Model Action Rebuild Reason

FMUexportTest Failed Code generation information file does not exist.

0 of 1 models built (0 models already up to date) Build duration: 0h 0m 4.644s Error: File: C:\Users\jeff.smith\Documents\MATLAB\FMIKit-Simulink-2.9\grtfmi\grtfmilib.tlc Line: 76 Column: 24 Undefined identifier Units

Matthias776 commented 2 years ago

Since I ran into the same issue as described above I tried to export the

fmikit_demo_BouncingBall

as verification, which ended up in the following error:

The call to grtfmi_make_rtw_hook, during the after_make hook generated the following error:
    Failed to run CMake generator

The build process will terminate as a result.

Caused by: Failed to run CMake generator

The figure below shows the choose able generators I have.

CMake

Could somebody tell me if the right CMake generator is missing in my case?