A sequential control diagram group configuration editing and layout method, device, medium and equipment

By automatically associating and sorting elements in the sequential control diagram, the inefficiency caused by manually adjusting element positions in existing technologies is solved, enabling efficient editing and layout of sequential control diagram configurations and improving the programming efficiency of engineers.

CN119847060BActive Publication Date: 2025-12-09SUPCON TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411969406.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-30
Publication Date
2025-12-09
Estimated Expiration
2044-12-30

AI Technical Summary

Technical Problem

In existing technologies, the configuration of sequential control diagrams requires manual adjustment of element positions to improve the readability of execution logic, which is inefficient.

Method used

A method for editing sequential control diagram configurations is provided, which automatically associates elements and displays them graphically in the execution order, including verifying the legality of new operation events and logical adjustments, and sorting and laying out logical elements according to the logical execution order.

Benefits of technology

It improves configuration efficiency, reduces manual adjustment workload, and enhances the programming familiarity and work efficiency of engineers, especially providing more guidance for those with less experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119847060B_ABST
    Figure CN119847060B_ABST
Patent Text Reader

Abstract

The application provides a sequential control diagram configuration editing and layout method, device, medium and equipment, the method comprises the following steps: acquiring a sequential control diagram, and acquiring a new operation event based on the control logic required on site, and performing legality verification and logic adjustment on the sequential control diagram logic after the newly added operation event according to the sequential control diagram configuration rule; according to the completed sequential control diagram logic, all logic elements are sorted according to the logical execution sequence, and the logic elements are laid out according to the sorting result. The method can correctly guide the sequential control diagram configuration, realize the addition guidance of different elements, give correct guidance in the case of illegal execution logic, improve the configuration efficiency; and after completing the sequential control diagram logic configuration, the logic elements can be automatically laid out according to the logical execution sequence, manual configuration adjustment position is avoided, and the work efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of configuration software, and particularly relates to a sequential function chart (SFC) configuration editing and layout method, device, medium and equipment. BACKGROUND

[0002] In an industrial control system, as one of the main programming methods, a sequential function chart (SFC) is widely used in configuration. The SFC is also called a flow chart or a state transition chart, is a truly graphical programming language, is composed of steps and transition points, each transition point has a certain logic condition, is a functional specification language specially used for industrial sequential program control design, can completely describe the working process, function and characteristics of a control system, is an important tool for analyzing and designing a control program of an electrical control system. For a sequential control problem, no matter how complex the control logic is, the problem can be clearly expressed in a graphical manner.

[0003] However, the rules of SFC configuration are relatively complex, different elements have different execution conditions, some are executed in parallel, some are executed in selection, and some are executed in sequence, so a good configuration method can quickly guide an engineer to perform SFC programming. In the process of configuration of configuration software, sometimes the existing execution logic needs to be edited, at this time, the positions of the front, rear, left and right elements need to be adjusted to improve the readability of the execution logic. In the prior art, an operator needs to manually configure and manually adjust the positions, and the configuration efficiency is low. SUMMARY

[0004] Based on the above background, the purpose of the present application is to provide a method for automatically associating elements and graphically displaying in execution order when editing a sequential function chart (SFC) configuration.

[0005] To achieve the above purpose, the present application adopts the following technical solutions:

[0006] In a first aspect, the present application provides a sequential function chart (SFC) configuration editing and layout method, comprising,

[0007] obtaining a sequential function chart (SFC), and obtaining a new operation event based on a required control logic on site, and performing legality verification and logic adjustment on the SFC logic after the new operation event is added according to SFC configuration rules;

[0008] According to the completed SFC logic, all logic elements are sorted according to the logic execution order, and the logic elements are laid out according to the sorting result, comprising,

[0009] obtaining a starting step record S of a target sequential function chart (SFC), and recording the row and column numbers of the starting step record S as (0, 0);

[0010] Based on the current logical element Q i Based on the connection relationship R, obtain the next target logical element Q. i+1 Q i Row and column number notation

[0011] Let Q be (m, n). i+1 The row number is incremented by 1 based on the previous element, and the column number remains the same as the previous element; this gives us Q. i+1 After the element, according to Q i+1 The type of the element determines whether to continue or terminate the search;

[0012] Get the first element of the sub-branch The row and column numbers are denoted as (m+1, n+j); and according to Based on the connection relationships, obtain the next target logical element. Its line number is Add 1 to the base, column number follows Same; according to Different search processes are executed depending on the element type until all logical elements are traversed;

[0013] Calculate the coordinates of all logical elements to complete the logical element layout.

[0014] In a second aspect, the present invention also provides a sequential control diagram configuration editing and layout apparatus, the sequential control diagram configuration editing and layout apparatus comprising:

[0015] The information acquisition module is used to acquire the control diagram to be edited and the new operations corresponding to the on-site requirements;

[0016] The sequential control chart editing module is used to verify the legality of added operation events and to make logical adjustments to the sequential control chart based on the verification results.

[0017] The sequential control diagram layout module is used to sort all logical elements according to the logical execution order based on the completed sequential control diagram logic, and to lay out the logical elements according to the sorting result.

[0018] Thirdly, the present invention also provides a non-transitory computer-readable storage medium storing at least one instruction or at least one program, wherein the at least one instruction or at least one program is loaded and executed by a processor to implement the above-described sequential control diagram configuration editing and layout method.

[0019] Fourthly, the present invention also provides an electronic device, including a processor and the aforementioned non-transitory computer-readable storage medium.

[0020] The beneficial effects of this invention are as follows:

[0021] The SFC configuration method provided by the application comprises a guiding method and an automatic layout method.

[0022] The guiding method can correctly guide the SFC configuration, realize the addition guidance of different elements, and give correct guidance for the execution logic that is not legal, thereby improving the configuration efficiency.

[0023] The automatic layout method is to automatically layout the logic elements according to the execution logic sequence after completing the SFC logic configuration, without manually adjusting the display of the logic elements on the interface. In the configuration process, the layout of the SFC elements in the configuration software changes according to the change of the execution logic.

[0024] In the configuration process, if the engineering implementer is inexperienced, the method can more accurately guide the engineering implementer to quickly familiarize with the SFC programming, reduce the learning cost, and improve the work efficiency. BRIEF DESCRIPTION OF DRAWINGS

[0025] In order to more clearly illustrate the technical solutions in the application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or the prior art description. Obviously, the drawings in the following description are some embodiments of the application, and other drawings can be obtained by those skilled in the art without creative labor on the basis of these drawings.

[0026] Figure 1 The flowchart of the SFC configuration editing and layout method provided by the embodiment of the application;

[0027] Figure 2 The SFC editing execution logic flowchart provided by the embodiment of the application;

[0028] Figure 3 The SFC sorting execution logic flowchart provided by the embodiment of the application. DETAILED DESCRIPTION

[0029] In order to further understand the application, the preferred embodiments of the application will be described below in combination with the embodiments, but it should be understood that these descriptions are only for further illustrating the features and advantages of the application, and are not limitations on the claims of the application.

[0030] Embodiment one

[0031] Referring to Figure 1 The embodiment provides a SFC logic modification method applied to configuration software, comprising the following steps:

[0032] S1: Obtain the sequence control diagram, and obtain new operation events based on the control logic required by the field; edit the sequence control diagram after the new operation events are added according to the sequence control diagram configuration rules;

[0033] S2: According to the completed sequence control diagram logic, the sequence control diagram elements are laid out according to the logical execution order.

[0034] The sequence control diagram logic editing method in step S1 includes the following steps:

[0035] Step S101: Obtain the sequence control diagram and the operation events of the target user through the configuration software; that is, modify the original sequence control diagram logic through the obtained operation events, and the modification is based on the sequence control diagram configuration rules, such as: the upper step can only be connected with conversion, parallel branch or alternative junction; the lower step can only be connected with conversion, parallel junction or alternative branch; the upper conversion can only be connected with steps, alternative branches or parallel junctions; and the lower conversion can only be connected with steps, alternative junctions or parallel branches.

[0036] Step S102: According to the sequence control diagram configuration rule that one conversion condition corresponds to one execution step, verify the legality of the execution logic added by the received new operation events;

[0037] Step S103: If it is legal, accept the corresponding operation event to adjust the logic of the sequence control diagram, and display the sequence control diagram execution logic in order.

[0038] Step S104: If it is illegal, guide according to the operation event, and the guidance can be performed through a prompt. If the added element does not meet the sequence control diagram execution rule, the user is prompted that the element is not allowed to be added. The specific judgment rule is: except for the start step, each step needs to have a conversion condition in front of it; when the conversion condition is logical "true", the program goes to the next step for execution; if it is logical "false", the conversion needs to be scanned every control cycle. When the conversion condition is not met, the currently activated step will be executed every scanning cycle until the conversion condition is met, and the currently activated step is disabled and the next step is activated.

[0039] The operation events are obtained based on the control logic required by the field, and the operation events refer to the operations that the user may perform when editing the SFC, such as inserting, adding or deleting logic. Referring to Figure 2 , specifically:

[0040] (1) Inserting logic refers to adding new logic in the existing logic sequence, which may change the execution order of the original logic, that is, inserting new logic elements such as a new conversion condition or a step in the SFC, thereby changing the control flow. The specific operation is,

[0041] The target position of the inserted logic is obtained, such as inserting the execution logic between two transition conditions or between a transition condition and a step.

[0042] The inserted element adjusts the original logical execution relationship; for example, if the user inserts a new transition condition, the original logical execution relationship is deleted and a new logical execution relationship is established to ensure the correctness of the logic. For another example, if the user inserts a transition condition 2 between a transition condition 1 and a step 1, the original direct relationship (transition condition 1 -> step 1) needs to be replaced by a new logical execution relationship (transition condition 1 -> empty step -> transition condition 2 -> step 1), where the "empty step" is a missing logical element based on the logical execution rule.

[0043] (2) Adding logic means adding a new logical element or step in the existing program or process. In SFC, this may correspond to adding a new step or transition condition to extend the function of the program or handle new control cases, that is, adding logic is to add new functions or steps to the program. The specific operation is:

[0044] The last execution logic before the newly added logic is determined, and the continuity and legality of the logic are checked and maintained according to the sequence control diagram configuration rule. If the added logic is legal, it is accepted and adjusted, and if the added logic is illegal, the illegal addition is prompted according to the sequence control diagram configuration rule, and the legal and addable logic is given, such as "xx element" is not allowed to be added after "xx element" and / or "xx element" can be added after "xx element".

[0045] (3) Deleting logic removes the no longer needed logical elements from the SFC. If the user deletes a certain element from the execution logic, the completeness of the remaining logic is checked according to the sequence control diagram configuration rule. If it is legal, the deletion operation is performed, and if it is illegal, the user is prompted to supplement the missing transition condition according to the sequence control diagram configuration rule to ensure the legality of the logic and the correctness of the execution.

[0046] The above sequence control diagram configuration editing method ensures that any insertion, addition or deletion operation can be correctly processed when editing the SFC, and each operation of the user can be legally checked and guided by the system to avoid logical errors and potential running problems.

[0047] In step S2, the execution logic is displayed in sequence to improve the readability of the logic and reduce the interface layout workload of the engineering personnel. After completing the logic modification, or obtaining the target sequence control diagram that needs to be displayed, the logical elements are sorted according to the target sequence control diagram execution logic in rows and columns, and then the logical elements are laid out according to the sorting result, as shown in Figure 3 , including,

[0048] S201: Obtain the starting step record S of the target sequence control diagram, and record its row and column numbers as (0, 0); this is the first step in the sequence control diagram and also the starting point of the entire process.

[0049] S202: According to the connection relationship R of the current logical element Q i , obtain the next target logical element Q i+1 , where Q i , the row number of Q i+1 is +1 based on the row number of the previous element, and the column number is consistent with the previous element. The formula is as follows:

[0050]

[0051] After obtaining the Q i+1 element, different processes are executed according to the type of the Q i+1 element, including,

[0052] On the one hand, if the Q i+1 element is not a branch element, continue to execute S202, that is, find the next logical element and update its row and column numbers.

[0053] On the one hand, if the Q i+1 element is an end element, the search is terminated, indicating that the end of the process has been reached.

[0054] On the one hand, if the Q i+1 is a branch element, the sub-branches are traversed in turn, and the row and column numbers of the sub-branches are recorded as (m+1, n), (m+1, n+1)..., respectively. The formula for the sub-branches is as follows, where l represents the maximum order number of the sub-branches:

[0055]

[0056] S203: Obtain the first element of the sub-branch , and record its row and column numbers as (m+1, n+j); and according to the connection relationship of , obtain the next target logical element , whose row number is +1 based on the row number of , and the column number is consistent with . Among them,

[0057] If is not a branch closing element or an end element, continue to execute step S203 until the next connection element is a branch closing element or an end element.

[0058] If is a branch closing element or an end element, execute the following process according to the order number j of the current sub-branch:

[0059] (1) If the sub-branch order number j is 0, the row number is increased by 1 based on the last element , the column number is consistent with the last element, and the traversal of the current sub-branch is ended, the traversal of the new sub-branch is started, and step S203 is continued to be executed;

[0060] (2) If the sub-branch order number j is not 0, the row numbers of all sub-branch closed elements under the same branch element are compared, the maximum row number M of the closed elements is taken, and the row numbers of all sub-branch closed elements are updated to M, and the formula is as follows: If the current sub-branch order number j is 1, the traversal of the branch is ended, and step S202 is continued to be executed;

[0061] S204: Calculate the coordinates of the logical elements to complete the layout of the logical elements; After sorting, the width and height of each logical element are set to fixed values W and H, the fixed spacing of adjacent logical elements on the x-axis is denoted as d x , and the fixed spacing of adjacent logical elements on the y-axis is denoted as d y . According to the specific row and column numbers (m, n), the x-axis and y-axis coordinates of each logical element in the layout are calculated as x and y respectively, and the calculation formula is:

[0062] x = n*W + (n+1)*d x ;

[0063] y = m*H + (m+1)*d y

[0064] The above method flow can be realized by programming, for example, in PLC programming software, functions can be written to automatically execute these steps, thereby reducing the workload of engineers editing, manually sorting and labeling. When implemented, a graph traversal algorithm such as depth-first search (DFS) or breadth-first search (BFS) can be used to traverse the logical elements of the sequence control diagram, and the row and column numbers are updated according to the above rules. In this way, the logical elements of the sequence control diagram in the method can be automatically sorted and labeled with row and column numbers, thereby improving the readability and maintainability of the logic. The logical elements in the sequence control diagram can be correctly sorted and laid out according to the execution logic. By automatically processing branches and sub-branches, the workload of engineers can be reduced, and the readability and maintainability of the sequence control diagram can be improved. Finally, the coordinates of each logical element can be calculated according to its row and column numbers and fixed width and height and spacing, so that each element can be accurately placed on the graphical interface.

[0065] Embodiment Two

[0066] The embodiment two provides a SFC configuration editing and layout device in configuration software, the SFC configuration editing and layout device in configuration software comprises:

[0067] The information acquisition module is used to acquire the control diagram to be edited and the new operations corresponding to the on-site requirements;

[0068] The sequential control diagram editing module is used to verify the legality of added operation events according to the sequential control diagram configuration rules, and to make logical adjustments to the sequential control diagram based on the verification results;

[0069] The sequential control diagram layout module is used to sort all logical elements according to the logical execution order based on the completed sequential control diagram logic, and to lay out the logical elements according to the sorting result.

[0070] Example 3

[0071] This invention provides a non-transitory computer-readable storage medium storing at least one instruction or at least one program segment, which is loaded and executed by a processor to implement the following steps:

[0072] Obtain the sequential control diagram and acquire new operation events based on the control logic required on site. Edit the sequential control diagram logic according to the sequential control diagram configuration rules; including verifying the legality of the added execution logic based on the received operation events, and adjusting the sequential control diagram logic based on the verification results.

[0073] Based on the configured sequential control diagram logic, all logical elements are sorted according to the logical execution order. Then, based on the sorting result, the logical elements are laid out, including...

[0074] The starting step for obtaining the target sequence control chart is denoted as S, and its row and column numbers are denoted as (0, 0);

[0075] Based on the current logical element Q i Based on the connection relationship R, obtain the next target logical element Q. i+1 Q i Row and column number notation

[0076] Let Q be (m, n). i+1 The row number is incremented by 1 based on the previous element, and the column number remains the same as the previous element; this gives us Q. i+1 After the element, according to Q i+1 The type of the element determines whether to continue or terminate the search;

[0077] Get the first element of the sub-branch The row and column numbers are denoted as (m+1, n+j); and according to Based on the connection relationships, obtain the next target logical element. Its line number is Add 1 to the base, column number follows Same; according to The type of element performs different lookup procedures to traverse all logical elements.

[0078] Coordinates of all logical elements are calculated to complete the layout of the logical elements.

[0079] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by a computer program instructing related hardware, and the computer program can be stored in a non-volatile computer readable storage medium. When the computer program is executed, the computer program can include the processes of the above-mentioned embodiments of the methods. Any reference to memory, storage, databases, or other media in the embodiments provided by the present application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration but not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0080] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the above-mentioned division of functional units and modules is exemplified, and in actual application, the above-mentioned functions can be completed by different functional units and modules according to needs, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the above-described functions.

[0081] Embodiment four

[0082] The electronic device provided by the embodiment of the present application includes a processor and the non-transitory computer readable storage medium in the embodiment three of the present application.

[0083] The above-mentioned embodiments are only used to help understand the method of the present application and its core idea. It should be pointed out that for those of ordinary skill in the art, without departing from the principle of the present application, some improvements and modifications can be made to the present application, and these improvements and modifications also fall within the protection scope of the claims of the present application.

[0084] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used in the description herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used herein, the term "and / or" includes any and all combinations of one or more of the associated listed items.

[0085] It should be noted that some of the example embodiments are described as processes or methods depicted as flow diagrams. Although the flow diagrams describe the processes as a sequential process, many of the steps can be performed in parallel, concurrently or simultaneously. In addition, the order of the steps can be re-arranged. The processes can be terminated when their operations are completed, but can also have additional steps not included in the figure. The processes can correspond to methods, functions, procedures, subroutines, subprograms, etc.

Claims

1. A sequential control diagram configuration editing and layout method, characterized by, comprising, obtaining the control sequence diagram, and obtaining new operation events based on the control logic required by the field, and checking the legality of the logic of the control sequence diagram after the new operation events are added and adjusting the logic according to the configuration rules of the control sequence diagram; sorting all the logic elements according to the logical execution sequence based on the configured logic of the control sequence diagram, and arranging the logic elements according to the sorting result, comprising, obtaining the starting step note S of the target control sequence diagram, and recording the row and column numbers as (0, 0); According to the connection relationship R of the current logical element Q i , the next target logical element Q i+1 is obtained, wherein Q i is represented by (m, n), the row number of Q i+1 is +1 based on the last element, and the column number is consistent with the last element; after obtaining the Q i+1 element, according to the type of the Q i+1 element, the search is continued or terminated, and specifically includes, If Q i+1 If the element is not a branching element, continue to the next logical element and update the row and column numbers. If Q i+1 The element is an end element, terminate the search; If Q i+1 is a branch element, then it is traversed in turn according to the sub-branches, and the sub-branch row and column numbers are recorded in turn as (m+1, n), (m+1, n+1),..., (m+1, n+l), and the sub-branches are expressed by the formula as follows, where l represents the maximum order number of the sub-branches: Get the first element of the sub-branch The row and column numbers are denoted as (m+1, n+j); and according to the connection relationship, the next target logical element is obtained The row number of which is increased by 1 based on , and the column number is the same as ; according to the type of the element, different search processes are performed to traverse all logical elements; calculating the coordinates of all the logic elements to complete the layout of the logic elements.

2. The sequence chart configuration editing and layout method according to claim 1, wherein The logic adjustment includes inserting, adding and / or deleting logic elements.

3. The sequence chart configuration editing and layout method according to claim 2, wherein The insertion of the logic elements includes obtaining the target position for the insertion of the logic, and adjusting the original logical execution relationship by the inserted elements; the addition of the logic elements includes determining the last execution logic before the newly added logic, checking and maintaining the continuity and legality of the logic according to the configuration rules of the control sequence diagram, and if the added logic is legal, adjusting it, and if the added logic is illegal, prompting the illegal addition according to the configuration rules of the control sequence diagram, and giving the legal and addable logic; the deletion of the logic elements includes checking the integrity of the remaining logic according to the configuration rules of the control sequence diagram, and if it is legal, executing the deletion operation, and if it is illegal, prompting the user to supplement the missing conversion condition according to the configuration rules of the control sequence diagram.

4. The sequence chart configuration editing and layout method according to claim 1, wherein The according to The type of element performs different lookup procedures to traverse all logical elements including, If is a close element or an end element of a branch, if the sub-branch serial number j is 0, the line number is increased by 1 on the basis of the line number of the previous element , the column number is consistent with the previous element, and the traversal of the current sub-branch is ended and the traversal of a new sub-branch is started; if the sub-branch serial number j is not 0, the line numbers of all close elements of the sub-branches under the same branch element are compared, the maximum line number M of the close elements is taken, and the line numbers of all close elements of the sub-branches are updated to M, and the formula is as follows: If the current sub-branch serial number j is 1, the traversal of the branch is ended, and the next target logic element Q i is obtained according to the connection relationship R of the current logic element Q i+1 . If If the next logical element is not a branch close element or an end element, continue searching for the next logical element until the next connection element is a branch close element or an end element is obtained.

5. The sequence chart configuration editing and layout method according to claim 1, wherein The calculation of the coordinates of all the logic elements to complete the layout of the logic elements includes, setting the width and height of each logic element as fixed values W and H; The fixed interval of adjacent logical elements in the x-axis is set as d x The fixed interval of adjacent logical elements in the y-axis is set as d y ; According to the specific row and column numbers (m, n), the x-axis and y-axis coordinates of each logic element in the layout are calculated as x and y, respectively, and the calculation formula is: x = n*W + (n+1)*d x ; y = m*H + (m+1)*d y .

6. A sequential control diagram configuration editing and layout device, characterized by comprising: The control sequence diagram configuration editing and layout device is used to realize the control sequence diagram configuration editing and layout method according to any one of claims 1-5, comprising, an information acquisition module for acquiring the control sequence diagram to be edited and the new operation events corresponding to the field requirements; a control sequence diagram editing module for checking the legality of the operation event addition, and adjusting the logic of the control sequence diagram according to the checking result; a control sequence diagram layout module for sorting all the logic elements according to the logical execution sequence based on the configured logic of the control sequence diagram, and arranging the logic elements according to the sorting result. 7.A non-transitory computer-readable storage medium having stored therein at least one instruction or at least one piece of program, characterized in that, The at least one instruction or the at least one program is loaded and executed by the processor to realize the control sequence diagram configuration editing and layout method according to any one of claims 1-5.

8. An electronic device, comprising: It includes a processor and a non-transitory computer readable storage medium as claimed in claim 7. It includes a processor and a non-transitory computer readable storage medium as claimed in claim 7.

Citation Information

Patent Citations

  • Multi-node sequential control method based on SCADA system

    CN103279333A

  • PLC gradient diagram matrix editing display method

    CN104656543A