Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » eTrice » self transitions
self transitions [message #1006379] Thu, 31 January 2013 02:58 Go to next message
Tim Born is currently offline Tim Born
Messages: 15
Registered: October 2012
Junior Member
I've been having a look in the documentation and examples, I can't seem to work out how one would implement a self transition. As shown in the MSC below, sometimes you want to send a message to yourself. I've tried internal ports and interface ports, but it behaves as if the loopback wiring is missing.

How do others implement self transitions? I would love to see even one small working example.

thanks,
-tim
  • Attachment: shot1.png
    (Size: 22.56KB, Downloaded 102 times)
Re: self transitions [message #1006421 is a reply to message #1006379] Thu, 31 January 2013 05:28 Go to previous messageGo to next message
Thomas Schuetz is currently offline Thomas Schuetz
Messages: 16
Registered: January 2010
Junior Member
Hello Tim,
I understand the problem, but imho in most cases you can avoid the problem. The solution would be an internal loop back binding (connecting two internal ports) which would keep it an implementation detail of the actor.
This is not so hard to implement, but we would like to avoid that if possible:
With this feature you can make while loops on Statemachine/Messaging level. You could do something similar by either looping (blocking!) in the detail code (e.g. entry code) or with a timer service to avoid the blocking of other messages. The timer approach also needs much less performance and gives you a call with always the same timebase. The loop back solution would also kill the responsiveness of the thread, since all free cpu power would go into sending and receiving the same message (like a while loop).
You can find the timer service in org.eclipse.etrice.modellib.java/models/TimingService.room and the tutorial here: http://eclipse.org/etrice/documentation/doc/etrice.html#ImporttheTimingService

If you still need this feature, please let us know, since it is not so hard to implement. We just want to keep conceptual integrity.
Also let us know how urgent it is.

- Thomas
Re: self transitions [message #1006566 is a reply to message #1006421] Thu, 31 January 2013 14:07 Go to previous messageGo to next message
Thomas Jung is currently offline Thomas Jung
Messages: 12
Registered: February 2011
Junior Member
Hi Tim,

i know this feature from OT. In OT you can do both, internal and external loop back binding. I used this feature very seldom.

In eTrice you can at least create an Actor which simply mirrors a message. You can connect this Actor to an internal (or external) port to generate a message to your own FSM.

The disadvantage of this solution is that you need a few more recources (performance, code). So, if this is acceptable for you, you can take this as a workaround.

All the logical aspects (kill the responsiveness of the thread) are the same as with a loop back binding.

Best Regards
Thomas
Re: self transitions [message #1007647 is a reply to message #1006566] Wed, 06 February 2013 16:16 Go to previous message
Tim Born is currently offline Tim Born
Messages: 15
Registered: October 2012
Junior Member
Thanks Thomas. It's nice to know my "little Mr. Echo" actor work-around is a known idiom. That makes me feel a little better anyway. Also knowing I can stop looking helps too.

best,
-tim
Previous Topic:Customized Code Generation
Next Topic:generating code for Keil compiler
Goto Forum:
  


Current Time: Thu Aug 28 21:29:41 EDT 2014

Powered by FUDForum. Page generated in 0.01634 seconds