Opened 10 years ago

Closed 10 years ago

#3240 closed defect (fixed)

FMI import treats enumeration parameters badly -- many MSL models fail

Reported by: Rüdiger Franke Owned by: Adeel Asghar
Priority: high Milestone: 1.9.3
Component: FMI Version: trunk
Keywords: Cc: jens.weidmann@…

Description

MSL uses evaluated parameters of enumeration types for initialization. FMI import using OMEdit leads to wrong equation counts, because the respective variables remain unassigned.

See Modelica.Blocks.Continuous.Integrator for an example. The model contains:

  parameter Modelica.Blocks.Types.Init initType = Modelica.Blocks.Types.Init.InitialState "Type of initialization (1: no init, 2: steady state, 3,4: initial output)" annotation(Evaluate = true, Dialog(group = "Initialization"));

The exported FMU lists:

<ScalarVariable description="Type of initialization (1: no init, 2: steady state, 3,4: initial output)" name="initType" 
  initial="calculated" causality="calculatedParameter" variability="fixed" valueReference="0">
    <Enumeration declaredType="Modelica.Blocks.Types.Init"/>
</ScalarVariable>

Importing the FMU back to OMEdit, the generated wrapper code declares the enumeration again:

  Modelica.Blocks.Types.Init initType "Type of initialization (1: no init, 2: steady state, 3,4: initial output)";

But the wrapper code assigns no value.

Couldn't the declarations of enumerations just be removed from the wrapper code -- or commented out unless they get values assigned?

Change History (3)

comment:1 by Rüdiger Franke, 10 years ago

Cc: jens.weidmann@… added

comment:2 by Adeel Asghar, 10 years ago

Status: newaccepted

comment:3 by Adeel Asghar, 10 years ago

Resolution: fixed
Status: acceptedclosed

Fixed in r25218.

Note: See TracTickets for help on using tickets.