Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » Finite State Machine - The sequel(Stiil trying to get an FSM simulating on screen .....)
Finite State Machine - The sequel [message #1870854] Tue, 10 September 2024 10:30 Go to next message
Peter Boudewijns is currently offline Peter BoudewijnsFriend
Messages: 2
Registered: September 2024
Junior Member
Hello All,

Over the last few years I repeatedly made an effort to try and make a simple FSM work using the Moka simulation. I didn't succeed, and since we use software like Matlab StateFlow/Simulink and Itemis Create at the office I gave up on Papyrus.
But ..... purely out of interest for the hobby (bare metal programming) I thought it would be a great idea tot try the latest release (Papyrus 6.7.0 / 2024-06 (4.32))
After having solved the Moka installation by using a nightly build (found on this forum) I could create a Class 'owning' my state diagram. But now I'm confronted with the same frustration as every time in the past years :

Why can't I find documentation about things like Guards, Triggers, Entry/Exit etcetera. And when I want to run a simulation with delay's on transitions, how the heck am I going to create a Call/Signal event? Do I really have to create code that 'externally' keeps track of time and signals the FSM?

It would be great if you could give me some info, perhaps even a simple project with a 'lamp on / lamp off' based on a delay timer? I would be so gratefull ;-)

Regards,

Peter
Re: Finite State Machine - The sequel [message #1870998 is a reply to message #1870854] Thu, 12 September 2024 15:45 Go to previous messageGo to next message
Pauline Deville is currently offline Pauline DevilleFriend
Messages: 128
Registered: November 2016
Location: Paris Saclay, France
Senior Member
Hello,

Moka is base on norms : fUML [1], PSSM [2] and PSCS [3] which are specialization of UML [4]. There is no documentation about how to create a UML model but these spec can help.

Unfortunately, timeEvent are exclude from fUML (see 7.9.1 in the norm) so as far as I know it should not be possible to use timeEvent in Moka simulation.

I make a simple example using callEvent in attachment.

HTH,
Pauline

1] https://www.omg.org/spec/FUML/1.5/PDF
2] https://www.omg.org/spec/PSSM/1.0/PDF
3] https://www.omg.org/spec/PSCS/1.2/PDF
4] https://www.omg.org/spec/UML/2.5.1/PDF
Re: Finite State Machine - The sequel [message #1871013 is a reply to message #1870998] Thu, 12 September 2024 18:03 Go to previous messageGo to next message
Peter Boudewijns is currently offline Peter BoudewijnsFriend
Messages: 2
Registered: September 2024
Junior Member
Hello Pauline,

Thanks for the explanation. I've tried to simulate the statemachine in your example, but with no luck.
For starters I'm not familiar enough with UML to really understand the entire construcion with a system and the lamp class. But as I already found out its a Class for which the statemachine should be its classifier behaviour.
I read the fUML paragraph that describes the exclusion of a timeEvent (or the entire timing as a matter of fact), so I understand the construction of a trigger like 'after 5' or 'at 5' won't work. Since my job and hobby mainly concern embedded systems I would like to simulate the statemachine with an animated diagram reacting to simulated triggers. But now I'm still wondering, even after seeing your example how I can throw the events causing the triggers to occur.
And even more, when the statemachine would have to respond to a simple switch (manually actuated in the real world), how should I do this in Papyrus.
The programs like Matlab Stateflow/Simulink or Itemis Create allow for simple manual triggers by clicking a tickbox for instance.

So, perhaps for starters : How can I make the statemachine under simulation halt in the Off state, and let the trigger to On occur at my command?

I also added 2 attachments, because 'out of the box' your example yields several errors when trying to validate/simulate.

Looking forward to your response :-)

Peter

[Updated on: Thu, 12 September 2024 18:15]

Report message to a moderator

Re: Finite State Machine - The sequel [message #1871292 is a reply to message #1871013] Thu, 19 September 2024 13:19 Go to previous message
Pauline Deville is currently offline Pauline DevilleFriend
Messages: 128
Registered: November 2016
Location: Paris Saclay, France
Senior Member
Hello Peter,

Can you give me why you cannot run the Factory I give you ? Do you have any error ? (can you open the error log view please)

For some explanation :
1. the Factory initialise the model
2. the Lamp class has a classifier behavior as a state machine which react on call of turnOn and turnOff operation
3. the activity in System call the operations turnOn and turnOff to change the state of the Lamp state machine

Using moka you cannot interact with the simulation at runtime so you will not be able to turn the lamp on manually. When we talk about events, it is event trigger by the model (as event send by the CallOperationAction and received by the transition in the state machine in the example I provided).

HTH,
Pauline

Previous Topic:Derived Property
Next Topic:Papyrus for Manufacturing (P4M)
Goto Forum:
  


Current Time: Thu Sep 26 22:29:17 GMT 2024

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

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

Back to the top