Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Papyrus for Real Time » Exchanging messages between capsules in different controllers(How to connect capsules in different controllers)
Exchanging messages between capsules in different controllers [message #1797607] Fri, 02 November 2018 16:20 Go to next message
Dimo Ditchev is currently offline Dimo DitchevFriend
Messages: 33
Registered: September 2018
Member
Let's create 2 capsules (for example Pinger and Ponger) in a Top capsule. The Top capsule will be assigned a Default controller.
Then let's select each capsule as Top and create Controller for each.
So under Linux we will have 2 executables, one for each Capsule.
How can we run both executables in a Linux shell and exchange messages (pings) between them.
Does anyone know how to do it?
Is there a similar example?

Thanks,
Dimo

[Updated on: Fri, 02 November 2018 16:55]

Report message to a moderator

Re: Exchanging messages between capsules in different controllers [message #1797614 is a reply to message #1797607] Fri, 02 November 2018 17:43 Go to previous messageGo to next message
Ernesto Posse is currently offline Ernesto PosseFriend
Messages: 438
Registered: March 2011
Senior Member
Currently the Papyrus-RT runtime is single process, so when you assign different capsule instances to different controllers, they run in different threads but on the same OS process. Hence, when you compile the generated code you get only one executable for that single process.

Multi-process models, running either in the same CPU or distributed has not been implemented, although it is in the roadmap.

Nevertheless, there is a research group at Queen's University in Canada which has developed an extension of Papyrus-RT supporting multi-processes which communicate via the MQTT protocol. Their website is http://flux.cs.queensu.ca/mase/. You may try to contact Karim Jahed for information on this extension.
Re: Exchanging messages between capsules in different controllers [message #1797619 is a reply to message #1797614] Fri, 02 November 2018 18:37 Go to previous messageGo to next message
Dimo Ditchev is currently offline Dimo DitchevFriend
Messages: 33
Registered: September 2018
Member
Thank you
Re: Exchanging messages between capsules in different controllers [message #1797621 is a reply to message #1797614] Fri, 02 November 2018 18:40 Go to previous messageGo to next message
Charles Rivet is currently offline Charles RivetFriend
Messages: 219
Registered: May 2014
Location: Canada
Senior Member

In addition to what Ernesto posted with the use of MQTT at Queen's University, you can also use any IPC mechanism supported by your platform, e.g.

  • Named Pipes,
  • SysV/PoSiX Message Queues
  • SysV/POSIX Message Queues
  • Shared Memory
  • etc.


What you have to do, in this case, then, is to wrap their interface implementation within a capsule providing a port that implements the protocol that defined for this exchange. This could be a service service provider point (SPP). Any capsule requiring that communication functionality would just need to have a service access point (SAP). SAP's and SPP's are connected based on their name, so they do not need connectors.
Note that the SPP would have to be on its own thread so as to not block the rest of the application when it runs!


/Charles Rivet
Re: Exchanging messages between capsules in different controllers [message #1797727 is a reply to message #1797621] Mon, 05 November 2018 17:43 Go to previous message
Dimo Ditchev is currently offline Dimo DitchevFriend
Messages: 33
Registered: September 2018
Member
Thank you, I will share you input and suggestions with the team.
We had considered some of these options.
The major concern is how to preserve the framework principles, more specifically RTC of the state machines when distributing the threads into multiple processes (which will ease the development of the teams).
Building comms on top of the framework without good knowledge of its details inherits the danger of breaking it and introducing bugs.
Previous Topic:Customize generated code folder
Next Topic:Papyrus-rt and conformance/compatibility to UML version and UML profile
Goto Forum:
  


Current Time: Thu Dec 26 23:53:45 GMT 2024

Powered by FUDForum. Page generated in 0.35018 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top