Skip to content

FMIImport #380

Open
Open

Description

@syntron

During rework of the last pull request, I noted one of the TODO items:

# TODO: why is '--allowNonStandardModelica=reinitInAlgorithms' needed? any example without this possible?

Is this really needed for any FMU to import? Are there other possibilities?

I do expect that such a functionality should be possible using only standard Modelica, or?

Activity

  1. added this to the milestone on Nov 20, 2025
  2. adeas31 commented on Nov 20, 2025

    @adeas31
    Member

    This was added by you in #351

    I suppose it should work without it. You can make a PR and see if the test pass.

  3. syntron commented on Nov 20, 2025

    @syntron
    ContributorAuthor

    This was added by you in #351

    I suppose it should work without it. You can make a PR and see if the test pass.

    I know that I added it - at that time I did not ask why it is not working - however, it is still failing; see the checks of my test branch at: https://github.com/syntron/OMPython/actions/runs/19550820822/job/55981548974

    Error message:

    FAILED 😰  tests/test_FMIImport.py::test_FMIImport - OMPython.ModelicaSystem.ModelicaSystemError: Error executing 'buildModel(M_me_FMU, variableFilter=".*")': OMC error occurred for 'sendExpression(buildModel(M_me_FMU, variableFilter=".*"), True):
    00: [translation:error:618] [/tmp/cde47604-2523-4ebd-81ee-cddb62bce9b5/M_me_FMU.mo:false:59:7:59:37] Operator reinit may not be used in an algorithm section (use translation flag --allowNonStandardModelica=reinitInAlgorithms to ignore).
    
  4. adeas31 commented on Dec 2, 2025

    @adeas31
    Member

    The generated Modelica code from FMU uses reinit inside algorithm section which is not allowed anymore. So in order to run this one need to use --allowNonStandardModelica=reinitInAlgorithms.

    I guess this won't fix since we use OMSimulator now for importing FMUs. The importFMU API is kind of depreciated and there are no future plans for it.

  5. syntron commented on Dec 3, 2025

    @syntron
    ContributorAuthor

    I guess this won't fix since we use OMSimulator now for importing FMUs. The importFMU API is kind of depreciated and there are no future plans for it.

    If FMU import in OpenModelica is depreciated what would be the recommended way to load an FMU and extend it by additional code using OpenModelica? As I read the description of OMSimulator is mainly for simulating an FMU; not for the extending part ...

  6. modified the milestones: , 5.0.0 on Dec 16, 2025
  7. syntron commented on Jan 11, 2026

    @syntron
    ContributorAuthor

    see also OpenModelica/OpenModelica#10974 as reference about the status of FMI import

  8. adeas31 commented on Feb 4, 2026

    @adeas31
    Member

    See also OpenModelica/OpenModelica#5345

    I have no idea if we are going to fix FMI import in future. But for now in order to make it work one need to use --allowNonStandardModelica=reinitInAlgorithms.

  9. casella commented on Feb 4, 2026

    @casella

    I have no idea if we are going to fix FMI import in future. But for now in order to make it work one need to use --allowNonStandardModelica=reinitInAlgorithms.

    That's a job for MAP-Lang/MAP-Lib. We're working on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions