Skip to content

Issue with FMU using an external resource #23

@modelonrobinandersson

Description

@modelonrobinandersson

With the model Modelica.Utilities.Examples.readRealParameterModel I generated a CS FMU using OCT.
Then I import this FMU Modelica_Utilities_Examples_readRealParameterModel.fmu into a dummy library using Modelica-FMI, for simplicity let's say I import it into library MyLibrary as MSLModel. Then I generate an FMU from MyLibrary.MSLModel and try to simulate this. I get the following error while the initialization is starting:

FMIL: module = FMICAPI, log level = 5: Calling fmi2SetupExperiment
FMIL: module = FMICAPI, log level = 5: Calling fmi2EnterInitializationMode
...
FMIL: module = Model, log level = 3: [WARNING][FMU status:Warning] <ModelicaMessage category="warning"><value name="msg">"&lt;Error category=""error""&gt;Could not locate resource &lt;value name=""File""&gt;""/ws/0/Examples_readRealParameters.txt""&lt;/value&gt;&lt;/Error&gt;&#10;"</value></ModelicaMessage>

It is a bit hard to read but the important part is:

Could not locate resource /ws/0/Examples_readRealParameters.txt

I can add that:

  1. In the FMU that is imported the resource exists at <FMU>/resources/0/Examples_readRealParameters.txt
  2. /ws/ is the top level path, I have my library at /ws/fmus/MyLibrary.
  3. I can verify that the file exists after import /ws/fmus/MyLibrary/Resources/FMUs/c156664/resources/0/Examples_readRealParameters.txt
  4. My working directory while getting the error above is /ws/fmus

Any idea what is wrong here? This example works for me with another FMU to Modelica Import tool. It looks like the path that is used for the resource file is the path from the FMU (which is expected) but concatenated with the incorrect path /ws/ in this case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    OptimicaRelated to Modelon Optimica Compiler Toolkit

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions