FBD user program batch generation and synchronization method and device based on difference item

Through the batch generation and synchronization method of FBD user programs based on the difference terms, the inefficiency problem of the same control logic but different measurement points in the automation industry is solved, and efficient synchronization and configuration of user programs between control stations is achieved.

CN120044839APending Publication Date: 2025-05-27SUPCON TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510093970.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-21
Publication Date
2025-05-27

AI Technical Summary

Technical Problem

In the automation industry, the equipment control logic of multiple production lines is the same, but the measurement point number is different, which leads to engineers need to repeatedly export and import user programs, modify the bit number name, function block name, etc., which is extremely inefficient.

Method used

The batch generation and synchronization method of FBD user program based on the difference items is adopted. By identifying the difference in naming rules between the reference control station and the target control station, the rule file is configured, the FBD user program of the target control station is generated, and when the reference control station user program changes, the difference items are identified and synchronized.

Benefits of technology

It realizes synchronization of user programs between control stations, improves engineering configuration efficiency for engineers, and reduces the time for manual modification and synchronization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120044839A_ABST
    Figure CN120044839A_ABST
Patent Text Reader

Abstract

The invention discloses an FBD user program batch generation and synchronization method and device based on a difference item. The FBD user program batch generation and synchronization method comprises the steps that naming rule difference between a reference control station and a target control station is recognized, and a rule file is configured; generating an FBD user program template from the reference control station user program, and generating a target control station FBD user program based on the rule file and the FBD user program template; if the reference control station program changes, performing difference item identification on the generated target control station user program and the target control station original user program; an operation report is generated based on a difference item, FBD user program synchronization is performed based on the operation report and a rule file, through the rule file between two control stations, a new control station program is generated in a one-key mode with a source control station as a reference and imported, and content modification is performed on any one control station through the user program generated in the one-key mode. Content modification can be carried out to synchronize other control stations, so that the engineering configuration efficiency of engineers is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of automation, and particularly to a method and device for batch generating and synchronizing FBD user programs based on difference items. Background Art

[0002] In the automation industry, in industries such as similar units, the device equipment of multiple production lines is the same, that is, the control logics are the same, only the measured point numbers for control are different. In this case, engineering personnel need to repeatedly export and import user programs, and finally need to open each user program one by one to modify information such as bit number names, function block names, and descriptions (for example, changing the 2# station to the 4# station), with extremely low efficiency.

[0003] Currently, for control station synchronization, generally, engineering personnel manually import user programs of different control stations and then open the user programs to perform content replacement.

[0004] Moreover, during the control station synchronization process, function blocks have type and parameter information, while input / output blocks only have name characteristics, and the names are different under different stations. During the implementation of automatic synchronization, the conflict problem after their update also needs to be considered. Summary of the Invention

[0005] In order to overcome the above-mentioned deficiencies in technology, the present invention proposes a method and device for batch generating and synchronizing FBD user programs based on difference items. Through a rule file between two control stations, with the source control station as the benchmark, a new control station FBD user program can be generated and imported with one key. If the FBD user program of any control station is modified, the modified content can be synchronized to the remaining control stations, thereby improving the efficiency of engineering configuration by engineering personnel.

[0006] The technical solution adopted by the present invention to overcome its technical problems is as follows: In the first aspect of the present invention, a method for batch generating and synchronizing FBD user programs based on difference items is proposed, including: S1, identifying the naming rule differences between the reference control station and the target control station and configuring a rule file; S2, generating an FBD user program template from the FBD user program of the reference control station, and generating an FBD user program for the target control station based on the rule file and the FBD user program template; S3, if the FBD user program of the reference control station changes, identifying the difference items from the original FBD user program of the target control station; S4, generating an operation report based on the difference items; S5, synchronizing the FBD user program based on the operation report and the rule file.

[0007] Further, the rule file at least includes user program name rules, user program description rules, user program bit number input / output rules, and function block naming rules.

[0008] There may be multiple corresponding relationships between the naming of the reference control station and the target control station. In this case, multiple rule files need to be configured to describe the differences between this pair of reference control station and target control station.

[0009] Furthermore, generating the target control station FBD user program based on the rule file specifically includes using wildcards to replace the input block name, output module name, and function block name of the reference control station FBD user program based on the rule file.

[0010] Furthermore, in step S3, if the reference control station FBD user program changes, difference item identification is performed with the original FBD user program of the target control station, specifically including: S31, identifying the number of blocks in the original FBD user program of the target controller and performing a comparison of the number of blocks; S32, identifying the connection relationship between function blocks, input blocks, and output blocks for connection information comparison; S33, identifying the function block ID and the corresponding function block type, thereby performing a comparison of the function block ID and type; S34, querying the configuration log to determine whether the internal parameters of the FBD function block have changed, and at the same time verifying whether the differences in the user program are recorded in the configuration log. If there is a record in the configuration log, FBD user program synchronization confirmation is performed. If no record is found in the configuration log, a prompt is given according to the detected changes, and manual confirmation is required.

[0011] Furthermore, the operation report includes function block addition and deletion operations, connection modification addition and deletion operations, modification of function block basic parameters, and change of input and output bit numbers.

[0012] Furthermore, performing FBD user program synchronization based on the operation report and the rule file includes: if there is a function block addition and deletion operation in the operation report, if it is a function block deletion operation, determine the ID number of the deleted function block, find the function block with the corresponding ID number in the target user program and delete it. If it is a function block addition operation, obtain the block type and number of the new function block and add it to the corresponding position of the target FBD user program; if there is a connection modification addition and deletion operation in the operation report, mark the positions at both ends of the connection and add or delete the connection correspondingly; if there is an input and output bit number change operation in the operation report, replace the bit number of the target control station based on the rule file; if the function block basic parameters are modified, determine the modification item based on the ID of the function block and the value of the parameter.

[0013] Furthermore, performing FBD user program synchronization also includes synchronizing based on the priority of difference items. Among them, the priority of difference items from high to low is function block deletion, function block addition, connection addition and deletion, modification of function block built-in parameters, and movement of function blocks.

[0014] Further, in step S3, if the FBD user program of the reference control station changes, the difference items are identified with the original FBD user program of the target control station. It further includes matching the input blocks and output blocks of the changed FBD user program of the reference control station with those of the original FBD user program of the target control station one by one. If an input block or an output block is newly added or deleted, all the input blocks and output blocks of the original FBD user program of the target control station are deleted, the input and output connections of the function blocks are traversed, the input blocks and output blocks are regenerated, and they are renamed according to the rule file to complete the synchronization.

[0015] In the case of adding input blocks and output blocks, the conflict problem is solved that since the function blocks only have type and parameter information, while the input blocks and output blocks only have name characteristics, and the names are different under different stations.

[0016] Another aspect of the present invention provides a device for batch generating and synchronizing FBD user programs based on difference items, including: a rule configuration module, a program generating module, a difference comparison module, and a synchronization module. The rule configuration module is used to generate a rule file based on the naming differences between the reference control station and the target control station; the program generating module is used to generate the FBD user program of the target control station based on the rule file; the difference comparison module is used to compare the difference items between the adjusted reference FBD user program and the target FBD user program, and generate an operation report based on the rule file and the difference items, and the synchronization module is used to perform synchronization based on the priority of the operations in the operation report.

[0017] The beneficial effects of the present invention are:

[0018] 1. By comparing the difference items, the synchronizability of the user programs between the control stations is ensured;

[0019] 2. When any control station modifies its content, the modified content can be synchronized to the other control stations, thereby improving the engineering configuration efficiency of engineering personnel. Description of the Drawings

[0020] Figure 1 It is a schematic flowchart of a method for batch generating and synchronizing FBD user programs based on difference items according to an embodiment of the present invention;

[0021] Figure 2 It is a schematic diagram of an FBD user program according to an embodiment of the present invention;

[0022] Figure 3 It is a schematic diagram of an application program for synchronizing FBD user programs according to an embodiment of the present invention;

[0023] Figure 4 It is a schematic flowchart of the content difference comparison between FBD user programs between control stations according to an embodiment of the present invention;

[0024] Figure 5 This is a schematic diagram of the operation report generated after the difference comparison is completed;

[0025] Figure 6 To find the schematic diagram of the control system software configuration log. DETAILED DESCRIPTION

[0026] First, some abbreviations and key terms mentioned in the present invention are explained.

[0027] Configuration: Input the control process related data and the required control rules into the system according to the software control module and data rules of the control system, so that the control system has the function of completing the control tasks of specific objects.

[0028] Bit number: Name defined in the software. Corresponding to the input and output points of the hardware.

[0029] FBD user program: FBD user program belongs to a control unit under the control station. It can realize input and output operations by writing corresponding graphic codes. It is composed of input and output bit numbers and logical calculation function blocks. A control station can have several user programs.

[0030] Function block: A function block is a solid program segment used in control software. A function block defines a set of data structures and a program.

[0031] Control System Software: A system that responds to input signals from the process or operators and produces output signals that cause the process to operate in the desired manner.

[0032] Control station: Real-time control equipment, complete on-site data collection and real-time process control. Contains several FBD user programs and input and output nodes according to the project volume.

[0033] Synchronization: When a user program with the same logic in different control stations is modified, the modified logic is quickly applied to other control stations.

[0034] Synchronization rules: describe the naming rule relationship between two control stations, used to quickly replace user program input and output bit numbers, function block names, user program names, descriptions, etc.

[0035] Function block parameters: Function blocks within user programs have their own parameters, which can be analog and switch constants.

[0036] In order to facilitate those skilled in the art to better understand the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. The following is only exemplary and does not limit the protection scope of the present invention.

[0037] like Figure 1As shown in the figure, the flowchart of a method for batch generating and synchronizing FBD user programs based on differential items according to the present invention mainly includes the following steps.

[0038] S1. Identify the naming rule differences between the reference control station and the target control station and configure the rule file.

[0039] The rule file at least includes user program name rules, user program description rules, user program tag input / output rules, function block naming rules, etc.

[0040] In an embodiment of the present invention, for the formulation of rules, wildcards can be used for quick matching. For example, the naming rule of the reference control station is: function block type + control station index + function block serial number (TIC_01_2612A). For the target control station, only the control station index needs to be replaced according to the rules specified in the rule file, and the wildcard is used: *_01_* is replaced with *_02_*. That is, the name of the target control station is updated to TIC_02_2612A.

[0041] It should be noted that there may be multiple corresponding relationships between the naming of the reference control station and the target control station. At this time, multiple rule files need to be configured to describe the differences between this pair of reference control station and target control station for subsequent generation and synchronization. In the current engineering environment, these rule files are only used to describe the differences between this pair of reference control station and target control station, and they are strongly bound to each other. Three rule files correspond to a group of reference control station and target control station.

[0042] It should be noted that one reference control station and one target control station correspond to one or more rule files, and the rule files are uniformly managed by the tool. The rule file groups corresponding to the reference control station and the target control station of each project are stored in the "Rule" folder under the tool directory.

[0043] S2. Generate the reference control station program into an FBD user program template, and generate the target control station FBD user program based on the rule file and the FBD user program template.

[0044] The specific implementation solution for generating the target control station FBD user program is as follows: Use the built-in function of the control system software to export the user program of the reference control station as a template program. The template program is an excel file, and the excel file records the input / output information and logical function block information. Then, use the rule file corresponding to the reference control station and the target control station to replace the input / output names and function block names, and then use the template program import function to generate the target control station user program.

[0045] In an embodiment of the present invention, such as Figure 3Among them, the leftmost control station "[4.2]FCS0402" represents the second control station in the fourth control domain. Its name is FCS0402, which is the reference control station. Under this control station, "P000_Inter-station Communication", "P001_Single Loop 1", and "P002_Single Loop 2" are ticked as user programs that need to be synchronized to other stations. In the middle tree node, "[4.8]FCS0408" is the target control station. Three copies of FBD user programs are generated for this work. In the rightmost part, the rule files required for synchronization from the reference control station to the target control station are ticked. If configured in advance, the rule files will be automatically ticked.

[0046] S3. If the FBD user program of the reference control station changes, then identify the difference items between the changed one and the original user program of the target control station.

[0047] The user program contains three parts: input blocks, output blocks, and function blocks. For details, see Figure 3 the described user program logic diagram. Both the input block and the output block include a unique parameter name. There are various types of function blocks, each representing different logic, and there is a unique number at the bottom of the function block.

[0048] Since the user program of each control station is generated by combining the user program under the reference control station with the rule file, during the process of generating the user programs of each control station, ensure that the input and output and control logic of each user program remain unchanged, only the parameter names of the input and output are different, and the function block numbers change.

[0049] It should be noted that the user can independently choose to synchronize to the target control station according to the differences, or regenerate the FBD user program and synchronize it to the target control station.

[0050] The difference identification mainly judges whether all block quantities, logic information, and function block numbers in the user program match. The flow schematic diagram for identifying difference items is as Figure 4 shown. The process of differential identification is described as follows.

[0051] S31. Identify all the function block quantities of the user program of the target controller and compare the control function block quantities.

[0052] If the control function block quantities are not equal, then search the configuration log to determine the deleted or added function blocks.

[0053] It should be noted that the quantity information is obtained by reading the binary file of the FBD user program archive.

[0054] If the function block quantities are inconsistent, it means that the control logic of the system is different. Forcing synchronization will cause logical disorders, and this situation should be identified for protection.

[0055] S32. Traverse the connection relationships of all blocks and compare the connection information.

[0056] If the connection relationships among the control function block, output modules change, search for the configuration log.

[0057] Among them, identifying the connection relationships among the control function block, output modules is obtained by reading through opening the binary file of the FBD user program archive.

[0058] S33. Identify the function block ID and the corresponding function block type, so as to compare the function block ID and type.

[0059] S34. View the configuration log to determine the difference items between the target user program and the reference user program. Check the configuration log to determine whether the generated target user program is synchronized. If there is modification information in the configuration log check, jump to step S35.

[0060] The configuration log check is to check the operation log of the control system software, which contains all the basic operations of the user program. After the configuration log check passes, it indicates that the user program logics of the reference control station and the target control station are the same and there is no content to be synchronized.

[0061] Query the configuration log, judge whether the internal parameters of the FBD function block have changed, and at the same time verify whether the differences of the user program are recorded in the configuration log. If there is a record in the configuration log, perform synchronization confirmation. If no record is found in the configuration log query, give a prompt according to the detected change situation for manual confirmation.

[0062] It should be noted that once the logic is modified, it can be recognized that the function block content and number do not match. For the situation of only modifying the input / output tag numbers and function block parameters, it is impossible to achieve by checking the function block quantity and connection relationship. Therefore, it is necessary to further view the operation log of the configuration to obtain relevant information.

[0063] S4. Generate an operation report based on the difference items.

[0064] Generate an operation report according to the determined difference items after viewing the configuration log.

[0065] The operation report includes the input / output and function block connection information after detection, the function block numbers and the logic operation log.

[0066] The logic operation log will record the modification of input / output tag numbers and function block parameters, and more accurately identify the logic change operations of engineering personnel.

[0067] The main contents of the operation report are function block addition and deletion operations, connection modification addition and deletion operations, function block basic parameter modification, and input / output tag number change.

[0068] S5, synchronize the FBD user program based on the operation report and the rule file.

[0069] The operation report is as Figure 4 shown. The synchronization operations based on the operation report mainly include the following aspects.

[0070] If there are block addition or deletion operations in the operation report, such as Figure 2 the deletion of the function block shown in it, the deletion operation only needs to determine the ID of the block to be deleted and find the block with the corresponding ID in the target user program and delete it.

[0071] If the operation report has an operation of adding a function block, then obtain the ID and block type of the new block and add them to the corresponding position.

[0072] It should be noted that the addition or deletion of blocks does not necessarily change the wiring. During the project implementation process, input / output modules may be added to view the real-time values when debugging the user program.

[0073] If the operation report records the addition and deletion flags of the wiring and marks the positions at both ends of the wiring, that is, the input / output relationship of the current connection line, which may be from function block to function block, or from function block to input block or output block, then add or delete the corresponding wiring.

[0074] If the basic parameters of the function block are modified, after identifying the change by searching the control system software configuration log, determine the modification item according to the ID of the function block and the value of the parameter. As Figure 5 shown, filter out the logs with the operation object being "user program", and then determine the tag number of the operation. The content of the tag number column in the configuration log is the specific function block ID in the user program operation, and the subsequent "attribute", "old value", and "new value" are the content of the modification item.

[0075] If the input / output tag number is modified, then find the tag number naming of the corresponding control station based on the rule file for replacement. For example Figure 2 shown, the input tag number of the source control station is Z1_0000_1.VALUE, while the input tag number of the target control station is Z2_0000_1_VALUE. Synchronization based on the rule file is from "Z1*" to "Z2*".

[0076] In some implementation manners, after the engineering personnel generate the FBD user program of the target control station using the rule file and make content adjustments to the reference control station during the function debugging process, the engineering personnel do not need to open the corresponding user programs under all control stations to make the same modifications. They can update the target control station by comparing the difference items with one key.

[0077] Before synchronization, verify whether synchronization can be performed. If most of the logic is found to be different through comparison, synchronization cannot be performed. After determining that synchronization is possible, perform the deletion operation first to ensure the consistency of the function block IDs.

[0078] It should be noted that the user program cannot be synchronized in the following situations:

[0079] 1) After the user program of the reference control station is modified, there are errors in the user program writing or necessary inputs and outputs are missing.

[0080] 2) When the reference control station and the target control station are synchronized, the rule file cannot match the control station naming.

[0081] 3) The function block IDs and function block types of the user programs of the reference control station and the target control station cannot be matched, and the modification information cannot be traced back according to the configuration log, which belongs to an untraceable modification.

[0082] In some embodiments, synchronizing the user program includes synchronizing based on the priority of the difference items.

[0083] Synchronizing according to the priority can avoid the disorder of the function module and ID matching of the user program after synchronization.

[0084] The priorities from high to low are deleting function blocks, adding function blocks, modifying connections, modifying the built-in parameters of function blocks, and moving the positions of function blocks. Modifying connections includes adding connections, deleting connections, or changing one end of a connection.

[0085] Since function blocks are deleted or the block layout is changed, the deletion operation should be the highest-priority operation during the synchronization process.

[0086] If the operation of adding function blocks is performed before deleting function blocks, the function block ID of the added function block cannot be matched with the function block ID in the reference user program. For example, if there are 3 function blocks in the reference user program and their IDs are P001, P002, and P003, the correct operation is to first delete P002 and then add a function block with the ID still P002. If the operation of adding function blocks is performed first and the newly added function block is P004, subsequent synchronization operations will be disordered and synchronization cannot be performed.

[0087] In some embodiments, since function blocks have type and parameter information, while input / output blocks only have name characteristics and the names are different under different stations, if a user adds 3 input / output blocks at the same time, the input / output blocks of the source user program cannot be matched and synchronized with those of the target user program one by one. To solve this problem, during the implementation process, all original input / output blocks will be deleted, the input / output connections of function blocks will be traversed, input / output blocks will be regenerated, and renamed according to the rule file to complete the synchronization.

[0088] Modifying the connection line and modifying the built-in parameters of the function block have a lower priority and do not involve modifying the function block ID. Moving the position of the function block does not change the function block ID.

[0089] It should be noted that during the execution of function block synchronization, it is necessary to ensure that the function block IDs match.

[0090] It should be noted that: in other embodiments, the steps of the corresponding methods are not necessarily executed in the order shown and described in this specification. In some other embodiments, the steps included in the method may be more or fewer than those described in this specification. In addition, a single step described in this specification may be decomposed into multiple steps for description in other embodiments; and multiple steps described in this specification may also be combined into a single step for description in other embodiments.

[0091] Each embodiment in this specification is described in a progressive manner. For the same or similar parts between the embodiments, reference can be made to each other. The key point of each embodiment is to illustrate the differences from other embodiments. In particular, for the system or system embodiments, since they are basically similar to the method embodiments, the description is relatively simple. For the relevant parts, reference can be made to the partial description of the method embodiments. The systems and system embodiments described above are merely illustrative, and some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art can understand and implement it without creative efforts.

Claims

1. A method for batch generation and synchronization of FBD user programs based on difference items, characterized in that: include: S1, identifying the naming rule differences between the reference control station and the target control station and configuring the rule file; S2, generating an FBD user program template from the reference control station FBD user program, and generating an FBD user program from the target control station based on the rule file and the FBD user program template; S3, if the FBD user program of the reference control station changes, identify the difference items with the original FBD user program of the target control station; S4, generating an operation report based on the difference items; S5, synchronize the FBD user program based on the operation report and rule file.

2. A method for batch generation and synchronization of FBD user programs based on difference items according to claim 1, characterized in that: The rule file at least includes user program name rules, user program description rules, user program bit number input and output rules, and function block naming rules.

3. A method for batch generation and synchronization of FBD user programs based on difference items according to claim 2, characterized in that: The generating of the target control station FBD user program based on the rule file specifically includes replacing the input block name, output block name and function block name of the reference control station FBD user program with wildcards based on the rule file.

4. The method for batch generation and synchronization of FBD user programs based on difference items according to claim 1, characterized in that: The step S3, if the FBD user program of the reference control station is changed, then the difference items are identified with the original FBD user program of the target control station, specifically including: S31, identifying the number of blocks of the original FBD user program of the target controller and performing a block number comparison; S32, identifying the connection relationship between the function block, the input block and the output block to compare the connection information; S33, identifying the function block ID and the corresponding function block type, thereby performing a comparison between the function block ID and the type; S34, query the configuration log to determine whether the internal parameters of the FBD function block have changed, and verify whether the differences in the user program are recorded in the configuration log. If there are records in the configuration log, perform FBD user program synchronization confirmation. If no records are found in the configuration log, prompts are given based on the detected changes for manual confirmation.

5. The method for batch generation and synchronization of FBD user programs based on difference items according to claim 1, characterized in that: The operation report includes function block addition and deletion operations, connection modification addition and deletion operations, function block basic parameter modification and input and output bit number change.

6. A method for batch generation and synchronization of FBD user programs based on difference items according to claim 5, characterized in that: The FBD user program synchronization based on the operation report and the rule file includes: If there are function block addition and deletion operations in the operation report, If it is a function block deletion operation, determine the ID of the function block to be deleted, find the function block with the corresponding ID in the target user program and delete it. If a new operation is added to a function block, the block type and number of the new function block are obtained and added to the corresponding position of the target FBD user program; If there are connection modification, addition, or deletion operations in the operation report, the positions of both ends of the connection will be marked, and new connections or deletions will be made accordingly; If there are input block and output block bit number change operations in the operation report, the bit number of the target control station is replaced based on the rule file; If the basic parameters of the function block are modified, the modification items are determined based on the ID of the function block and the value of the parameters.

7. A method for batch generation and synchronization of FBD user programs based on difference items according to claim 6, characterized in that: The FBD user program synchronization also includes synchronization based on the priority of the difference items, wherein the priority of the difference items from high to low is deleting function blocks, adding function blocks, adding and deleting connections, modifying function block built-in parameters and moving function blocks.

8. The method for batch generation and synchronization of FBD user programs based on difference items according to claim 4, characterized in that: The S3, if the FBD user program of the reference control station changes, identifies the difference items with the original FBD user program of the target control station, and also includes matching the input blocks and output blocks of the changed FBD user program of the reference control station with the input blocks and output blocks of the original FBD user program of the target control station one by one; if an input block or an output block is added or deleted, delete all the input blocks and output blocks of the original FBD user program of the target control station, traverse the input and output connections of the function blocks, regenerate the input blocks and output blocks, and rename them according to the rule file to complete the synchronization.

9. A FBD user program batch generation and synchronization device based on difference items, comprising: Rule configuration module, program generation module, difference comparison module and synchronization module, The rule configuration module is used to generate a rule file based on the naming difference between the reference control station and the target control station; The program generation module is used to generate the FBD user program of the target control station based on the rule file; The difference comparison module is used to compare the difference items between the adjusted benchmark FBD user program and the target FBD user program, and generate an operation report based on the rule file and the difference items. The synchronization module is used for performing synchronization based on the priority of the operation in the operation report.