Cylindrical cam mechanisms have many merits, such as compact configuration, low cost, high reliability, better performance of kinematics and dynamics, and they have been widely used in fields of automatization and mechanization. Cylindrical cam mechanisms are the spatial mechanisms. Traditional methods of design and machining for cylindrical cam were complex, and it was difficult to ensure the precision of machining cylindrical cams, so it is impossible to meet the requirement of the development of high-speed automatic equipments. The better method of machining for cylindrical cams is to use the NC milling machine with 3 moving coordinates and 1 revolving coordinate. The key to realize the machining method is to resolve the problem of calculating tool’s paths for NC machining from the motion rule of followers of cam mechanisms. In this paper, the programming principle and technology of NC machining for cylindrical cams were analyzed, the compensation of cutting-tool radius for NC machining was discussed, the method of calculation for motion rule of cam followers and method of programming of NC machining with 4-coordinates were proposed, through which perfect effect have been gained in practice.