Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unity crash #2

Open
saulcasti opened this issue Jan 13, 2021 · 5 comments
Open

Unity crash #2

saulcasti opened this issue Jan 13, 2021 · 5 comments

Comments

@saulcasti
Copy link

saulcasti commented Jan 13, 2021

When I use a .fmu file of 184 model variables, FMI2's variable "component" always set to 0x0. Then, when I play app, Unity crash.

@saulcasti saulcasti reopened this Jan 14, 2021
@sangvikh
Copy link

sangvikh commented Mar 3, 2021

I have the same problem with FMU's made in OpenModelica. From simulink it works with a hack (setting time to 0 every step).

@CNowak-itk
Copy link

CNowak-itk commented Mar 10, 2021

Same problem here.

Simulink FMUs are working

FMUs from https://github.com/fmi-tools/cpp-fmus are crashing during FMI initialisation. FMPy can simulate these FMUs. So I guess the problem is in the Unity FMI Importer. Anyone has any clue why that is?

edit: Using Debug Logs in the FMI unity crashes during processing https://github.com/viproma/cppfmu/blob/100cdd288dd9deedd5eb0d20abddcc7cbc96fd53/fmi_functions.cpp#L495 in the FMU. My guess is, there is a problem with this cpp library and the C# FMI Importer. But I don't know for sure on which side the error is. (as the FMI can be simulated with FMPy, I guess the error is on the C# side, but I'm not an expert in this)

@sakspapir
Copy link

I have the same issue, Unity crashes when instantiating the fmu, at FMI2.cs -> Line 223:

component = fmi2Instantiate(instanceName, (int)fmi2Type.fmi2CoSimulation, guid, resourceLocation, callbacks, fmi2False, loggingOn ? fmi2True : fmi2False);

The FMU im using is made with OpenModelica:

SimpleModel.zip

@OivinF
Copy link

OivinF commented Feb 2, 2022

I'm seeing a crash as well when initializing my own FMU, I think it's the same as described in this thread.
The crash dump says

0xC0000090 The exponent of a floating-point operation is greater than the magnitude allowed by the corresponding type

The demo scene with the bouncing ball works fine.

@ashtorak
Copy link

ashtorak commented Aug 8, 2022

I have the same issue, Unity crashes when instantiating the fmu, at FMI2.cs -> Line 223:

component = fmi2Instantiate(instanceName, (int)fmi2Type.fmi2CoSimulation, guid, resourceLocation, callbacks, fmi2False, loggingOn ? fmi2True : fmi2False);

The FMU im using is made with OpenModelica:

SimpleModel.zip

Exact same for me. Have you found a solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants