- Index
- » Users
- » adeas
- » Profile
Posts
Hi, I think r23774 (https://trac.openmodelica.org/OpenModel … et/23774/) should fix everything. Note that now the connection will start through click and drag.
Adeel.
Wait a second. There is something wrong. I need to test whats going on. There is something wrong with events.
When you double click you should get the error "You cannot connect a component to itself" because a single click will start making the connection.
Adeel.
I can't even reproduce it on my virtual box Linux (ubtunu 12.04).
Are you clicking twice to start the connection?
Adeel.
I can't reproduce it on my Windows machine.
Adeel.
I don't understand your problem.
Is your question "You cannot connect a component to itself" if yes then it is not allowed.
Or your question is "You cannot connect two objects" if yes then post a use case to reproduce the issue.
Adeel.
Call omc.getErrorString() when result is false so that compiler can giev you error that occurred while loading the file.
Code:
boolean result = omc.loadFile(file.getPath()); //loadFile returns zero for second file
if(result) {
String[] packages = omc.getPackages();
} else {
print(omc.getErrorString());
}
Adeel.
This is working fine with r23646.
For example try this
Adeel.
This should be trac ticket instead of forum post.
Adeel.
Set the flag -noEquidistantTimeGrid to use dassl in a single step mode.
If you are using a simulate command then you need to set this in simflags argument https://build.openmodelica.org/Document … ulate.html
If you are using OMEdit then in the Simulation Setup->Output uncheck Equidistant Time Grid.
Adeel.
Because OMC automatically sets the environment i.e provides the required dlls in PATH.
If you want to provide your Model.exe to some other users you should provide the required dlls alongwith.
Adeel.
That's the right way to check the revision. So you are in revision 23121 and the bug was fixed in revision 23123.
Time to update again.
Adeel.
Seems related to this bug https://trac.openmodelica.org/OpenModelica/ticket/2943.
Which revision are you using?
Adeel.
Try JModelica http://www.jmodelica.org/
Adeel.
Ah you are talking about co-simulation FMU. We don't support import of co-simulation FMU even the users guide mention this "The support for FMI Co-Simulation 1.0 tool coupling is still under development."
Adeel.
Send me the FMU and I will see what is wrong. The bouncingBall FMU from FMU SDK should work. It is very simple example.
Adeel.
There is a bug saving protected classes. In your code find text "package fmi1Functions" and above this line add "public" keyword then try to save the file.
I will try to fix the bug.
You should not change the generated FMU code. When you are creating the FMU at that time specify the I/Os. If your FMU has the I/Os then the generated code will automatically have the I/Os. Even if you manage to put I/O manually in the FMU block still maybe your model will not work correctly.
Adeel.
Its not UserGuide its UsersGuide,
https://openmodelica.org/svn/OpenModeli … sGuide.pdf
Adeel.
The users guide is showing the old picture. I will update the users guide with the new picture.
You insert inputs/outputs to FMU block before adding it to new model. Normally you don't need to create inputs/outputs by hand, they will be generated automatically based on the inputs/outputs of your FMU.
Adeel.
Code:
make -j4 > out.log 2>&1
Adeel.
Yes, it should work.
If you are just specifying the fileName then remember that compiler will try to look for the file in its working directory which is normally at %TEMP%/OpenModelica/OMEdit. A more better approach is to use modelica:// uri format.
Adeel.
Can you create a trac ticket about it?
Adeel.
By interactive I mean when you select true for "tableOnFile" the fields "tableName" and "fileName" should become active. Similarly when you select false they should become inactive. This is not supported yet.
Of course you will see your changes done in text view but again as I should you can't make fields active/inactive.
Adeel.
You can't do this. The interactive data manipulation is not possible in OMEdit's parameters window yet. You have to set these values in the code manually. Hopefully we will have this feature soon.
Adeel.
I suggest you should install the latest nightly build https://build.openmodelica.org/omc/buil … y-builds/.
Then try to run this on your python console,
Code:
from OMPython import OMCSession
omc = OMCSession()
omc.execute('getVersion()')
Note that OMPython.run() is removed from the new version. I will update the users guide soon.
Adeel.
Which version of OpenModelica are you using? The same as of the user manual? I your OpenModelica is 1.9.0 Beta3 then it should work.
Adeel.
Yes this is a known problem but I don't know when I get time to fix this. Right now there are more things in priority. I will try my best to fix this ASAP.
Adeel.
I think you need to compile OMPython before installing it.
Code:
make -f 'Makefile.unix' install-python
Normally we do this when we install OpenModelica from source.
I don't know how you can achieve the same using apt-get install. Martin knows how the linux stuff works but he is on vacations right now.
Adeel.
When you say you have installed the latest build does it mean you have installed the latest nightly build from here https://build.openmodelica.org/omc/buil … y-builds/?
Adeel.
omc.exe +help
Adeel.
Send an email to Adrian.pop at liu.se. He will create an account for you.
Adeel.
You must save the class so that you can uncheck "Store image in model". Otherwise when you uncheck a dialog box appear which tells you to save the class. I believe in your case the dialog box is not appearing because you might have unchecked "Show save model for bitmap insertion message" in Options->Notifications.
Adeel.
Here is the actual error,
Code:
assert | debug | division by zero at time 0, (a=0) / (b=0), where divisor b expression is: heatPump_ConstantCOPheat1.W Debug more
Clicking on Debug more should take you to the equation causing the error. Fix division by zero error in your model.
Adeel.
I really have no idea whats wrong here.
Have you tried running with administrator access? Becasue it seems like it was not able to find Modelica.Electrical.Machines.Examples.AsynchronousInductionMa
chines.AIMC_DOL_functions.o. However, the command should create this file.
Remove all *.o files and try the makefile again.
Is this a valid path in your system C:/OpenModelica1.9.1Nightly//include/omc/c?
Adeel.
Eeeeehhh. Thats weird. I really don't know why make is failing here.
Are there any *.o files generated in C:\Users\esser\AppData\Local\Temp\OpenModelica\OMEdit?
Do you have write access to C:\Users\esser\AppData\Local\Temp\OpenModelica\OMEdit?
Is this happening for all modelica models?
- Run the cmd.exe with administrator (right click cmd.exe and click on "Run as administrator")
- Execute the same commands I mentioned above.
- set the path
- Run "echo %PATH%"
- switch to the working directory
- run the makefile
Post the output of all four commands.
Adeel.
This is wrong. Why are you running it from C:\OpenModelica1.9.1Nightly\bin?
You should run it from OMEdit/OMC working directory which should be %TEMP% if you have not changed it.
Now the error says makefile is not found which is true because you are in a wrong directory.
From the commands I have posted above you forgot to execute,
Code:
cd C:\Users\<user_name>\AppData\Local\Temp\OpenModelica\OMEdit
replace <user_name> with your windows username.
Adeel.
Can you run the following commands from cmd.exe?
Code:
set PATH=C:\OpenModelica1.9.1Nightly\MinGW\bin;C:\OpenModelica1.9.1Nightly\MinGW\libexec\gcc\mingw32\4.4.0
Change the location according to your setup in the following command,
Code:
cd Users\adeas31\AppData\Local\Temp\OpenModelica\OMEdit
Code:
"C:\OpenModelica1.9.1Nightly\\MinGW\bin\mingw32-make.exe" -f Modelica.Electrical.Machines.Examples.AsynchronousInductionMachines.AIMC_DOL.makefile
Adeel.
It seems like it is still a parallel make. Can you run it from OMEdit by setting "Number of Processes" to 1 in simulation setup and post the output generated in compilation tab.
Martin - OMEdit compiles the stuff with a clean PATH.
Adeel.
I don't think that its a problem with gcc not found. Because I can see successful compilation of AIMC_DOL.c, AIMC_DOL_functions.c & AIMC_DOL_records.c.
Its a problem with the parallel make since the error is "Waiting for unfinished jobs". Running it with -j1 might solve the problem and OMEdit does have that option available in Simulation setup.
Adeel.
Have you tried with Number of Processors = 1?
Adeel.
Do you have some other MinGW installation in your PATH?
Before simulating set the "Number of Processors" to 1 in the Simulation setup.
Adeel.
I have already fixed this error a while ago.
Download & install a new nightly build https://build.openmodelica.org/omc/buil … ly-builds/
Adeel.
Have you noticed,
Code:
extent=[-10, -34; 10, -14]
in the RL model?
This is old Modelica syntax. OMEdit only supports 3.x annotation syntax.
Btw, Dymola does show the model fine but you can't really use it e.g try moving the inductor component.
Adeel.
1) Yes, as long as your models are standard Modelica code.
2) Update the version and post some use case. I can't say what is wrong. Note that its a variable filter. No-where does it say it filters parameters
Adeel.
2) Download and try the latest nightly build. https://build.openmodelica.org/omc/buil … ly-builds/
3) Variable Filter is a regular expression. There are several discussions about it on the forum e.g https://www.openmodelica.org/index.php/ … ic?id=1227
Adeel.
- The CSV results file is generated in %TEMP%/OpenModelica/OMEdit/model_name_res.csv
- This could be a bug in csv writer/reader. Which version of OpenModelica are you using? Can you share a sample model?
- OMEdit->Simulation Setup->Output->Variable Filter, specify which variables you want to output to the result file. By default all variables are written to the file. AFAIK parameters are only available in mat result file.
Adeel.
I think its not. Our build servers are showing the compilation is fine https://test.openmodelica.org/hudson/. Try
Code:
make -f Makefile.omdev.mingw clean-qtclients
and then,
Code:
make -f Makefile.omdev.mingw qtclients
Adeel.
There are already tickets about it,
https://trac.openmodelica.org/OpenModelica/ticket/2677
https://trac.openmodelica.org/OpenModelica/ticket/2676
You can add you use case there.
Adeel.
Martin means that you need to add getErrorString(); in your .mos file.
Just insert getErrorString(); before the simulate command.
Adeel.
Its already fixed. You can see the status of the builds here https://test.openmodelica.org/hudson/
Adeel.
fmigenerator.exe is old. It is no more supported. I have fixed it in the setup https://trac.openmodelica.org/OpenModel … et/20667/.
I am not sure about OMCppSimulation.exe. Have you done,
Code:
make -f 'Makefile.omdev.mingw' runtimeCPPinstall
Adeel.
When you drag & drop the Ground model into DCMotor it should become,
Code:
inner Ground ground;
The top model Adrian is referring to is DCMotor.
Adeel.
This error was not really fixed in revision https://trac.openmodelica.org/OpenModel … eset/17882 there was one more location where it should be fixed and i did that in revision https://trac.openmodelica.org/OpenModel … set/19911. If your revision is higher than 19911 then I might need to look into it again.
Adeel.
Note that fmi_input_* are just dummy variables to make the modelica models valid. They are not supposed to follow the actual input values. You must see the values of cmd & windowState and make sure they are set properly.
Can you send me your actual modelica model? adeel.asghar at liu.se
Adeel.
Use Modelica3D. There is a chapter about it in OpenModelica Users Guide.
OMEdit doesn't support animations.
Adeel.
Just call plot with variable names,
Code:
plot({x,y,z})
If you want to plot variables in new window then,
Code:
plot(x, externalWindow=true)
Adeel.
Because you haven't simulated the model long enough. Its,
Code:
simulate (VanderPol, stopTime=25)
not
Code:
simulate (VanderPol, stoptime=25)
Notice the capital T in stopTime.
After simulate command send plotParametric,
Code:
plotParametric(x,y)
Adeel.
plotParametric doesn't have any stoptime argument. This should work,
Code:
plotParametric(x,y);
Adeel.
As a work around don't use the swedish locale for now.
Add a bug report about this issue here https://trac.openmodelica.org/OpenModelica/newticket
Adeel.
No the GUI feature is not available yet.
Adeel.
Check this link
https://openmodelica.org/index.php/forum/topic?id=1167
Adeel.
Can you provide a sample model or the csv file?
Adeel.
Ahh you are trying to import a co-simulation FMU. This is not fully done yet.
Try adding the following line,
Code:
{theInput} = fmi1Functions.fmi1SetReal(fmi1cs, {0.0}, {theInput});
before doStep. Add a trac ticket about it. We don't fully support co-simulation import.
Adeel.
There should be a call to
Code:
fmi1Functions.fmi1Set*
in the equation section for your input variables right after
Code:
flowTime = fmi1Functions.fmi1SetTime(fmi1me, time);
I can't tell more without seeing the code.
Adeel.
You can send it to my email address.
adeel.asghar [at] liu.se
Adeel.
Go to Tools->Options->Simulation->OMC Flags and type +d=initialization and then press OK.
You can specify the initial conditions like this
Code:
(start = 0, fixed = true)
Adeel.
Yes bitmap is not supported to be displayed on Libraries Browser. https://trac.openmodelica.org/OpenModel … t.cpp#L330
I don't know why I had done that. Might be there were issues displaying it or might be it was not allowed according to Modelica specifications.
Can you send me your model? I will try it and then enable this feature.
For documentation just look at any of the MSL example.
Adeel.
There is no another way to add icons. Everything you draw on icon layer is used as icon for the model in Libraries Browser and component instance.
You need to write the documentation inside the model code. There is currently no way to write the documentation via GUI.
Adeel.
1. answer:
Simulate & buildModel are same except that buildModel only compiles the model and generates the simulation executable whereas simulate compiles the model, generates the simulation executable and runs it.
2. answer:
You should use buildModel but note that buildModel doesn't set the default result filename for the environment so you need to specify a resutl filename to plot. Use the following code,
Code:
loadFile("reaction2.mo");
buildModel(reaction2);
system("reaction2.exe -f reaction2_init.xml -overrideFile=reaction2_param.txt");
plot({xA,xB}, fileName="reaction2_res.mat");
Adeel.
Are you referring to World3 included in SystemDynamics library? If yes then,
Yes all the system libraries are read-only.
You should load it as normal modelica file if you want to update it not from system libraries sub-menu.
OR
You can create a new model extend it from World3 and play with some of its parameters.
Adeel.
You mean it works in OM and not in FMU SDK?
Adeel.
Saving the code with errors is not allowed.
Check your options and see if you have auto save setting enabled. Try disabling it or set a bug interval. It will give you time to write the code.
We are currently working on the debugger. It will be available soon.
Adeel.
Interactive simulation is currently not available. It will be available in future but i can't say when.
Adeel.
From OMEdit simply drag & drop the components into your model.
Read OpenModelicaUsersGuide.pdf chapter 2 for more information.
Adeel.
I suppose you are using OMEdit.
Create your model and then export it as an FMU. From the menu FMI->export FMU.
Adeel.
If you get a message from plot command it means your plot command is silent. You need to enable it,
Code:
setPlotSilent(false)
Adeel.
The code is correct. But OMC fails to parse it,
Code:
getIconAnnotation(justIcon)
{-100.0,-100.0,100.0,100.0,false,0.1,2.0,2.0}
The reason is
Code:
visible = useHeatPort
Although we do instantiation but in your case useHeatPort is not defined. So that particular case should handled. Add a bug report about it https://trac.openmodelica.org/OpenModelica/newticket
As a workaround for now either change useHeatPort with true/false or define useHeatPort. In the following code useHeatPort is defined and it works fine,
Code:
model justIcon
parameter Boolean useHeatPort = false;
annotation(Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100,-100},{100,100}}), graphics), Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-100,-100},{100,100}}), graphics={ Text(extent = {{-154,-47},{146,-87}}, textString = "%name", lineColor = {0,0,255}),Polygon(points = {{26,0},{-34,40},{-34,-40},{26,0}}, lineColor = {0,0,0}, fillColor = {255,255,255},
fillPattern = FillPattern.Solid),Line(points = {{-94,0},{96,0}}, color = {0,0,255}),Line(points = {{26,40},{26,-40}}, color = {0,0,255}),Line(points = {{26,20},{54,50},{54,76}}, color = {0,0,255}),Line(points = {{36,50},{56,30}}, color = {0,0,255}),Line(visible = useHeatPort, points = {{-4,-100},{-4,-20}}, color = {127,0,0}, smooth = Smooth.None, pattern = LinePattern.Dot),Rectangle(extent = {{-66,84},{68,62}}, lineColor = {0,0,255}, fillColor = {255,255,255},
fillPattern = FillPattern.Solid),Line(points = {{0,84},{0,106}}, color = {0,0,255}, smooth = Smooth.None)}),
uses(Modelica(version="3.2")));
end justIcon;
Adeel.
Thats too old. The current revision is 19035. Update to latest.
If you still encounter the same issue then report it on https://trac.openmodelica.org/OpenModelica/.
Adeel.
Which revision are you using?
Adeel.
Then the name you give to it, is the path since you don't put it inside any package.
Lets say you name it "SampleModel" then your visualization script will be something like this,
Code:
loadFile("D:\Temp\sample.mo");getErrorString();
loadModelica3D();getErrorString();
loadString("model SampleModelVis
extends SampleModel;
inner ModelicaServices.Modelica3D.Controller m3d_control;
end SampleModelVis;");getErrorString();
simulate(SampleModelVis);
Note that you need to load your model so that the compiler can find it.
Adeel.
What do you mean how do you find this path? You know this path since you have created it.
For example if I create the following package,
Code:
package p1
package p2
package p3
model m1
end m1;
end p3;
end p2;
end p1;
Now i know the path of model m1 i.e p1.p2.p3.m1
There are API calls to find the class names e.g,
Code:
loadString("package p1
package p2
package p3
model m1
end m1;
end p3;
end p2;
end p1;");
getClassNames();
getClassNames(p1);
getClassNames(p1.p2);
getClassNames(p1.p2.p3);
Adeel.
The path of your models e.g MyPackage.MyNestedPackage.MyModel
Adeel.
Great. I have also updated the users guide.
Adeel.
I think we should update the users guide as it is still the old example code in it.
I will fix it.
Adeel.
Yes, that is right. I don't know why then python says,
File "C:\Python27\lib\os.py", line 423, in __getitem__
return self.data[key.upper()]
KeyError: 'OPENMODELICAHOME'
As I said try with 32 bit version of python and pygtk.
Adeel.
Check your OPENMODELICAHOME environment variable.
Adeel.
I don't think reinstalling OpenModelica will help.
You should probably try with 32 bit Python and pygtk-all-in-one-2.24.2.win32-py2.7.msi
Adeel.
You should do,
Code:
cd "D:\\OpenModelica1.9.1Nightly\\lib\\omlibrary-modelica3d\\osg-gtk"
python dbus-server.py
In this way your working directory is "osg-gtk" and then python can find the dll.
Adeel.
How do you start dbus-server.py? The libm3d-osg-gtk.dll is located in the same directory where dbus-server.py is.
I need to know how you run your python script?
If you just cd to the directory and run,
Code:
python dbus-server.py
it should work.
Adeel.
The dbus-server.py should be available now. Adrian has fixed it in r18663.
Adeel.
Read OpenModelica users guide. It is part of OpenModelica installation and is located at C:\OpenModelica1.9.1Nightly\share\doc\omc\OpenModelicaUsersGuide.pdf (assuming that you installed OpenModelica at the default location).
In particular read chapter 1 for general understanding and read chapter 11 for Modelica3D.
I checked the dbus-server.py and yes it is missing. It seems like something is wrong in the build. I will look into it.
Adeel.
No, there is no debug option to see the interaction when OMEdit is making a conneciton with OMC.
There are debug options once you are connected to OMC as mentioned in the above post.
Adeel.
You can configure it in Eclipse but you need to install CDT with mingw tool chain. MDT doesn't provide such features.
Why don't you use Qt Creator for debugging?
Do a make clean and use GDB to find out the exact location of the bug.
Adeel.
No, but algorithmic code debugging is available.
See chapter 10 of OpenModelicaUsersGuide.pdf for more details.
Adeel.
The crash is because of MainWindow.cpp line 1441,
Code:
GraphicsView *pGraphicsView = mpModelWidgetContainer->getCurrentModelWidget()->getDiagramGraphicsView();
OMEdit preserves the user customizations & you have connect mode enabled so when OMEdit starts it triggers the toggleShapesButton SLOT.
Since there is no ModelWidget available so,
Code:
mpModelWidgetContainer->getCurrentModelWidget();
returns 0. You should check it before asking for the DiagramGraphicsView instance.
BTW, why do you want to make show/hide annotations part of toggle Shapes? It should be an option in the Options Dialog not in the toolbar.
Adeel.
I guess you have auto save enabled with a very short time interval. Disable it or set the interval to some reasonable duration.
Tools->Options->General->Enable Auto Save
OR
It could be that your OpenModelica is older than revision 17652.
This bug was fixed in revision 17652 https://trac.openmodelica.org/OpenModelica/ticket/2416.
Adeel.
Check the OpenModelicaUsersGuide.pdf which should be included in the package you have downloaded.
OpenModelicaInstallationFolder/share/doc/omc/OpenModelicaUsersGuide.pdf
Adeel.
No, currently there is no snap to grid function.
But perhaps we will have it in the future. There is already a ticket about it. https://trac.openmodelica.org/OpenModelica/ticket/2477
Adeel.
Code:
model A
Integer aValue1(start=1);
Integer aValue2(start=2);
equation
aValue1 = B(2);
aValue2 = aValue1 + 10;
end A;
function B
input Integer bValue1;
output Integer bValue2;
algorithm
bValue2 := bValue1 + 1;
end B;
Adeel.
Simulate the model and switch to modeling view.
One the right side you will see the "variables browser". It has the value column which allows you to modify the variables/parameters which are changeable.
Change the value and then right click the parent item of the list and choose re-simulate.
BTW why don't you use a function?
Adeel.
you can't run it in OMEdit.
In OMEdit once you have simulated the model then you can change the values in the variables browser and re-simulate it.
Note that you need atleast revision 18123.
Adeel.
I haven't tried it but i think you must specify three outputs,
Code:
(,sub,);=add(3,4);
you are missing the third output.
Adeel.
The options are only read once when you create the model. If you want to change the behavior of the existing models then you must change its local settings. Right click inside the icon/diagram view and choose properties. Note that changing the values will not update the existing components.
Adeel.
This is still work in progress but the workaround for it was already done in r17652.
OR
You can disable the auto save feature. Tools->Options->Genaral->Auto Save.
Adeel.
What do you mean by you change the icon size? There is not icon size in options.
Yes, snap to grid can be implemented. Please add a new enhancement ticket here https://trac.openmodelica.org/OpenModelica/
Adeel.
Tools->Options->Simulation. Type +d=initialization in OMC Flags.
Adeel.
No, there is no other way to hide the individual variables. You can only delete the complete result.
However, you can apply the variable filter during the simulation. On the simulation->output->Variable Filter. You can right a regular expression here to filter the variables. https://build.openmodelica.org/Document … ulate.html
Adeel.
Hi,
We are already working on this. It will be available soon in future versions but I can't say exactly when.
For reference you can follow this ticket https://trac.openmodelica.org/OpenModelica/ticket/2439
Adeel.
For your other question, the best is to read the Modelica specificaiton section 4.6 Specialized Classes,
https://modelica.org/documents/ModelicaSpec33.pdf
Adeel.
The error says it all. Change your HelloWorld class to function.
Adeel.
OK. Thats my mistake. Thanks for finding this error. I will try to fix it ASAP.
You can use the one night earlier build https://build.openmodelica.org/omc/buil … -17148.exe until I fix the issue.
Adeel.
You should enable the initialization flag via Tools->Options->Simulation and then in the OMC Flags text box enter,
Code:
+d=initialization
It will remove the initialization warning message but it will output other initialization warnings that you should fix. The rules for initialization are more up to the specification now which were not even checked in the previous versions. Post the warnings. I will ask Lennart to help you with initialization issues.
Adeel.
The interesting error message is,
Code:
\"[C:/Users/Ilma/Dropbox/zavrsni/robotic/script1.mos:4:1-4:74:writable] Error: Class getInstallationDirectoryPath not found in scope <global scope> (looking for a function or record).
I am not sure why getInstallationDirectoryPath() is failing. I recommend installing a new OpenModelica nightly build since the one you are using is almost 4000 revisions old version.
https://build.openmodelica.org/omc/buil … ly-builds/
Things are getting closer don't give up
Adeel.
Which version of OpenModelica are you using?
Try running the script from command line.
Go to your script file location and then run, C:/OpenModelica/bin/omc.exe script.mos (change the path according to your environment).
The reason you are getting this error is because OMNotebook current working directory is %TEMP%. So when you say loadFile("strukturav2.mo") it will fail because the file is located somewhere else. Either use the full path to load file OR change the working directory before calling loadFile.
Assuming your script and model files are loacated at "C:/Users/Ilma/Dropbox/zavrsni/robotic" the following script should work for you,
Code:
loadModel(Modelica, {"3.1"}); getErrorString();
loadModel(ModelicaServices, {"1.0 modelica3d"}); getErrorString();
// get the path to modelica3d patches
m3d_path := getInstallationDirectoryPath() + "/lib/omlibrary-modelica3d/";
// load the changed Modelica.Utilities.Internal
loadFile(m3d_path + "Internal.mo"); getErrorString();
cd("C:/Users/Ilma/Dropbox/zavrsni/robotic"); getErrorString();
loadFile("strukturav2.mo"); getErrorString();
loadString("
model Visualize_strukturav2
inner ModelicaServices.Modelica3D.Controller m3d_control;
extends strukturav2;
end Visualize_strukturav2;
");
simulate(Visualize_strukturav2, stopTime=30); getErrorString();
Adeel.
No. loadModelica3D() doesn't work.
I think ModelicaServices.Modelica3D.Controller is defined as outer in the default implementation which should be inner. Ask Adrian for details.
Adeel.
It works fine for me.
- I just saved your model into a file "strukturav2.mo".
- Started the dbus-server.py
- Ran the following script.
Code:
loadModel(Modelica, {"3.1"}); getErrorString();
loadModel(ModelicaServices, {"1.0 modelica3d"}); getErrorString();
// get the path to modelica3d patches
m3d_path := getInstallationDirectoryPath() + "/lib/omlibrary-modelica3d/";
// load the changed Modelica.Utilities.Internal
loadFile(m3d_path + "Internal.mo"); getErrorString();
loadFile("strukturav2.mo"); getErrorString();
loadString("
model Visualize_strukturav2
inner ModelicaServices.Modelica3D.Controller m3d_control;
extends strukturav2;
end Visualize_strukturav2;
");
cd("C:/Users/adeas31/AppData/Local/Temp/OpenModelica"); getErrorString();
simulate(Visualize_strukturav2, stopTime=30); getErrorString();
Note that you must save the script file and the strukturav2.mo file at the same level.
Adeel.
Are you able to simulate your model without modelica3D?
Can you post your model?
The error message doesn't seem to be related with visualization.
Adeel.
Interactive simulation is currently not available. It will be back again soon but I can't tell you exactly when.
Adeel.
Its a rather old revision. Try the latest the revision 16690.
What is TestFMU.EinfachesModell in your FMU import model?
Which values are you interested in?
Adeel.
I need more info. Which revision you are using? The sample model etc...
Adeel.
Hi,
No, it is not a bug and you are not doing anything wrong here.
Your parameter value 2 for gain that you set in your original model will be picked up when you run the simulation. The value is stored in the fmu binary and is only read when you simulate the model. If it is a start value then you should be able to see it right after import.
flowInstantiate, flowParamsStart are used internally so you you don't need to fill a value for them.
Adeel.
Hi,
It seems like you are using the release version of openmodelica.
The red boxes indicates your variables which doesn't have any placement annotation defined.
The latest source doesn't draw red boxes for real variabels. You can download and install the latest nightly build https://build.openmodelica.org/omc/buil … ly-builds/
Adeel.
Hi Christoph,
Don't worry about the "404 Component not found" error. Just follow the instructions from this document https://trac.openmodelica.org/documents … ingMDT.pdf and it will work.
Adeel.
I cannot run the generated code. I need the FMU for reproducing the crash and testing.
Adeel.
The required dll was missing in the installer. I have added it now. The next nightly build will work fine.
Adeel.
Check email.
Adeel.
Hi,
What version of OpenModelica are you using? Can you send me the omeditcommands.log file? You can find it in your users Temp folder under OpenModelica/OMEdit.
Adeel.
Hi,
Create a new connector via File->New Modelica Class, give it some name and choose the connector from the restriction drop down.
Draw icon for the connector in the icon view and type in the required equations in the Modelica text view.
Adeel.
Hi,
I tried it and got the same result. It looks like a bug. Can you report it https://trac.openmodelica.org/OpenModelica/?
Adeel.
No, OpenModelica can't export slave FMU for co-simulation. Only the model exchange FMU export is supported right now.
You can check the status here https://www.fmi-standard.org/tools.
Adeel.
Anonymous users are not allowed to attach files while creating the ticket. But you can create the ticket and then go on the ticket to attach the file.
Adeel.
you can send the screenshots to adeel.asghar at liu.se
Adeel.
You mean the trac site doesn't allow you to upload the images? You can send the screenshots to me and i will add the ticket to the tracker. You can later edit it.
Btw which OpenModelica revisions are you using?
Adeel.
If you think the results shown are wrong then file a bug report here https://trac.openmodelica.org/OpenModelica/
However, I plotted pipe length over time and it always shows a constant value of 20.
Adeel.
Hi,
1. Yes, in the toolbar click on the plot parameteric tool button, it will open the new plot window then you can select two variables for plotting.
2. This can be done via interactive simulation but unfortunately interactive simulation is broken right now and I can't tell you when it will be available again. However, you can install some old OpenModelica like 1.7 or 1.8 and can run interactive simulation.
Adeel.
Where is libmylib.a located? You can put it either in C:/Programfiles/OpenModelica//lib/omc OR add the library path like this,
Code:
setEnvironmentVar("MODELICAUSERLFLAGS","-Lpath-to-library");
put the above line into your mos file.
Also, I think you must change
Code:
external "C" annotation(Library="libmylib.a",Include="#include \"ExternalFunc2.h\"");
to
Code:
external "C" annotation(Library="mylib",Include="#include \"ExternalFunc2.h\"");
Adeel.
Its a known bug, https://trac.openmodelica.org/OpenModelica/ticket/2122
The problem is with the OpenModelica interactive scripting environment.
Adeel.
you can print the string value by using Modelica.Utilities.Streams.print during the runtime.
Adeel.
Modelica.pltpkg is not part of the current OpenModelica. The users guide is not updated.
You have to download old OpenModelica if you want to use it. Perhaps version 1.6 or 1.7.
Adeel.
Move the SimpleVisual object declaration in the end,
Code:
model BouncingBall3D
import SimpleVisual.*;
parameter Real e=0.7 "coefficient of restitution";
parameter Real g=9.81 "gravity acceleration";
Real h(start=10) "height of ball";
Real v "velocity of ball";
Boolean flying(start=true) "true, if ball is flying";
Boolean impact;
Real v_new;
SimpleVisual.PositionSize ball "color=red;shape=sphere;";
equation
impact=h <= 0.0;
der(v)=if flying then -g else 0;
der(h)=v;
ball.size[1]=5;
ball.size[2]=5;
ball.size[3]=5;
ball.frame_a[1]=0;
ball.frame_a[2]=h+ball.size[2]/2;
ball.frame_a[3]=0;
when {h <= 0.0 and v <= 0.0,impact} then
v_new=if edge(impact) then -e*pre(v) else 0;
flying=v_new > 0;
reinit(v, v_new);
end when;
end BouncingBall3D;
I have fixed the bug in r14814. But for now use the above model.
Adeel.
Can you post you visualization model?
I tried BouncingBall3D model with the latest OpenModelica nightly build and it worked fine. You can find the BouncingBall3D model in $OPENMODELICAHOME/share/doc/omc/testmodels/visualize_3D_BouncingBall.mo
Adeel.
We don't have anything like loadLibrary, you must call,
Code:
loadModel(SimpleVisual)
Adeel.
This API is used by OMNotebook. The idea is to automatically call this API when OMNotebook starts. By doing this we don't have to update all the .onb files. The problem is OMShell and OMNotebook uses the same instance of omc.
The other solution is to get rid of this API and add an extra argument to plot API but then we need to update all the .onb files.
Adeel.
Call,
Code:
setPlotSilent(false)
before plot.
Adeel.
OpenModelica r14546 can't load this library. I got this,
Code:
loadModel(ModelicaAdditions)
false
[C:/OpenModelica/trunk/build/lib/omlibrary/ModelicaAdditions/Blocks/package.mo:1:1-55:11:writable] Error: Expected the package to have within ModelicaAdditions; but got within ;
Error: Failed to load package ModelicaAdditions (default) using MODELICAPATH C:/OpenModelica/trunk/build/lib/omlibrary.
Adeel.
You need to load the ModelicaAdditions library. In OMEdit you can do it like this,
Tools->Options->Libraries then click on Add. Write ModelicaAdditions in the Name field and default in the Value field, click OK and then restart OMEdit.
Adeel.
This is already reported here https://trac.openmodelica.org/OpenModelica/ticket/1853
I am not sure when this will be fixed
Adeel.
You will obviously won't get BouncingBall.exe on OSX . It will be BouncingBall. Remove .exe from the commands.
Adeel.
Run the following commands one by one in OMShell,
Code:
loadFile("BouncingBall.mo")
simulate(BouncingBall, startTime=0.0, stopTime=10.0)
plot(h)
setInitXmlStartValue("BouncingBall_init.xml", "h", "5", "BouncingBall_init.xml")
system("BouncingBall.exe")
plot(h, externalWindow=true)
When we simulate the model the init xml file is created which contains the start values. The setInitXmlStartValue command updates the file with new values and then we just simply run the simulation executable. If we run the simulate command after setInitXmlStartValue command then it will override the values back to the original values.
If you want to use the Adrian's suggestion,
Code:
loadFile("BouncingBall.mo")
buildModel(BouncingBall, startTime=0.0, stopTime=10.0)
system("BouncingBall.exe")
plot(h)
system("BouncingBall.exe -override h=5")
plot(h, externalWindow=true)
Adeel.
Simulate the model to get the init xml file then call setInitXmlStartValue to update the start value of h then use the system command to run the simulation executable again.
Code:
setInitXmlStartValue("BouncingBall_init.xml", "h", "5", "BouncingBall_init.xml")
system("BouncingBall.exe")
Adeel.
Try this API command,
https://build.openmodelica.org/Document … Value.html
the command is,
Code:
translateModelFMU(<model_name>)
Adeel.
These are known bugs and we are trying to fix them ASAP. You can look at the status of these bugs here,
https://trac.openmodelica.org/OpenModelica/ticket/1861
https://trac.openmodelica.org/OpenModelica/ticket/1713
Adeel.
Yes, I will do that.
Adeel.
Currently, there is no way to avoid red boxes.
I think we should respect annotation(visible=false). I will add this feature soon. Thanks.
Adeel.
No, on windows it is c:/OpenModelica1.9.0/lib/omlibrary
You can find documentation in C:\OpenModelica1.9.0\share\doc\omc. A good start is OpenModelicaUsersGuide.pdf
Adeel.
Hi Arnaud,
When you install without admin rights, you won't get any option from installer to choose "install for me or install for all users".
If you are not admin you are always installing for yourself only.
You should get an OpenModelica folder in your start menu.
Can you check if the environment variables are set for you or not? Run set command in cmd and see the results. The result list should have OPENMODELICAHOME and OPENMODELICALIBRARY.
Adeel.
You can use any file encoding convert utility like iconv to make your libraries UTF-8.
To convert them to Modelica 3.x you can use Dymola or either do it manually.
Adeel.
Hi Joe,
You can safely download and install it.
The Symantec is complaining possibly because the build executables are unauthorized and are not digitally signed via SSL certificates.
Adeel.
Just open the library file (normally package.mo) in OMEdit.
Adeel.
You need to update rml-mmc.
Adeel.
Hi,
Install the new nightly build https://build.openmodelica.org/omc/buil … y-builds/.
In the simulation dialog you see two new drop down boxes where you can select these options before simulation.
Adeel.
OMEdit now handles this.
Adeel.
Hello,
If you move your cursor on the plotted curve it will show you all the values.
OR
Use the val API command https://build.openmodelica.org/Document … .val.html. (not available from the graphical tool).
Adeel.
Hi David,
The library is same as package. So you should be able to load it via File->Open. But yes it will appear in Modelica Files. Anything that is loaded in Modelica Library tab is considered readonly. We have planned to merge these tabs into one in future release.
If you want to load it in Modelica Library tab, you must copy your library to C:/OpenModelica1.8.1/lib/omlibrary and then tell OMEdit to load it by setting it in Tools->Options then in Libraries add new library. Lets say your library is named X then you add a new library with name X and value default. Restart OMEdit.
Adeel.
Hi,
Can you tell more about your installation? Also please post the result of checkSettings() command.
Adeel.
You need to check the inheritance of master class and then get modifiers of the inherited class. I posted the sequence of commands,
Code:
>> getInheritanceCount(master)
<< 1
>> getNthInheritedClass(master, 1)
<< base
>> getExtendsModifierNames(master, base)
<< {p1}
>> getExtendsModifierValue(master, base, p1)
<< = 10
Adeel.
You can do that with OMPlot. OMEdit is using OMPlot for plotting but with some added features
Adeel.
Hi,
This message is shown when OpenModelica compiler is closed. Can you tell which model is causing this behavior?
You can also try installing the latest build,
https://build.openmodelica.org/omc/buil … ly-builds/
Adeel.
The interactive simulation is currently not supported.
May be the example TwoTanks.TanksConnectedPI.exe is old executable generated via old OpenModelica. And the one you are creating now doesn't have support for interactive simulation since the current OpenModelica is not supporting it now.
I am not sure when interactive simulation is available again, perhaps next release.
Adeel.
The result file is generated in the temp folder depending on how you have generated it.
If its generated via OMShel then it will be in %TEMP%/OpenModelica/<your-resut-file>.csv
If its generated via OMEdit then it will be in %TEMP%/OpenModelica/OMEdit/<your-resut-file>.csv
Adeel.
In the Simulation Dialog select csv as outputFormat. You will get the result file as csv which you can use with Excel.
Adeel.
Hi,
Can you please provide more information. I tried the steps you said and I didn't get any error.
Download and check this test OMNotebook file http://www.ida.liu.se/~adeas31/NotebookTest.onb
Adeel.
Hi,
Solution 1 - You are not specifying the annotate string properly. It should be,
>> updateComponent(testReal, Real, test, annotate=Placement(transformation=transformation(extent = {{1,2},{3,4}})))
instead of,
>> updateComponent(testReal, Real, test, annotate=Placement(transformation(extent = {{1,2},{3,4}})))
Solution 2 - A component can only have a placement annotation AFAIK. Read Modelica Specification 3.2 section 17.5.2 Component Instance
The Dialog annotation is for the class and you have to use addClassAnnotation API for it. However, multiple annotations are not supported through addClassAnnotation. You have to set them individually through addClassAnnotation.
Answers:
- No updateComponent is the only way.
- Yes you are using annotate= in a wrong way. Read solution 1. For further reading check this document https://openmodelica.org/svn/OpenModeli … -HowTo.pdf and study updateComponent API usage.
Anonymous read access is allowed with user: anonymous and pass: none.
Adeel.
Update your MDT to 0.7.28.
From eclipse Help->Check for updates
Adeel.
OMEdit uses Qt's default functions to get the temp directory for any platform. I was expecting that something similar was done in MDT as well, but surprisingly the /tmp/ value was hard coded there
I have fixed it now.
Adeel.
Hi,
Can you check if this file really exists /tmp/openmodelica.dbarends.objid.mdt ?
Also make sure that eclipse has rights to read this file.
Adeel.
Hi,
Inside eclipse goto Windows->Preferences then select Modelica and then inside "OpenModelica Compiler (OMC) Binary" section choose "use custom binary" and specify the path where your omc is located.
Adeel.
Hi,
Interactive Simulation is not supported now. Perhaps it will be part of next release again.
If you want to use it then you have to use older version of OpenModelica.
Adeel.
This is not possible with the current version of OMEdit. We are planning to release a new version in this winter where we are addressing such issues.
Perhaps zoom out one level can be work around for now.
Adeel.
Write full absolute path of the file or put the file where OMPlot is located.
Adeel.
Hi,
Can you explain your problem a bit more.
Normally, you do ctrl+a and then move all selected components. If you just want to move one select and drag it.
Adeel.
Hello Paul,
No, its not possible. OMEdit use the result file to read the plot varibales and when you do re-simulation the result file is created again which means OMEdit has to read it again. However, you can generate a new result file. In the Simulation box got to output tab and set File Name. This will tell OpenModelica compiler to create a result file with this name which means you get a new file. Then OMEdit plot is not cleared out.
Adeel.
Sorry, the second link is http://build.openmodelica.org/omc/build … ly-builds/
Adeel.
A new version is available now http://build.openmodelica.org/omc/build … ses/1.8.1/
We normally recommend installing the latest nightly build so that the user get the most recent updates http://build.openmodelica.org/omc/build … ses/1.8.1/
Adeel.
This is because your simulation has failed and no result file is generated. However, you should get a better error message, perhaps you are using an older version. Which revision you are using?
Adeel.
There is a README.txt inside each OMTool directory. e.g https://openmodelica.org/svn/OpenModeli … README.txt
Adeel.
Uncheck "group items by category" option on the eclipse install page.
Read Page of this document. http://openmodelica.ida.liu.se:8080/cb/ … oc_id=1389
Adeel.
Hi,
I have updated the source code. Now you can define translations for static variables as well.
Can you update your Russian translations file? Thanks.
Adeel.
Yes. You will have that feature in this Fall (by the end of this year).
Adeel.
Yes the 2nd variant is not supported now. OMEdit can read packages with directory structures but can't save them. Only save option available right now is to save in a single file.
Adeel.
You can also take a look at QT_TR_NOOP() http://qt-project.org/doc/qt-4.8/qtglob … QT_TR_NOOP
But I guess what Sjoelund recommended is rather easy to implement.
Adeel.
On Linux, Use the makefiles inside OMEdit/OMEditGUI directory.
On Windows, follow the INSTALL.txt instructions + you have to generate omc_communication.cc and omc_communication.h files using the omc_communication.idl file located at trunk/Compiler/runtime through the OmniORB (or anyother CORBA idl that you prefer to use).
Adeel.
Hi Patrik,
Thanks for pointing out the problem. I have fixed it now in r11411.
If you don't specify the extract folder then the files are extracted in the current working directory of OpenModelica.
Adeel.
Hi,
This was fixed in r11053. If you are using an older version I suggest installing the new nightly build,
http://build.openmodelica.org/omc/build … ly-builds/
Adeel.
OpenModelica 1.8.1 (r11291)
http://build.openmodelica.org/omc/build … ly-builds/
Adeel.
- Index
- » Users
- » adeas
- » Profile