- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Co-simulation 1.0 in OMEdit
Co-simulation 1.0 in OMEdit
Re: Co-simulation 1.0 in OMEdit
We do not have 1.0 co-simulation yet. Just FMI 2.0 and you need a specific version for Windows. Install this one:
https://build.openmodelica.org/omc/buil … 9d33ec.exe
Then you need to write a script to export the FMU. Create a new file translateMyFMU.mos containing:
Code:
loadModel(Modelica); getErrorString();
// load any other models you need
loadFile("MyModel.mo"); getErrorString();
// translate MyModel to FMU for co-simulation
translateModelFMU(Model, "2.0", "cs"); getErrorString();
Then you run omc.exe on the script from the command line:
Code:
> C:\OpenModelica\build\bin\omc.exe translateMyFMU.mos
- adrpo
- 885 Posts
Re: Co-simulation 1.0 in OMEdit
Hello adrpo;
I think that I did all what you told me to do in your last message . But I get always the same error: I created the file translateMyFMU.mos . And when I tray to run omc.exe I get this error :
C:\OpenModelica\build\bin\omc.exe translateMyFMU.mos
Error occurred building AST
Syntax Error
[<interactive>:1:2-1:2:writable] Error: Lexer failed to recognize '\OpenModeli'
The omc.exe is actually located in this directory : C:\OpenModelica1.9.4-dev\bin\omc.exe . I tried this command and I I got :
Error occurred building AST
Syntax Error
[<interactive>:1:4-1:4:writable] Error: Lexer failed to recognize '\OpenModeli'
[<interactive>:1:18-1:20:writable] Warning: Treating .9 as 0.9. This is not standard Modelica and only done for compatibility with old code. Support for this feature may be removed in the future.
[<interactive>:1:20-1:22:writable] Warning: Treating .4 as 0.4. This is not standard Modelica and only done for compatibility with old code. Support for this feature may be removed in the future.
What should I do ?
Re: Co-simulation 1.0 in OMEdit
Sorry, it seems that you put some wrong code in file translateMyFMU.mos.
We fixed the FMU generation for Windows in the last 1.9.2-dev.beta2 release, so you can now do it via OMEdit (OpenModelica Connection Editor).
Just install this version:
https://build.openmodelica.org/omc/buil … 9.4/beta2/
And then open your model in OMEdit and right click on it and say Export FMU.
- adrpo
- 885 Posts
Re: Co-simulation 1.0 in OMEdit
The type of exported FMU depends on what settings you have in Tools->Options->FMI.
Adeel.
- adeas
- 454 Posts
Re: Co-simulation 1.0 in OMEdit
Hello, The generation of the fmi for co-simulation 2.0 is successful [1] . But when I try to import a file co-simulation 2.0 to OMEdit I get this error:[2]
[1] 12:09:03 Scripting Notification
The FMU Modelica.Blocks.Logical.Xor.fmu is generated at C:/Users/aer/AppData/Local/Temp/OpenModelica/OMEdit
[2] 13:50:28 Scripting Error
The FMU version is 2.0 and FMU type is CoSimulation. Unsupported FMU type. Only FMI 2.0 ModelExchange is supported.
Besides, I used a simple model (logical block XOR), generated by OMEdit ,with another tool. The importation was perfect but, in the simulation’s beginning, the simulation stops and displays this error:
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Co-simulation 1.0 in OMEdit