The invention discloses a path generation and motion control method of a rail transfer stacker, which is applied to the control of a rail transfer stacker and a turnout mechanism. The system hardware is composed of vehicle-mounted PLC, conveyor line PLC, walking address recognition device, traveling driving device, track changing driving device, and track changing in-position sensor. The control method includes four parts: the generation method of the transition path, the detection method of the path conflict, the generation method of the transition command, the control of the turnout and the detection method of the path state. The method that the present invention proposes. The control method of the invention is based on the spanning tree to generate the path, realizes the control facing the path, greatly simplifies the program design and interactive data, and realizes the modular design of the stacker and the turnout mechanism. The interaction between the upper and lower computers is reduced, and the efficiency of the transfer operation is significantly improved.