Program faults are usually reported through return-value or emergency. But, when they emergence in the state-orient model, how to make the program return to the fault point’s state and which further corresponding actions should be taken, merely by using the simple method-report or reset, can’t define the return-value or emergency. In order to process the fault automatically, this article presents an automatic program with thoughts of combined coding and state redundant design, and proposes its frame model and algorithm. This model decreases faults of state-switch and increases capability of fault-restore. At last, parts of the results are applied to a vending machine project and the tests show its satisfaction.