With the development of science and technology, new sensors continuously emerge. Among them, research on the fiber grating has become the hot spot. According to the characteristics of existing production method of fiber Bragg grating, demand of new technologies adapted to the fabrication of fiber Bragg grating becomes urgent. This paper mainly research on fiber grating written online system. Based on the study of online writing method of optical fiber drawing tower, phase mask plate automatic replacement online and fiber grating automatic writing online were achieved through the design of a mechanical and control system for online of fiber Bragg gratings written.