Author Topic: SysML SendMessage, AcceptEvent, State Machine effect, Signal data and simulation  (Read 10007 times)

sego

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Hi,

[ Originally posted in the General group, then moved here more appropriately. ]

I am a recent user of EA, trying to succes in using Signal parameters efficiently in SysML activities and state machine simulations.

It seems that such problems have been encountered in the past by other forum users, so I suppose I am not the only one to face them.

So, I hope that somebody can propose a solution that could help several persons.

Here is the problem : I design complex hardware and software systems having to exchange "signals", the quotes meaning they can be simple electrical values or data through a datalink.

I have concurrent activities and state machines to synchronize.
Those are represented by blocks.
The logical way to sync and transmit data is to use Signals and have those Signals carry some data between activities and state machines.
This means that the Signals have to be sent by a Send Signal action from an activity ( eventually called as a state behavior or transition effect ) and retrieve those from an AcceptEvent in an activity or from a transition triggering event in a state machine.
So far, I succeed to send Signals to state machines or activities and have them trigger the next item in the execution flow.  So far so good.

The problem is that the data ( Signal parameters ) seem not to be passed along or accessible in the simulation.

The questions I have are
1) how to define and pass the parameters to a SendSignal action so that
--  it reaches the proper target ( activity or state machine )
-- it carries the parameters

2) how to retrieve those parameters and use them within state machines and activities ( as effects or behaviors or with acceptEvent ) ?

I did not find any helpful resource nor in the documentation nor online, except some examples using NoMagic or Cameo which do not work once rebuilt in EA.  Maybe I overlooked something, so I'll be glad  to hear about pointers to such things.

Any kind of help would be welcome since I am stuck on a large project.

Thanks a lot in advance,
kind regards,
Serge

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Hi Serge,
pretty sure you won't get an answer. EA simulation is a nice toy. It probably mostly serves as marketing instrument. Just compare the price of EA to tools that do simulation in a more earnest way. And those are targeted to simulation alone (mostly) while EA has a bunch of other usages. So guess which price you actually pay for the simulation part.

q.

sego

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
@querty
So, basically I should not expect more than very basic control flow from the simple simulation, true simulation only for executable state machines and perhaps something for activities provided that I write a full javascript set of software chunks and then place them at each interesting node of the diagrams.   Looks like twice the programming work.

A toy indeed.  But anyway, Sparx advertises it as a full simulation tool, which is definitely misleading.
I was already surprised by the far from complete documentation, and the maze it is, but now this bad news confirms it is not the best choice.
Neverthelee, I hope someone will give me a few hints.  I not, I will get in touch with Sparx support.

I am not aware of the pricing of other true simulation tools, but knowing Catia/Dassault, I can guesstimate an order of magnitude.  This would be an overkill for my present projects.

Thanks for sharing the info,
Serge

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Wheter EA is a good choice depends. True, it's sort of a "China toy" but it also has its advantages. Definitely for that price you wont get any other tool with that capabilities. It also comes with a lot of pain, very, very sadly. Life could be so nice, but suffering seems to ba an unavoidable part. (If you read Dough Adams, definitely Sparx' marketing team is a clone of that mentioned in the Hitchhiker.)

q.

Takeshi K

  • EA User
  • **
  • Posts: 556
  • Karma: +35/-1
    • View Profile
Hello Serge,

Please try the following steps.

1. Create a Trigger ('Trigger1') and a Signal ('Signal1')
2. specify the type of Trigger1 to 'Signal' and assign Signal1 as its signal
3. add an attribute 'att' to Signal1
4. create a Statemachine diagram and assign Trigger1 to a Transition
5. create an Action and enter the following code as its effect

UIBroadcastSignal("Signal1",{'att' : 1});
// 1 is an example value

6. for a State after the Transition, you can refer the passed value (1 in this case) like:

sim.x = sim.Signal1.att;
// sim.x will be 1 (you need to define sim.x before this code)

This means that we (maybe) cannot use SendSignal Action with specified parameters but use the UIBroadcastSignal macro with parameters.

HTH,
--
t-kouno

freezepour

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
State Diagram with Ingress/Exit Procedures:
  • To illustrate the typical execution sequence and unusual situations, use a state chart.
  • Specify how states and transitions should enter and leave.
  • The entrance action has the ability to detect unusual situations and initiate a shift to a "exception handling" state in the interruptible zone, which is equivalent to the C++ try block.
  • For the "exception handling" state, define numerous exit actions, each of which should correspond to a distinct C++ catch block. The catch-body operations would be represented by these departure actions.
  • By substituting state transitions and actions for repeated repetitions of the same event, this method eliminates their limitations.
« Last Edit: May 09, 2024, 11:13:35 am by freezepour »