The milling method of the tooth profile of chain wheel tooth by the function of user’s macro program NC system is given.The characteristic and scope of user’s macroprogram function are discussed.And then development method of macroprogram of chain wheel machining based on FANUC-0i system is discussed.A typical instance of the macroprogram is provided.