Engineering System Design

 View Only
  • 1.  Statechart receiving signal in Ports

    Posted Tue February 21, 2023 09:14 AM

    Hello,

    I have the following problem:

    I designed a block containing  a proxyport of a type definition which also has a reception of a signal evSignal1Received. If I now create a statechart inside this block and put a AcceptEventAction with Signal set to evSignal1Received, Rhapsody creates an reception below the block for exactly this signal. How can this be avoided, so that the proxyport definition is used for the reception?

    The reception is also created, if I directly use the event in a transition.

    I can't find any definition to receive the signal through the defined proxyPort, neither in the AcceptEventAction nor in the transition features.

    Best regards

    Robert



    ------------------------------
    Robert Fromm
    ------------------------------

    #EngineeringSystemDesign
    #Sustainability


  • 2.  RE: Statechart receiving signal in Ports

    Posted Wed February 22, 2023 02:45 AM

    I always use interfaceBlocks to type the proxy ports and for the communication to work, the event reception needs to be specified on the operations tab in that interfaceBlock. Also, that event reception needs to be stereotyped with the <<directedFeature>> stereotype and the Feature Direction set appropriately.

    Consider the example below where the Sender is sending the Event to the Receiver via a proxy port typed by an interfaceBlock every 1000 ms and the Receiver changes it state from WaitingForEvent to EventHappened every time. Note that conjugation of the proxy port and the corresponding "Feature Direction" of the event reception. If the conjugation would be reversed so that pReciever is conjugated and pSender is unconjugated, the Feature Direction of the event reception would need to be "provided" for it to work the same way.



    ------------------------------
    Markus Nordstrand
    ------------------------------



  • 3.  RE: Statechart receiving signal in Ports

    Posted Wed February 22, 2023 05:00 AM

    Hello Markus,

    thanks for the feedback.

    Basically my system was setup like you described. Indeed, yet I did not check the "Behavior" checkbox in the ports definition. I thought a proxy port does not implement behavior. 

    Anyhow, now I implemented your example.

    The interface block is of Class Type "Regular"

    Indeed, I get the error

    I also tried the other settings for the interface's ClassType but the error persists.

    The Component settings is

    The initialization is 

    The language used is C++ with Cygwin compiler. Unfortunately I understand C++ just very basically, far away from being an expert. Any hint what causes that problem? 

    Best regards

    Robert



    ------------------------------
    Robert Fromm
    ------------------------------



  • 4.  RE: Statechart receiving signal in Ports

    Posted Wed February 22, 2023 08:30 AM

    I don't know these things good enough to give a rationale behind my suggestion, but I use a different component than the DefaultComponent when building. Instead of using the DefaultComponent I have another component (EventsAndIFB) directly in the Package where my blocks, interfaceblocks etc. are: 

    This is the Scope settings I use for that componenet: 

    In the configuration of the componenet and in the Initilization tab I leave Initial instances at "Explicit" and don't check any boxes:

    When you build, you should select the component (so not DefaultComponent):

    Hope this helps!



    ------------------------------
    Markus Nordstrand
    ------------------------------



  • 5.  RE: Statechart receiving signal in Ports

    Posted Wed February 22, 2023 09:46 AM

    Hello Markus,

    you're right. Now it's working as desired (without any further changes). Actually, I also do not really understand the background, but for now I'm quite happy and can go the next step. 

    Thank you!!

    Best regards

    Robert



    ------------------------------
    Robert Fromm
    ------------------------------



  • 6.  RE: Statechart receiving signal in Ports

    Posted Thu February 23, 2023 12:33 PM

    Hello Markus,

    maybe one additional final comment...

    As my example was close to what you did, I noticed that you marked the checkbox of Attribute: Behavior. 

    In the meantime I searched for this and it is crucial for simulation that it is marked. Basically it fulfills the sentence in the SysML specification "A completely specified proxy port shall describe how any interaction through the port is handled or initiated".

    Without this checkbox being active, signals in simulation will not being transferred, even if the rest of the model (and compiler configuration) is properly set up. At least that's what I noticed after digging a bit into to understand more of the background.

    Anyhow thanks for you hints!

    Best regards

    Robert



    ------------------------------
    Robert Fromm
    ------------------------------