# FMU generated by SM does not run in Simulation Center

Posted 9 months ago
1515 Views
|
9 Replies
|
2 Total Likes
|
 I exported a model to FMU that depends on external files to work, but when I run it the simulation center does not compute variables, it just show parameters. If I run normally the modelica file it runs fine, but when I load the FMU generated by the same System Modeler the problem occurs. I've put the external files in system modeler working directory.The model represents a Hybrid Electric Vehicle and it comes inside a package with a library. The Package comes with many other models. I simulated and exported the "SHEVpowerFiltSocOO" model. I modified it a little bit so that it have a real output now (outputs battery SOC variable). The picture below shows the expected result (run normally): But when I load the FMU version and run it shows: The SOC variable was just for example, but other variables have the same issue.The FMU is the 2.0 version for Co-Simulation. I've attached the package, lib and external files (.txt).The original package is here: http://omwebbook.openmodelica.org/SMEHVThe only modification was the SOC_Output variable, which is just a Real Output interface with causality as output. Attachments:
9 Replies
Sort By:
Posted 9 months ago
 Got it, but are the "step" and "stepTrigger" variables that appear in modelica code of the imported FMU created by SM at the time it opens or are they in some "hidden place" in the FMU? I'm asking because I'm developing an application where I execute SM FMU's. No they are not part of the FMU, they are part of the Modelica wrapper that is generated when you import an FMU into System Modeler. So you would get them for every imported co-simulation FMU regardless of the tool used to produce the FMU.Otto
Posted 9 months ago
 For a co simulation FMUs the FMU and Modelica model exchange input/outputs at discrete communication points. The FMU wrapper in System Modeler offers two ways of controlling that, using an externa trigger signal (useTriggerInput_=true) or periodically with the step size given by step_ (useTriggerIntput_false) Got it, but are the "step" and "stepTrigger" variables that appear in modelica code of the imported FMU created by SM at the time it opens or are they in some "hidden place" in the FMU? I'm asking because I'm developing an application where I execute SM FMU's.
Posted 9 months ago
 For a co simulation FMUs the FMU and Modelica model exchange input/outputs at discrete communication points. The FMU wrapper in System Modeler offers two ways of controlling that, using an externa trigger signal (useTriggerInput_=true) or periodically with the step size given by step_ (useTriggerIntput_false).
Posted 9 months ago
 Hi again, I was wondering what the useTriggerInput_ parameter means? is it a kind of enable signal generator for the solver?in the FMU that I generated in systemModeler there is a variable: Interfaces_.Boolean_DiscreteInput stepTrigger_ if useTriggerInput_ >>; I noticed that SM just generate it if the FMU is for Co-Simulation. So if I'm correct it is a synchronization mechanism for other programs or process that simulate other part of the system.
Posted 9 months ago
 I found the tab here, set the parameters as you said and it worked! My bad! Thanks for the help Otto!Michel
Posted 9 months ago
 I'm using System Modeler 12.1, where can I find those simulation options? It's a parameter in the model that is generated when you import the FMU. So you should get that Co-simulation tab when you open the generated model.Otto
Posted 9 months ago
 Hi Otto, Thanks for the response, I've attached the files that I modified and used. the difference is highlighted on the image below. I'm using System Modeler 12.1, where can I find those simulation options?
 I'm suspecting you are simulating the imported FMU with useTriggerInput_=true, but without anything connected to the trigger. You could connect it to a BooleanPulse or SampleTrigger, but the easiest solution is to simply set the useTriggerInput_=false and specify a step_ size.I hope that helps.Otto