| Currently, the problem of urban traffic congestion is serious increasingly, and the city development is greatly restricted. In order to solve the traffic problem and change the traditional traffic mode, construction of rapid rail transit projects is active in many big cities of our country. The rapid rail transits include subway and suburban railway for instance. The Automatic Fare Collection (AFC) plays an extremely important role in building and operation management of rail transit. The AFC provides the services of automatic ticket selling and checking for passengers, and it also provides reliable data for the scientific management of rail transportation operators. The AFC is an important characteristic of the modern rail transit. The demand of AFC is continually increasing and the market competition of AFC becomes more intense with the development of rail transit.The Ticket Vending Machine (TVM) is an important part of AFC and is one of the user-oriented major terminal devices in AFC system. It is also an important product in in AFC series products of the company at present.Firstly, the project background, purpose and significance of TVM are introduced. Secondly, the system outline of TVM and the development technology involved are explained. Then the thesis focuses on the design solution and implementation method of major model in the system. The interface module, main service module, exception handling feature and printing feature are designed and implemented independently by the author. As a principal responsible person, the author designs and completes the state polling function, mode switching and settlement function of the control module. As a main participant, the author implements the communication with hardware serial port, messages processing between processes and part of communication function. Finally, the test results of the system are analyzed simply and summarized.Compared with the primal system, the TVM system designed in this thesis has many advantages. Its system architecture is significantly simplified. The services of recharging and buying tickets are more efficient. The interface is more friendly. The stability, universality and expansibility are improved greatly. The TVM becomes more market competitive. |