Opened 3 years ago

Closed 3 years ago

#6258 closed defect (fixed)

Workflow for FMU import in SSP not working

Reported by: AnHeuermann Owned by: lochel
Priority: blocker Milestone: 1.17.0
Component: FMI Version: 1.16.0
Keywords: OMEdit, FMI, SSP Cc: adeas31

Description (last modified by lochel)

I'm trying to export a model to FMU and import it back again in OMEdit by using SSP. When trying to simulate I will get multiple errors and the simulation is failing.

How to reproduce:

  • Export a FMU for Modelica.Electrical.Analog.Examples.CauerLowPassAnalog
    [3] 12:50:14 Scripting Notification
    The FMU is generated at /tmp/OpenModelica_andreas/OMEdit/Modelica.Electrical.Analog.Examples.CauerLowPassAnalog/Modelica.Electrical.Analog.Examples.CauerLowPassAnalog.fmu.
    
  • Create a new SSP model with: SSP->New SSP model. In the following dialog enter name: importMEFMU, Root System Name: Root, Root System Type: Strongly Coupled and confirm with ok.
  • Enter the root model via the libraries browser with a double click.
  • Click Add SubModlue (the icon with FMU and the green arrow on it), browse to your created FMU open it.
  • Confirm the Path and Name in the next dialog and click ok.
  • Click Instantiates the current SSP model (the icon with the blue cube with a small green arrow on it). The view will change a bit and it is not possible to change anything any more.
  • Click Simulate (the icon with the big green arrow).
[3] 13:03:55 Scripting Error
[fmi2logger] Modelica_Electrical_Analog_Examples_CauerLowPassAnalog (logStatusError): fmi2Terminate: Illegal call sequence. fmi2Terminate is not allowed in Initialization Mode state.

[4] 13:03:55 Scripting Error
[terminate] Termination of system "Modelica_Electrical_Analog_Examples_CauerLowPassAnalog" failed

[5] 13:03:55 Scripting Error
[terminate] Termination of system "importMEFMU.Root" failed

[6] 13:03:55 Scripting Error
[fmi2logger] Modelica_Electrical_Analog_Examples_CauerLowPassAnalog (logStatusError): fmi2ExitInitializationMode: Illegal call sequence. fmi2ExitInitializationMode is not allowed in Error state.

[7] 13:03:55 Scripting Error
[initialize] fmi2_import_exit_initialization_mode failed for FMU "importMEFMU.Root.Modelica_Electrical_Analog_Examples_CauerLowPassAnalog"

[8] 13:03:55 Scripting Error
[fmi2logger] Modelica_Electrical_Analog_Examples_CauerLowPassAnalog (logStatusError): fmi2Terminate: Illegal call sequence. fmi2Terminate is not allowed in Error state.

[9] 13:03:55 Scripting Error
[terminate] Termination of system "Modelica_Electrical_Analog_Examples_CauerLowPassAnalog" failed

[10] 13:03:55 Scripting Error
[terminate] Termination of system "importMEFMU.Root" failed

[11] 13:03:55 Scripting Error
[initialize] Initialization of system "importMEFMU.Root" failed

[12] 13:03:55 Scripting Error
[fmi2logger] Modelica_Electrical_Analog_Examples_CauerLowPassAnalog (logStatusError): fmi2Terminate: Illegal call sequence. fmi2Terminate is not allowed in Error state.

[13] 13:03:55 Scripting Error
[terminate] Termination of system "Modelica_Electrical_Analog_Examples_CauerLowPassAnalog" failed

[14] 13:03:55 Scripting Error
[terminate] Termination of system "importMEFMU.Root" failed

Note that I didn't hit Ctrl+S yet and the model is not saved. Also I can't save it now.

So maybe I'm just missing one setting in the simulation setup, but now it isn't possible to change anything. I can't write in the SSP model, it's read-only.
Also I can't terminate the model initialization because this is failing as well. So my only option is to close OMEdit and lose all my work progress.

My OS: Ubuntu 20.04 in WSL2 on Windows 10. I'm using VcXsrv as an X-server to open OMEdit.
OpenModelica version: OMCompiler v1.17.0-dev.224+g780a680592

Change History (7)

comment:1 Changed 3 years ago by AnHeuermann

The ssp file (copied to the clipboard because I can't save).

<?xml version="1.0"?>
<ssd:SystemStructureDescription xmlns:ssc="http://ssp-standard.org/SSP1/SystemStructureCommon" xmlns:ssd="http://ssp-standard.org/SSP1/SystemStructureDescription" xmlns:ssv="http://ssp-standard.org/SSP1/SystemStructureParameterValues" xmlns:ssm="http://ssp-standard.org/SSP1/SystemStructureParameterMapping" xmlns:ssb="http://ssp-standard.org/SSP1/SystemStructureSignalDictionary" xmlns:oms="https://raw.githubusercontent.com/OpenModelica/OMSimulator/master/schema/oms.xsd" name="importMEFMU" version="1.0">
	<ssd:System name="Root">
		<ssd:Elements>
			<ssd:Component name="Modelica_Electrical_Analog_Examples_CauerLowPassAnalog" type="application/x-fmu-sharedlibrary" source="resources/0001_Modelica_Electrical_Analog_Examples_CauerLowPassAnalog.fmu">
				<ssd:Connectors>
					<ssd:Connector name="R1.R" kind="parameter">
						<ssc:Real />
					</ssd:Connector>
					<ssd:Connector name="R1.T_ref" kind="parameter">
						<ssc:Real />
					</ssd:Connector>
					<ssd:Connector name="R1.alpha" kind="parameter">
						<ssc:Real />
					</ssd:Connector>
					<ssd:Connector name="R2.R" kind="parameter">
						<ssc:Real />
					</ssd:Connector>
					<ssd:Connector name="R2.T_ref" kind="parameter">
						<ssc:Real />
					</ssd:Connector>
					<ssd:Connector name="R2.alpha" kind="parameter">
						<ssc:Real />
					</ssd:Connector>
					<ssd:Connector name="V.V" kind="parameter">
						<ssc:Real />
					</ssd:Connector>
					<ssd:Connector name="V.offset" kind="parameter">
						<ssc:Real />
					</ssd:Connector>
					<ssd:Connector name="V.startTime" kind="parameter">
						<ssc:Real />
					</ssd:Connector>
					<ssd:Connector name="c1" kind="parameter">
						<ssc:Real />
					</ssd:Connector>
					<ssd:Connector name="c3" kind="parameter">
						<ssc:Real />
					</ssd:Connector>
					<ssd:Connector name="c5" kind="parameter">
						<ssc:Real />
					</ssd:Connector>
					<ssd:Connector name="l1" kind="parameter">
						<ssc:Real />
					</ssd:Connector>
					<ssd:Connector name="l2" kind="parameter">
						<ssc:Real />
					</ssd:Connector>
					<ssd:Connector name="C1.C" kind="calculatedParameter">
						<ssc:Real />
					</ssd:Connector>
					<ssd:Connector name="C2.C" kind="calculatedParameter">
						<ssc:Real />
					</ssd:Connector>
					<ssd:Connector name="C3.C" kind="calculatedParameter">
						<ssc:Real />
					</ssd:Connector>
					<ssd:Connector name="C4.C" kind="calculatedParameter">
						<ssc:Real />
					</ssd:Connector>
					<ssd:Connector name="C5.C" kind="calculatedParameter">
						<ssc:Real />
					</ssd:Connector>
					<ssd:Connector name="L1.L" kind="calculatedParameter">
						<ssc:Real />
					</ssd:Connector>
					<ssd:Connector name="L2.L" kind="calculatedParameter">
						<ssc:Real />
					</ssd:Connector>
					<ssd:Connector name="R1.T" kind="calculatedParameter">
						<ssc:Real />
					</ssd:Connector>
					<ssd:Connector name="R1.T_heatPort" kind="calculatedParameter">
						<ssc:Real />
					</ssd:Connector>
					<ssd:Connector name="R2.T" kind="calculatedParameter">
						<ssc:Real />
					</ssd:Connector>
					<ssd:Connector name="R2.T_heatPort" kind="calculatedParameter">
						<ssc:Real />
					</ssd:Connector>
					<ssd:Connector name="V.signalSource.height" kind="calculatedParameter">
						<ssc:Real />
					</ssd:Connector>
					<ssd:Connector name="V.signalSource.offset" kind="calculatedParameter">
						<ssc:Real />
					</ssd:Connector>
					<ssd:Connector name="V.signalSource.startTime" kind="calculatedParameter">
						<ssc:Real />
					</ssd:Connector>
					<ssd:Connector name="c2" kind="calculatedParameter">
						<ssc:Real />
					</ssd:Connector>
					<ssd:Connector name="c4" kind="calculatedParameter">
						<ssc:Real />
					</ssd:Connector>
					<ssd:Connector name="R1.useHeatPort" kind="calculatedParameter">
						<ssc:Boolean />
					</ssd:Connector>
					<ssd:Connector name="R2.useHeatPort" kind="calculatedParameter">
						<ssc:Boolean />
					</ssd:Connector>
				</ssd:Connectors>
			</ssd:Component>
		</ssd:Elements>
		<ssd:Annotations>
			<ssc:Annotation type="org.openmodelica">
				<oms:SimulationInformation>
					<oms:VariableStepSolver description="cvode" absoluteTolerance="0.000100" relativeTolerance="0.000100" minimumStepSize="0.000100" maximumStepSize="0.100000" initialStepSize="0.000100" />
				</oms:SimulationInformation>
			</ssc:Annotation>
		</ssd:Annotations>
	</ssd:System>
	<ssd:DefaultExperiment startTime="0.000000" stopTime="1.000000">
		<ssd:Annotations>
			<ssc:Annotation type="org.openmodelica">
				<oms:SimulationInformation resultFile="importMEFMU_res.mat" loggingInterval="0.000000" bufferSize="10" signalFilter=".*" />
			</ssc:Annotation>
		</ssd:Annotations>
	</ssd:DefaultExperiment>
</ssd:SystemStructureDescription>

comment:2 Changed 3 years ago by casella

  • Milestone changed from NeedsInput to 1.17.0
  • Priority changed from high to blocker

Using SSP shouldn't be frustrating...

comment:3 Changed 3 years ago by AnHeuermann

I tried this again today and my error is apparently the step:

  • Click Instantiates the current SSP model (the icon with the blue cube with a small green error on it). The view will change a bit and it is not possible to change anything any more.

If I don't press it it works.

comment:4 Changed 3 years ago by AnHeuermann

  • Description modified (diff)

comment:5 Changed 3 years ago by lochel

  • Description modified (diff)

comment:6 Changed 3 years ago by adeas31

  • Cc adeas31 added

comment:7 Changed 3 years ago by lochel

  • Resolution set to fixed
  • Status changed from new to closed

This is fixed; thanks @AnHeuermann and @adeas31!

Note: See TracTickets for help on using tickets.