CATIA-Systems / FMIKit-Simulink

Import and export Functional Mock-up Units with Simulink
Other
155 stars 50 forks source link

Fail when compiling PowerGui into FMU #384

Open nl78 opened 1 year ago

nl78 commented 1 year ago

Hello,

We're facing a issue when trying to compile a model with a PowerGui block. (see attached example). The error messsage is

The call to grtfmi_make_rtw_hook, during the after_make hook generated the following error:
    Reference to non-existent field 'sources'.

The build process will terminate as a result.
Caused by:
Reference to non-existent field 'sources'.

As a workaround we added an if isfield(makeInfo,'sources') around lines 56-64 of grtfmi_model_sources.m. Hope that's the correct way to fix the issue :-).

powermodel.zip

FMIKit Release 3.0 (but it seems to be the case also with master version) + Matlab 2016

t-sommer commented 1 year ago

Can you please provide steps to reproduce the problem including the exact MATLAB version?

nl78 commented 1 year ago

Step to produce: open the .slx (attached to issue report) and try to compile it as FMU with ctrl-B. (it is already configured) Configuration: Matlab 2016b Update 7.

wie-mar commented 1 year ago

I have had the same issues, when I was using PowerGUI blocks in Matlab 2021b. The fix nl78 posts seems to solve the problem.