Topic
8 replies Latest Post - ‏2013-05-15T10:35:42Z by shanz9903
RJadhav
RJadhav
11 Posts
ACCEPTED ANSWER

Pinned topic SXF C++ sending an event

‏2013-05-02T09:26:08Z |

Hello

What is the syntax to send or generate an event when using Safety Critical SXF C++ framework:

If the event name is evTrial, I am using send(&evTrial()) and then the program crashes due to some memory exception.

 

Any ideas?

  • pathfinder_hartmut
    pathfinder_hartmut
    44 Posts
    ACCEPTED ANSWER

    Re: SXF C++ sending an event

    ‏2013-05-07T12:54:19Z  in response to RJadhav

    Hi RJadhav,

    have you tried send(new evTrial()) ? Or don't you want to create a new one?

    Regards, Hartmut

     

    Updated on 2013-05-07T12:55:07Z at 2013-05-07T12:55:07Z by pathfinder_hartmut
  • shanz9903
    shanz9903
    234 Posts
    ACCEPTED ANSWER

    Re: SXF C++ sending an event

    ‏2013-05-07T14:53:53Z  in response to RJadhav

    Have you got an attribute of type evTrial?

    See also https://www.ibm.com/developerworks/community/forums/html/topic?id=2bae5e4f-3a8c-493d-a692-e6968de4ce46&ps=25

     

    Updated on 2013-05-07T14:55:05Z at 2013-05-07T14:55:05Z by shanz9903
  • RJadhav
    RJadhav
    11 Posts
    ACCEPTED ANSWER

    Re: SXF C++ sending an event

    ‏2013-05-10T13:19:02Z  in response to RJadhav

    Hello Hartmut and Shanz,

    I dont want to create a new event. The thread posted by Shanz also did not work.

    I followed  this page: http://pic.dhe.ibm.com/infocenter/rhaphlp/v7r6/index.jsp?topic=%2Fcom.ibm.rhp.misra.doc%2Ftopics%2Ft_misracpp.html

    See the NOTE section of the above link.

    • shanz9903
      shanz9903
      234 Posts
      ACCEPTED ANSWER

      Re: SXF C++ sending an event

      ‏2013-05-10T15:44:03Z  in response to RJadhav

      Attached is a simple Rhapsody 7.6.1.0 project showing how it's done.

      After attaching the project, I tried again with a SXFC++ type project.

      The <<static>> stereotype is already included as one of the SXFC++ stereotypes and the "Hello World" is printed out as expected every 3 seconds.

      Attachments

      Updated on 2013-05-10T15:51:59Z at 2013-05-10T15:51:59Z by shanz9903
  • RJadhav
    RJadhav
    11 Posts
    ACCEPTED ANSWER

    Re: SXF C++ sending an event

    ‏2013-05-13T12:17:10Z  in response to RJadhav

    Hi shanz

    What about applying stereotype SXF to the configuration. Only in that case the framwork files of SXF framework are used.

    Your above model works because the files used are not from SXF Framework but from OXF framwork.

    • shanz9903
      shanz9903
      234 Posts
      ACCEPTED ANSWER

      Re: SXF C++ sending an event

      ‏2013-05-13T14:37:13Z  in response to RJadhav

      RJadhav,

      Not sure what you mean about an SXF stereotype.

      I created a standard project (ie: OXF-based) and it worked.

      I created a SXFC++ project and it worked again.

      At project creation I chose Project Settings = SXFC++.

      This adds the SXFC++ Settings which contains 10 separate stereotypes, one of which is called SXF.

      If I add the SXF stereotype to the configuration, it still works.

      Updated on 2013-05-13T14:55:29Z at 2013-05-13T14:55:29Z by shanz9903
      • RJadhav
        RJadhav
        11 Posts
        ACCEPTED ANSWER

        Re: SXF C++ sending an event

        ‏2013-05-15T08:59:46Z  in response to shanz9903

        Hi

        Can you please try the following:

        Create a SXFC++ project. At project creation choose the Project Settings = SafetyCriticalForC++Developers

        Add the SXF stereotype to the configuration.

        If it works can you send me the model (preferably Rhapsody v8.0.2)

        Then I can compare and see where I am going wrong.

        • shanz9903
          shanz9903
          234 Posts
          ACCEPTED ANSWER

          Re: SXF C++ sending an event

          ‏2013-05-15T10:35:42Z  in response to RJadhav

          I see that the SafetyCriticalForC++Developers setting is merely an amalgamation of SXFC++ and MISRAC++.

              General::Profile::AutoReferences $OMROOT/Settings/MISRA/MISRAC++.sbs,$OMROOT/Settings/MISRA/SXFC++.sbs

          So if it doesn't work then it must be related to the MISRAC++ settings.

          I'll try it then update this post ...

          **UPDATE**

          Yes - it works after tweaking the Component's FrameworkInitialization property from MISRAC++

          OXF::initialize(0,NULL$(TimerResolution)$(TimerMaxTimeouts)$(TimeModel))

          to

          OXF::initialize($(TimerResolution)$(TimerMaxTimeouts)$(TimeModel))

          which produces

          if(OXF::initialize(0, 1000))

          I never use MISRAC++ settings and I don't understand the problem with the main file's initialization of the oxf.

          I won't install Rhapsody 8 just to produce another model sample.

          I've attached another example project which you should be able to open in any version of Rhapsody 7610 or newer.

          Attachments

          Updated on 2013-05-15T12:15:30Z at 2013-05-15T12:15:30Z by shanz9903