PLC program execution system

By introducing a unified interactive interface and multiple executor selection in the PLC program execution system, the problem that users cannot choose the execution method is solved, and the system flexibility and scalability are improved.

CN120386279AActive Publication Date: 2025-07-29SHENZHEN HUICHEN AUTOMATION TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202510886027.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-30
Publication Date
2025-07-29
Estimated Expiration
2045-06-30

AI Technical Summary

Technical Problem

The existing PLC program execution system lacks flexibility and users cannot choose the execution method, which makes replacement difficult and inefficient.

Method used

The PLC program execution system is divided into a runtime system and an execution mechanism, providing a unified interactive interface. The execution mechanism can choose interpreted, compiled or JIT-type executors, and the implementation method is flexible and optional.

Benefits of technology

It improves the flexibility and scalability of the PLC program execution system, reduces code coupling, shortens the time to replace the actuator, and improves operating efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120386279A_ABST
    Figure CN120386279A_ABST
Patent Text Reader

Abstract

The invention provides a PLC program execution system, and relates to the technical field of programmable logic controllers, the PLC program execution system comprises a runtime system and an execution mechanism, the runtime system is used for storing data and carrying out network interaction, and a unified interaction interface is arranged in the runtime system; the execution mechanism is connected to the runtime system through the interactive interface and used for accessing a memory and a network through the interactive interface and selecting one implementation mode to execute a PLC program, and the implementation modes of the execution mechanism comprise an interpretation type actuator, a compilation type actuator and a JIT type actuator. Through the execution mechanism in the PLC program execution system, one implementation mode can be selected from multiple implementation modes of the execution mechanism to execute the PLC program, the implementation mode is flexible and selectable, the flexibility of the PLC program execution system is improved, and the problems that in the related technology, a user cannot select the execution mode of the PLC program, and flexibility is lacked are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of programmable logic controllers, and particularly relates to a PLC program execution system. Background Art

[0002] Currently, the programmable logic controller (PLC) products provided on the market use a fixed and single way to execute PLC programs. When the PLC program execution system in the related art executes a PLC program, the user cannot select which way to execute the logic of the PLC program. Such a PLC program execution system is rigid and lacks flexibility.

[0003] Regarding the problem that the user cannot select the execution mode of the PLC program and lacks flexibility in the related art, no effective technical solution has been proposed yet. Summary of the Invention

[0004] The main purpose of the present disclosure is to provide a PLC program execution system to solve the problem that the user cannot select the execution mode of the PLC program and lacks flexibility in the related art.

[0005] To achieve the above purpose, the present disclosure provides a PLC program execution system, including: A runtime system, which is used to store data and perform network interaction, and a unified interaction interface is provided in the runtime system; An execution mechanism, which is connected to the runtime system through the interaction interface, and is used to access the memory and network through the interaction interface and select an implementation method to execute the PLC program. Among them, the implementation methods of the execution mechanism include an interpretive executor, a compiled executor, and a JIT executor.

[0006] Optionally, the runtime system includes: A network manager, which is used to perform network communication with external devices, obtain the input signal data and output signal data of the external devices, and interact with the host computer; A memory mechanism, which is used to store data; The interaction interface is respectively connected to the network manager and the memory mechanism, and is used to configure the read / write parameters and network parameters of the execution mechanism. The read / write parameters include the position of the data read or written in the memory mechanism and the size of the data read or written, and the network parameters include the address for network interaction.

[0007] Optionally, the execution mechanism is further used to replace by selecting different implementation methods during the operation of the PLC or during the compilation of software configuration.

[0008] Optionally, the actuator is further configured to dynamically add or delete the implementation manners of the actuator.

[0009] Further, the PLC program execution system is a plug-in PLC program execution system.

[0010] Optionally, the interpreted actuator is configured to interpret and execute program logical operations by parsing the bytecode instructions generated by compiling the PLC program through a parsing compiler.

[0011] Optionally, the compiled actuator is configured to directly compile the PLC program into machine code instructions and directly run the program on the operating system of the PLC main body hardware.

[0012] Optionally, the JIT actuator is configured to convert bytecode instructions into machine code instructions during runtime to improve the runtime efficiency.

[0013] Optionally, the runtime system is compiled into a dynamic library.

[0014] Optionally, the actuator is compiled into a dynamic library.

[0015] In the PLC program execution system provided by the embodiments of the present disclosure, the runtime system is used to store data and perform network interactions, and a unified interaction interface is provided in the runtime system; the actuator is connected to the runtime system through the interaction interface and is configured to access the memory and the network through the interaction interface, and select an implementation manner to execute the PLC program, where the implementation manners of the actuator include an interpreted actuator, a compiled actuator, and a JIT actuator. Through the actuator in the PLC program execution system, an implementation manner can be selected from multiple implementation manners of the actuator to execute the PLC program, and the implementation manner is flexibly selectable, which improves the flexibility of the PLC program execution system and solves the problem that users in the related art cannot select the execution manner of the PLC program and lack flexibility. Description of the Drawings

[0016] In order to more clearly illustrate the specific embodiments of the present disclosure or the technical solutions in the related art, the following will briefly introduce the drawings required for use in the description of the specific embodiments or the related technical solutions. Obviously, the drawings in the following description are only some embodiments of the present disclosure, and those of ordinary skill in the art can obtain other drawings without creative efforts based on these drawings.

[0017] Figure 1 It is the architecture diagram of the PLC program execution system provided by the embodiments of the present disclosure. Detailed Embodiments

[0018] To enable those skilled in the art to better understand the present disclosure solution, the following will clearly and completely describe the technical solutions in the embodiments of the present disclosure in conjunction with the accompanying drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only a part of the embodiments of the present disclosure, rather than all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present disclosure without creative efforts shall fall within the scope of protection of the present disclosure.

[0019] It should be noted that the terms "including" and "having" and any variations thereof in the specification and claims of the present disclosure and the above-mentioned accompanying drawings are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device that includes a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.

[0020] In addition, the terms "installed", "set up", "provided with", "connected", "linked", and "socketed" should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral structure; it can be a mechanical connection or an electrical connection; it can be directly connected, or indirectly connected through an intermediate medium, or there can be internal communication between two devices, components or parts. For those of ordinary skill in the art, the specific meanings of the above terms in the present disclosure can be understood according to specific circumstances.

[0021] It should be noted that, without conflict, the embodiments in the present disclosure and the features in the embodiments can be combined with each other. The following will detail the present disclosure with reference to the drawings and in conjunction with the embodiments.

[0022] Currently, the programmable logic controller (PLC) products provided on the market all use a fixed and single way to execute the PLC program. When the PLC program execution system in the related art executes the PLC program, the user cannot choose which way to execute the logic of the PLC program. This kind of PLC program execution system is rigid and lacks flexibility.

[0023] Moreover, for the above-mentioned PLC program execution system with a fixed and single execution method, when programming and implementing, the code may have a high degree of coupling. If the user wants to improve the operation efficiency and replace the current execution system, due to the high code coupling, the replacement difficulty will be relatively large and it will take a long time.

[0024] To solve the above problems, the embodiments of the present disclosure provide a PLC program execution system, and the architecture diagram is as Figure 1 shown. The PLC program execution system includes: A runtime system for storing data and performing network interactions, with a unified interaction interface provided within the runtime system; the runtime system provides a unified interaction interface for accessing memory and the network. An execution mechanism, connected to the runtime system through the interaction interface, for accessing memory and the network through the interaction interface and selecting an implementation method to execute the PLC program. Among them, the implementation methods of the execution mechanism include an interpreted executor, a compiled executor, and a JIT executor. Based on the unified interaction interface, there can be multiple implementation methods for the execution mechanism, not a single fixed one.

[0025] The execution mechanism performs memory access and network interactions through the unified interaction interface. By using the unified interaction interface, there can be multiple different implementation methods, and one implementation method is selected from them to execute the PLC program, which can be an interpreted executor, a compiled executor, or a JIT executor, or other implementation methods. For example, after selecting the interpreted executor, the interpreted executor is used as the execution mechanism to execute the PLC program; the JIT executor is similar to the Just In Time compilation method of the JVM.

[0026] In the present disclosure, through the execution mechanism in the PLC program execution system, one implementation method can be selected from multiple implementation methods of the execution mechanism to execute the PLC program. The implementation method is flexibly selectable, which improves the flexibility of the PLC program execution system and solves the problem in the related art that users cannot select the execution method of the PLC program and lack flexibility.

[0027] Moreover, by dividing the PLC program execution system into two parts, namely the runtime system and the execution mechanism, and providing a unified interaction interface, the coupling between codes is reduced, the difficulty of replacing the execution mechanism is decreased, and the time for replacing the execution mechanism is shortened.

[0028] In an optional implementation manner of the present disclosure, the runtime system includes: A network manager for performing network communication with external devices, obtaining input signal data and output signal data of the external devices, and interacting with the host computer; the external devices are devices other than the PLC program execution system, and network communication can be performed with the external devices through the IP addresses of the external devices. A memory mechanism for storing data; the memory mechanism has scalability and can expand the memory. Moreover, the memory mechanism and the execution mechanism can form a program executor, and the formed program executor can be used to execute the logic of the PLC program, and at the same time, obtain the input signal data and set the output signal data through the interaction interface; in the embodiments of the present disclosure, the network manager, the memory mechanism, and the interaction interface are integrated to form the runtime system. An interaction interface, which is respectively connected to a network manager and a memory mechanism, is used to configure the read / write parameters and network parameters of an actuator. The read / write parameters include the position of the data to be read or written in the memory mechanism and the size of the data volume to be read or written. The network parameters include the address for network interaction. For example, when configuring the read / write parameters of the actuator, configure respectively which position in which memory to read, how many bits or bytes to read, where to place the read data after reading, and which position in which memory to write, how many bits or bytes to write, and the content of the data to be written. When configuring the network parameters of the actuator, the address can be a network address or an IP address. Access the network through the network address and perform network interaction with devices in the network through the IP address of the device to achieve remote reading or writing of data.

[0029] In an optional implementation manner of the present disclosure, the actuator is further configured to be replaced by selecting different implementation manners when the PLC is running or when the software configuration is compiled. During runtime, there can be multiple different implementation manners in the PLC program execution system, serving as multiple different actuators, which facilitates users to flexibly select the execution manner of the PLC program and improve the operation efficiency. Based on the unified interaction interface, there can be multiple implementation manners of the actuator. It can be flexibly replaced by selecting different implementation manners when the PLC is running or when the software configuration is compiled, improving the operation efficiency and further enhancing the scalability of the PLC program execution system.

[0030] Based on the unified interaction interface, the present disclosure reduces the coupling between codes, simplifies the difficulty of replacing the actuator, and shortens the time for replacing the actuator.

[0031] In an optional implementation manner of the present disclosure, the actuator is further configured to dynamically add or delete the implementation manners of the actuator.

[0032] In a preferred implementation manner of the present disclosure, the PLC program execution system is a plug-in PLC program execution system.

[0033] Based on the unified interaction interface, there can be multiple implementation manners of the actuator. In addition to the three types of interpreter executors, compiler executors, and JIT executors, the implementation manners of the actuator can also be dynamically added or deleted to expand the PLC program execution manners. Such a PLC program execution system is plug-in and can improve the scalability of the PLC program execution system.

[0034] In an optional implementation manner of the present disclosure, the interpreter executor is used to interpret and execute the program logical operations by parsing the bytecode instructions generated by compiling the PLC program by the compiler. The interpreter executor is an implementation manner based on bytecode instructions. As long as the memory mechanism remains unchanged, no matter how the bytecode instruction format is designed, it will not cause changes in other parts of the PLC program execution system.

[0035] In an alternative embodiment of the present disclosure, a compilation-type actuator is used to directly compile a PLC program into machine code instructions and directly run the program on the operating system of the PLC main body hardware.

[0036] In an alternative embodiment of the present disclosure, a JIT-type actuator is used to convert bytecode instructions into machine code instructions during runtime to improve the runtime efficiency. The JIT-type actuator is an implementation based on bytecode instructions. As long as the memory structure remains unchanged, no matter how the bytecode instruction format is designed, it will not cause changes in other parts of the PLC program execution system.

[0037] In an alternative embodiment of the present disclosure, the runtime system is compiled into a dynamic library. Generally, the runtime system is compiled into a dynamic library.

[0038] In an alternative embodiment of the present disclosure, the execution mechanism is compiled into a dynamic library. Generally, the execution mechanism is also compiled into a dynamic library.

[0039] From the above description, it can be seen that the present disclosure achieves the following technical effects: Through the execution mechanism in the PLC program execution system of the present disclosure, one implementation method can be selected from multiple implementation methods of the execution mechanism to execute the PLC program. The implementation method is flexible and optional, improving the flexibility of the PLC program execution system and solving the problem in the related art that users cannot select the execution method of the PLC program and lack flexibility.

[0040] By dividing the PLC program execution system into two parts, namely the runtime system and the execution mechanism, and providing a unified interaction interface, the coupling between codes is reduced, the difficulty of replacing the execution mechanism is decreased, and the time for replacing the execution mechanism is shortened; Based on the unified interaction interface, there can be multiple implementation methods for the execution mechanism. The execution mechanism can be flexibly replaced by selecting different implementation methods during the runtime of the PLC or during software configuration compilation, further improving the scalability of the PLC program execution system.

[0041] It should be understood that the various aspects of the present disclosure can be implemented alone or in combination with one or more other aspects. It should also be understood that the descriptions and specific embodiments herein are for illustrative purposes only and are not intended to limit the scope of the present disclosure.

[0042] Although the embodiments of the present disclosure have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the present disclosure, and such modifications and variations fall within the scope defined by the appended claims.

Claims

1. A PLC program execution system, characterized in that It includes: A runtime system for storing data and performing network interactions, with a unified interaction interface provided therein. An execution mechanism connected to the runtime system through the interaction interface, for accessing memory and the network through the interaction interface and selecting an implementation method to execute the PLC program. Among them, the implementation methods of the execution mechanism include an interpretive executor, a compiled executor, and a JIT executor.

2. The PLC program execution system according to claim 1, wherein The runtime system includes: A network manager for performing network communication with external devices, obtaining the input signal data and output signal data of the external devices, and interacting with the host computer. A memory mechanism for storing data. The interaction interface is respectively connected to the network manager and the memory mechanism, for configuring the read / write parameters and network parameters of the execution mechanism. The read / write parameters include the position of the data to be read or written in the memory mechanism and the size of the data to be read or written, and the network parameters include the address for network interaction.

3. The PLC program execution system according to claim 1, characterized in that The execution mechanism is also used to replace by selecting different implementation methods during the operation of the PLC or during the compilation of software configuration.

4. The PLC program execution system according to claim 1, characterized in that The execution mechanism is also used to dynamically add or delete the implementation methods of the execution mechanism.

5. The PLC program execution system according to claim 4, wherein The PLC program execution system is a plug-in PLC program execution system.

6. The PLC program execution system according to claim 1, wherein The interpretive executor is used to interpret and execute program logical operations by parsing the bytecode instructions generated by compiling the PLC program by a parser compiler.

7. The PLC program execution system according to claim 1, characterized in that, The compiled executor is used to directly compile the PLC program into machine code instructions and directly run the program on the operating system of the PLC main body hardware.

8. The PLC program execution system according to claim 1, wherein The JIT executor is used to convert bytecode instructions into machine code instructions during runtime to improve the runtime efficiency.

9. The PLC program execution system according to claim 1, wherein, The runtime system is compiled into a dynamic library.

10. The PLC program execution system according to claim 1, wherein The execution mechanism is compiled into a dynamic library.

Citation Information

Patent Citations

  • Profile guided jit code generation

    CN103064720A

  • Method of optimally compiling PLC command

    CN107024900A

  • Hybrid compiling method of programmable logic controller, storage medium and program product

    CN113485228A

  • Hybrid execution method and device of programmable logic controller, equipment and medium

    CN118069219A

  • Method and device for selecting compiler way in operating time

    CN1255674A