- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Modelica-Arduino not working in...
Modelica-Arduino not working in OpenModelica
Modelica-Arduino not working in OpenModelica
Hello everyone,
does anybody has experience with the Arduino Uno model in OpenModelica?
I got the Arduino-library from GitHubArduino-library. Among other things, it states there that Dymola 2017 FD01 (or later) and Visual Studio 2015 is needed. I was hoping that there is some way to make the arduino work in openmodelica too, because for a project i only have openmodelica at my disposal. So i tried to run just the "Blink" of the Arduino library with Visual Studio 2015 as Target Build but it didn't work. The first thing which came up is a question window (see below in attachments).
If I keep using new frontend the simulation stops and I got the following messages in the message browser:
C:/PROGRA~1/OPENMO~1.2-6/tools/msys/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lModelicaArduino
collect2.exe: error: ld returned 1 exit status
Arduino.Examples.Blink.makefile:32: recipe for target 'omc_main_target' failed
mingw32-make: *** [omc_main_target] Error 1
mingw32-make: Leaving directory 'C:/Users/mhl-gl/AppData/Local/Temp/OPENMO~1/OMEdit/ARDUIN~1.BLI'
Compilation process failed. Exited with code 2.
Did anybody has an idea how I can solve this problem or did anybody just found another way to run the Arduino library without erros in OpenModelica?
I am grateful for any advice!
Best,
Gela
Re: Modelica-Arduino not working in OpenModelica
You'll need to look into that library to see which commands are being run to compile that library automatically in Dymola. If you compile it, I think it might work.
Otherwise, try the Modelica_DeviceDrivers library. It has worked in OpenModelica in the past at least.
- sjoelund.se
- 1700 Posts
Re: Modelica-Arduino not working in OpenModelica
Tank you for your answer sjoelund.se.
Do you mean something like the message [16] from the message browser?
I'll try to complete the code with "each" and see what comes out.
It is important that I can work with the Arduino model, because I need this model to continue working in another model in OpenModelica. In the Modelica_DeviceDrivers library I haven't found an Arduino model yet...
Re: Modelica-Arduino not working in OpenModelica
Modelica_DeviceDrivers.EmbeddedTargets.AVR.Examples.Arduino.UNO.Blink
- sjoelund.se
- 1700 Posts
Re: Modelica-Arduino not working in OpenModelica
Oh, that's what you meant.
I think you have misunderstood my request with the Arduino Uno a little bit or I have expressed myself there probably inaccurately: My goal is to run the Arduino model with different scripts (as one can do that on the real Arduino too). In Dymola I can select the script I want to run on the Arduino in its block parameters.
Soon I have no access to Dymola anymore so I need the same functionality in OpenModelica with the Arduino model there. I had mentioned the "Blink" only as an example, so that I can test the function.
Unfortunately I can't upload a screenshot of my model with the Arduino right now, because an error happens when uploading the image in my post. I hope you can see it here.
In my modelica model I run a script which I created with the Arduino Uno block. For this, the Arduino needs the different analog inputs and digital outputs. Because of this I tried it with the model from Github, since it had worked with this in Dymola everything.
Is there really no chance to simulate a working model in OpenModelica with the library from Github?
Re: Modelica-Arduino not working in OpenModelica
gela wrote:
Oh, that's what you meant.
I think you have misunderstood my request with the Arduino Uno a little bit or I have expressed myself there probably inaccurately: My goal is to run the Arduino model with different scripts (as one can do that on the real Arduino too). In Dymola I can select the script I want to run on the Arduino in its block parameters.
Soon I have no access to Dymola anymore so I need the same functionality in OpenModelica with the Arduino model there. I had mentioned the "Blink" only as an example, so that I can test the function.
Unfortunately I can't upload a screenshot of my model with the Arduino right now, because an error happens when uploading the image in my post. I hope you can see it here.
In my modelica model I run a script which I created with the Arduino Uno block. For this, the Arduino needs the different analog inputs and digital outputs. Because of this I tried it with the model from Github, since it had worked with this in Dymola everything.
Is there really no chance to simulate a working model in OpenModelica with the library from Github?
In Modelica_DeviceDrivers you can choose which AVR chip to target (but only a few different AVR microcontrollers are available). The Modelica model is what you compile for the Arduino.
As for the CATIA library, it might work. You just need to run some commands manually (look at all the Dymola-specific annotations in the model). Read the documentation and run everything special it is doing manually. For example: When a model that contains the ArduinoUno block is translated the external object is automatically re-built through the preInstantiate=Arduino.Internal.buildSketch(...) directive in its annotation.
- sjoelund.se
- 1700 Posts
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Modelica-Arduino not working in...