Jack
Jack

Reputation: 1232

An error in Dymola "Failed to generate XML file for the FMU"?

A model works fine, but on my PC it ends up with an error "Failed to generate XML file for the FMU". Someone told me this is because the XML parser is broken on Windows system. Anyone know the exact reason for this problem?

enter image description here

Upvotes: 4

Views: 596

Answers (5)

MMeissner
MMeissner

Reputation: 61

I had the same problem. For me the error popped up when I had the combination of the two flags:

  • „Translation“ -> „Provide variable dependencies for plotting“ (which is Advanced.GenerateVariableDependencies) = true.
  • „FMI Export“ -> “Exclude Auxiliary variables“ (which is Advanced.FMI.xmlIgnoreLocal) = true.

Disabeling one of them both got rid of the error for me.

Upvotes: 1

Dave
Dave

Reputation: 41

I encountered the same issue when exporting an FMU. For me the above listed options didn't work but excluding the auxiliary variables worked. Might be an really specific solution but I wanted to share it anyway. The corresponding command in Dymola is Advanced.FMI.xmlIgnoreLocal = true A screenshot of the settings can be found here

Upvotes: 4

Jack
Jack

Reputation: 1232

The explanations from macro and Hans Olsson are very helpful. Thanks to their help I found the reason. It is because I set "Provide variable dependencies for plotting" in the Translation Tab.

enter image description here

enter image description here

Upvotes: 0

Hans Olsson
Hans Olsson

Reputation: 12507

Both the logic to avoid generating that error, and the error message has been improved in later versions of Dymola. In Dymola 2020x you get:

Failed to generate XML file for the FMU or for variable dependencies.

indicating that the issue is likely that you have set Advanced.GenerateVariableDependencies=true;

Upvotes: 7

marco
marco

Reputation: 6645

FMUs are causal, so you have to use causal inputs and outputs as interfaces. These inputs must be defined at the top level, so Dymola knows what the interfaces of the FMU to export will be.

In your model the inputs of some components are open. You have to define top-level connectors for them and connect them, like in the screenshot below. Then the FMU export will work.

Screenshot of model for FMU export, with inputs connected

The same goes for outputs: If your FMU shall have outputs, you must define them on top level. In your example we can easily do that for stodolaTurbine.MechPower.

Upvotes: 3

Related Questions