Wouter van Ooijen wrote: > > FSM is one of the few programming techniques that really > > should be implemented in a graphical programming language. > > I disagree: > > 1. A non-trivial state machine contains, beside the state-stuff itself, > a lot of plain and (not so) simple code. I don't see how anything but a > HLL (for asm lovers: assembler) would be usefull for that part. I agree with you on this. I did not mean that every aspect of the programming proceadure should be done using diagrams. Yes write A=B+2 where it is appropriote but use diagrams to program the relationships between the states and events. The event transition and monitor functions can be written in anything you like. > > 2. A non-trivial state machine contains far too many states, events and > transitions to be reasonably represented in a graphical way. Think > 10..20 states, same number of events. I disagree here. A large system consisting of hundreds of states and thousands of events can be much more easily managed using an appropriate tool. Think of a large silicon chip with huge numbers of features. scroll around, zoom in. Same with a huge state diagram. Also with the right tools you can build small state machines, test them then use them as components in larger state machines. I have worked on systems that have had tens of states and hundreds of events which although they were described as state machines - were anything but. Large state machines are very hard to verify and often people take short cuts because they need a quick fix. These systems degenerate into a collection of hacks and the documentation becomes almost useless. If you use the right tools you don't have to resort to short cuts, you can add a few more states and events in the time it takes you to draw a few boxes, add a couple of lines and type in the names. Have a look at http://www.xcprod.com/titan/ZMECH-DOC/generate/state-machine/block-indx.html 34 states and 88 events. The diagram shows a multimaster I2C system. It would look better on the screen if you shrank it down and scrolled and zoomed but that defeats the objective of presenting it as a html image with anotated hot spots. Regards Sergio Masci http://www.xcprod.com/titan/XCSB - optimising structured PIC BASIC compiler -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.