Safty plc have written the program, why the main plc still writes the program

You have to create your own FB block or FC block. In the local variable table of the FB, various variables used in the block, INPUT, OUTPUT, TEMP, etc. are created. You also need to build some UDT types, variable references. Doing your own block program requires some practical programming experience. The FB block program is called to create the called instance data block. In the case of FC blocks, the internal local variables are only valid for one cycle, and the variables inside the FB block are different. This is the difference between the two.