Opened 4 years ago
Last modified 4 years ago
#6371 assigned defect
Modelic_Synchronus FMUs not working — at Initial Version
Reported by: | Andreas Heuermann | Owned by: | Lennart Ochel |
---|---|---|---|
Priority: | high | Milestone: | |
Component: | FMI | Version: | v1.17.0-dev |
Keywords: | fmi, Modelica_Synchronus, clock, | Cc: | arunkumar palanisamy |
Description
As far as I can tell it is not possible to export a Modelica model, that is using features like clocks from Modelic_Synchronus, as an FMU that can be run by a FMU Import Tool.
For example when exporting Modelica_Synchronous.Examples.Elementary.ClockSignals.SubSample
as a 2.0 FMU and simulating it with OMSimulator the simulation will issue warnings and the results are completely wrong.
setCommandLineOptions("--std=3.5 --simCodeTarget=Cpp"); getErrorString(); loadModel(Modelica, {"3.2.3"}); getErrorString(); loadModel(Modelica_Synchronous); getErrorString(); buildModelFMU(Modelica_Synchronous.Examples.Elementary.ClockSignals.SubSample, version="2.0", fmuType="me"); getErrorString(); system("OMSimulator Modelica_Synchronous.Examples.Elementary.ClockSignals.SubSample.fmu"); getErrorString();
andreas@DESKTOP-OSJIVA0:~/workspace/Testitesttest/newTicketClocks$ omc runTests.mos true "" true "" true "" "/home/andreas/workspace/Testitesttest/newTicketClocks/Modelica_Synchronous.Examples.Elementary.ClockSignals.SubSample.fmu" "" info: Set temp directory to "/home/andreas/workspace/Testitesttest/newTicketClocks" info: Set working directory to "/home/andreas/workspace/Testitesttest/newTicketClocks" info: Set working directory to "/home/andreas/workspace/Testitesttest/newTicketClocks" info: New model "model" with corresponding temp directory "/home/andreas/workspace/Testitesttest/newTicketClocks/model-ew0k961t" error: [fmiLogger] module FMI2XML: [Line:105] Unknown element 'Clocks' in XML, skipping warning: module FMI2XML: [Line:106] Skipping nested XML element 'Clock' warning: module FMI2XML: [Line:106] Skipping nested XML element 'Inferred' error: [fmiLogger] module FMI2XML: Unknown attribute 'clockIndex=1' in XML info: model doesn't contain any continuous state info: Result file: model_res.mat (bufferSize=10) info: Parameter model.root.fmu.periodicClock.solverMethod will not be stored in the result file, because the signal type is not supported info: 2 warnings info: 2 errors 0 ""
The result of model.sample1.y
should be a clocked version of a sine curve.
I have added the modelDescription.xml to this ticket.
Or is it just that I exported the FMU wrong and it is possible? The Cpp should be able to use clocks in FMUs, but it didn't change anything for me when adding simCodeTarget=Cpp
.