Skip to main content



      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 14:57 Go to next message
Eclipse UserFriend
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 15:05 Go to previous messageGo to next message
Eclipse UserFriend
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 16:16 Go to previous message
Eclipse UserFriend
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: Wed May 21 16:33:24 EDT 2025

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

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

Back to the top