Opened 9 years ago
Closed 9 years ago
#3240 closed defect (fixed)
FMI import treats enumeration parameters badly -- many MSL models fail
Reported by: | rfranke | Owned by: | adeas31 |
---|---|---|---|
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 Changed 9 years ago by rfranke
- Cc jens.weidmann@… added
comment:2 Changed 9 years ago by adeas31
- Status changed from new to accepted
comment:3 Changed 9 years ago by adeas31
- Resolution set to fixed
- Status changed from accepted to closed
Fixed in r25218.