Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register
  • Index
  • » Users
  • » m.akram040@gmail.com
  • » Profile

Posts

Posts

Dear Jawhar,

Thanks for the report of your Phd Thesis.

The problem I am facing now:

1.  Whenever I run the model called Socket it runs and through the port option check in windows (netstat -an) when I check it I did not found that it had open the port 12345 in the address 127.0.0.1  . It just ran and gave the output which is nothing except port number.

What I am trying to do.

1. Create a socket server from OpenModelica and list to it from outside then do something and send Message to outside again.

Its like
a. create socket from OMC
b. send message from outside to OMC server
c. OMC receives the message
d. Do some computation
e. OMC send the message to outside again.


I have looked through your code and changed some of mine.

I have attached the code below.

It would be really helpful to have your guidance.
SocketModelica.zip

Koldo wrote:


Hello sjoelund.se

I have seen that nc listen TCP connection in Linux. In my case I am in Windows and the simulation duration is variable: the model decides when to stop.

Anyway sockets do not seem so difficult. I have collected a couple of samples and I will try them.

Best regards
Koldo

Dear Koldo,
I am trying to do the same thing but you are using Orcos and I have to use 4DIAC. I am trying to send message to my control application and also trying to receive it. But still not able to make it work.

I would like to get help from anyone from here. I am new to all these things.

Jawhar wrote:


In the past, I used external socket functions to make communication between OpenModelica and an external tool. The best idea is to use the sample() function. In this way you are sure to obtain your data at a precise time corresponding to your sample. If you want to send data to OpenModelica, it will work too.

Could you give more information about your project?

Hope this help.

Regards,
Hassen

Dear Jawhar,
I was looking for a socket communication with external tool using Socket.

But whenever I tried to run the socket it runs the socket and turned off.

I was looking though this thread http://www.modelica-forum.com/forums/lo … p/t17.html

But got stuck. It would be really helpful to have your guidance.

My goal : create a socket from Open Modelica mode and receive message via that socket
                 A control program written in C++ will send some message to this socket.
                Then message will be received by this socket and will work on some other models and then again send the message via that socket.

regards Akram

Dear Jawhar,
I was looking for a socket communication with external tool using Socket.

But whenever I tried to run the socket it runs the socket and turned off.

I was looking though this thread http://www.modelica-forum.com/forums/lo … p/t17.html

But got stuck. It would be really helpful to have your guidance.

My goal : create a socket from Open Modelica mode and receive message via that socket
                 A control program written in C++ will send some message to this socket.
                Then message will be received by this socket and will work on some other models and then again send the message via that socket.

bull,


I am also looking for this type of solution and problem is same as yours. But how do you do the same thing at a time, Run the server from the OpenModelica via external C function and also listen at the same time ? Because when I run the server and listen from the clients on that port simulation runs and runs it does not stop. And I cant do anything in the equation of the OpenModelica model. But when I do not listen to any port then when I run the server it creates a host and port and bind them and then returns and turns off and then equation of the model works. But the thing is port is off and I cant contact with it from the outside client.

Hello,
I was going through this post but as it has been said the external libraries are missing fr CDACRealtimeSynchronousization library.

But is it possible to get it from somewhere so that I can run this code and check it out.

As for my work I need something related to that. Where I will run a server from OpenModelica via call of external C functions but when I run the server it simulates and stop I want to call from a outside client and want to run the server then I want OpenModelica model to get the value from the client send and then process it and send it again. Can you please tell me how to do it ?

  • Index
  • » Users
  • » m.akram040@gmail.com
  • » Profile
You are here: