CN118092958A - PLC program online updating method and device and electronic equipment - Google Patents

PLC program online updating method and device and electronic equipment Download PDF

Info

Publication number
CN118092958A
CN118092958A CN202310994320.2A CN202310994320A CN118092958A CN 118092958 A CN118092958 A CN 118092958A CN 202310994320 A CN202310994320 A CN 202310994320A CN 118092958 A CN118092958 A CN 118092958A
Authority
CN
China
Prior art keywords
webassembly
new version
plc program
program
memory
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310994320.2A
Other languages
Chinese (zh)
Inventor
王鑫
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Hongjing Intelligent Technology Co ltd
Original Assignee
Suzhou Hongjing Intelligent Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Hongjing Intelligent Technology Co ltd filed Critical Suzhou Hongjing Intelligent Technology Co ltd
Priority to CN202310994320.2A priority Critical patent/CN118092958A/en
Publication of CN118092958A publication Critical patent/CN118092958A/en
Pending legal-status Critical Current

Links

Landscapes

  • Stored Programmes (AREA)
  • Programmable Controllers (AREA)

Abstract

The application discloses a PLC program online updating method, a device and electronic equipment, which relate to the technical field of industrial control and the technical field of computers and comprise the following steps: loading a new version of PLC program into the memory, wherein the new version of PLC program is WebAssembly codes; generating a WebAssembly module data structure of a new version by analyzing the new version of the PLC program; executing an instantiation operation on the WebAssembly module data structure of the new version to obtain a WebAssembly module instance of the new version, wherein WebAssembly memory layout of the WebAssembly module instance of the new version is identical to WebAssembly memory layout of the WebAssembly module instance of the old version of the current running PLC program; copying the memory data in the WebAssembly memory layout of the WebAssembly module example of the old version into the WebAssembly memory layout of the WebAssembly module example of the new version; and running the new version PLC program by starting a task execution entry of the new version PLC program. By adopting the scheme, the online update of the PLC program is realized.

Description

PLC program online updating method and device and electronic equipment
Technical Field
The application relates to the technical field of industrial control and the technical field of computers, in particular to a PLC (programmable logic controller) program online updating method, a device and electronic equipment.
Background
The PLC (programmable logic controller ) has a wide application in the field of industrial control, which is an important component in an industrial automation control system, and continuously reads the state of an input signal when the PLC is operated, processes the input signal according to the logic of the PLC program currently operated, and finally outputs a corresponding result.
Because real-time control, management and monitoring data can be performed to ensure accurate operation and efficient performance of the production line, the reliability of the PLC has an important influence on the normal operation of the production line and the production efficiency of enterprises. In modern industrial production, there is a continuous need for upgrading and improvement, so that industrial PLC products supporting online modification of PLC programs without shutdown have high practical value:
Ensuring continuous operation of the production line: the PLC is one of core technologies in an industrial automation control system, can monitor and control the operation of industrial equipment, and ensures that the equipment always operates in an optimal state, thereby ensuring the continuity and stability of the whole production line.
Reducing industrial downtime: a high-performance and reliable PLC system can timely detect and repair faults, so that the fault rate of equipment is reduced, the downtime is reduced, the operation efficiency of a production line is improved, and the production loss is reduced.
The production cost is reduced: the industrial equipment can be controlled by the PLC to optimize the production flow and reduce the production cost. Through real-time monitoring and measurement, the PLC can accurately adjust and optimize the production process, so that the production efficiency and the equipment utilization rate are improved, and the energy consumption and the material use are reduced.
Disclosure of Invention
The embodiment of the application provides a method and a device for online updating of a PLC program and electronic equipment, which are used for solving the problem of how to realize online updating of the PLC program in the prior art.
The embodiment of the application provides a PLC program online updating method, which comprises the following steps:
Loading a new version of PLC program into a memory, wherein the new version of PLC program is WebAssembly codes;
analyzing the new version of the PLC program to generate a WebAssembly module data structure of a new version;
Executing an instantiation operation on the WebAssembly module data structure of the new version to obtain a WebAssembly module instance of the new version, wherein WebAssembly memory layout of the WebAssembly module instance of the new version is identical to WebAssembly memory layout of the WebAssembly module instance of the old version of the current running old version of the PLC program;
Copying the memory data in the WebAssembly memory layout of the WebAssembly module example of the old version into the WebAssembly memory layout of the WebAssembly module example of the new version;
And operating the new version PLC program by starting a task execution entry of the new version PLC program.
Further, the copying the memory data in the WebAssembly memory layout of the WebAssembly module instance of the old version to the WebAssembly memory layout of the WebAssembly module instance of the new version includes:
and after the task execution in the current PLC task period is finished, copying the memory data in the WebAssembly memory layout of the WebAssembly module instance of the old version into the WebAssembly memory layout of the WebAssembly module instance of the new version.
Further, the running the new version PLC program by enabling the task execution portal of the new version PLC program includes:
starting from the next PLC task period, the new version PLC program is operated by starting a task execution entry of the new version PLC program.
Further, the memory data in the WebAssembly memory layout includes:
WebAssembly linear space and WebAssembly GLOBALS table.
Further, the WebAssembly linear space data includes:
Global variables, function block data structures, program constant data, and heap space data of a program;
The data in the WebAssembly GLOBALS table includes:
WebAssembly GLOBAL objects.
Further, the code blocks included in the new version of PLC PROGRAM and the old version of PLC PROGRAM include the same PROGRAM object, which is used as an execution entry of the PLC cycle task.
The embodiment of the application also provides a device for online updating the PLC program, which comprises the following steps:
The program loading module is used for loading a new version of PLC program into the memory, wherein the new version of PLC program is WebAssembly codes;
the program analysis module is used for generating a WebAssembly module data structure of a new version by analyzing the new version of the PLC program;
The program instantiation module is used for executing instantiation operation on the WebAssembly module data structure of the new version to obtain a WebAssembly module instance of the new version, wherein WebAssembly memory layout of the WebAssembly module instance of the new version is identical to WebAssembly memory layout of the WebAssembly module instance of the old version of the current running old version PLC program;
The memory data copying module is used for copying the memory data in the WebAssembly memory layout of the WebAssembly module instance of the old version into the WebAssembly memory layout of the WebAssembly module instance of the new version;
and the program running module is used for running the new version PLC program by starting the task execution entry of the new version PLC program.
Further, the memory data copying module is specifically configured to copy, after the task execution in the current PLC task cycle is completed, the memory data in the WebAssembly memory layout of the WebAssembly module instance of the old version to the WebAssembly memory layout of the WebAssembly module instance of the new version.
Further, the program running module is specifically configured to start from the next PLC task period, and run the new version PLC program by starting the task execution entry of the new version PLC program.
Further, the memory data in the WebAssembly memory layout includes:
WebAssembly linear space and WebAssembly GLOBALS table.
Further, the WebAssembly linear space data includes:
Global variables, function block data structures, program constant data, and heap space data of a program;
The data in the WebAssembly GLOBALS table includes:
WebAssembly GLOBAL objects.
Further, the code blocks included in the new version of PLC PROGRAM and the old version of PLC PROGRAM include the same PROGRAM object, which is used as an execution entry of the PLC cycle task.
Embodiments of the present application also provide an electronic device comprising a processor and a machine-readable storage medium storing machine-executable instructions executable by the processor, the processor being caused by the machine-executable instructions to: the online updating method of any PLC program is realized.
The embodiment of the application also provides a computer readable storage medium, wherein a computer program is stored in the computer readable storage medium, and the computer program realizes any one of the PLC program online updating methods when being executed by a processor.
The embodiment of the application also provides a computer program product containing instructions, which when run on a computer, cause the computer to execute any one of the PLC program online updating methods.
The beneficial effects of the application include:
In the online update method for the PLC program provided by the embodiment of the present application, the new version PLC program is WebAssembly codes, after loading, resolving and instantiating operations are performed on the new version PLC program, a new version WebAssembly module instance is obtained, and the WebAssembly memory layout of the new version WebAssembly module instance is the same as the WebAssembly memory layout of the old version WebAssembly module instance of the currently running old version PLC program, and after copying the memory data in the WebAssembly memory layout of the old version WebAssembly module instance to the WebAssembly memory layout of the new version WebAssembly module instance, the new version PLC program is run by starting the task execution entry of the new version PLC program, and because the memory layout of the new version PLC program and the WebAssembly memory layout of the old version PLC program are the same, the new version PLC program can be directly run based on the memory data in the WebAssembly memory layout of the new version WebAssembly module instance, that is in the WebAssembly memory layout of the running old version PLC program, and the online update of the program is realized without stopping running the PLC program.
Additional features and advantages of the application will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the application. The objectives and other advantages of the application will be realized and attained by the structure particularly pointed out in the written description and claims thereof as well as the appended drawings.
Drawings
The accompanying drawings are included to provide a further understanding of the application and are incorporated in and constitute a part of this specification, illustrate the application and together with the embodiments of the application, serve to explain the application. In the drawings:
FIG. 1 is a flowchart of a PLC program online updating method provided by an embodiment of the application;
FIG. 2 is a flowchart of an online update method of a PLC program according to another embodiment of the present application;
FIG. 3 is a diagram of WebAssembly codes and WebAssembly memory layout according to an embodiment of the present application;
Fig. 4 is a schematic structural diagram of a PLC program online updating apparatus according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order to provide a solution for implementing online update of a PLC program, an embodiment of the present application provides a method, an apparatus and an electronic device for online update of a PLC program, and the following description is given with reference to the accompanying drawings of the present application, which should be understood that the preferred embodiments described herein are only for illustrating and explaining the present application, and are not limited to the present application. And embodiments of the application and features of the embodiments may be combined with each other without conflict.
The embodiment of the application provides a PLC program online updating method, as shown in figure 1, comprising the following steps:
step 11, loading a new version of PLC program into a memory, wherein the new version of PLC program is WebAssembly codes;
step 12, generating a WebAssembly module data structure of a new version by analyzing the new version of the PLC program;
Step 13, executing an instantiation operation on the WebAssembly module data structure of the new version to obtain a WebAssembly module instance of the new version, wherein WebAssembly memory layout of the WebAssembly module instance of the new version is identical to WebAssembly memory layout of the WebAssembly module instance of the old version of the current running old version PLC program;
Step 14, copying the memory data in the WebAssembly memory layout of the WebAssembly module example of the old version into the WebAssembly memory layout of the WebAssembly module example of the new version;
And 15, operating the new version PLC program by starting a task execution entry of the new version PLC program.
By adopting the online update method of the PLC program provided by the embodiment of the application, after loading, analyzing and instantiating operations are carried out on the new version PLC program, a new version WebAssembly module instance is obtained, webAssembly memory layout of the new version WebAssembly module instance is the same as WebAssembly memory layout of the old version WebAssembly module instance of the old version PLC program currently running, and after the memory data in the WebAssembly memory layout of the old version WebAssembly module instance is copied to the WebAssembly memory layout of the new version WebAssembly module instance, the task execution entry of the new version PLC program is started, and the new version PLC program is run.
The method and apparatus provided by the present application will now be described in detail with particular embodiments thereof, with reference to the accompanying drawings.
The embodiment of the application provides a PLC program online updating method, as shown in fig. 2, comprising the following steps:
And step 21, loading a new version of PLC program into the memory, wherein the new version of PLC program is WebAssembly codes.
In the embodiment of the present application, the new version PLC program and the old version PLC program are WebAssembly codes, the old version PLC program includes a plurality of old version code blocks, the new version PLC program includes a plurality of code blocks corresponding to the plurality of old version code blocks one by one, and part of the code blocks in the plurality of code blocks are identical to the corresponding old version code blocks, and the part of the code blocks are modified compared with the corresponding old version code blocks, namely, the new version code blocks.
In this step, a new version of the PLC program is loaded into the memory, i.e., a new version WebAssembly code is loaded into the memory buffer.
And 22, generating a WebAssembly module data structure of a new version by analyzing the new version of the PLC program.
In this step, the content of the new version WebAssembly code loaded into the memory is parsed to generate a new version WebAssembly module data structure.
And step 23, executing an instantiation operation on the WebAssembly module data structure of the new version to obtain a WebAssembly module instance of the new version.
In the resulting new version of the WebAssembly module example, the WebAssembly memory layout is included, and the WebAssembly memory layout may represent an arrangement of memory data for executing WebAssembly code, and the WebAssembly memory layout is used for storing memory data.
In the embodiment of the application, the WebAssembly memory layout of the WebAssembly module instance of the new version is the same as the WebAssembly memory layout of the WebAssembly module instance of the old version of the current running old version of the PLC program.
The WebAssembly module example of the old version is obtained after loading, analyzing and instantiating the PLC program of the old version.
As shown in fig. 3, in the embodiment of the present application, the memory data in the WebAssembly memory layout (i.e., the WebAssemlby memory layout of the WebAssembly module instance of the new version and the WebAssembly module instance of the old version) may include:
WebAssembly linear space and data in WebAssembly GLOBALS table;
further WebAssembly of the data in linear space may include:
Global variables, function block data structures, program constant data, and heap space data of a program;
WebAssembly GLOBALS table may include:
WebAssembly GLOBAL objects.
In the embodiment of the application, as the WebAssembly module instance of the new version and the WebAssemlby memory of the WebAssembly module instance of the old version have the same layout, the pointed position of the global variable referenced in the WebAssembly code of the new version can be ensured to be consistent with the pointed position of the global variable in the old version;
for the function block data structure, compared with the WebAssembly codes of the old version, when the interface of the function block is unchanged, the arrangement layout of the internal member variables can be ensured to be unchanged, so that the function block codes in the WebAssembly codes of the new version can correctly access each member variable.
For WebAssembly GLOBAL objects, the data structure resembles an array, and the meaning of the data represented by each element in WebAssembly GLOBAL objects remains unchanged compared to the older version of WebAssembly code.
Further, in the embodiment of the present application, the code blocks included in the new version PLC PROGRAM and the old version PLC PROGRAM include the same PROGRAM object, which is used as an execution entry of the PLC cycle task.
Step 24, copying the memory data in the WebAssembly memory layout of the WebAssembly module example of the old version into the WebAssembly memory layout of the WebAssembly module example of the new version.
After the task execution in the current PLC task cycle is finished, the memory data in the WebAssembly memory layout of the WebAssembly module instance of the old version is copied to the WebAssembly memory layout of the WebAssembly module instance of the new version.
Specifically, the memory data in the WebAssembly memory layout of the WebAssembly module instance of the old version may be copied to the corresponding location in the WebAssembly memory layout of the WebAssembly module instance of the new version.
The memory data in the WebAssembly memory layout of the WebAssembly module example of the old version can be copied into the WebAssembly memory layout of the WebAssembly module example of the new version, and in the running process of the WebAssembly code, the data in the WebAssembly linear space and the WebAssembly GLOBALS table can be accessed through internal indexes, so that even if the data are copied to different physical addresses, the running of the code is not affected.
In the embodiment of the application, the task in one PLC task period is executed from the WebAssembly entry function corresponding to the task, and after the WebAssembly entry function corresponding to the task is executed and returned, the task in the current PLC task period can be considered to be executed.
And step 25, operating the new version PLC program by starting a task execution entry of the new version PLC program.
In this step, the new version PLC program may be run by starting the task execution entry of the new version PLC program from the next PLC task period of the current PLC task period.
It is also understood that the task execution portal is switched from the task execution portal of the old version PLC program to the task execution portal of the new version PLC program.
For the operation of the new version PLC PROGRAM, task configuration data of the new version PLC PROGRAM can be obtained, all periodic task definitions (including the name of a PROGRAM object of a task entry, the period time length of the task, the priority of the task and the like) are read from the task configuration data, each periodic task is started and executed in sequence according to the task period interval time of each periodic task, for the execution of a single periodic task, a WebAssemly entry function corresponding to the PROGRAM object of the periodic task can be called, and after the WebAssemly entry function is executed, the starting and the execution of the next periodic task are waited according to the task period interval time.
By adopting the online updating method of the PLC program provided by the embodiment of the application, as the WebAssembly memory layouts of the new version PLC program and the old version PLC program are the same, the online updating of the program version can be realized without stopping the running of the PLC program based on the memory data in the WebAssembly memory layout of the new version WebAssembly module instance, namely the memory data in the WebAssembly memory layout of the running old version PLC program.
The online updating method of the PLC program provided by the embodiment of the application can support the PLC program generated after mixed compiling based on IEC61131-3 programming language and a general-purpose computer program (such as C/C++), and can be applied to the scheme only by further compiling the PLC program into WebAssembly codes. The power supply system has more general capability and can be applied to other fields besides PLC. The memory address of the program symbol after loading of the traditional compiled program has randomness, and the data reconstruction can not be carried out in a new example in a memory data copying mode. In the embodiment of the application, the PLC program is executed based on WebAssembly, so that the copying of the symbol address can be continued to be effective in the target instance.
Based on the same inventive concept, according to the PLC program online updating method provided by the foregoing embodiment of the present application, correspondingly, another embodiment of the present application further provides an online PLC program updating device, a schematic structural diagram of which is shown in fig. 4, which specifically includes:
the program loading module 41 is configured to load a new version of PLC program into the memory, where the new version of PLC program is WebAssembly codes;
the program analysis module 42 is configured to generate a new-version WebAssembly module data structure by analyzing the new-version PLC program;
program instantiation module 43, configured to perform an instantiation operation on the new WebAssembly module data structure to obtain a new WebAssembly module instance, where a WebAssembly memory layout of the new WebAssembly module instance is the same as a WebAssembly memory layout of an old WebAssembly module instance of an old PLC program that is currently running;
The memory data copying module 44 is configured to copy the memory data in the WebAssembly memory layout of the WebAssembly module instance of the old version to the WebAssembly memory layout of the WebAssembly module instance of the new version;
And the program running module 45 is used for running the new version of the PLC program by enabling the task execution portal of the new version of the PLC program.
Further, the memory data copying module 44 is specifically configured to copy, after the task execution in the current PLC task cycle is completed, the memory data in the WebAssembly memory layout of the WebAssembly module instance of the old version to the WebAssembly memory layout of the WebAssembly module instance of the new version.
Further, the program running module 45 is specifically configured to start from the next PLC task period, and run the new version PLC program by enabling the task execution entry of the new version PLC program.
Further, the memory data in the WebAssembly memory layout includes:
WebAssembly linear space and WebAssembly GLOBALS table.
Further, the WebAssembly linear space data includes:
Global variables, function block data structures, program constant data, and heap space data of a program;
The data in the WebAssembly GLOBALS table includes:
WebAssembly GLOBAL objects.
Further, the code blocks included in the new version of PLC PROGRAM and the old version of PLC PROGRAM include the same PROGRAM object, which is used as an execution entry of the PLC cycle task.
The functions of the above modules may correspond to the corresponding processing steps in the flow shown in fig. 1 to 3, and are not described herein.
The PLC program online updating device provided by the embodiment of the application can be realized through a computer program. It should be understood by those skilled in the art that the above-mentioned module dividing method is only one of many module dividing methods, and if the module dividing method is divided into other modules or not, it is within the scope of the present application as long as the PLC program online updating apparatus has the above-mentioned functions.
An embodiment of the present application further provides an electronic device, as shown in fig. 5, including a processor 51 and a machine-readable storage medium 52, the machine-readable storage medium 52 storing machine-executable instructions executable by the processor 51, the processor 51 being caused by the machine-executable instructions to: the online updating method of any PLC program is realized.
The embodiment of the application also provides a computer readable storage medium, wherein a computer program is stored in the computer readable storage medium, and the computer program realizes any one of the PLC program online updating methods when being executed by a processor.
The embodiment of the application also provides a computer program product containing instructions, which when run on a computer, cause the computer to execute any one of the PLC program online updating methods.
The machine-readable storage medium in the electronic device may include random access Memory (Random Access Memory, RAM) or may include Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the aforementioned processor.
The processor may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU), a network processor (Network Processor, NP), etc.; but may also be a digital signal processor (DIGITAL SIGNAL Processing, DSP), application SPECIFIC INTEGRATED Circuit (ASIC), field-Programmable gate array (Field-Programmable GATE ARRAY, FPGA) or other Programmable logic device, discrete gate or transistor logic device, discrete hardware components.
In this specification, each embodiment is described in a related manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for an apparatus, an electronic device, a computer readable storage medium, a computer program product embodiment, since it is substantially similar to a method embodiment, the description is relatively simple, and reference is made to the section description of a method embodiment for relevant points.
It is noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various modifications and variations can be made to the present application without departing from the spirit or scope of the application. Thus, it is intended that the present application also include such modifications and alterations insofar as they come within the scope of the appended claims or the equivalents thereof.

Claims (10)

1. The PLC program online updating method is characterized by comprising the following steps of:
Loading a new version of PLC program into a memory, wherein the new version of PLC program is WebAssembly codes;
analyzing the new version of the PLC program to generate a WebAssembly module data structure of a new version;
Executing an instantiation operation on the WebAssembly module data structure of the new version to obtain a WebAssembly module instance of the new version, wherein WebAssembly memory layout of the WebAssembly module instance of the new version is identical to WebAssembly memory layout of the WebAssembly module instance of the old version of the current running old version of the PLC program;
Copying the memory data in the WebAssembly memory layout of the WebAssembly module example of the old version into the WebAssembly memory layout of the WebAssembly module example of the new version;
And operating the new version PLC program by starting a task execution entry of the new version PLC program.
2. The method of claim 1, wherein copying the memory data in the WebAssembly memory layout of the WebAssembly module instance of the old version to the WebAssembly memory layout of the WebAssembly module instance of the new version comprises:
and after the task execution in the current PLC task period is finished, copying the memory data in the WebAssembly memory layout of the WebAssembly module instance of the old version into the WebAssembly memory layout of the WebAssembly module instance of the new version.
3. The method of claim 2, wherein the running the new version of the PLC program by enabling a task execution portal of the new version of the PLC program comprises:
starting from the next PLC task period, the new version PLC program is operated by starting a task execution entry of the new version PLC program.
4. A method as claimed in any one of claims 1 to 3, wherein the memory data in the WebAssembly memory layouts comprises:
WebAssembly linear space and WebAssembly GLOBALS table.
5. The method of claim 4, wherein the WebAssembly linear space of data comprises:
Global variables, function block data structures, program constant data, and heap space data of a program;
The data in the WebAssembly GLOBALS table includes:
WebAssembly GLOBAL objects.
6. The method of claim 3, wherein the new version of the PLC PROGRAM and the old version of the PLC PROGRAM contain the same PROGRAM object as an execution entry for the PLC cycle task.
7. The utility model provides a PLC program online updating device which characterized in that includes:
The program loading module is used for loading a new version of PLC program into the memory, wherein the new version of PLC program is WebAssembly codes;
the program analysis module is used for generating a WebAssembly module data structure of a new version by analyzing the new version of the PLC program;
The program instantiation module is used for executing instantiation operation on the WebAssembly module data structure of the new version to obtain a WebAssembly module instance of the new version, wherein WebAssembly memory layout of the WebAssembly module instance of the new version is identical to WebAssembly memory layout of the WebAssembly module instance of the old version of the current running old version PLC program;
The memory data copying module is used for copying the memory data in the WebAssembly memory layout of the WebAssembly module instance of the old version into the WebAssembly memory layout of the WebAssembly module instance of the new version;
and the program running module is used for running the new version PLC program by starting the task execution entry of the new version PLC program.
8. The apparatus of claim 7, wherein the memory data copying module is specifically configured to copy the memory data in the WebAssembly memory layout of the WebAssembly module instance of the old version to the WebAssembly memory layout of the WebAssembly module instance of the new version after the task execution within the current PLC task cycle is completed.
9. An electronic device comprising a processor and a machine-readable storage medium storing machine-executable instructions executable by the processor, the processor being caused by the machine-executable instructions to: the method of any one of claims 1-6 is implemented.
10. A computer readable storage medium, characterized in that the computer readable storage medium has stored therein a computer program which, when executed by a processor, implements the method of any of claims 1-6.
CN202310994320.2A 2023-08-08 2023-08-08 PLC program online updating method and device and electronic equipment Pending CN118092958A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310994320.2A CN118092958A (en) 2023-08-08 2023-08-08 PLC program online updating method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310994320.2A CN118092958A (en) 2023-08-08 2023-08-08 PLC program online updating method and device and electronic equipment

Publications (1)

Publication Number Publication Date
CN118092958A true CN118092958A (en) 2024-05-28

Family

ID=91162295

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310994320.2A Pending CN118092958A (en) 2023-08-08 2023-08-08 PLC program online updating method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN118092958A (en)

Similar Documents

Publication Publication Date Title
Moghadam et al. Automated refactoring using design differencing
CN105045568B (en) System and method for optimizing operation of real-time embedded solutions in industrial automation
US10169002B2 (en) Automated and heuristically managed solution to quantify CPU and path length cost of instructions added, changed or removed by a service team
US20110126179A1 (en) Method and System for Dynamic Patching Software Using Source Code
CN110990019A (en) Java class analysis method and device, storage medium and electronic equipment
CN106909123B (en) Control programming auxiliary assembly
CN105204837B (en) Method and device for realizing logic programming
CN101776877A (en) Program editing system and method for programmable logic controller
CN114237146A (en) Soft PLC control function implementation method, device, equipment and storage medium
CN112400162B (en) Simulation device, simulation method, and ECU device
CN102880473A (en) Method and device for task execution based on quartz framework
CN114924737A (en) Battery management system source code integration test method and device and electronic equipment
CN118092958A (en) PLC program online updating method and device and electronic equipment
CN110928760A (en) Unit testing method and device in embedded system
CN102566512A (en) Control circuit special for bearing cutting automatic production line based on graph programming and system with control circuit
CN102520984A (en) Computing method for worst time of object software in specified hardware environment
CN106126211A (en) A kind of MCU In-circuit programming system supporting debugging interface
Mao et al. A refinement development approach for enhancing the safety of PLC programs with Event-B
CN102722142A (en) Special control system of bearing cutting automation production line based on graphic programming
CN202351658U (en) Graphics programming based special control circuit for bearing cutting automatic production line
CN117873582A (en) PLC program heat transfer method, hot standby implementation method and device and electronic equipment
CN117762466A (en) PLC program generation method and device for online updating and electronic equipment
EP2781977B1 (en) Method and system for managing distributed computing in automation systems
JPH0410081B2 (en)
US20230315613A1 (en) Method and system for eradicating programmatical errors from engineering programs in a technical installation

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination