CN115903642A - PLC program processing method, device and server - Google Patents
PLC program processing method, device and server Download PDFInfo
- Publication number
- CN115903642A CN115903642A CN202211533167.5A CN202211533167A CN115903642A CN 115903642 A CN115903642 A CN 115903642A CN 202211533167 A CN202211533167 A CN 202211533167A CN 115903642 A CN115903642 A CN 115903642A
- Authority
- CN
- China
- Prior art keywords
- user program
- plc
- engineering
- program
- service
- 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.)
- Granted
Links
Images
Classifications
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02P—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
- Y02P90/00—Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
- Y02P90/02—Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]
Landscapes
- Programmable Controllers (AREA)
Abstract
The invention relates to the technical field of industrial automation control, and discloses a PLC program processing method, a PLC program processing device and a PLC program processing server. The PLC program processing method is applied to a local server, and the local server comprises an engineering file service and at least one local engineering service. When an engineering comparison instruction is received, a first user program is obtained from the local engineering service, and a second user program is obtained from the engineering file service; comparing the first user program and the second user program; therefore, the user program of the PLC equipment is managed by using the storage of the local server, the data downloaded to the PLC equipment is reduced, and the utilization rate of the storage space of the PLC equipment is improved.
Description
Technical Field
The invention relates to the technical field of industrial automation control, in particular to a PLC program processing method, a PLC program processing device and a PLC program processing server.
Background
Typically, user applications of the PLC require constant modification and debugging, as well as comparison of version differences.
At present, the engineering comparison during the operation of the PLC has the following two key points: firstly, the user engineering file is downloaded to the PLC equipment, and at the moment when the user triggers comparison, the engineering file in the equipment is uploaded to the local server for comparison. And secondly, detecting whether the engineering file has a difference or not by taking the line text and the program segment text in the engineering file as a comparison unit.
However, for the backup of the project files and the project comparison function, the project files are downloaded to the PLC device for storage, and the limited storage space of the PLC device is occupied. At run-time, files are frequently uploaded from the device, impacting other traffic that relies on communication.
Disclosure of Invention
The invention mainly aims to provide a PLC program processing method, a PLC program processing device and a PLC program processing server, aiming at managing a user program of a PLC device by using the storage of a local server, reducing data downloaded to the PLC device and improving the utilization rate of the storage space of the PLC device.
In order to achieve the above object, the present invention provides a PLC program processing method, which is applied to a local server including an engineering document service and at least one local engineering service, and includes the steps of:
when receiving a project comparison instruction, acquiring a first user program from the local project service and acquiring a second user program from the project file service;
the first user program and the second user program are compared.
Preferably, the local server is in communication connection with the PLC device, the engineering comparison instruction includes an online comparison instruction, and the steps of obtaining a first user program from the local engineering service and obtaining a second user program from the engineering document service when receiving the engineering comparison instruction include:
when the online comparison instruction is received, acquiring identification information corresponding to the PLC equipment from the PLC equipment, wherein the identification information comprises an engineering identification of a user program of a current running version of the PLC equipment and an equipment identification of the PLC equipment;
and acquiring a first user program corresponding to the project identification from the local project service, and acquiring a second user program corresponding to the identification information from the project file service.
Preferably, the project comparison instruction comprises an offline comparison instruction, and the step of obtaining a first user program from the local project service and a second user program from the project file service upon receiving the project comparison instruction comprises:
when the offline comparison instruction is received, acquiring a first user program from the engineering file service, and acquiring a second user program from the local engineering service; and the second user program is a temporary version user program established in the local engineering service.
Preferably, the step of comparing the first user program and the second user program comprises:
detecting whether an object in the first user program is missing or not, and if the object in the first user program is detected to be missing, adding an object missing mark of the missing object to obtain a third user program; detecting whether an object in the second user program is missing or not, and if the object in the second user program is missing, adding an object missing mark of the missing object to obtain a fourth user program;
comparing the third user program and the fourth user program.
Preferably, the step of comparing the first user program and the second user program comprises:
obtaining a first variable declaration feature of the first user program; and obtaining a second variable declaration feature of the second user program; wherein the first variable declaration feature and the second variable declaration feature include at least one of a range, a name, a type, an address, a power loss, and an annotation;
comparing the first variable declaration feature and the second variable declaration feature.
Preferably, the step of comparing the first user program and the second user program comprises:
comparing the first user program and the second user program in text;
if the difference of the line texts in the first user program and the second user program is detected, acquiring a character string corresponding to the line text with the difference;
and comparing character strings corresponding to the lines of text with differences.
Preferably, the local server is connected to the PLC device in a communication manner, and before the steps of obtaining the first user program from the local engineering service and obtaining the second user program from the engineering document service when receiving the engineering comparison instruction, the method further includes:
acquiring an engineering identifier of a user program and an equipment identifier of the PLC equipment;
associating the project identification and the equipment identification;
and sending the associated project identification and the equipment identification to the project file service.
Preferably, after the step of comparing the first user program and the second user program, the method further comprises:
if the first user program and the second user program are detected to be different, performing difference combination on the first user program and the second user program to obtain a user program after difference combination;
and sending the user program after the difference combination to the engineering file service, and updating the user program after the difference combination into the second user program.
In order to achieve the above object, the present invention also provides a PLC program processing device including:
the acquisition module is used for acquiring a first user program from local engineering service and a second user program from engineering file service when receiving an engineering comparison instruction;
a comparison module to compare the first user program and the second user program.
In addition, to achieve the above object, the present invention also provides a server, including:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the steps of the PLC program processing method as described above.
The invention provides a PLC program processing method, a device and a server; the PLC program processing method is applied to a local server, and the local server comprises an engineering file service and at least one local engineering service; acquiring a first user program from the local engineering service and a second user program from the engineering file service when an engineering comparison instruction is received; comparing the first user program and the second user program; therefore, the user program of the PLC equipment is managed by using the storage of the local server, the data downloaded to the PLC equipment is reduced, and the utilization rate of the storage space of the PLC equipment is improved.
Drawings
Fig. 1 is a schematic device structure diagram of a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart of a PLC program processing method according to a first embodiment of the present invention;
FIG. 3 is a schematic diagram illustrating interaction between the engineering document service and the local engineering service according to the PLC program processing method of the present invention;
FIG. 4 is a schematic sub-flow chart of a first embodiment of a PLC program processing method according to the present invention;
FIG. 5 is a schematic diagram showing an online comparison of the PLC process of the present invention;
FIG. 6 is a schematic diagram of an offline comparison of the PLC program processing method of the present invention;
FIG. 7 is a flowchart illustrating a PLC program processing method according to a second embodiment of the present invention;
FIG. 8 is a flowchart illustrating a PLC program processing method according to a third embodiment of the present invention;
FIG. 9 is a flowchart illustrating a PLC program processing method according to a fourth embodiment of the present invention;
FIG. 10 is a schematic view showing the effect of the PLC program processing method of the present invention in adding objects missing from the current project;
FIG. 11 is a diagram illustrating the comparison effect of objects with the same ID in the PLC program processing method according to the present invention;
fig. 12 is a schematic flowchart of a PLC program processing method according to a fifth embodiment of the present invention;
FIG. 13 is a schematic diagram showing the sequence of comparison of variable declaration areas of the PLC program processing method of the present invention;
FIG. 14 is a schematic diagram showing the sequence of comparison of variable declaration areas and partial attribute change in the PLC program processing method of the present invention;
fig. 15 is a schematic flowchart of a PLC program processing method according to a sixth embodiment of the present invention;
FIG. 16 is a schematic diagram showing comparison among trigger rows according to the PLC program processing method of the present invention;
fig. 17 is a schematic flowchart of a PLC program processing method according to a seventh embodiment of the present invention;
FIG. 18 is a schematic diagram of the decoupling of a user program and a PLC device according to the PLC program processing method of the present invention;
fig. 19 is a functional block diagram of the PLC runtime engineering comparison system according to the first embodiment of the present invention.
The implementation, functional features and advantages of the present invention will be further described with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and do not limit the invention.
As shown in fig. 1, fig. 1 is a schematic device structure diagram of a hardware operating environment according to an embodiment of the present invention.
The device of the embodiment of the invention can be a mobile terminal or a server device.
As shown in fig. 1, the apparatus may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, a communication bus 1002. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory such as a disk memory. The memory 1005 may alternatively be a storage device separate from the processor 1001.
Those skilled in the art will appreciate that the configuration of the apparatus shown in fig. 1 is not intended to be limiting of the apparatus and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
As shown in fig. 1, the memory 1005, which is a kind of computer storage medium, may include therein an operating system, a network communication module, a user interface module, and a PLC program processing program.
The operating system is a program for managing and controlling terminal equipment and software resources, and supports the running of a network communication module, a user interface module, a PLC program processing program and other programs or software; the network communication module is used for managing and controlling the network interface 1002; the user interface module is used to manage and control the user interface 1003.
In the apparatus shown in fig. 1, the apparatus calls a PLC program processing program stored in the memory 1005 by the processor 1001 and performs operations in the various embodiments of the PLC program processing method described below.
Based on the hardware structure, the embodiment of the PLC program processing method is provided.
Referring to fig. 2, fig. 2 is a flowchart illustrating a PLC program processing method according to a first embodiment of the present invention, the PLC program processing method including:
and step S10, when receiving a project comparison instruction, acquiring a first user program from the local project service and acquiring a second user program from the project file service.
In this embodiment, the PLC program processing method is applied to a local server including a project file service and at least one local project service.
The project file service is used for storing user programs of historical versions which need to be downloaded by users. When the project comparison is triggered, the corresponding version of the user program can be searched from the project file service for comparison.
The local engineering service includes a user program stored in a local server for editing.
Referring to fig. 3, fig. 3 is an interaction diagram of the project document service and the local project service; in FIG. 3, the project documentation service may connect multiple local project services; for example, the project file service is connected with a local project service 1 (IDE 1) and a local project service n (IDEn). The user program in the local engineering service 1 can be uploaded to the engineering file service, and the user program update of the latest version in the engineering file service can be downloaded to the local engineering service 1 (IDE 1).
The engineering comparison refers to the version difference comparison of different versions of the same user program in the modification and debugging processes of the user program so as to identify the difference between the different versions of the same user program; the project comparison may include a user program runtime project comparison, i.e., an online comparison; an offline comparison may also be included.
The online comparison is a comparison of the projects triggered when the local server is communicatively connected to the PLC device.
The offline comparison is a project comparison triggered when there is no communication connection between the local server and the PLC device.
The project comparison may be a comparison of the user program in the project documentation service with a corresponding different version of the user program in the local project service.
And when receiving a project comparison instruction, acquiring a first user program to be compared from the local project service, and acquiring a second user program to be compared of a corresponding version from the project file service.
Step S20, comparing the first user program and the second user program.
In this embodiment, after the first user program and the second user program are obtained, the first user program and the second user program may be compared with each other through texts and program segment texts, so that a difference between the first user program and the second user program may be compared.
Further, referring to fig. 4, in an embodiment, after step S20, the PLC program processing method may further include the following steps:
step S30, if the first user program and the second user program are detected to be different, the first user program and the second user program are subjected to difference combination to obtain a user program subjected to difference combination;
and S40, sending the user program after the difference combination to the engineering file service, and updating the user program after the difference combination into the second user program.
In this embodiment, after comparing the first user program and the second user program, when it is detected that the first user program and the second user program are different, the first user program and the second user program may be subjected to difference combination to obtain a corresponding user program subjected to difference combination; and then uploading the user program after the difference combination to an engineering file service, and updating the user program after the difference combination into a second user program.
As an example, referring to fig. 5, fig. 5 is a schematic diagram of an online comparison; after the first user program and the second user program are compared on line, and when the first user program and the second user program are detected to have difference, the first user program and the second user program are subjected to difference combination to obtain a corresponding user program subjected to difference combination; and uploading the user program after the difference combination to an engineering file service, and updating the user program after the difference combination into a second user program.
As another example, referring to fig. 6, fig. 6 is a schematic diagram of an offline comparison; after the first user program and the second user program are compared in an off-line mode, when the first user program and the second user program are detected to be different, the first user program and the second user program are subjected to difference combination, and a corresponding user program after the difference combination is obtained; and uploading the user program after the difference combination to an engineering file service.
Further, the next time a project comparison is triggered, a comparison may be made from the second user program updated in the project file service. Therefore, the user program of the PLC equipment is managed by using the storage of the local server, the utilization rate of the storage space of the PLC equipment can be improved, and the communication pressure of the PLC equipment is reduced.
In the embodiment, when an engineering comparison instruction is received, a first user program is obtained from a local engineering service, and a second user program is obtained from an engineering file service; comparing the first user program and the second user program; therefore, the user program of the PLC equipment is managed by using the storage of the local server, the data downloaded to the PLC equipment is reduced, and the utilization rate of the storage space of the PLC equipment is improved.
Further, based on the first embodiment, a second embodiment of the PLC program processing method of the present invention is proposed.
Referring to fig. 7, in the present embodiment, step S10 may include the following sub-steps:
and a substep S11 of acquiring identification information corresponding to the PLC device from the PLC device when the online comparison instruction is received, wherein the identification information comprises an engineering identification of the current running version user program of the PLC device and a device identification of the PLC device.
Wherein, in the case that the local server is in communication connection with the PLC device, the engineering comparison instruction may include an online comparison instruction.
The online comparison refers to comparing the user program of the PLC equipment in the current operation with the user programs of different versions corresponding to the local engineering service.
The identification information may include an engineering identification of a user program of a currently running version of the PLC device, and a device identification of the PLC device.
The engineering identification refers to the version number of the user program, and the user program of the same version is unique.
The equipment identifier refers to the serial number of the PLC equipment, and each PLC equipment corresponds to a unique equipment identifier.
When the online comparison instruction is received, identification information corresponding to the PLC equipment can be obtained from the PLC equipment, and further the engineering identification of the user program of the current running version of the corresponding PLC equipment and the equipment identification of the PLC equipment can be determined according to the identification information.
And a substep S12, obtaining a first user program corresponding to the project identification from the local project service, and obtaining a second user program corresponding to the identification information from the project file service.
In this embodiment, the corresponding first user program may be obtained from the local engineering service through the engineering identifier; the corresponding second user program can be obtained from the engineering file service through the identification information; the first user program and the second user program may then be compared.
In this embodiment, when the online comparison is triggered, the corresponding identification information is acquired from the PLC device, and then the corresponding first user program is acquired from the local engineering service and the corresponding second user program is acquired from the engineering file service, respectively, according to the identification information; therefore, the storage management of the local server is fully utilized to realize the project comparison during the operation of the PLC, and the communication pressure of the PLC equipment is reduced.
Further, based on the first embodiment, a third embodiment of the PLC program processing method of the present invention is provided.
Referring to fig. 8, in this embodiment, step S10 may further include the following sub-steps:
substep S13, when receiving the off-line comparison instruction, acquiring a first user program from the engineering file service and acquiring a second user program from the local engineering service; and the second user program is a temporary version user program established in the local engineering service.
In this embodiment, in a case where the local server is not in communication connection with the PLC device, the engineering comparison instruction may include an offline comparison instruction.
The second user program is a temporary version user program established in the local engineering service.
As an example, the project file service comprises a user program A, a user program B, a user program C and a user program D. And downloading the user program A from the engineering file service to the local engineering service, continuously editing the user program A in the local engineering service, and generating a corresponding user program A1 after editing, wherein the user program A1 is a temporary version user program established in the local engineering service.
And when an offline comparison instruction is triggered, acquiring a first user program of a corresponding version from the engineering file service, and acquiring a second user program of a corresponding version from the local engineering service. The first user program and the second user program may then be compared.
In the embodiment, when the offline comparison is triggered, a corresponding first user program is respectively obtained from the engineering file service, and a corresponding second user program is obtained from the local engineering service; therefore, the storage management of the local server is fully utilized to realize the offline comparison of the PLC user program, and the communication pressure of the PLC equipment is reduced.
Further, based on the first, second, and third embodiments, a fourth embodiment of the PLC program processing method of the present invention is provided. Referring to fig. 9, step S20 may include the following sub-steps:
a substep 21, detecting whether the first user compares the objects in the programs of the first user program and the second user program, if detecting that the objects in the first user program are missing, adding an object missing mark of the missing objects to obtain a third user program; and detecting whether the object in the second user program is missing or not, and if the object in the second user program is detected to be missing, adding an object missing mark of the missing object to obtain a fourth user program.
Wherein, first, it may be detected whether objects in the first user program and the second user program are missing.
And when the object in the first user program is detected to be missing, adding the currently missing object in the first user program, and adding an object missing mark of the missing object to obtain a corresponding third user program.
As an example, referring to fig. 10, fig. 10 is a schematic diagram illustrating an effect of adding an object missing from a current project; in the left diagram of fig. 10, the PLC _1 user program lacks the object POU _2 in the folder 1, and adds a corresponding object missing flag, i.e., POU _2 (missing), at the position of the object POU _ 2.
And when the object in the second user program is detected to be missing, adding the currently missing object in the second user program, and adding an object missing mark of the missing object to obtain a corresponding fourth user program.
As yet another example, referring to fig. 10, fig. 10 is a schematic diagram of the effect of adding missing objects for a current project; in the right diagram of fig. 10, the PLC _1 user program lacks the object POU _1 in folder 1, and adds a corresponding object missing flag, POU _1 (missing), at the position of the object POU _ 1.
A substep 22 of comparing said third user program with said fourth user program.
In this embodiment, after the third user program and the fourth user program are obtained, the object comparison with the same ID may be performed on the third user program and the fourth user program.
As an example, referring to fig. 11, fig. 11 is a schematic diagram illustrating the effect of object comparison with the same ID; POU _1id _1of folder 1 in the PLC _1 user program in the left diagram of FIG. 11 is compared with POU _11id _1of folder 1 in the PLC _1 user program in the right diagram of FIG. 11.
By comparing the objects with the same ID with the third user program and the fourth user program, the object-level comparison can be satisfied, and the objects compared with each other are ensured to be the historical versions of the original objects. Therefore, the problem that the positions of the file folders with the same name and the object nodes in the PLC user program object are different in the prior art, and the objects with non-historical versions are compared during comparison is solved.
In this embodiment, a third user program is obtained by detecting whether the first user compares objects in the programs of the first user program and the second user program, and if detecting that the objects in the first user program are missing, adding an object missing mark of the missing objects; detecting whether an object in the second user program is missing or not, and if the object in the second user program is missing, adding an object missing mark of the missing object to obtain a fourth user program; comparing the third user program and the fourth user program; therefore, the problem that the positions of the file folders with the same name and the object nodes in the PLC user program object are different in the prior art, and objects with non-historical versions are compared in the comparison process is solved.
Further, based on the first, second, and third embodiments, a fifth embodiment of the PLC program processing method according to the present invention is provided. Referring to fig. 12, step S20 may further include the following sub-steps:
substep 23, obtaining a first variable declaration feature of the first user program; and obtaining a second variable declaration feature of the second user program; wherein the first variable declaration feature and the second variable declaration feature include at least one of a range, a name, a type, an address, a power loss, and an annotation.
Wherein the variable declaration feature is a variable declaration characteristic of a Structured (ST) text language, and may include at least one of a range, a name, a type, an address, a power loss, and an annotation.
A first variable declaration feature of a first user program is obtained, and a second variable declaration feature of a second user program is obtained.
A substep 24 of comparing said first variable declared feature with said second variable declared feature.
After acquiring the first variable declaration feature of the first user program and the second variable declaration feature of the second user program, comparing the first variable declaration feature with the second variable declaration feature.
As an example, referring to fig. 13, fig. 13 is a schematic diagram of sequential variation of variable declaration area comparison; determining that there is no difference between the first variable declaration feature and the second variable declaration feature when a sequential change of the variables in the first variable declaration feature and the second variable declaration feature is detected; i.e., the POU variable declaration areas of the first user program and the second user program are not different.
As another example, referring to fig. 14, fig. 14 is a schematic diagram of the order of comparison of variable declaration areas and partial attribute change; determining that there is a difference between the first variable declaration feature and the second variable declaration feature when a change in type of the same variable of the first variable declaration feature and the second variable declaration feature is detected; that is, the POU variable declaration area of the first user program and the second user program are different.
And comparing the variable declaration characteristics of the first user program and the second user program to accurately analyze the difference points of the POU variable declaration areas of the first user program and the second user program.
In the embodiment, a first variable declaration feature of a first user program and a second variable declaration feature of a second user program are obtained; comparing the first variable declared feature and the second variable declared feature; therefore, by comparing the variable declaration characteristics of the first user program and the second user program, the difference points of the POU variable declaration areas of the first user program and the second user program are accurately analyzed.
Further, based on the first, second, and third embodiments, a sixth embodiment of the PLC program processing method according to the present invention is provided. Referring to fig. 15, step S20 may further include the following sub-steps:
a substep 25 of text comparison of said first user program and said second user program.
And comparing the line texts and the program segment texts of the first user program and the second user program to detect whether the line texts in the first user program and the second user program are different.
And a substep 26, if it is detected that the line texts in the first user program and the second user program have differences, acquiring character strings corresponding to the line texts with the differences.
In this embodiment, when a difference between the line texts in the first user program and the second user program is detected, marking the line text with the difference between the first user program and the second user program, and acquiring a character string corresponding to the line text with the difference; then, specific variables of the line text where the difference exists are further identified with respect to the character string.
And a substep 27 of comparing the character strings corresponding to the lines of text with differences.
In this embodiment, after determining the character strings corresponding to the line text with the difference, the delay calculation is started, and the intra-line character string comparison is triggered, so that the character strings corresponding to the line text with the difference can be compared.
As an example, referring to fig. 16, fig. 16 is a schematic diagram illustrating comparison in triggering rows after a difference exists in the rows; under the condition that the difference of line texts in the first user program and the second user program is detected, marking the line where the difference exists between the first user program and the second user program; simultaneously, triggering the in-line character string comparison aiming at the line texts with differences; and then identifying a specific variable in the line text with difference, and the specific position of the variable can be accurate to a certain column.
In the embodiment, the first user program and the second user program are compared through texts; if the difference of the line texts in the first user program and the second user program is detected, acquiring a character string corresponding to the line text with the difference; comparing character strings corresponding to the lines of text with differences; therefore, the text comparison is carried out on the first user program and the second user program, and when the line texts in the first user program and the second user program are different, the character string comparison in the line is triggered, so that the accuracy of variable comparison is improved.
Further, based on the first embodiment, a seventh embodiment of the PLC program processing method of the present invention is proposed.
Referring to fig. 17, before step S10, the PLC program processing method may further include the steps of:
step A10, acquiring an engineering identifier of a user program and an equipment identifier of the PLC equipment;
step A20, associating the project identifier and the equipment identifier;
and A30, sending the associated project identification and the equipment identification to the project file service.
The engineering identification refers to the version number of the user program, and the user program of the same version is unique.
The equipment identifier refers to the serial number of the PLC equipment, and each PLC equipment corresponds to a unique equipment identifier.
Before receiving an engineering comparison instruction aiming at a user program, acquiring an engineering identifier of the user program and an equipment identifier of the PLC equipment; further, the engineering mark and the equipment mark can be associated; and sending the associated project identification and equipment identification to a project file service.
Referring to fig. 18, fig. 18 is a schematic diagram of the decoupling of the user program and the PLC device; and associating the project identification of the user program and the equipment identification of the PLC equipment, and sending the associated project identification and equipment identification to a project file service.
As an example, when the PLC device downloads a certain version of the user program from the engineering file service, the PLC device only needs to download the version number of the user program, that is, the engineering identifier corresponding to the current user program.
As another example, when downloading the user programs of the same version in the project file service to different PLC devices, the project file service may record the project identifiers of the user programs through the device list recorder, and may not store multiple user programs of the same version in the project file service.
In this embodiment, the engineering identifier of the user program and the device identifier of the PLC device are obtained; associating the project identification and the equipment identification; sending the associated project identification and the equipment identification to the project file service; therefore, the project identification of the user program and the equipment identification of the PLC equipment are associated, and when the user program is compared, the user program of the corresponding version can be obtained through the association relationship between the project identification and the equipment identification.
The invention also provides a PLC operation engineering comparison device. Referring to fig. 19, the PLC runtime engineering comparison apparatus of the present invention includes:
an obtaining module 10, configured to obtain a first user program from the local engineering service and a second user program from the engineering document service when receiving an engineering comparison instruction;
a comparison module 20 for comparing the first user program and the second user program.
Optionally, the obtaining module 10 may further include:
the first unit is used for acquiring identification information corresponding to the PLC equipment from the PLC equipment when the online comparison instruction is received, wherein the identification information comprises an engineering identification of a user program of a current running version of the PLC equipment and an equipment identification of the PLC equipment;
and the second unit is used for acquiring a first user program corresponding to the project identification from the local project service and acquiring a second user program corresponding to the identification information from the project file service.
Optionally, the obtaining module 10 may further include:
the third unit is used for acquiring a first user program from the engineering file service and acquiring a second user program from the local engineering service when the offline comparison instruction is received; and the second user program is a temporary version user program established in the local engineering service.
Optionally, the comparing module 20 may further include:
the detection unit is used for detecting whether the object in the first user program is missing or not, and if the object in the first user program is detected to be missing, adding an object missing mark of the missing object to obtain a third user program; detecting whether an object in the second user program is missing or not, and if the object in the second user program is missing, adding an object missing mark of the missing object to obtain a fourth user program;
an object unit for comparing the third user program and the fourth user program.
Optionally, the comparing module 20 may further include:
a variable unit, configured to obtain a first variable declaration feature of the first user program; and obtaining a second variable declaration feature of the second user program; wherein the first variable declaration feature and the second variable declaration feature include at least one of a scope, a name, a type, an address, a power loss, and an annotation;
a feature unit for comparing the first variable declared feature and the second variable declared feature.
Optionally, the comparing module 20 may further include:
a line text unit for performing text comparison on the first user program and the second user program;
the difference unit is used for acquiring a character string corresponding to a line text with a difference if the line text in the first user program and the second user program is detected to have the difference;
and the character string unit is used for comparing character strings corresponding to the lines of text with differences.
Optionally, the PLC runtime engineering comparison apparatus may further include:
the mark module is used for acquiring an engineering mark of a user program and an equipment identifier of the PLC equipment;
the association module is used for associating the engineering mark with the equipment identifier;
and the sending module is used for sending the associated project mark and the equipment identifier to the project file service.
Optionally, the PLC runtime engineering comparison apparatus may further include:
a merging module, configured to perform difference merging on the first user program and the second user program if it is detected that the first user program and the second user program are different, so as to obtain a user program after difference merging;
and the updating module is used for sending the user program after the difference combination to the engineering file service and updating the user program after the difference combination into the second user program.
Furthermore, the present invention also provides a computer-readable storage medium having stored thereon a PLC runtime engineering comparison program, which when executed by a processor implements the steps of the PLC program processing method as described above.
The method implemented when the PLC runtime engineering comparison program running on the processor is executed may refer to each embodiment of the PLC program processing method of the present invention, and is not described herein again.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system 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 system. Without further limitation, an element defined by the phrases "comprising a," "8230," "8230," or "comprising" does not exclude the presence of other like elements in a process, method, article, or system comprising the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the description of the foregoing embodiments, it is clear to those skilled in the art that the method of the foregoing embodiments may be implemented by software plus a necessary general hardware platform, and certainly may also be implemented by hardware, but in many cases, the former is a better implementation. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) as described above and includes instructions for enabling a terminal device (e.g., a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and is not intended to limit the scope of the present invention, and all equivalent structures or equivalent processes performed by the present specification and the attached drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.
Claims (10)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202211533167.5A CN115903642B (en) | 2022-12-01 | 2022-12-01 | PLC program processing method, device and server |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202211533167.5A CN115903642B (en) | 2022-12-01 | 2022-12-01 | PLC program processing method, device and server |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN115903642A true CN115903642A (en) | 2023-04-04 |
| CN115903642B CN115903642B (en) | 2025-12-09 |
Family
ID=86495238
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202211533167.5A Active CN115903642B (en) | 2022-12-01 | 2022-12-01 | PLC program processing method, device and server |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN115903642B (en) |
Citations (10)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20030131072A1 (en) * | 2001-12-05 | 2003-07-10 | Hiroki Kobayashi | Device information acquiring method, server apparatus and computer-readable storage medium |
| US20050144612A1 (en) * | 2003-12-31 | 2005-06-30 | Shin-Ping Wang | Firmware updating method and application utilizing the same |
| CN101388101A (en) * | 2001-09-24 | 2009-03-18 | 西门子能量及自动化公司 | Method for providing engineering tool services |
| US20090276059A1 (en) * | 2006-03-29 | 2009-11-05 | Mitsubishi Electric Corporation | Programming support apparatus, programming support method, program for causing computer to implement the method, and recording medium containing the program |
| CN102236333A (en) * | 2010-04-30 | 2011-11-09 | 深圳市合信自动化技术有限公司 | Programmable logic controller program uploading device and method |
| JP2013157656A (en) * | 2012-01-26 | 2013-08-15 | Mitsubishi Electric Corp | Digital broadcasting system |
| CN104714468A (en) * | 2014-12-31 | 2015-06-17 | 北京纵横机电技术开发公司 | Method of comparison between continuous functional diagram files |
| CN112947986A (en) * | 2020-09-29 | 2021-06-11 | 深圳市明源云科技有限公司 | Multi-version code sign-in control method and device, client and storage medium |
| CN113157315A (en) * | 2021-04-30 | 2021-07-23 | 平安普惠企业管理有限公司 | Method, device, equipment and medium for identifying difference information of different versions of software |
| CN114968276A (en) * | 2021-02-22 | 2022-08-30 | 腾讯科技(深圳)有限公司 | Application program deployment method and device, computer equipment and storage medium |
-
2022
- 2022-12-01 CN CN202211533167.5A patent/CN115903642B/en active Active
Patent Citations (10)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101388101A (en) * | 2001-09-24 | 2009-03-18 | 西门子能量及自动化公司 | Method for providing engineering tool services |
| US20030131072A1 (en) * | 2001-12-05 | 2003-07-10 | Hiroki Kobayashi | Device information acquiring method, server apparatus and computer-readable storage medium |
| US20050144612A1 (en) * | 2003-12-31 | 2005-06-30 | Shin-Ping Wang | Firmware updating method and application utilizing the same |
| US20090276059A1 (en) * | 2006-03-29 | 2009-11-05 | Mitsubishi Electric Corporation | Programming support apparatus, programming support method, program for causing computer to implement the method, and recording medium containing the program |
| CN102236333A (en) * | 2010-04-30 | 2011-11-09 | 深圳市合信自动化技术有限公司 | Programmable logic controller program uploading device and method |
| JP2013157656A (en) * | 2012-01-26 | 2013-08-15 | Mitsubishi Electric Corp | Digital broadcasting system |
| CN104714468A (en) * | 2014-12-31 | 2015-06-17 | 北京纵横机电技术开发公司 | Method of comparison between continuous functional diagram files |
| CN112947986A (en) * | 2020-09-29 | 2021-06-11 | 深圳市明源云科技有限公司 | Multi-version code sign-in control method and device, client and storage medium |
| CN114968276A (en) * | 2021-02-22 | 2022-08-30 | 腾讯科技(深圳)有限公司 | Application program deployment method and device, computer equipment and storage medium |
| CN113157315A (en) * | 2021-04-30 | 2021-07-23 | 平安普惠企业管理有限公司 | Method, device, equipment and medium for identifying difference information of different versions of software |
Non-Patent Citations (3)
| Title |
|---|
| 中国工控网: "如何在TIA Portal中比较两个离线项目", pages 2 - 6, Retrieved from the Internet <URL:http://www.gongkong.com/article/201807/81709.html> * |
| 北岛李工: "西门子S7-1200/1500 PLC SCL语言编程", Retrieved from the Internet <URL:https://www.bilibili.com/video/BV1WY411A7w2?spm_id_from=333.788.player.switch> * |
| 段礼材等: "西门子S7-1200 PLC编程及使用指南", 31 October 2017, 机械工业出版社, pages: 160 - 161 * |
Also Published As
| Publication number | Publication date |
|---|---|
| CN115903642B (en) | 2025-12-09 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN112380130B (en) | Application testing method and device based on call dependency relationship | |
| CN108920691B (en) | Front-end static resource management method and device, computer equipment and storage medium | |
| JP2006031109A (en) | Management system and management method | |
| CN110554962A (en) | Regression testing process covering method, server and computer readable storage medium | |
| CN108255735B (en) | Associated environment testing method, electronic device and computer readable storage medium | |
| CN108415998B (en) | Application dependency relationship updating method, terminal, device and storage medium | |
| CN107704260A (en) | Method and system for updating software development kit of application software | |
| CN111796855A (en) | Incremental version updating method and device, storage medium and computer equipment | |
| CN110134595B (en) | Analysis method, analysis device and computer equipment before SVN (scalable vector network) resource library test | |
| CN111984264A (en) | Static library generation method and device | |
| CN112947991A (en) | Method and device for acquiring version difference code file, computer equipment and medium | |
| CN113126998A (en) | Incremental source code acquisition method and device, electronic equipment and storage medium | |
| CN106843947B (en) | Method and device for processing code defects | |
| CN108399125B (en) | Automatic testing method and device, computer equipment and storage medium | |
| CN106776266B (en) | Configuration method of test tool and terminal equipment | |
| CN111651195A (en) | System dependency package conflict detection method and device | |
| KR102340453B1 (en) | Information processing apparatus, information processing method, and information processing program stored in a recording medium | |
| CN109582347B (en) | Method and device for acquiring front-end codes | |
| CN115794214A (en) | Application module metadata management method, device, storage medium and device | |
| CN114416641A (en) | File data processing method and device, electronic equipment and storage medium | |
| CN109933976B (en) | Android application similarity detection method, mobile terminal and storage device | |
| CN115903642A (en) | PLC program processing method, device and server | |
| JP6210010B2 (en) | Information processing program, apparatus and method | |
| CN114237976A (en) | Data acquisition method and device | |
| CN112800194A (en) | Interface change identification method, device, equipment and storage medium |
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 | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |