Method for assisting ladder diagram programming
The method automates step code management in ladder diagram programming for PLCs, addressing inefficiencies by enabling or disabling coding functions and ensuring sequential updates, thereby improving user efficiency.
Patent Information
- Application Number
- PCT/CN2024/083881
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2024-03-26
- Publication Date
- 2025-10-02
AI Technical Summary
Existing ladder diagram programming for programmable logic controllers (PLCs) is inefficient due to the need for manual addition and modification of step codes when networks are added, deleted, or modified, affecting user work efficiency.
A method that includes a step editing area with a toggle to enable or disable coding functions, automatically adding or adjusting step codes based on logical sequence positions, and replacing them with actual logical sequence codes during compilation.
Automatically manages step code additions and deletions, improving user efficiency by ensuring step codes are sequentially updated according to logical sequence positions, thus enhancing the programming process.
Smart Images

Figure CN2024083881_02102025_PF_FP_ABST
Abstract
Description
METHOD FOR ASSISTING LADDER DIAGRAM PROGRAMMINGTECHNICAL FIELD
[0001] The present disclosure relates to the technical field of automatic control, and in particular, relates to a method for assisting ladder diagram programming.BACKGROUND
[0002] When a user programs a programmable logic controller (PLC) using a ladder diagram programming tool, it is often necessary to divide the operation under control into several steps, and then the programming is separately undertaken in several networks. When editing a network, the user needs to write down the step codes in the network to make it easier to understand the relationship and logical sequence between the networks. In the case of a large number of networks, either when step codes are normally input or when the user adds or deletes networks and needs to modify the step codes accordingly, additional operations are caused to the user, affecting the work efficiency.SUMMARY
[0003] The present disclosure is intended to provide a method for assisting ladder diagram programming, capable of automatically adding or adjusting step codes during ladder diagram programming, and improving work efficiency.
[0004] The method for assisting ladder diagram programming includes:
[0005] S10: setting a step editing area displayable in a ladder diagram programming interface, wherein the step editing area includes a function toggle for enabling or disabling a coding function;
[0006] S20: when a user creates a network, adding automatically a step code to the created network based on a logical sequence position of the created network in the case that the coding function is enabled by the user, and modifying the step code of the network with the coding function enabled after the created network at the same time, such that the step code of the network with the coding function enabled is increased sequentially in accordance with the logical sequence position in the case that the network with the coding function enabled exists after the created network;
[0007] S30: when the user deletes the network with the coding function enabled or disables the coding function of the network, modifying the step code of the network with the coding function enabled after the deleted network or the network with the coding function disabled, such that the step code of the network with the coding function enabled is increased sequentially in accordance with the logical sequence position; and
[0008] S40: replacing the step code with an actual logical sequence code during compilation.
[0009] The method for assisting ladder diagram programming according to the present disclosure provides the user with a step editing area that can be displayed in the ladder diagram programming interface, and the user can enable or disable the coding function in the step editing area. After the coding function is enabled, the step codes of networks are automatically added and deleted when creating and deleting networks, and the step codes of following networks are adjusted so that the step codes of networks with the coding function enabled are sequentially increased in accordance with the logical sequence position.
[0010] In some exemplary embodiments, S20 includes:
[0011] S21: creating node data corresponding to the created network, wherein the node data is configured to store a node name, the step code, the actual logical sequence code, and a next node pointer, the node name being automatically generated when the node data is created;
[0012] S22: determining whether the network with the coding function enabled exists prior to the created the network;
[0013] in response to determining that the network with the coding function enabled does not exist, proceeding to S23: saving a step code to the node data, and saving a numeral 1 as the actual logical sequence code to the node data;
[0014] in response to determining that the network with the coding function enabled exists, proceeding to S24: reading the node data of a previous network with the coding function enabled, adding 1 to the step code and the actual logical sequence code of the previous network with the coding function enabled respectively as the step code and the actual logical sequence code of the created network, and saving the step code and the actual logical sequence code to the node data of the created network; and taking the node name of the created network as the next node pointer of the previous network with the coding function enabled, and saving the next node pointer to the node data of the previous network with the coding function enabled;
[0015] S25: determining whether the network with the coding function enabled exists after the created network; and
[0016] in response to determining that the network with the coding function enabled exists, proceeding to S26: modifying the node data of the network with the coding function enabled after the created network, and adding 1 to the step code and the actual logical sequence code of the network with the coding function enabled after the created network respectively; and taking the node name of the first network with the coding function enabled after created the network as the next node pointer of the created network, and saving the next node pointer the node data of the created network.
[0017] In some exemplary embodiments, S30 includes:
[0018] S31: traversing the node data of the network to find the node data of the deleted network or the network with the coding function disabled;
[0019] S32: deleting the found node data;
[0020] S33: determining whether the network with the coding function enabled exists after the node data of the deleted network or of the network with the coding function disabled; and
[0021] in response to determining that the network with the coding function enabled exists, proceeding to S34: subtracting 1 from the step code and the actual logical sequence code of the network with the coding function enabled after the deleted network or the network with the coding function disabled respectively; and taking the node name of the first network with the coding function enabled after the deleted network or the network with the coding function disabled as the next node pointer of the network with the coding function enabled before the deleted network or the network with the coding function disabled, and saving the next node pointer to the node data of the network with the coding function enabled before the deleted network or the network with the coding function disabled .
[0022] In some exemplary embodiments, S20 further includes:
[0023] S27: taking the node name of the first network with the coding function enabled as the node pointer of the last network with the coding function enabled, and saving the node pointer to the node data of the last network with the coding function enabled.
[0024] In some exemplary embodiments, the step editing area includes a text box for displaying and entering the step code of the network.
[0025] In some exemplary embodiments, S23 includes the following steps:
[0026] S231: determining whether the user enters the step code in the text box;
[0027] in response to determining that the user enters the step code, proceeding to S232: saving the step code entered by the user to the node data;
[0028] in response to determining that the user does not enter the step code, proceeding to S233: saving a predefined step code to the node data; and
[0029] S234: saving the numeral 1 as an actual logical sequence code to the node data.
[0030] In some exemplary embodiments, the node data is also used to store a step ID and a network ID, wherein the step ID and the network ID are automatically generated when the node data is created, each step ID is globally unique, and the network ID is a name of the network corresponding to the node data.
[0031] In some exemplary embodiments, the method further includes:
[0032] S50: setting a display toggle in the ladder diagram programming interface, allowing the user to operate the display toggle to display or hide the step editing area.
[0033] In some exemplary embodiments, S10 specifically includes providing the step editing area in a title bar of each network, wherein the function toggle of the step editing area is configured to control to enable or disable the coding function of the network corresponding to the function toggle.
[0034] In some exemplary embodiments, S40 includes:
[0035] S41: reading the step code of the network during compilation;
[0036] S42: finding the actual logical sequence code in the node data in which the step code is saved; and
[0037] S43: replacing the step code with the actual logical sequence code.BRIEF DESCRIPTION OF THE DRAWINGS
[0038] The accompanying drawings are merely for schematic and illustrative description and explanation of the present disclosure, instead of limiting the scope of the present disclosure.
[0039] FIG. 1 is a flowchart of a method for assisting ladder diagram programming according to an exemplary embodiment of the present disclosure;
[0040] FIG. 2 is a schematic diagram of an implementation of the method for assisting ladder diagram programming;
[0041] FIG. 3 is a schematic diagram of another implementation of the method for assisting ladder diagram programming;
[0042] FIG. 4 is a flowchart of some steps of the method for assisting ladder diagram programming;
[0043] FIG. 5 is a schematic diagram of another implementation of the method for assisting ladder diagram programming;
[0044] FIG. 6 is a flowchart of some steps of the method for assisting ladder diagram programming;
[0045] FIG. 7 is a flowchart of some steps of the method for assisting ladder diagram programming; and
[0046] FIG. 8 is a flowchart of some steps of the method for assisting ladder diagram programming.
[0047] Reference numerals and denotations thereof:
[0048] 10-step editing area
[0049] 11-function toggle
[0050] 12-text box
[0051] 20-display toggleDETAILED DESCRIPTION
[0052] For clearer descriptions of the technical features, objects, and the technical effects of the present disclosure, the specific embodiments of the present disclosure are hereinafter described with reference to the accompanying drawings. In the drawings, like reference numerals denote elements having the same structure or having the similar structure but the same function.
[0053] In this text, the term "exemplary" or "schematic" is used herein to mean "serving as an example, instance, or illustration, " and any illustration or embodiment described herein as "exemplary" or "schematic" shall not be necessarily construed as preferred or advantageous over other illustrations or embodiments.
[0054] In this text, the terms "first, " "second, " and the like do not represent degrees of importance or a sequence, but only for differentiation, and for ease of description.
[0055] For brevity, parts relevant to the present disclosure are merely illustrated in the drawings, and these parts do not denote the actual structure of the product.
[0056] FIG. 1 is a flowchart of a method for assisting ladder diagram programming according to an exemplary embodiment of the present disclosure. FIGS. 2 and 3 are respectively schematic diagrams of implementations of a method for assisting ladder diagram programming. Referring to FIGS. 1 to 3, the method for assisting ladder diagram programming includes the following steps S10 to S50.
[0057] In S10, a step editing area 10 displayable in a ladder diagram programming interface is set. The step editing area 10 includes a function toggle 11 for enabling or disabling a coding function. FIG. 2 shows the ladder diagram programming interface, wherein a plurality of program sets are included. In an exemplary embodiment, a step editing area 10 is provided in a title bar of each network, and the step editing area 10 further includes a text box 12 for displaying and entering the step code of the network in addition to the function toggle 11. In an exemplary embodiment, the function toggle 11 is a checkbox which is checked or selected by a click to enable the coding function, and which is unchecked or deselected by a click to disable the coding function. However, the manner for enabling or disabling the coding function is not limited thereto. In other exemplary embodiments, a user may set the function toggle 11 to other styles according to user's habits. When creating a network, the function toggle 11 is checked or selected by default, and the coding function is enabled. When the network does not need to participate in the coding, the user can take the initiative to uncheck or deselect the checkbox to disable the coding function, thereby facilitating the operations of the user.
[0058] In S20, when the user creates a network, a step code is automatically added to the created network based on a logical sequence position of the created network in the case that the coding function is enabled by the user, and the step code of the network with the coding function enabled is modified after the created network at the same time, such that the step code of the network with the coding function enabled is increased sequentially in accordance with the logical sequence position in the case that the network with the coding function enabled exists after the created network. The logical sequence position refers to the sequence positions of all networks with the coding function enabled during the actual runtime, and the networks with the coding function disabled are not involved in the sequencing when sequencing is performed. The step codes are, but not limited to, e.g., Step101 and Step Step102 in FIG. 2, or the like. However, in other exemplary embodiments, the step codes may be set to other pure codes or combinations of letters and codes according to the user's own preferences, but the numerical portions of the step codes of the networks with the coding function enabled should be increased sequentially.
[0059] In S30, when the user deletes a network with the coding function enabled or disables the coding function of a network, the step code of the network with the coding function enabled after the deleted network or the network with the coding function disabled is modified, such that the step code of the network with the coding function enabled is increased sequentially in accordance with the logical sequence position. When deleting a network with the coding function enabled or disabling the coding function of a network, the step codes of the subsequent networks with the coding function enabled fail to be sequentially coded, and consequently, the step codes of the subsequent networks need to be modified sequentially.
[0060] In S40, the step code is replaced with an actual logical sequence code during compilation. The actual logical sequence code is purely numeric and corresponds to the sequence position of the network with the coding function enabled during the actual runtime. For example, the actual logical sequence code of the network for the first run is 1, the actual logical sequence code of the network for the second run is 2, or the like.
[0061] In S50, a display toggle 20 is set in the ladder diagram programming interface, which allows the user to operate the display toggle 20 to display or hide the step editing area 10. FIG. 3 shows a schematic diagram of another implementation of the method for assisting ladder diagram programming. Referring to FIGS. 2 and 3, the display toggle 20 is a button that is toggleable to show or hide each of the step editing area 10 by a click on the button. However, the display toggle is not limited thereto. In other exemplary embodiments, the user may set the display toggle 20 to other styles according to the user's own preferences, or the display toggle 20 may not be set such that the step editing area 10 keeps being displayed.
[0062] The method for assisting ladder diagram programming provided in the present disclosure provides the user with a step editing area 10 that is displayable d in the ladder diagram programming interface, and the user may enable or disable the coding function in the step editing area 10. After the coding function is enabled, the step codes of networks are automatically added and deleted when creating and deleting networks, and the step codes of the following networks are adjusted, such that the step codes of networks with the coding function enabled are sequentially increased in accordance with the logical sequence position.
[0063] FIG. 4 is a flowchart of some steps of the method for assisting ladder diagram programming. FIG. 5 is a schematic diagram of another implementation of the method for assisting ladder diagram programming. Referring to FIGS. 4 and 5, in an exemplary embodiment, S20 includes the following steps.
[0064] In S21, node data corresponding to the created network is created, wherein the node data is configured to store a node name, a step ID, a step code, an actual logical sequence code, a next node pointer, and a network ID. The node name, the step ID, and the network ID are automatically generated when node data is created. The node name is, for example, step node 1, step node 2, step node 3, or the like, in FIG. 5. Each step ID, such as S_001, S_002 and S_003, or the like, in FIG. 5, is globally unique and cannot be modified. The network ID is the name of the network corresponding to the node data, for example, network 1, network 2, network 3, or the like, in FIG. 5. The node name and step ID are not limited to those shown in FIG. 5, and may be changed to other styles depending on actual needs.
[0065] In S22, whether the network with the coding function enabled exists prior to the created network is determined.
[0066] In response to determining that the network with the coding function enabled does not exist, the process proceeds to S23: saving a step code to the node data, and saving the numeral 1 as the actual logical sequence code to the node data.
[0067] In response to determining that the network with the coding function enabled exists, the process proceeds to S24: reading the node data of the previous network with the coding function enabled, adding 1 to the step code and the actual logical sequence code of the previous network with the coding function enabled respectively as the step code and the actual logical sequence code of the created network, and saving the step code and the actual logical sequence code to the node data of the created network; taking the node name of the created network as the next node pointer of the previous network with the coding function enabled, and saving the next node pointer to the node data of the previous network with the coding function enabled.
[0068] In S25, whether there exists the network with the coding function enabled after the created network is determined.
[0069] In response to determining that the network with the coding function enabled exists, the process proceeds to S26: modifying the node data of the network with the coding function enabled after the created network, and adding 1 to the step code and the actual logical sequence code of the network with the coding function enabled following the created network respectively; and taking the node name of the first network with the coding function enabled after the created network as the next node pointer of the created network, and saving the next node pointer to the node data of the created network.
[0070] In S27, the node name of the first network with the coding function enabled is taken as the node pointer of the last network with the coding function enabled, and saved to the node data of the last network with the coding function enabled. In this way, the cyclic operation of the network in the actual runtime is represented.
[0071] FIG. 6 is a flowchart of some of the method for assisting ladder diagram programming. Referring to FIGS. 5 and 6, S30 includes the following steps.
[0072] In S31, the node data of the network is traversed to find the node data of the deleted network or the network with the coding function disabled.
[0073] In S32, the found node data is deleted.
[0074] In S33, whether the network with the coding function enabled exists after the node data of the deleted network or of the network with the coding function disabled is determined.
[0075] In response to determining that the network with the coding function enabled exists, the process proceeds to S34: subtracting 1 from the step code and the actual logical sequence code of the network with the coding function enabled after the deleted network or the network with the coding function disabled respectively, taking the node name of the first network with the coding function enabled the deleted network or the network with the coding function disabled as the next node pointer of the network with the coding function enabled prior to the deleted network or the network with the coding function disabled, and saving the next node pointer to the node data of the network with the coding function enabled prior to the deleted network or the network with the coding function disabled.
[0076] FIG. 7 is a flowchart of some steps of the method for assisting ladder diagram programming. Referring to FIGS. 5 and 7, S40 includes:
[0077] In S41, the step code of the network during compilation is read.
[0078] In S42, the actual logical sequence code in the node data in which the step code is saved is found.
[0079] In S43, the step code is replaced with the actual logical sequence code.
[0080] FIG. 8 is a flowchart of some steps of the method for assisting ladder diagram programming. Referring to FIG. 8, S23 includes the following steps.
[0081] In S231, whether the user enters the step code in the text box 12 is determined.
[0082] In response to determining that the user enters the step code, the process proceeds to S232: saving the step code entered by the user to the node data.
[0083] In response to determining that the user does not enter the step code, the process proceeds to S233: saving a predefined step code to the node data.
[0084] In S234, the numeral 1 is saved as an actual logical sequence code to the node data.
[0085] Through steps S231 to S234, the user avoids entering the step code when creating the first network to further simplify the operation, and the user may also manually enter the step code to meet the demand in special cases depending on the actual situation.
[0086] It should be understood that, although this specification is described on the basis of the embodiments, not each of the embodiments discloses an independent technical solution. Such description manner of the specification is only for clarity. A person skilled in the art should consider the specification as an entirety. The technical solutions according to the embodiments may also be suitably combined to derive other embodiments that may be understood by a person skilled in the art.
[0087] A series of detailed descriptions given in this specification are merely intended to illustrate feasible embodiments of the present disclosure, instead of limiting the protection scope of the present disclosure. Any equivalent embodiments or modifications, for example, combinations, segmentations, or repetition of features, derived without departing from the spirit of the present disclosure shall fall within the protection scope of the present disclosure.
Claims
1.A method for assisting ladder diagram programming, comprising:S10: setting a step editing area displayable in a ladder diagram programming interface, wherein the step editing area comprises a function toggle for enabling or disabling a coding function;S20: when a user creates a network, adding automatically a step code to the created network based on a logical sequence position of the created network in the case that the coding function is enabled by the user, and modifying the step code of the network with the coding function enabled after the created network at the same time, such that the step code of the network with the coding function enabled is increased sequentially in accordance with the logical sequence position in the case that the network with the coding function enabled exists after the created network;S30: when the user deletes the network with the coding function enabled or disables the coding function of the network, modifying the step code of the network with the coding function enabled after the deleted network or the network with the coding function disabled, such that the step code of the network with the coding function enabled is increased sequentially in accordance with the logical sequence position; andS40: replacing the step code with an actual logical sequence code during compilation.2.The method for assisting ladder diagram programming according to claim 1, wherein S20 comprises:S21: creating node data corresponding to the created network, wherein the node data is configured to store a node name, the step code, the actual logical sequence code, and a next node pointer, the node name being automatically generated when the node data is created;S22: determining whether the network with the coding function enabled exists prior to the created network;in response to determining that the network with the coding function enabled does not exist, proceeding to S23: saving a step code to the node data, and saving a numeral 1 as the actual logical sequence code to the node data;in response to determining that the network with the coding function enabled exists, proceeding to S24: reading the node data of a previous network with the coding function enabled, adding 1 to the step code and the actual logical sequence code of the previous network with the coding function enabled respectively as the step code and the actual logical sequence code of the created network, and saving the step code and the actual logical sequence code to the node data of the created network; and taking the node name of the created network as the next node pointer of the previous network with the coding function enabled, and saving the next node pointer to the node data of the previous network with the coding function enabled;S25, determining whether the network with the coding function enabled exists after the created network; andin response to determining that the network with the coding function enabled exists, proceeding to S26: modifying the node data of the network with the coding function enabled after the created network, and adding 1 to the step code and the actual logical sequence code of the network with the coding function enabled after the created the network respectively; and taking the node name of the first network with the coding function enabled after the created network as the next node pointer of the created network, and saving the next node pointer to the node data of the created network.3.The method for assisting ladder diagram programming according to claim 2, wherein step S30 comprises:S31: traversing the node data of the network to find the node data of the deleted network or the network with the coding function disabled;S32: deleting the found node data;S33: determining whether the network with the coding function enabled exists after the node data of the deleted network or of the network with the coding function disabled; andin response to determining that the network with the coding function enabled exists, proceeding to S34: subtracting 1 from the step code and the actual logical sequence code of the network with the coding function enabled after the deleted network or the network with the coding function disabled respectively; and taking the node name of the first network with the coding function enabled after the deleted network or the network with the coding function disabled as the next node pointer of the network with the coding function enabled before the deleted network or the network with the coding function disabled, and saving the next node pointer to the node data of the network with the coding function enabled before the deleted network or the network with the coding function disabled.4.The method for assisting ladder diagram programming according to claim 2, wherein S20 further comprises:S27: taking the node name of the first network with the coding function enabled as the node pointer of the last network with the coding function enabled, and saving the node pointer to the node data of the last network with the coding function enabled.5.The method for assisting ladder diagram programming according to claim 2, wherein the step editing area further comprises a text box for displaying and entering the step code of the network.6.The method for assisting ladder diagram programming according to claim 5, wherein step S23 comprises:S231: determining whether the user enters the step code in the text box;in response to determining that the user enters the step code, proceeding to S232: saving the step code entered by the user to the node data;in response to determining that the user does not enter the step code, proceeding to S233: saving a predefined step code to the node data; andS234: saving the numeral 1 as an actual logical sequence code to the node data.7.The method for assisting ladder diagram programming according to claim 2, wherein the node data is further configured to store a step ID and a network ID, the step ID and the network ID being automatically generated when the node data is created, each step ID being globally unique, and the network ID being a name of the network corresponding to the node data.8.The method for assisting ladder diagram programming according to claim 1, further comprising:S50: setting a display toggle in the ladder diagram programming interface, and allowing the user to operate the display toggle to display or hide the step editing area.9.The method for assisting ladder diagram programming according to claim 1, wherein S10 comprises providing the step editing area in a title bar of each network, wherein the function toggle of the step editing area is configured to control to enable or disable the coding function of the network corresponding to the function toggle.10.The method for assisting ladder diagram programming according to claim 2, wherein step S40 comprises:S41: reading the step code of the network during compilation;S42: finding the actual logical sequence code in the node data in which the step code is saved; andS43:replacing the step code with the actual logical sequence code.
Citation Information
Patent Citations
Method for designing ladder diagram editing software of embedded PLC (Programmable Logic Controller)
CN102508654A
Control system, support device, and support program
CN111971629A
Industrial control program generation method and system and storage medium
CN115390508A
Interface layout system and layout method for ladder diagram logic configuration
CN117221146A
Ladder diagram editor, ladder diagram editing method and program, and computer-readable recording medium
JP2005092807A