Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Papyrus for Real Time » How to access port index of an incoming message
How to access port index of an incoming message [message #1755496] Fri, 03 March 2017 19:57 Go to next message
Tuhin Das is currently offline Tuhin DasFriend
Messages: 5
Registered: October 2014
Junior Member
Hi,

I am designing a Papyrus-RT model which has a capsule named 'X' and the
'X' capsule has a port "y:Y" having a multiplicity of 5. Now, if a message
arrives in this port, in the 'X' capsule behaviour how would we access the
particular port index where the message arrived?


Thanks



Re: How to access port index of an incoming message [message #1755498 is a reply to message #1755496] Fri, 03 March 2017 20:05 Go to previous messageGo to next message
Ernesto Posse is currently offline Ernesto PosseFriend
Messages: 438
Registered: March 2011
Senior Member
Hi.

In action code you can obtain the index using either

getMsg().sapIndex()


or

getMsg().sapIndex0()


The difference between the two is that in the first one, indices are counted from 1, whereas in the second, they are counted from 0.

Re: How to access port index of an incoming message [message #1755504 is a reply to message #1755498] Fri, 03 March 2017 21:16 Go to previous message
Tuhin Das is currently offline Tuhin DasFriend
Messages: 5
Registered: October 2014
Junior Member
Thank you, Ernesto. It worked with a slight modification to replace the '.' operator with '->'.
Previous Topic:Ignoring Unexpected Messages
Next Topic:Papyrus-rt gets stock
Goto Forum:
  


Current Time: Thu Apr 18 15:35:26 GMT 2024

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

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

Back to the top