In the process of cigar production and packaging,ASB drawer-type packaging machine can only cover each piece of trademark paper with traceability code before production by manual stamping,which is time-consuming and labor-intensive,and the depth of the code printed by manual printing is unstable and easy to be defaced.In order to solve this problem,on the basis of ASB drawer packaging machine,a set of automatic coding device is designed and modified,which adopts the rail fixed steel printing method and adds PLC control commands in the original control system to control the coding time,realizing the automatic stamping of each box of cigarettes with the traceability code,and the productivity after the transformation is increased by 30%compared with that before the improvement,which has a very good economic benefit.