Finite State Machine - The sequel [message #1870854] |
Tue, 10 September 2024 06:30  |
Eclipse User |
|
|
|
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 #1871013 is a reply to message #1870998] |
Thu, 12 September 2024 14:03   |
Eclipse User |
|
|
|
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 14:15] by Moderator
|
|
|
|
|
Re: Finite State Machine - The sequel [message #1871784 is a reply to message #1871526] |
Thu, 10 October 2024 08:48  |
Eclipse User |
|
|
|
Hello,
I may be do an error in the model. I upload a new version.
Validation errors are not worrying in this case. I add one or two comments in the model. If you wan tot understand it you should look mainly at : main activity and LampStateMachine.
Hope it will works better.
Pauline
|
|
|
Powered by
FUDForum. Page generated in 0.07371 seconds