To improve the flexibility for adaption to local demand of measure-control and protection devices for substation, speed up device software’s development and enhance software’s openness, this paper studies a software designing method based on IEC 61131-3 standard to realize programmable function in devices, and bring up software function model, object codes analysis and execute machine’s design method. Object oriented modern software technique such as function block is introduced in software design. An example of the realization of programmable function in reserve power source automatic connection device(RPSACD) is presented.