Problem with simulation after FMU generated

Issue #91 closed
Former user created an issue

After I generated the FMU with fmu-builder, I checked it with FMU Compliance Checker (available for free at https://trac.fmi-standard.org/browser/branches/public/Test_FMUs/Compliance-Checker) and the result is: "Failed to initialize FMU for simulation (FMU status: fatal) Simulation loop terminated at time 0 since FMU returned status: Fatal fmiTerminateSlave returned status: Fatal ".

Comments (8)

  1. Jose Evora

    Dear Andrei,

    Thank you very much for contacting us. I have run your FMU in a small master algorithm I developed and it seems to work correctly at least using JavaFMI wrapper.

            Simulation simulation = new Simulation("D:\\Users\\Downloads\\Car.fmu");
            simulation.init(0);
            simulation.write("car.in").with(2);
            simulation.doStep(60);
            System.out.println(simulation.read("car.out").asInteger());
            simulation.terminate();
    

    Which wrappers have you used? In which of them it crashes?.

    Additionally, I've observed there are some changes made in the Java code of the Car.java as variables are different from the one of the example. May I have a look on your source code?. I have the feeling it crashes when calling the init method.

    Please, find attached an example of a working Car.fmu (no fatal errors). I also recommend you to check the jar file inside to see how it is built (with the framework is extracted inside the jar). I don't think this is a root of any problem but we believe it is the best way to built the Jar. There are also some strange eclipse classes. Do you have dependencies in your code with eclipse libraries?. Maybe in the init method a dependency is missed?. Normally, if the FMU internally crashes, a file with the error is generated in the same location from where you're executing the checker (this could also help you to detect the problem).

    If you check the FMU provided in the checker, you'll find some errors. Some of them are because the variables are not well-defined in the "define" method (easy to solve defining them well). Others are issues that must be addressed in the dynamic libraries (1 memory leak and 1 log callback) -> nothing to worry too much. As they are not blocking (fatal), these issues have a low priority. The FMU can be perfectly executed from start to the end.

    Best,

  2. Jose Evora

    Hello Andrei,

    Thank you very much for submitting the code. I have created the FMU based on it a it works properly (it still shows some non-blocking errors in the checker but nothing fatal). I attach in the message the Car.jar I created for building the FMU and the fmu itself. If you take a look on it, the construction of the Jar is different from the one that is inside the FMU built by you. Please, try to follow that way of constructing the Jar and let me know if you succeed.

    If you're using Eclipse, you should specify that you want dependent libraries (fmu-framework in this case), extracted inside the jar.

    Hoping it helps, best!

  3. Former user Account Deleted

    Hello Jose,

    I changed the construction of the .jar file and now is working.

    Thank you very much!

  4. Log in to comment