In motion control area,safety consideration while the moving part touches the limit switch is very important.Otherwise there might be device damage if the moving parts still move toward the limit switch after it touches the switch.In the SFC extraction electrostatic spectrum motion control project[1]and the Xi’an 200 MeV proton device electrostatic spectrum motion control work,we realized the limit position protection function using Phoenix PLC and Rockwell Allen Bradley(AB)PLC.In the Phoenix PLC,a function block is designed using ST language.In the AB PLC,ladder logic programming language is used to realize the function.