On Wed, 21 Jan 2004 17:11:38 +1300, Hopkins wrote: >State Diagram - time line diagram? > State diagrams are actually independent of time (except, of course, when the triggering events are timer-based). They're used to depict the state that your program is in. >What info do you normally show in the state diagram? > I don't know about anybody else but here's how I do mine: First, I create circles with each of the named states in them. Typically, I'll put the initial state at the top of the page and arrange the other states in a circle around the page. Most processes eventually get back to the idle state so the circular form works well for this. I show state transitions using curved connecting lines (with arrows) going from one state's circle to the next. Everything else that needs to be included gets put into text fields that are placed on the lines. Near the beginning of the line, I list the event that has started the transition. This could be a key-press, a timer interrupt, or some other triggering event. (If needed, response to other events can be shown with their own connecting lines.) Following the event, I show any operations that need to be executed in response to it on the line. I use pseudo-code at this level. (I avoid getting down to the individual instruction level on a state diagram. My intent is to document more of what's going on and why it's being done, rather than the lowest level details of exactly how it's done.) Whenever they're needed, conditionals are shown as simple questions on the line. A second line branching off from the first one depicts the split in program execution. I usually just use the labels 'Yes' and 'No' to indicate which path is taken based on the test. (This added line shows the execution of different code and perhaps a transition to a different state than the original path enters.) >What software do you use to create the state diagram? > I use a graphics program called 'FlowCharter'. It used to be named 'ABC Flowcharter' in earlier versions but I believe its developer, Micrographx, has dropped the 'ABC' part recently. You can probably use just about any drawing program that you're comfortable with. Regards, Bob -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu