Finite state machines (FSB) are a great tool for modeling equipment and machine functionality. It provides user with tools to model behavior of equipment, well defined programming interface and ability to easily monitor and trace machine operation. Produced code is simple, clear and easy to maintain. Engineering effort is moved from coding to modeling behavior of equipment using state charts. A simple valve control will be used to demonstrate this approach.