Control programs for machine tools and industrial machines include programs that control axis motion, and programs, that periodically execute machine sequence control. Both the axis motion control programs and the sequence programs are coded in an NC program format. The controller analyzes the sequence programs created in NC program format, converts them into executable form, and executes the executable-form programs periodically from when power to the machine is turned on until the power is shut down.