Editing auxiliary method and device for ladder diagram programming

By determining two selection points in the ladder diagram editing interface and automatically identifying the quick editing type, the complex operation problem during the ladder diagram editing process is solved, and the rapid editing of connecting lines and element components is realized, the programming process is simplified, and the programming process is improved. Convenience and efficiency.

CN119126664APending Publication Date: 2024-12-13SHENZHEN LEAD CNC SYST +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411310044.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-19
Publication Date
2024-12-13

AI Technical Summary

Technical Problem

The traditional ladder diagram editing function is complex and tedious, lacking convenience, and it is difficult to meet customers' personalized needs, especially in the process of batch copying, deleting and programming of element components.

Method used

In the ladder editing interface, the editing process is simplified by determining two selection points, responding to user operations, automatically identifying and performing quick editing types to add connection lines or element components.

Benefits of technology

It realizes rapid editing of ladder diagrams, simplifies the programming process, and makes ladder diagram programming more convenient, fast and intuitive.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119126664A_ABST
    Figure CN119126664A_ABST
Patent Text Reader

Abstract

The invention discloses an editing auxiliary method and device for ladder diagram programming, and the method comprises the steps: firstly generating and displaying a ladder diagram editing interface, and then editing and displaying a ladder diagram in the ladder diagram editing interface in response to user operation. In the editing process, two selection points are determined on a ladder diagram currently displayed on a ladder diagram editing interface, and under the condition that the positions of the two selection points on the ladder diagram conform to a programming rule, a target quick editing type conforming to the positions of the two selection points on the ladder diagram is determined from a plurality of quick editing types; and on the basis of the target quick editing type and the positions of the two selection points on the ladder diagram, editing of adding connecting lines or element elements is carried out on the ladder diagram. The connecting lines and the elements of the ladder diagram can be quickly edited only by determining the two selection points in the ladder diagram editing interface, so that the ladder diagram programming process is simplified, and the ladder diagram editing efficiency 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 industrial control technology, and in particular to an editing auxiliary method and device for ladder diagram programming. Background Art

[0002] Programmable Logic Controller (PLC) is used to realize controller control in various industrial equipment, and the corresponding PLC software editing generally uses ladder diagram programming. The traditional ladder diagram editing function is single, the operation process is stereotyped, and the degree of freedom is low, which can no longer meet the needs of customers for multiple personalized functions. In the actual editing process of ladder diagram programming, it often involves batch copying and pasting of elements, batch deletion of elements, vertical line programming and vertical line deletion. The existing editing method can only insert elements through menus or drag and drop, which is complicated and cumbersome, and there are also operational problems such as difficulty in inserting elements in parallel. Summary of the invention

[0003] The main technical problem solved by the present invention is how to improve the convenience of ladder diagram editing.

[0004] According to a first aspect, an embodiment provides an editing assistance method for ladder diagram programming, comprising: Generate and display the ladder diagram editing interface; In response to user operations, the ladder diagram is edited and displayed in the ladder diagram editing interface, wherein: In response to a first operation of the user, determining two selection points on the ladder diagram currently displayed on the ladder diagram editing interface; In the case where the positions of the two selection points on the ladder diagram conform to the programming rules, determining a target quick edit type that the positions of the two selection points on the ladder diagram conform to from a plurality of quick edit types; wherein the quick edit type is used to add a connection line or an element component; Based on the target quick edit type and the positions of the two selection points on the ladder diagram, the ladder diagram is edited accordingly.

[0005] According to the second aspect, an embodiment provides a computer-readable storage medium, on which a computer program is stored. The computer program can be executed by a processor to implement the editing assistance method as described in the first aspect.

[0006] According to a third aspect, an embodiment provides an editing auxiliary device for ladder diagram programming, comprising: Display module, used to generate and display the ladder diagram editing interface; An operation execution module is used to edit and display the ladder diagram in the ladder diagram editing interface in response to user operations, wherein: In response to a first operation of the user, determining two selection points on the ladder diagram currently displayed on the ladder diagram editing interface; In the case where the positions of the two selection points on the ladder diagram conform to the programming rules, determining a target quick edit type that the positions of the two selection points on the ladder diagram conform to from a plurality of quick edit types; wherein the quick edit type is used to add a connection line or an element component; Based on the target quick edit type and the positions of the two selection points on the ladder diagram, the ladder diagram is edited accordingly.

[0007] According to the editing assistance method of the above embodiment, the connection lines and element components of the ladder diagram can be quickly edited by simply determining two selection points in the ladder diagram editing interface, thereby simplifying the ladder diagram programming process and making ladder diagram programming more convenient, faster and more intuitive. BRIEF DESCRIPTION OF THE DRAWINGS

[0008] Figure 1 A schematic diagram of an example structure of a ladder in a ladder diagram; Figure 2 A structural block diagram of an editing auxiliary device in an embodiment; Figure 3 A schematic diagram of a flow chart of an editing assistance method in an embodiment; Figure 4 A schematic diagram of adding connection lines to a parallel structure in an embodiment; Figure 5 A schematic diagram of adding a connection line across a first branch in an embodiment; Figure 6 A schematic diagram of adding a connection line to a second cross-branch in an embodiment; Figure 7 A schematic diagram of adding two elements to the front end of the parallel structure in one embodiment; Figure 8 A schematic diagram of adding two elements to the rear end of the parallel structure in one embodiment; Fig. 9 A schematic diagram of adding two elements across a branch in one embodiment; Fig.10 An example diagram of adding an element to a series structure in one embodiment; Fig.11 An example diagram of adding an element from a series structure to a parallel structure in one embodiment; Fig.12 An example diagram of adding an element from a parallel structure to a series structure in one embodiment; Fig.13 An example diagram of adding an element between two parallel structures in one embodiment; Fig.14 Determine a schematic diagram for a selection point that does not comply with programming rules in one embodiment; Fig.15 A schematic diagram of a flow chart of an editing assistance method for copying and pasting elements in an embodiment; Fig.16 A schematic diagram of a pasting connection method when adding a unit including multiple branches in an embodiment; Fig.17 A schematic diagram of a pasting connection method when adding a unit including a parallel structure in an embodiment; Fig.18 A schematic diagram of a paste connection method for adding a unit when the left busbar is used as the default copy destination in an embodiment; Fig.19 is a flow chart of an editing auxiliary method for element deletion in an embodiment; Fig. 20 A schematic diagram of a deletion implementation method when the element to be deleted is an element component in an embodiment; Fig.21 A schematic diagram of deleting a connection line when the connection line to be deleted is at the end of the first sub-branch in a parallel structure in an embodiment; Fig. 22 A schematic diagram of deleting a connection line when the connection line to be deleted is between two sub-branches in a parallel structure in an embodiment; Fig.23 This is a schematic diagram of deleting a connection line when the connection line to be deleted is at the end of the last sub-branch in a parallel structure in an embodiment. DETAILED DESCRIPTION

[0009] The present invention is further described in detail below by specific embodiments in conjunction with the accompanying drawings. Wherein similar elements in different embodiments adopt associated similar element numbers. In the following embodiments, many detailed descriptions are for making the present application better understood. However, those skilled in the art can easily recognize that some features can be omitted in different situations, or can be replaced by other elements, materials, methods. In some cases, some operations related to the present application are not shown or described in the specification, this is to avoid the core part of the present application being overwhelmed by too much description, and for those skilled in the art, it is not necessary to describe these related operations in detail, and they can fully understand the related operations according to the description in the specification and the general technical knowledge in the art.

[0010] In addition, the features, operations or characteristics described in the specification can be combined in any appropriate manner to form various implementations. At the same time, the steps or actions in the method description can also be interchanged or adjusted in a manner that is obvious to those skilled in the art. Therefore, the various sequences in the specification and the drawings are only for the purpose of clearly describing a certain embodiment and are not meant to be a required sequence, unless otherwise specified that a certain sequence must be followed.

[0011] The serial numbers assigned to the components herein, such as "first", "second", etc., are only used to distinguish the objects described and do not have any order or technical meaning. The "connection" and "coupling" mentioned in this application, unless otherwise specified, include direct and indirect connections (couplings).

[0012] Ladder diagram is a programming language for PLC. The ladder diagram language follows the form of relay control circuit. The ladder diagram is evolved from simplified symbols based on the commonly used relay and contactor logic control. It has the characteristics of image, intuitiveness, and practicality. It is easy for electrical technicians to accept and is currently the most used PLC programming language. The elements of the general ladder diagram include busbars, contacts, and coils. The busbars are the leftmost and rightmost vertical lines in the ladder diagram (left busbar and right busbar), which are used to identify the starting position (left busbar) and the end position (right busbar) of the circuit, similar to the positive and negative poles of the power supply in the circuit diagram. Contacts are used to identify electrical components such as switches, buttons, relay contacts, and contactor contacts in the electrical control schematic diagram. They are represented as conditions or input signals in the ladder diagram. Coils are used to correspond to relay coils, contactor coils, etc. in the electrical control schematic diagram, and are usually used to control external devices such as indicator lights, motors, etc. Coils represent output signals or action commands in ladder diagrams.

[0013] Please refer to Figure 1 , is a schematic diagram of an example structure of a rung in a ladder diagram, each ladder diagram includes at least one busbar (left busbar) and a rung (program segment), each rung (program segment) includes a main circuit and at least one output element (the output element can be a coil, a name element of another rung, or a busbar on the right), the main circuit is connected between the left busbar and an output element, and each main circuit includes at least one element. Figure 1 As shown, the main circuit is composed of element AAA-element BBB-element CCC-element FFF-element GGG-element HHH connected in series in sequence, and the output element connected to the main circuit is the right bus. Each element includes a connection front end and a connection rear end. In one embodiment, the ladder can also include a sub-branch, and the sub-branch includes at least one element connected in series, such as Figure 1As shown, it includes sub-branch 1 (element element DDD-element element EEE) and sub-branch 2 (element element III). The element element DDD-element element EEE of sub-branch 1 is connected in parallel with the element element BBB and element element CCC on the main circuit, and the element element III of sub-branch 2 is connected in parallel with the element element HHH on the main circuit. In one embodiment, the ladder can also include branch circuits. When a ladder includes at least two end positions (i.e., output elements), one end position is connected to the main circuit, and the other different end positions are respectively connected to a corresponding branch circuit. Figure 1 As shown, it includes branch 1 (element element JJJ-element element KKK) and branch 2 (element element LLL-element element MMM). Each branch includes at least one element. Each branch is composed of element elements connected in series in sequence.

[0014] In an embodiment of the present application, the connection lines and element components of the ladder diagram can be quickly edited by simply determining two selection points in the ladder diagram editing interface, thereby providing editing assistance for ladder diagram programming and simplifying the ladder diagram programming process, making ladder diagram programming more convenient, faster and more intuitive.

[0015] Embodiment 1: Please refer to Figure 2 , is a structural block diagram of an editing auxiliary device in an embodiment, and the editing auxiliary device 1 includes a display module 10 and an operation execution module 20. The display module 10 is used to generate and display a ladder diagram editing interface. The operation execution module 20 is used to edit and display the ladder diagram in the ladder diagram editing interface in response to user operations. In one embodiment, the display module includes a display screen or a display. In one embodiment, the operation execution module 20 obtains the user's operation or instruction through a computer input device, and the computer input device includes a keyboard, a mouse, a scanner, a handwriting tablet, a camera, a voice input device and / or a light pen.

[0016] Please refer to Figure 3 , is a flowchart of an editing assistance method in an embodiment. In one embodiment, the editing assistance method executed in the editing assistance device includes: Step 101, generate and display a ladder diagram editing interface.

[0017] Step 102, in response to user operation, edit and display the ladder diagram in the ladder diagram editing interface.

[0018] The ladder diagram editing interface is displayed and generated by the display module. In one embodiment, the ladder diagram stored in history is read and displayed in the ladder diagram editing interface. In one embodiment, the ladder diagram displayed in the ladder diagram editing interface is newly edited and generated.

[0019] Step 103 , in response to a first operation of the user, two selection points are determined on the ladder diagram currently displayed on the ladder diagram editing interface.

[0020] The user's first operation is obtained through the computer input device, and the operation execution module determines two selection points on the ladder diagram currently displayed on the ladder diagram editing interface in response to the user's first operation, and the two selection points are on the same rung. In one embodiment, the selection point is determined by moving the pointer with a mouse or typing the display interface coordinates through the keyboard. In one embodiment, the two selection points are identified by lighting up and / or adding identifiers. Among them, the added identifiers include dots, line segments or graphics. In one embodiment, the two selection points are identified by connecting arrow lines, the arrow end is the end point (the second selection point), and the non-arrow end is the starting point (the first selection point).

[0021] Step 104, when the positions of the two selection points on the ladder diagram meet the programming rules, determine the target quick edit type that the positions of the two selection points on the ladder diagram meet from multiple quick edit types; wherein the quick edit type is used to add connection lines or element components.

[0022] When the positions of the two selection points on the ladder diagram meet the programming rules, determine the target quick edit type that the positions of the two selection points on the ladder diagram meet from multiple quick edit types, where the quick edit type is used to add a connection line or an element component. The multiple quick edit types include a first quick edit type, a second quick edit type, and / or a third quick edit type. The first quick edit type includes an edit type for inserting a connection line, please refer to Figure 4 , Figure 5 and Figure 6 , which is an example diagram of inserting a connection line in an implementation. The second quick edit type includes an edit type for adding two element components, please refer to Figure 7 , Figure 8 and Fig. 9 , is an example diagram of adding two element components in one embodiment. The third quick edit type includes an edit type for adding an element component, please refer to Fig.10 , Fig.11 , Fig.12 and Fig.13 , which is an example diagram of adding an element component in an embodiment.

[0023] In this implementation, when the positions of the two selection points on the ladder diagram conform to the programming rules, the target quick edit type that the positions of the two selection points on the ladder diagram conform to is determined from a plurality of quick edit types, including: If two selection points are located on a parallel structure on the same branch of the same rung, and one selection point is located between two adjacent elements of one sub-branch of the parallel structure, and the other selection point is located between two adjacent elements of another sub-branch of the parallel structure (such as Figure 4 Or, if the two selection points are located on two parallel branches of the same ladder, and one selection point is located between two adjacent elements of one branch, and the other selection point is located between two adjacent elements of the other branch (such as Figure 5 and Figure 6 As shown), the first quick edit type is determined as the target quick edit type that the positions of the two selection points on the ladder diagram conform to.

[0024] If two selection points are located on a parallel structure on the same branch of the same ladder, and one selection point is located at the front end of a sub-branch of the parallel structure, and the other selection point is located at the front end of another sub-branch of the parallel structure (such as Figure 7 Or, if two selection points are located on a parallel structure on the same branch of the same ladder, and one selection point is located at the rear end of one sub-branch of the parallel structure, and the other selection point is located at the rear end of another sub-branch of the parallel structure (such as Figure 8 Or, if the two selection points are located on two parallel branches of the same ladder, and one selection point is located at the front end of one branch and the other selection point is located at the front end of the other branch (as shown in Fig. 9 As shown), the second quick edit type is determined as the target quick edit type that the positions of the two selection points on the ladder diagram conform to; In the case where the target quick edit type that the positions of the two selection points on the ladder diagram conform to is not the first quick edit type and the second quick edit type, the target quick edit type that the positions of the two selection points on the ladder diagram conform to is the third quick edit type. The positions of the two selection points that conform to the third quick edit type include: The two selection points are located in a series structure on the same branch of the same ladder, and there is at least one element between the two selection points (such as Fig.10 ); two selection points are located on different branches of the same ladder, one of which is on a sub-branch of a parallel structure, and the other is not on the sub-branch of the parallel structure and is on a series branch that includes at least one element between the parallel structure (such as Fig.11 and Fig.12 As shown in the figure); the two selection points are located on the sub-branches of different parallel structures of the same ladder (such as Fig.13 As shown), and at least one element is included between two different parallel structures.

[0025] Step 105 , based on the target quick edit type and the positions of the two selection points on the ladder diagram, edit the ladder diagram accordingly.

[0026] Based on the target quick edit type and the location of the two selection points on the ladder diagram, edit the ladder diagram accordingly, including one or more of the following: When the target quick edit type is the first quick edit type, a connection line is added based on the positions of the two selection points on the ladder diagram. The two ends of the connection line are the positions of the two selection points on the ladder diagram, such as Figure 4 , Figure 5 and Figure 6 shown.

[0027] When the target quick edit type is the second quick edit type, a parallel structure consisting of two element components is added to the ladder diagram based on the positions of the two selection points on the ladder diagram, wherein if the two selection points are at the front end, a parallel structure consisting of two element components is added to the front end, and if the two selection points are at the rear end, a parallel structure consisting of two element components is added to the rear end, such as Figure 7 and Figure 8 shown.

[0028] When the target quick edit type is the third quick edit type, an element component is added to the ladder diagram based on the positions of the two selection points on the ladder diagram, and the two ends of the element component are respectively connected to the positions of the two selection points on the ladder diagram, such as Fig.10 , Fig.11 , Fig.12 and Fig.13 shown.

[0029] In order to facilitate the understanding of the programming rules involved in this embodiment, the following examples are given of situations that do not comply with the programming rules. Please refer to Fig.14 , is a schematic diagram for determining a selection point that does not conform to programming rules in an embodiment, specifically including one or more of the following: If two selection points are located in a series structure on the same branch of the same ladder, the elements adjacent to the left and right of the two selection points are the same, such as Fig.14 14-1 in FIG. 14-1; if two selection points are located in a series structure on the same branch of the same ladder, the branch between the two selection points includes at least one sub-branch connection point and / or branch connection point, such as Fig.14 14-2 and 14-3 in FIG. 14-2; if the two selection points are located on different parallel structures of the same branch cascade of the same ladder, and there is no element between the two selection points, such as Fig.14 14-4 and 14-5 in FIG. 14-4; if the two selection points are located on different parallel structures on the same branch of the same ladder, and there are other branches between the two selection points, such as Fig.14 As shown in 14-6; if the two selection points are located on different branches of the same ladder, and there are other branches between the two selection points, such as Fig.14 Otherwise, it complies with the programming rules.

[0030] The following examples illustrate situations that meet programming rules, including one or more of the following: If two selection points are located on a parallel structure on the same branch of the same rung, and one selection point is located between two adjacent elements of one sub-branch of the parallel structure, and the other selection point is located between two adjacent elements of another sub-branch of the parallel structure (such as Figure 4 Or, if the two selection points are located on two parallel branches of the same ladder, and one selection point is located between two adjacent elements of one branch, and the other selection point is located between two adjacent elements of the other branch (such as Figure 5 as shown).

[0031] If two selection points are located on a parallel structure on the same branch of the same ladder, and one selection point is located at the front end of a sub-branch of the parallel structure, and the other selection point is located at the front end of another sub-branch of the parallel structure (such as Figure 7 or, if the two selection points are located in a parallel structure on the same branch of the same ladder, and one selection point is located at the rear end of a sub-branch of the parallel structure, and the other selection point is located at the rear end of another sub-branch of the parallel structure (such as Figure 8 Or, if the two selection points are located on two parallel branches of the same ladder, and one selection point is located at the front end of one branch and the other selection point is located at the front end of the other branch (as shown in Fig. 9 shown); Two selection points are located in a series structure on the same branch of the same ladder, and there is at least one element between the two selection points (such as Fig.10 As shown in ); two selection points are located on the same branch of the same rung, and one selection point is between two adjacent elements of a sub-branch of a parallel structure, and the other selection point is not located on the parallel structure (such as Fig.11 and Fig.12 As shown in ); two selection points are located on the same branch of the same ladder, and one selection point is on a sub-branch of a parallel structure, and the other selection point is on a sub-branch of another parallel structure (such as Fig.13 as shown).

[0032] In an embodiment of the present application, when a new element component is added after the editing assistance method is executed, the editing assistance method further includes: The added element component is an element component with empty attributes, and it is necessary to edit the element component with empty attributes in response to the user's second operation. Editing the added element component includes defining the type, name and / or parameters of the element component. The type of element component includes contacts, coils and function blocks. The function blocks are used to implement preset logical operations and / or data processing functions. In one embodiment, the second operation is input through a computer input device, for example, by selecting an empty attribute element component to be edited through a mouse pointer, image coordinates or a touch screen, and directly calling the historically stored element component attributes in a pre-set element component database to load them into the element component currently to be edited.

[0033] Please refer to Fig.15 , is a flowchart of an editing assistance method for copying and pasting elements in an embodiment. In an embodiment of the present application, an editing assistance method for copying and pasting elements is also included, which specifically includes: Step 201, select an additional unit.

[0034] In response to the user's third operation, the added unit to be copied is determined on the ladder diagram currently displayed in the ladder diagram editing interface, wherein the added unit includes at least one element component. In one embodiment, the third operation includes selecting the element component by framing or clicking with a mouse pointer, selecting the element component by selecting the element component name or number, and / or selecting the element original by multi-touch on the touch screen. In one embodiment, the element of the added unit is marked and displayed on the original ladder diagram by lighting up or changing the color.

[0035] Step 202, execute the copy instruction.

[0036] After confirming each element of the added unit, execute the copy command by selecting it from the tool menu bar or using the keyboard shortcut key combination, and retain the connection relationship between each element of the added unit on the original ladder diagram when executing the copy command.

[0037] Step 203, determine the copy destination.

[0038] In response to the fourth operation of the user, a copy destination is determined on the ladder diagram currently displayed in the ladder diagram editing interface. In one embodiment, an element component on the ladder diagram can be used as a copy destination, and the copy destination is used to set a connection base point when adding a unit copy. In one embodiment, when step 203 is not performed, that is, when the copy destination is not selected, the left bus is used as the default copy destination.

[0039] Step 204, performing a paste operation.

[0040] Please refer to Fig.16 and Fig.17, are schematic diagrams of a paste connection method when the added unit includes multiple branches and a parallel structure in an embodiment, in response to the user's paste operation, the added unit is displayed on the ladder diagram editing interface, and an automatic connection between the added unit and the copy destination is established, specifically including: Based on the relationship between the position of the added unit before copying in the ladder diagram and the copy destination, a connection method for copying the added unit to the copy destination is determined, and the added unit is copied to the copy destination in the determined connection method, specifically including: If the added unit before copying and the copy destination are on different branches of the same ladder, the front end of the added unit is connected to the copy destination and copied. Fig.16 As shown, the selected adding units are element element CCC, element element DDD, element element EEE, element element GGG and element element III, which are on the same level but different branches as the determined copy destination (element element III). The adding unit will be connected to the rear connection end of element element III.

[0041] If the added unit before copying and the copy destination are on the same branch of the same ladder, the added unit will be copied to the copy destination in parallel with the copy destination. Fig.17 As shown, the selected added units are element component CCC, element component DDD and element component HHH, and their structure is that element component CCC and element component DDD are connected in series and then connected in parallel with element component HHH, and are connected in series with the copy destination (element component EEE). After pasting, the added unit will be connected in parallel to element component EEE.

[0042] Please refer to Fig.18 , is a schematic diagram of a paste connection method for adding a unit when the left bus is used as the default copy destination in an embodiment. When the copy destination is not determined in step 203, the left bus is used as the copy destination, and each element component of the added unit is connected to the left bus. In one embodiment, the paste operation includes executing a paste instruction by selecting from a tool menu bar or by using a keyboard shortcut combination key.

[0043] Please refer to Fig.19 , is a flowchart of an editing assistance method for element deletion in an embodiment. In an embodiment of the present application, an editing assistance method for element component deletion is also included, which specifically includes: Step 301, select the element to be deleted.

[0044] In response to the user's fifth operation, at least one element component or connecting line is determined on the ladder diagram currently displayed in the ladder diagram editing interface as an element to be deleted. In one embodiment, the element to be deleted is marked and displayed on the original ladder diagram by lighting up or changing color.

[0045] Step 302, execute the deletion operation.

[0046] In response to the sixth operation performed by the user, the determined element or connecting line is deleted, and when it is determined that the element to be deleted is an element, the two ends of the deleted element are connected by a connecting line after the element is deleted, and when the connecting line is deleted, the connecting line is directly deleted. In one embodiment, the deletion operation includes executing the deletion command by selecting the tool menu bar and or the keyboard shortcut key combination.

[0047] Please refer to Fig. 20 , is a schematic diagram of a deletion implementation method when the element to be deleted is an element element in an embodiment, directly deleting the elements to be deleted (element element BBB, element element CCC, element element DDD, element element EEE, element element NNN, element element HHH, element element III and element element LLL), and connecting the two ends of the deleted element element with a connecting line.

[0048] Please refer to Fig.21 , Fig. 22 and Fig.23 , respectively, are schematic diagrams of deleting a connection line when the connection line to be deleted is at the end of the first sub-branch, between two sub-branches, and at the end of the last sub-branch in a parallel structure in an embodiment.

[0049] The editing assistance method disclosed in the embodiment of the present application first generates and displays a ladder diagram editing interface, and then edits and displays the ladder diagram in the ladder diagram editing interface in response to user operations. During the editing process, two selection points are first determined on the ladder diagram currently displayed in the ladder diagram editing interface, and when the positions of the two selection points on the ladder diagram meet the programming rules, the target quick editing type that the positions of the two selection points on the ladder diagram meet is determined from multiple quick editing types, and then based on the target quick editing type and the positions of the two selection points on the ladder diagram, the ladder diagram is edited by adding connecting lines or element components. Since only two selection points need to be determined in the ladder diagram editing interface to achieve quick editing of the connecting lines and element components of the ladder diagram, the ladder diagram programming process is simplified and the ladder diagram editing efficiency is improved.

[0050] Those skilled in the art will appreciate that all or part of the functions of the various methods in the above-mentioned embodiments can be implemented by hardware or by computer programs. When all or part of the functions in the above-mentioned embodiments are implemented by computer programs, the program can be stored in a computer-readable storage medium, and the storage medium can include: read-only memory, random access memory, disk, optical disk, hard disk, etc., and the program is executed by a computer to implement the above-mentioned functions. For example, the program is stored in the memory of the device, and when the program in the memory is executed by the processor, all or part of the above-mentioned functions can be implemented. In addition, when all or part of the functions in the above-mentioned embodiments are implemented by computer programs, the program can also be stored in a storage medium such as a server, another computer, disk, optical disk, flash disk or mobile hard disk, and can be downloaded or copied and saved in the memory of the local device, or the system of the local device is updated, and when the program in the memory is executed by the processor, all or part of the functions in the above-mentioned embodiments can be implemented.

[0051] The above specific examples are used to illustrate the present invention, which is only used to help understand the present invention and is not intended to limit the present invention. For those skilled in the art, according to the concept of the present invention, some simple deductions, modifications or substitutions can be made.

Claims

1. An editing assistance method for ladder diagram programming, characterized in that: include: Generate and display the ladder diagram editing interface; In response to user operations, the ladder diagram is edited and displayed in the ladder diagram editing interface, wherein: In response to a first operation of the user, determining two selection points on the ladder diagram currently displayed on the ladder diagram editing interface; In the case where the positions of the two selection points on the ladder diagram conform to the programming rules, determining a target quick edit type that the positions of the two selection points on the ladder diagram conform to from a plurality of quick edit types; wherein the quick edit type is used to add a connection line or an element component; Based on the target quick edit type and the positions of the two selection points on the ladder diagram, the ladder diagram is edited accordingly.

2. The editing assistance method according to claim 1, characterized in that: The plurality of quick edit types include one or more of the following: a first quick edit type, a second quick edit type, and a third quick edit type; the first quick edit type includes an edit type for inserting a connecting line; the second quick edit type includes an edit type for adding two element components; the third quick edit type includes an edit type for adding one element component; In the case where the positions of the two selection points on the ladder diagram conform to programming rules, determining a target quick edit type conforming to the positions of the two selection points on the ladder diagram from a plurality of quick edit types comprises one or more of the following: If the two selection points are located on a parallel structure on the same branch of the same ladder, and one selection point is located between two adjacent elements of a sub-branch of the parallel structure, and the other selection point is located between two adjacent elements of another sub-branch of the parallel structure; or, if the two selection points are located on two parallel branches of the same ladder, and one selection point is located between two adjacent elements of one branch, and the other selection point is located between two adjacent elements of another branch, then the first shortcut editing type is determined as the target shortcut editing type that the positions of the two selection points on the ladder diagram correspond to; If the two selection points are located on a parallel structure on the same branch of the same rung, and one selection point is located at the front end of a sub-branch of the parallel structure, and the other selection point is located at the front end of another sub-branch of the parallel structure; or, if the two selection points are located on a parallel structure on the same branch of the same rung, and one selection point is located at the rear end of a sub-branch of the parallel structure, and the other selection point is located at the rear end of another sub-branch of the parallel structure; or, if the two selection points are located on two parallel branches of the same rung, respectively, and one selection point is located at the front end of one of the branches, and the other selection point is located at the front end of the other branch, then the second quick edit type is determined as the target quick edit type that the positions of the two selection points on the ladder diagram correspond to; When the target quick edit type conforming to the positions of the two selection points on the ladder diagram is not the first quick edit type and the second quick edit type, the target quick edit type conforming to the positions of the two selection points on the ladder diagram is the third quick edit type.

3. The editing assistance method according to claim 2, characterized in that: The positions of the two selection points that meet the third shortcut type include one or more of the following: The two selection points are located in a series structure on the same branch of the same step, and at least one element is included between the two selection points; The two selection points are located on different branches of the same ladder, wherein one of the selection points is on a sub-branch of a parallel structure, and the other selection point is not on the sub-branch of the parallel structure and is on a series branch including at least one of the elements between the parallel structure and the branch; The two selection points are located on sub-branches of different parallel structures of the same rung; wherein at least one element component is included between the two different parallel structures.

4. The editing assistance method according to claim 2, characterized in that: The step of editing the ladder diagram accordingly based on the target quick edit type and the positions of the two selection points on the ladder diagram includes one or more of the following: When the target quick edit type is the first quick edit type, a connecting line is added based on the positions of the two selection points on the ladder diagram, and the two ends of the connecting line are the positions of the two selection points on the ladder diagram respectively; In the case where the target quick edit type is the second quick edit type, a parallel structure consisting of two element components is added to the ladder diagram based on the positions of the two selection points on the ladder diagram, wherein if the two selection points are at the front end, a parallel structure consisting of two element components is added to the front end, and if the two selection points are at the rear end, a parallel structure consisting of two element components is added to the rear end; When the target quick edit type is the third quick edit type, an element component is added to the ladder diagram based on the positions of the two selection points on the ladder diagram, and both ends of the element component are respectively connected to the positions of the two selection points on the ladder diagram.

5. The editing assistance method according to claim 1, characterized in that: The situations that meet the programming rules include one or more of the following: If the two selection points are located on a parallel structure on the same branch of the same ladder, and one selection point is located between two adjacent elements of a sub-branch of the parallel structure, and the other selection point is located between two adjacent elements of another sub-branch of the parallel structure; or, if the two selection points are located on two parallel branches of the same ladder, and one selection point is located between two adjacent elements of one branch, and the other selection point is located between two adjacent elements of the other branch; If the two selection points are located in a parallel structure on the same branch of the same step, and one selection point is located at the front end of a sub-branch of the parallel structure, and the other selection point is located at the front end of another sub-branch of the parallel structure; or, if the two selection points are located in a parallel structure on the same branch of the same step, and one selection point is located at the rear end of a sub-branch of the parallel structure, and the other selection point is located at the rear end of another sub-branch of the parallel structure; or, if the two selection points are located on two parallel branches of the same step, and one selection point is located at the front end of one of the branches, and the other selection point is located at the front end of the other branch; The two selection points are located in a series structure on the same branch of the same step, and at least one element is included between the two selection points; The two selection points are located on the same branch of the same rung, and one selection point is between two adjacent elements of a sub-branch of a parallel structure, and the other selection point is not located on the parallel structure; The two selection points are located on the same branch of the same ladder, and one selection point is on a sub-branch of a parallel structure, and the other selection point is on a sub-branch of another parallel structure.

6. The editing assistance method according to claim 1, characterized in that: Also includes: The added element component is an element component with empty attributes; In response to a second operation by the user, editing the element component whose attribute is left blank; The element component whose editing attribute is empty includes: Define the type, name and / or parameter of the element component; the type of the element component includes contacts, coils and function blocks; the function block is used to implement preset logical operations and / or data processing functions.

7. The editing assistance method according to claim 1, characterized in that: Also includes: In response to a third operation of the user, determining an added unit to be copied on the ladder diagram currently displayed on the ladder diagram editing interface; the added unit includes at least one element component, and the connection relationship of each of the element components on the original ladder diagram is retained; In response to a fourth operation of the user, determining a copy destination on the ladder diagram currently displayed on the ladder diagram editing interface; Based on the relationship between the position of the added unit before copying in the ladder diagram and the copy destination, a connection method for copying the added unit to the copy destination is determined, and the added unit is copied to the copy destination in the determined connection method.

8. The editing assistance method according to claim 7, characterized in that: The determining, based on the relationship between the position of the added unit before copying in the ladder diagram and the copy destination, a connection mode for copying the added unit to the copy destination, and copying the added unit to the copy destination in the determined connection mode, comprises: When the added unit before the copying is on the same branch of the same ladder as the copying destination, the added unit is copied to the copying destination in parallel with the copying destination; And / or, when the adding unit before copying and the copy destination are on different branches of the same ladder, the front end of the adding unit is connected to the copy destination and copied.

9. The editing assistance method according to claim 1, characterized in that: Also includes: In response to a fifth operation of the user, determining at least one element component or connection line on the ladder diagram currently displayed on the ladder diagram editing interface; In response to a deletion operation performed by the user, the determined element component or the connecting line is deleted, and when it is determined that the element component is deleted, after the element component is deleted, two ends of the deleted element component are connected through a connecting line.

10. A computer program product comprising a computer program and / or instructions, characterized in that: When the computer program and / or the instructions are executed by a processor, the editing assistance method according to any one of claims 1 to 9 is implemented.

11. A computer-readable storage medium, characterized in that: The medium stores a computer program, which can be executed by a processor to implement the editing assistance method according to any one of claims 1 to 9.