Method and device for multiplexing engineering project file of PLC (Programmable Logic Controller) and storage medium

By dividing and converting the project files of PLC equipment into compatible formats, the differences in programming language and data formats between PLC equipment are solved, file reuse between PLC equipment is realized, and project construction efficiency and system stability are improved.

CN119165814APending Publication Date: 2024-12-20BEIJING HELISHI SYST INTEGRATION CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411346531.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-25
Publication Date
2024-12-20

AI Technical Summary

Technical Problem

There are differences in programming language and data formats between PLC equipment of different manufacturers, which makes programs and data unreusable and require reprogramming and debugging, affecting the iteration and maintenance work during the upgrade and transformation process.

Method used

By obtaining the PLC's project file, dividing it into hardware configuration files, global variable files and application files, and converting them into formats that other PLCs can recognize, establishing instructions and functions correspondence, realizing file processing and conversion, ensuring that Compatibility between different PLCs.

Benefits of technology

It realizes the reuse of engineering project files between PLC equipment of different manufacturers, reduces manual programming and debugging work, shortens project construction period, and improves efficiency and system stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119165814A_ABST
    Figure CN119165814A_ABST
Patent Text Reader

Abstract

The invention discloses a multiplexing method and device for engineering project files of a PLC and a storage medium. The method comprises the steps of obtaining an engineering project file of a first PLC; according to the content of the engineering project file, dividing the engineering project file of the first PLC into a first hardware configuration file recording interface information of the first PLC, a first global variable file recording global variables used by the first PLC, and a first application program file recording functions executed by the first PLC; and respectively converting the first hardware configuration file, the first global variable file and the first application program file into files which can be identified by a second PLC, wherein a manufacturer of the first PLC is different from a manufacturer of the second PLC.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This article relates to PLC programming technology, and in particular to a method, device and storage medium for reusing engineering project files of a PLC. Background Art

[0002] Programmable Logic Controller (PLC) is the core control device in the field of industrial automation control. There are differences in programming languages ​​and data formats between products from different manufacturers, such as Siemens, Rockwell, Schneider, etc., and they are not compatible. The mutual incompatibility of their programs and data will lead to the following problems: (1) The program cannot be reused between devices from different manufacturers; (2) The data cannot be reused between devices from different manufacturers; (3) Projects that need to be upgraded need to be reprogrammed and re-debugged; (4) Projects that need to be upgraded will affect the normal operation of existing functions during implementation. Therefore, in the process of upgrading and renovating PLCs, there are many inconveniences such as product iteration, production suspension, long supply cycle of imported equipment, and long maintenance cycle. Therefore, there is an urgent need to provide a solution for the mutual conversion and reuse of programmable logic controllers from different manufacturers. Summary of the invention

[0003] The embodiments of the present application provide a method, device and storage medium for reusing engineering project files of a PLC.

[0004] A method for reusing engineering project files of a PLC, comprising: Obtain the engineering project files of the first PLC; According to the content of the engineering project file, the engineering project file of the first PLC is divided into a first hardware configuration file recording the interface information of the first PLC, a first global variable file recording the global variables used by the first PLC, and a first application file recording the functions executed by the first PLC; Converting the first hardware configuration file, the first global variable file, and the first application file into files recognizable by a second PLC, respectively, wherein the manufacturer of the first PLC is different from the manufacturer of the second PLC; Wherein, in the process of converting the first application file, a one-to-one or one-to-many correspondence between programming instructions supported by the first PLC and programming instructions supported by the second PLC is obtained to obtain an instruction correspondence, wherein the operations performed by the instructions with corresponding relationships in the first PLC and the second PLC are the same; and a one-to-one or one-to-many correspondence between all functions supported by the first PLC and functions supported by the second PLC is obtained to obtain a function correspondence, wherein the operations performed by the instructions with corresponding relationships in the first PLC and the second PLC are the same and the values ​​of the parameters used are the same; According to the instruction correspondence relationship and the function correspondence relationship, programming statements in the application file of the first PLC are processed one by one until the application ends, including: For the current programming statement, determine whether there is a function call relationship between the current programming statement; If there is a function call relationship between the current programming statement, then according to the function matching relationship, determine the function in the current programming statement corresponding to the function in the second PLC, obtain the target function, generate a programming statement recognizable by the second PLC according to the target function, and continue to execute the next programming statement; If there is no function call relationship between the current programming statement, determine the programming instructions in the current programming statement corresponding to the programming instructions in the second PLC based on the function matching relationship, obtain the target programming instructions, generate the programming statements that can be recognized by the second PLC function based on the target programming instructions, and continue to execute the next programming statement.

[0005] A storage medium stores a computer program, wherein the computer program is configured to execute the method described above when running.

[0006] A multiplexing device for engineering project files of a PLC comprises a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the method described above.

[0007] In the embodiment of the present application, the purpose of reusing the engineering project files of the first PLC in the second PLC is achieved by converting three files with different data contents in the engineering project files of the first PLC into files that can be recognized by the second PLC, thereby realizing the reuse of engineering project files between different manufacturers.

[0008] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or be understood by implementing the present application. Other advantages of the present application can be realized and obtained by the schemes described in the description and the drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0009] The accompanying drawings are used to provide an understanding of the technical solution of the present application and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the technical solution of the present application and do not constitute a limitation on the technical solution of the present application.

[0010] Figure 1 A flowchart of a method for reusing engineering project files of a PLC provided in an embodiment of the present application. DETAILED DESCRIPTION

[0011] The present application describes multiple embodiments, but the description is exemplary rather than restrictive, and it is obvious to those skilled in the art that there may be more embodiments and implementations within the scope of the embodiments described in the present application. Although many possible feature combinations are shown in the drawings and discussed in the specific embodiments, many other combinations of the disclosed features are also possible. Unless specifically limited, any feature or element of any embodiment may be used in combination with any other feature or element in any other embodiment, or may replace any other feature or element in any other embodiment.

[0012] The present application includes and contemplates combinations of features and elements known to those of ordinary skill in the art. The embodiments, features and elements disclosed in the present application may also be combined with any conventional features or elements to form a unique invention scheme. Any features or elements of any embodiment may also be combined with features or elements from other invention schemes to form another unique invention scheme. Therefore, it should be understood that any feature shown and / or discussed in the present application may be implemented individually or in any appropriate combination. Therefore, except for the limitations made according to the attached claims and their equivalents, the embodiments are not subject to other restrictions. In addition, various modifications and changes may be made within the scope of protection of the attached claims.

[0013] In addition, when describing representative embodiments, the specification may have presented the method and / or process as a specific sequence of steps. However, to the extent that the method or process does not rely on the specific order of the steps described herein, the method or process should not be limited to the steps of the specific order described. As will be understood by those of ordinary skill in the art, other sequences of steps are also possible. Therefore, the specific sequence of the steps set forth in the specification should not be interpreted as a limitation to the claims. In addition, the claims for the method and / or process should not be limited to the steps of performing them in the order written, and those skilled in the art can easily understand that these sequences can be changed and still remain within the spirit and scope of the embodiments of the present application.

[0014] Figure 1The flowchart of the method for reusing the engineering project files of the PLC provided in the embodiment of the present application is as follows. Figure 1 As shown, the method includes:

[0015] Step 101, obtaining a project file of a first PLC; The project file is all the data currently recorded in the first PLC.

[0016] Step 102: According to the content of the engineering project file, the engineering project file of the first PLC is divided into a first hardware configuration file recording the interface information of the first PLC, a first global variable file recording the global variables used by the first PLC, and a first application file recording the functions executed by the first PLC; Since the functions of hardware configuration files, global variable files and application files in PLC are different and the differences between them in different PLCs are also different, each type of data needs to be processed independently.

[0017] Step 103: Convert the first hardware configuration file, the first global variable file, and the first application file into files recognizable by a second PLC, respectively, wherein the manufacturer of the first PLC is different from the manufacturer of the second PLC.

[0018] In an embodiment of the present application, by converting three files with different data contents in the engineering project files of the first PLC into files recognizable by the second PLC, the purpose of reusing the engineering project files of the first PLC into the second PLC is achieved, thereby realizing the reuse of engineering project files between different manufacturers.

[0019] For the three files with different data contents in the first PLC, the conversion operation can be completed in the following order, including: First, the first hardware configuration file is converted to obtain the second hardware configuration file, so that the second PLC can realize hardware interconnection with external devices according to the second hardware configuration file and support data transmission operations; then the first global variable file is converted to obtain the second global variable file, so that the programming statements run by the second PLC can be determined and identified, providing a basis for the operation of the application file of the second PLC; finally, the first application file is converted to obtain the second application file, so that the second PLC can realize the function of the first PLC by running the second application file and complete the data multiplexing operation.

[0020] Each conversion operation is described below: Conversion operations of global variables: The scope of a global variable is the entire program. Therefore, as long as a variable is defined as a global variable, it can be accessed from any location in the program, and the life cycle of a global variable runs from the start of the program to the end of the program. Based on the working characteristics of global variables, it can be seen that the global variable itself is not affected by the differences between different manufacturers, and it only needs to ensure that the PLC can parse it. Therefore, in the process of converting the first variable file, the file format of the first variable file is converted to generate a second variable file that can be recognized by the second PLC.

[0021] Specifically, the execution steps of the conversion operation are as follows: Step A1, obtaining a file recording global variables in a first PLC to obtain a first global variable file; Step A2, determining whether the second PLC can parse the first global variable file; Step A3: if the second PLC can parse the first global variable file, save the first global variable file to the second PLC; Step A4: if the second PLC cannot parse the first global variable file, convert the file format of the first global variable file into a file format recognizable by the second PLC to obtain a second global variable file, and save the second global variable file to the second PLC.

[0022] Hardware configuration conversion operation: With the update and iteration of products, there will be differences in the hardware functions connected to the first PLC and the second PLC. For example, taking the input source of the digital signal connected to the PLC as an example, the hardware used by the first PLC is relatively old. In order to meet 16 sampling points, 4 sampling devices need to be set up, each of which supports sampling of 4 digital signals. The hardware used by the second PLC is more advanced and can directly use 1 sampling device that supports sampling 16 digital signals; or, the first PLC needs to connect to the first device that implements function A and the second device that implements function B. With the development of product function integration, the second PLC may only need to connect to the third device that integrates function A and function B. Therefore, it is necessary to convert the configuration of the PLC's communication equipment, input equipment, and output equipment to adapt to the deployment environment of the second PLC. Therefore, the following solutions are proposed, including:

[0023] During the conversion of the first hardware configuration file, a one-to-one correspondence is established between the interface of the first PLC in the first hardware configuration file and the interface information of the second PLC, and the interface configuration information of the second PLC is obtained, wherein the functions of the interfaces in the first PLC and the second PLC that have a corresponding relationship are the same; A second hardware configuration file that can be recognized by the second PLC is generated according to the interface configuration information of the second PLC.

[0024] Specifically, the execution steps of the conversion operation are as follows: Step B1: obtaining a first hardware configuration file of the first PLC according to the engineering project file of the first PLC, wherein the first hardware configuration file records the interface definition of each interface in the first PLC, wherein the interface definition can be used to describe the networking solution, system architecture and connection relationship between the first PLC and external devices; Step B2, querying the second PLC for an interface that matches the interface definition in the first PLC to obtain interface configuration information of the second PLC; Step B3: interface configuration information of the second PLC, obtaining a hardware configuration file of the second PLC; For example, when the second PLC acquires temperature data of external device 1, interfaces numbered 01 to 04 in the first interface of the first PLC are connected to the first sampling device, interfaces numbered 05 to 08 in the first interface of the first PLC are connected to the second sampling device, interfaces numbered 09 to 12 in the first interface of the first PLC are connected to the third sampling device, and interfaces numbered 13 to 16 in the first interface of the first PLC are connected to the fourth sampling device, wherein the first to fourth sampling devices of the first PLC can be connected to the first device 1 of the second PLC.

[0025] Application conversion operations: The application of PLC is described by the logical relationship composed of instructions and functions. Since the built-in functions of PLC are called, and PLCs produced by different manufacturers have their own privately defined functions, it is impossible to reuse the application programs in different manufacturers. Therefore, the following solutions are proposed, including:

[0026] The first application file includes programming statements executed by the first PLC and data processed by the programming statements.

[0027] The following is an explanation of the conversion of programming statements: Wherein, in the process of converting the first application file, a one-to-one or one-to-many correspondence between programming instructions supported by the first PLC and programming instructions supported by the second PLC is obtained to obtain an instruction correspondence, wherein the operations performed by the instructions with corresponding relationships in the first PLC and the second PLC are the same; and a one-to-one or one-to-many correspondence between all functions supported by the first PLC and functions supported by the second PLC is obtained to obtain a function correspondence, wherein the operations performed by the instructions with corresponding relationships in the first PLC and the second PLC are the same and the values ​​of the parameters used are the same; Among them, in the above-mentioned correspondence establishment process, if there are instructions or functions for which a one-to-one correspondence cannot be established, the correspondence with the instruction or function of the first PLC can be established through the instruction combination or function combination of the second PLC.

[0028] According to the instruction correspondence relationship and the function correspondence relationship, programming statements in the application file of the first PLC are processed one by one until the application ends, including: Step C1, for the current programming statement, determine whether there is a function call relationship between the current programming statement; Step C2: if the current programming statement has a function call relationship, then according to the function matching relationship, determine the function in the current programming statement corresponding to the function in the second PLC, obtain the target function, generate a programming statement recognizable by the second PLC according to the target function, and continue to execute the next programming statement; Step C3: If a function call relationship exists in the current programming statement, determine the programming instructions in the current programming statement corresponding to the programming instructions in the second PLC according to the function matching relationship, obtain the target programming instructions, generate the programming statements that can be recognized by the second PLC function according to the target programming instructions, and continue to execute the next programming statement.

[0029] In the above exemplary embodiment, the method of acquiring the instruction correspondence relationship includes: Divide the programming instructions supported by the first PLC into general instructions and user-defined instructions; According to the functions of the general instructions, a corresponding relationship between the general instructions in the first PLC and the programming instructions in the second PLC is established; According to the function of the custom instruction, the programming instruction matching the function is queried in the second PLC; if the programming instruction matching the function is found, a correspondence is established between the custom instruction in the first PLC and the programming instruction in the second PLC; otherwise, a programming instruction combination matching the function is set, and a correspondence is established between the custom instruction in the first PLC and the programming instruction combination in the second PLC.

[0030] Preferably, when setting new programming instructions, existing instructions in the second PLC can be used for configuration to obtain new instructions that match the functions of the custom instructions, thereby reducing the difficulty of software development and improving system stability.

[0031] In the above exemplary embodiment, the method for acquiring the function correspondence relationship includes: The following operations are performed for each function supported by the first PLC, including: For the current function, according to the operation performed by the current function in the first PLC, searching for an alternative function in the second PLC that has the same operation as the one performed; If an alternative function is found, determining whether the values ​​of the parameters used by each alternative function are the same as the values ​​of the parameters of the current function; If the values ​​of the parameters used by the candidate functions are the same as the values ​​of the parameters of the currently used function, a correspondence is established between the function names of the candidate functions with the same values ​​and the function names of the parameters used by the current function, and a correspondence is established between the parameter names of the candidate functions with the same values ​​and the parameter names of the current function; If the values ​​of the parameters used by an alternative function are different from the values ​​of the parameters of the currently used function, an optimization function with the same values ​​is generated based on the alternative function, and a correspondence is established between the function names of the optimization functions with the same values ​​and the function names of the parameters used by the current function, and a correspondence is established between the parameter names of the optimization functions with the same values ​​and the parameter names of the current function.

[0032] Optionally, if no alternative function is found, at least two functions in the second PLC generate an alternative function combination that matches the functionality of the current function, and the alternative function combination is used as the required alternative function, thereby reducing the difficulty of software development and improving system stability.

[0033] Explain the conversion of data used by the application: The data can be the input data used by the PLC, such as the collection results obtained by the external collection device in the PLC application scenario. Taking the application of PLC to the urban rail transit system as an example, the data can be the speed, acceleration and position information of different collection points, or the temperature and humidity of the sensor.

[0034] Based on the information carried by the data, it can be known that the data itself is not affected by the differences between different manufacturers, and it only needs to ensure that the PLC can parse it. Therefore, in the process of converting the first application file, the file format of the data in the first application file is converted to generate data of the application file that can be recognized by the second PLC.

[0035] Specifically, the execution steps of the conversion operation are as follows: Step D1, obtaining a file recording data in a first PLC to obtain a first data file; Step D2, determining whether the second PLC can parse the first data file; Step D3: if the second PLC is able to parse the first data file, then save the first data file to the second PLC; Step D4: If the second PLC cannot parse the first data file, the file format of the first data file is converted into a file format recognizable by the second PLC to obtain a second data file.

[0036] Based on the above process, it can be seen that the solution provided in the embodiment of the present application has the following advantages, including: Directly generate engineering project files for different PLCs through automated means. In upgrading projects, there is no need for manual programming, data configuration, adding variables, and hardware configuration, which saves manpower and reduces on-site point-to-point debugging work. The reuse of programs, data, variables, and hardware configurations can be realized through automated methods, which can greatly shorten the project construction period, improve construction efficiency, and save construction costs; The duplication and use of programs, data, variables, and hardware configurations can avoid the risk of loopholes in manual programming and provide a very high guarantee for the accuracy, stability, and reliability of system control.

[0037] In addition, an embodiment of the present application further provides a storage medium, in which a computer program is stored, wherein the computer program is configured to execute the method described above when running.

[0038] An embodiment of the present application further provides a device for reusing engineering project files of a PLC, comprising a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the method described above.

[0039] Optionally, the device further comprises: An input interface, used to receive the engineering project file of the first PLC; The output interface is used to output files that can be recognized by the second PLC.

[0040] The above device can be connected to the data output interface of the first PLC through the input interface, and can be connected to the data input interface of the second PLC through the output interface to realize data import and export operations.

[0041] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In hardware implementations, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all components may be implemented as software executed by a processor, such as a digital signal processor or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or transient medium). As is known to those skilled in the art, the term "computer storage medium" includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, it is well known to those skilled in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.

Claims

1. A method for reusing a PLC engineering project file, comprising: Obtain the engineering project files of the first PLC; According to the content of the engineering project file, the engineering project file of the first PLC is divided into a first hardware configuration file recording the interface information of the first PLC, a first global variable file recording the global variables used by the first PLC, and a first application file recording the functions executed by the first PLC; Converting the first hardware configuration file, the first global variable file, and the first application file into files recognizable by a second PLC, respectively, wherein the manufacturer of the first PLC is different from the manufacturer of the second PLC; Wherein, in the process of converting the first application file, a one-to-one or one-to-many correspondence between all programming instructions supported by the first PLC and all programming instructions supported by the second PLC is obtained to obtain an instruction correspondence, wherein the operations performed by the instructions with corresponding relationships in the first PLC and the second PLC are the same; and a one-to-one or one-to-many correspondence between all functions supported by the first PLC and functions supported by the second PLC is obtained to obtain a function correspondence, wherein the operations performed by the instructions with corresponding relationships in the first PLC and the second PLC are the same and the values ​​of the parameters used are the same; According to the instruction correspondence relationship and the function correspondence relationship, programming statements in the application file of the first PLC are processed one by one until the application ends, including: For the current programming statement, determine whether there is a function call relationship between the current programming statement; If there is a function call relationship between the current programming statement, then according to the function matching relationship, determine the function in the current programming statement corresponding to the function in the second PLC, obtain the target function, generate a programming statement recognizable by the second PLC according to the target function, and continue to execute the next programming statement; If there is no function call relationship between the current programming statement, determine the programming instructions in the current programming statement corresponding to the programming instructions in the second PLC based on the function matching relationship, obtain the target programming instructions, generate the programming statements that can be recognized by the second PLC function based on the target programming instructions, and continue to execute the next programming statement.

2. The method according to claim 1, characterized in that: During the conversion of the first application file, the file format of the data in the first application file is obtained and converted to generate data of the application file that can be recognized by the second PLC.

3. The method according to claim 1, characterized in that: During the conversion of the first variable file, the file format of the first variable file is converted to generate a second variable file that can be recognized by the second PLC.

4. The method according to claim 1, characterized in that: During the conversion of the first hardware configuration file, a one-to-one correspondence is established between the interface of the first PLC in the first hardware configuration file and the interface information of the second PLC, and the interface configuration information of the second PLC is obtained, wherein the functions of the interfaces in the first PLC and the second PLC that have a corresponding relationship are the same; A second hardware configuration file that can be recognized by the second PLC is generated according to the interface configuration information of the second PLC.

5. The method according to claim 1, characterized in that: The method further comprises: After the first hardware configuration file, the first global variable file, and the first application file are respectively converted into files recognizable by the second PLC, the converted files are imported into the second PLC.

6. The method according to claim 1, characterized in that The method for obtaining the instruction correspondence relationship includes: Divide the programming instructions supported by the first PLC into general instructions and user-defined instructions; According to the functions of the general instructions, a corresponding relationship between the general instructions in the first PLC and the programming instructions in the second PLC is established; According to the function of the custom instruction, the programming instruction matching the function is queried in the second PLC; if the programming instruction matching the function is found, a correspondence is established between the custom instruction in the first PLC and the programming instruction in the second PLC; otherwise, a programming instruction combination matching the function is set, and a correspondence is established between the custom instruction in the first PLC and the programming instruction combination in the second PLC.

7. The method according to claim 1, characterized in that The method for obtaining the function correspondence relationship includes: The following operations are performed for each function supported by the first PLC, including: For the current function, according to the operation performed by the current function in the first PLC, searching for an alternative function in the second PLC that has the same operation as the one performed; If an alternative function is found, determining whether the values ​​of the parameters used by each alternative function are the same as the values ​​of the parameters of the current function; If the values ​​of the parameters used by the candidate functions are the same as the values ​​of the parameters of the currently used function, a correspondence is established between the function names of the candidate functions with the same values ​​and the function names of the parameters used by the current function, and a correspondence is established between the parameter names of the candidate functions with the same values ​​and the parameter names of the current function; If the values ​​of the parameters used by an alternative function are different from the values ​​of the parameters of the currently used function, an optimization function with the same values ​​is generated based on the alternative function, and a correspondence is established between the function names of the optimization functions with the same values ​​and the function names of the parameters used by the current function, and a correspondence is established between the parameter names of the optimization functions with the same values ​​and the parameter names of the current function.

8. The method according to claim 7, characterized in that The method further comprises: If no candidate function is found, a candidate function combination matching the functionality of the current function is generated based on at least two functions in the second PLC, and the candidate function combination is used as the required candidate function.

9. A storage medium storing a computer program, wherein: The computer program is configured to execute the method according to any one of claims 1 to 8 when executed.

10. A multiplexing device for a PLC engineering project file, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the method described in any one of claims 1 to 8.