Yes. In 30 years of programming I only met two people who knew what it was. I don't think it is taught in school any more. I would hate to see it disappear which is why I brought up the subject. It has come to my rescue in dozens of situations.

Programming and debugging a finite state machine application is almost trivial. The hard part is determining the states. But that part is done with paper and pencil before one begins coding.

The books on the subject have relatively simple examples so the student doesn't really see the value of it.

Here is an easily understood sample from my experience:
My project was for a machining company that used CNC to mill metal parts. Their programmers would prepare the CNC instructions on CAD computers but not being totally skilled in milling techniques there would be mistakes. So they wanted a way to read back and repair the command tapes quickly without having to go back to the CAD programs and try to figure out what went wrong.

A programmer was working on this project for a year in Basic using lots of If-Then-Else logic and never got it to work. Using FSM I solved the problem in three days. Unfortunately the IT manager had no clue what I was talking about. On top of that the owner of the company signed papers to sell the company on the day I was to give a demonstration and everything was canceled.

Think about it. CNC commands are free-form and streaming. That is, there is a one-byte command followed by one to four digits representing a number such as size of bit, distance to move, coordinates, etc.

Try to create the If-Then-Else scenario. If the byte is a command, then look at next byte. Is it a command? Is it is number? And so on for fifteen or twenty commands. It is a rat's next of logic.

Decoding/parsing commands such as needed in compilers is a natural for FSM. Real-life examples are much more difficult to find the states but it can be done. I once applied for a job at a firm that does product placement. They contracted with clients to determine how to match products with customers. They would break out patterns of customers: those that liked hot, or salty or special flavors or speed, etc. and tweak the products to match these various categories.

The engineer that I interviewed was describing his programming efforts and I said it looked like a situation for the FSM. He immediately jumped out of his seat and said that's exactly what he was doing and ran to fetch his design notes to show me.

Nick Geti




----- Original Message ----- From: "Jean MAURICE" <[email protected]>
To: <[email protected]>
Sent: Thursday, December 19, 2013 12:21 AM
Subject: Re: Finite State Machine


I think I do ! In fact I am not sure with the translation.

When you have a lot of 'states' and a lot of conditions, you built an array. With one line per state and one column per condition. In each cell of this array, you get the index of the next state you must go and the name of the procedure you must execute.

Is that what you are dealing with ?

The Foxil


[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/B80FE4164F434891A8311CAFB7C30EDF@dual
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to