The invention discloses a compiling method and device based on a PLC
object model, equipment and a medium. In the scheme, when the
compiler compiles the PLC
program code, the target instance and the target function to be called need to be determined, and the corresponding instance calling code is generated, so that the PLC
executable program is generated based on the instance calling code. Wherein the target instance is created through a target function block, and if the
parameter type comprises a heterogeneous instruction function
block type, the heterogeneous resource is directly stored in a heterogeneous resource memory allocated by the target instance, and
adaptation of the
object model and the heterogeneous instruction is achieved; moreover, the data can be effectively monitored through the
temporary variable of the instance; through the reserved memory of the instance, the overall memory space of the instance does not need to be changed during hot update, and the influence of hot update on the instance is reduced; therefore, the method can meet the special requirements of the PLC equipment, and enables the PLC
compiler to compile the PLC
program code accurately and effectively.