From: ql on
Since this forum mentions my book ("Practical Statecharts in C/C++")
and the website (www.state-machine.com), I'd like to clarify some
misconceptions about state machines, UML, and tools.

For starters, I'd recommend reading a few articles about modern state
machines in embedded systems (see also www.state-machine.com/resources/papers.htm).

1. The articles "Who Moved My State" (http://www.ddj.com/cpp/
184401643) and "Back to Basics" (http://www.ddj.com/cpp/184401737)
explain what state machines are and what kind of programming problem
they address. You learn how state machine can become very powerful
"spaghetti-code reducers" and how they are fundamentally different
from flowcharts. The article gives also some guidelines for designing
state machines and concrete C and C++ code examples (the code is
available for download at http://www.state-machine.com/writings/cuj.htm).

2. The article "Déjà vu" (http://www.ddj.com/cpp/184401665) introduces
the more advanced concept of hierarchical state nesting and shows how
it counteracts the "state and transition explosion" problem of
traditional non-hierarchical state machines. The source code
accompanying this article is available for download at
http://www.state-machine.com/writings/cuj.htm.

3. The article "UML at $10.99" (http://www.ddj.com/embedded/188101799)
shows that contrary to widespread misconceptions, modern hierarchical
state machines are applicable to the tiniest, deeply embedded
microcontrollers. This article shows an tiny state machine framework
and real-time kernel running in a USB Toolstick from Silicon Labs
(8051-based C8051F300 MCU), with just 8K of flash ROM and 256 bytes or
RAM.


The bottom line is that to use state machines effectively, you first
need to make a paradigm shift from the traditional sequential
programming (such as a traditional RTOS or just a "superloop") to
event-driven programming. Event-driven programming leads to inversion
of control (a.k.a. the Hollywood Principle: "Don't call us, we'll call
you") between the application and the event-driven infrastructure.
This inversion of control, in turn, means that the event-driven
infrastructure for executing state machines naturally takes a form of
an application framework.

Which brings us to the tools based on state machines. As it turns out,
virtually all such code-generating tools have an event-driven
framework buried inside (e.g., the Rhapsody tool generates code for
either the OXF or the IDF framework). In fact, the framework is the
most important enabler of automatic code generation.

But you don't need a big tool to use an event-driven framework. You
just need the framework. For example, the QP family of very
lightweight, open source frameworks (https://sourceforge.net/projects/
qpc/) are designed for manual coding of hierarchical state machines .
The code you need to write directly in C or C++ is actually simpler
than the state machine specification for the SMC compiler (https://
sourceforge.net/projects/smc/) mentioned in this forum. SMC is not
hierarchical.

Miro Samek
http://www.state-machine.com


From: Chris H on
In message <T4KdnXOGUPe8Sn_XnZ2dnUVZ8ludnZ2d(a)lyse.net>, David Brown
<david.brown(a)hesbynett.removethisbit.no> writes
>Chris H wrote:
>> In message <hbt1hj$411$1(a)news.eternal-september.org>, Cesar Rabak
>> <csrabak(a)bol.com.br> writes
>>> Dan Henry escreveu:
>>>> On Thu, 15 Oct 2009 19:53:35 +1100, "Marc Hillman"
>>>> <7owsx1j02(a)sneakemail.com> wrote:
>>>>
>>>>> I'm looking for a Statechart (Harel) tool that supports C code
>>>>> generation, and is free (not trial copies). Any suggestions?
>>>> IAR's visualSTATE http://www.iar.com/vs
>>>>
>>> But it is not free, is it?
>> Nothing in this life is free.
>>
>Perhaps you should find yourself a better life?

I have a very good life. It is based in reality.

--
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills Staffs England /\/\/\/\/
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/



From: Jon Kirwan on
On Sat, 24 Oct 2009 20:04:32 +0100, Chris H <chris(a)phaedsys.org>
wrote:

>In message <T4KdnXOGUPe8Sn_XnZ2dnUVZ8ludnZ2d(a)lyse.net>, David Brown
><david.brown(a)hesbynett.removethisbit.no> writes
>>Chris H wrote:
>>> In message <hbt1hj$411$1(a)news.eternal-september.org>, Cesar Rabak
>>> <csrabak(a)bol.com.br> writes
>>>> Dan Henry escreveu:
>>>>> On Thu, 15 Oct 2009 19:53:35 +1100, "Marc Hillman"
>>>>> <7owsx1j02(a)sneakemail.com> wrote:
>>>>>
>>>>>> I'm looking for a Statechart (Harel) tool that supports C code
>>>>>> generation, and is free (not trial copies). Any suggestions?
>>>>> IAR's visualSTATE http://www.iar.com/vs
>>>>>
>>>> But it is not free, is it?
>>> Nothing in this life is free.
>>>
>>Perhaps you should find yourself a better life?
>
>I have a very good life.

:)

>It is based in reality.

Most people believe that. It's generally false.

http://www.amazon.com/Species-Denial-Jeremy-Griffith/dp/1741290015

Jon
From: Cesar Rabak on
Chris H escreveu:
> In message <hbt1hj$411$1(a)news.eternal-september.org>, Cesar Rabak
> <csrabak(a)bol.com.br> writes
>> Dan Henry escreveu:
>>> On Thu, 15 Oct 2009 19:53:35 +1100, "Marc Hillman"
>>> <7owsx1j02(a)sneakemail.com> wrote:
>>>
>>>> I'm looking for a Statechart (Harel) tool that supports C code
>>>> generation, and is free (not trial copies). Any suggestions?
>>> IAR's visualSTATE http://www.iar.com/vs
>>>
>> But it is not free, is it?
>
> Nothing in this life is free.
>
This affirmation is a fallacy that gives opportunity to another very
interesting thread ;-)

--
Cesar Rabak
GNU/Linux User 52247.
Get counted: http://counter.li.org/
From: Cesar Rabak on
Marco escreveu:
> On Oct 23, 12:52 pm, Cesar Rabak <csra...(a)bol.com.br> wrote:
>> Dan Henry escreveu:> On Thu, 15 Oct 2009 19:53:35 +1100, "Marc Hillman"
>>> <7owsx1...(a)sneakemail.com> wrote:
>>>> I'm looking for a Statechart (Harel) tool that supports C code generation,
>>>> and is free (not trial copies). Any suggestions?
>>> IAR's visualSTATEhttp://www.iar.com/vs
>> But it is not free, is it?
>>
>
>
> it allowed some states or so for free in the trial version (not sure
> if trial legal for commercial use) I haven't looked into this in a
> while
The OP wrote "not trial copies" so. . .

--
Cesar Rabak
GNU/Linux User 52247.
Get counted: http://counter.li.org/