[go: up one dir, main page]

CN119225269A - An Editing Adaptive Display Method for Ladder Diagram Programming - Google Patents

An Editing Adaptive Display Method for Ladder Diagram Programming Download PDF

Info

Publication number
CN119225269A
CN119225269A CN202411385850.8A CN202411385850A CN119225269A CN 119225269 A CN119225269 A CN 119225269A CN 202411385850 A CN202411385850 A CN 202411385850A CN 119225269 A CN119225269 A CN 119225269A
Authority
CN
China
Prior art keywords
functional block
ladder diagram
pins
distance
branch
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202411385850.8A
Other languages
Chinese (zh)
Inventor
陈志强
尹作昌
胡国煌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Leadshine Technology Co Ltd
Shenzhen Leadshine Control Technology Co Ltd
Original Assignee
Leadshine Technology Co Ltd
Shenzhen Leadshine Control Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Leadshine Technology Co Ltd, Shenzhen Leadshine Control Technology Co Ltd filed Critical Leadshine Technology Co Ltd
Priority to CN202411385850.8A priority Critical patent/CN119225269A/en
Publication of CN119225269A publication Critical patent/CN119225269A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/04Programme control other than numerical control, i.e. in sequence controllers or logic controllers
    • G05B19/05Programmable logic controllers, e.g. simulating logic interconnections of signals according to ladder diagrams or function charts
    • G05B19/056Programming the PLC
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B2219/00Program-control systems
    • G05B2219/10Plc systems
    • G05B2219/13Plc programming
    • G05B2219/13004Programming the plc

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Automation & Control Theory (AREA)
  • Programmable Controllers (AREA)

Abstract

The application discloses an editing self-adaptive display method for ladder diagram programming, which comprises the steps of firstly generating and displaying a ladder diagram editing interface, the ladder diagram is then edited and displayed within the ladder diagram editing interface in response to a user operation. In the editing process, if the ladder diagram has the functional block, acquiring and monitoring branches connected with all pins of the functional block, determining whether spacing adjustment is needed according to the change when the branches connected with the pins of the functional block are monitored to change, and adjusting the spacing between the pins of the functional block and the spacing between the branches connected with the pins according to a preset spacing adjustment rule in the vertical direction of the ladder diagram editing interface according to the change if the spacing adjustment is needed. Because the distance between the branches and the distance between the corresponding connecting pins of the functional blocks can be dynamically adjusted according to the change of the connecting branches of the functional blocks, when the functional blocks are displayed on the ladder diagram, the connection relationship is more concise, attractive and practical, and the ladder diagram display mode is optimized, so that the editing efficiency of the ladder diagram is improved.

Description

Editing self-adaptive display method for ladder diagram programming
Technical Field
The invention relates to the technical field of industrial control, in particular to an editing self-adaptive display method for ladder diagram programming.
Background
The Programmable logic controller (Programmable LogicController, PLC) is used for realizing controller control in various industrial equipment, and software editing of corresponding PLCs generally uses ladder diagram programming, ladder diagram language inherits the form of a relay control circuit, ladder diagram is formed by simplifying symbol evolution on the basis of common relay and contactor logic control, has the characteristics of image, intuition, practicability and the like, is easily accepted by electric technicians, and is the programming language of the PLC which is most used at present. The basic composition elements of the ladder diagram comprise buses, contacts, coils and functional blocks, wherein the buses (power rails) are two vertical lines positioned on the left side and the right side of the ladder diagram, represent power input and output of a circuit, are also basic composition parts of the ladder diagram, and provide a basis for power connection of the whole circuit. The contact is an element in the ladder diagram and used for representing the state change of a Boolean variable, the contact can be of a normally open type or a normally closed type, the contact can be divided into a normally open contact and a normally closed contact according to different states under normal working conditions, and the state change of the contact is an important component of logic operation of the ladder diagram. The coil is also a fundamental element of the ladder diagram, which represents a change in the state of the boolean quantity, typically used together with contacts, by changing its state to control the output of the circuit. The ladder diagram is also a functional block ‌, ‌ representing more complex logic operations or functions, which are represented in the ladder diagram with specific graphical symbols for performing specific logic functions, enabling the ladder diagram to express more complex control logic. The ladder diagram enables an electrician to express and control the logical operation of the electrical system in an intuitive graphical manner. The traditional ladder diagram editing interface has single display function and low degree of freedom, and is carved in operation flow, so that the requirements of customers on expansion of various personalized self-adaptive functions cannot be met.
Disclosure of Invention
The invention mainly solves the technical problem of how to realize the self-adaptive display function of the editing interface in the process of editing the ladder diagram.
According to a first aspect, in one embodiment, there is provided an edit adaptive display method for ladder programming, comprising:
Generating and displaying a ladder diagram editing interface;
Editing and displaying a ladder diagram in response to a user operation, wherein the ladder diagram comprises element elements, and types of the element elements comprise functional blocks, contacts and/or coils, and the ladder diagram comprises the following steps:
If the ladder diagram has a functional block, acquiring and monitoring a branch circuit connected with each pin of the functional block;
When the change of the branch circuit connected with the pin of the functional block is monitored, determining whether the space adjustment is required according to the change;
And if so, adjusting the intervals among the pins of the functional block and the intervals among the branches connected with the pins according to a preset interval adjustment rule in the vertical direction of the ladder diagram editing interface according to the change.
According to a second aspect, an embodiment provides a computer readable storage medium having stored thereon a computer program executable by a processor to implement the editing adaptive display method according to the first aspect.
According to a third aspect, an embodiment provides a computer program product comprising a computer program and/or instructions which, when executed by a processor, implement the editing adaptive display method of any of the first aspects.
According to the editing self-adaptive display method of the embodiment, the distance between the branches and the distance between the corresponding connection pins of the functional blocks can be dynamically adjusted according to the change of the connection branches of the functional blocks, so that the connection relationship is more concise, attractive and practical when the functional blocks are displayed on the ladder diagram, and the ladder diagram display mode is optimized, so that the editing efficiency of the ladder diagram is improved.
Drawings
FIG. 1 is a schematic illustration of an exemplary configuration of one step in a ladder diagram;
FIG. 2 is a schematic diagram of editing function blocks in a ladder diagram;
FIG. 3 is a block diagram of an embodiment of an editing adaptive display device;
FIG. 4 is a flow chart of an editing adaptive display method of ladder programming in one embodiment;
FIG. 5 is a schematic diagram of a functional block pin connection;
FIG. 6 is a schematic diagram of a branch circuit added parallel configuration in one embodiment;
FIG. 7 is a schematic diagram of a new connection leg of a functional block pin in an embodiment;
FIG. 8 is a schematic diagram of adding annotation information to an element original, according to one embodiment;
FIG. 9 is a schematic diagram of a variable type discrimination display of an element in one embodiment;
FIG. 10 is a schematic diagram showing a contact expression in one embodiment;
FIG. 11 is a flow chart of a tag navigation function in one embodiment;
FIG. 12 is a schematic diagram showing a display of a tab navigation list in one embodiment;
Fig. 13 is a flow chart of a single-key shortcut adding method for shortcut adding an element in an embodiment.
Detailed Description
The application will be described in further detail below with reference to the drawings by means of specific embodiments. Wherein like elements in different embodiments are numbered alike in association. In the following embodiments, numerous specific details are set forth in order to provide a better understanding of the present application. However, one skilled in the art will readily recognize that some of the features may be omitted, or replaced by other elements, materials, or methods in different situations. In some instances, related operations of the present application have not been shown or described in the specification in order to avoid obscuring the core portions of the present application, and may be unnecessary to persons skilled in the art from a detailed description of the related operations, which may be presented in the description and general knowledge of one skilled in the art.
Furthermore, the described features, operations, or characteristics of the description may be combined in any suitable manner in various embodiments. Also, various steps or acts in the method descriptions may be interchanged or modified in a manner apparent to those of ordinary skill in the art. Thus, the various orders in the description and drawings are for clarity of description of only certain embodiments, and are not meant to be required orders unless otherwise indicated.
The numbering of the components itself, e.g. "first", "second", etc., is used herein merely to distinguish between the described objects and does not have any sequential or technical meaning. The term "coupled" as used herein includes both direct and indirect coupling (coupling), unless otherwise indicated.
Referring to fig. 1, there is shown an exemplary schematic structure of one ladder in each ladder diagram, each ladder diagram including at least one bus bar (left bus bar) and one ladder (program segment), each ladder (program segment) including a main branch and at least one output element (the output element may be a coil, a name element of another ladder, or a right bus bar), the main branch being connected between the left bus bar and one output element, each main branch including at least one element. As shown in fig. 1, the main branch is formed by sequentially connecting element AAA-element BBB-element CCC-element FFF-element GGG-element HHH in series, and the output element of the main branch connection is the right bus. Wherein each element comprises a connection front end and a connection back end. In an embodiment, the rung may further comprise a sub-branch comprising at least one serially connected element, as shown in fig. 1, comprising a sub-branch 1 (element DDD-element EEE) and a sub-branch 2 (element III), the element DDD-element EEE of the sub-branch 1 being connected in parallel with the element BBB and the element CCC of the main branch, and the element III of the sub-branch 2 being connected in parallel with the element HHH of the main branch. In one embodiment, the rung may further include a branching circuit. When a step comprises at least two end positions (i.e. output elements), one end position is connected to the main branch and the other different end positions are each connected to a corresponding one of the branch. As shown in fig. 1, a branch 1 (element JJJ-element KKK) and a branch 2 (element LLL-element MMM) are included. Each branch comprises at least one element, and each branch is formed by sequentially connecting the element elements in series. The logic structure relation of the branches (the branches comprise a main branch, a branch and a sub-branch) in one ladder stage in the ladder diagram comprises a serial structure and a parallel structure, wherein the serial structure refers to that output is only carried out when the conditions defined by all element elements on the same branch are met, and is similar to the serial relation in an electronic circuit, as shown in fig. 1, the element JJ and the element KKK in the branch 1 are set to be contacts, and only all the contacts (the element JJ and the element KK) in the branch 1 are required to be closed at the same time, so that the output to a right bus can be carried out. The parallel structure means that output is provided if only one of the plurality of branches is satisfied. The parallel structure is similar to the parallel relationship in the circuit, and as shown in fig. 1, the sub-branch 1 (the element DDD and the element EEE) and the element BBB and the element CCC in the main branch are parallel structures, and the conditions of the sub-branch 1 or the element BBB and the element CCC in the main branch can be both turned on. The parallel structure can exist between the sub-branch and the main branch, and the parallel structure can also exist between a plurality of sub-branches. In addition, the branch and the main branch may have a parallel structure, and a parallel structure may also exist between a plurality of branches (for example, the logical structural relationship between the branch 1 and the branch 2 in fig. 1 is a parallel structure).
Referring to FIG. 2, a schematic diagram is compiled for functional blocks, and the functional blocks of the predetermined function perform specific algorithm or logic operations ‌. The input and output pins of the functional block can be flexibly defined, and the input pins are used for being connected with the branches. In the editing process of ladder diagram programming, the interval of pins of the functional block and branches connected with the pins is optimally displayed, so that a developer can quickly and accurately edit the ladder diagram, and further the ladder diagram programming efficiency is improved. In the embodiment of the application, the automatic adjustment of the branch distance is performed according to whether the branch and the connection branch distance of the pins of the functional block exist or not.
Embodiment one:
Referring to fig. 3, a block diagram of an editing adaptive display device 1 according to an embodiment includes a display module 10 and an operation execution module 20. The display module 10 is used for generating and displaying a ladder diagram editing interface. The operation execution module 20 is used for editing and displaying the ladder diagram in response to a user operation. In one embodiment, the display module includes a display screen or display. In one embodiment, the operation execution module 20 obtains the user's operations or instructions through a computer input device, including a keyboard, a mouse, a scanner, a tablet, a camera, a voice input device, and/or a light pen.
Referring to fig. 4, a flowchart of an editing adaptive display method for ladder programming in an embodiment is shown, and in an embodiment, the editing adaptive display method executed by the editing adaptive display device includes:
step 101, generating and displaying a ladder diagram editing interface.
Step 102, in response to the user operation, editing and displaying the ladder diagram in the ladder diagram editing interface.
And displaying and generating a ladder diagram editing interface through a display module. In one embodiment, the historically stored ladder diagram is read and displayed in a ladder diagram editing interface. In one embodiment, the ladder diagram displayed by the ladder diagram editing interface is newly edited. The ladder diagram includes elemental elements of the type including functional blocks, contacts and/or coils.
And step 103, if the ladder diagram has the functional block, acquiring and monitoring the branch circuit connected with each pin of the functional block.
The functional block is a basic program unit that standardizes the processing functions. The circuit comprises an input pin and an output pin, and in this embodiment, the circuit is mainly used for acquiring and monitoring branches connected with each input pin of the functional block.
And 104, when the change of the branch circuit connected with the pin of the functional block is monitored, determining whether the space adjustment is needed according to the change.
When the ladder diagram is programmed, the change between the pins of the functional block is monitored in real time, such as adding an input pin newly, or adding a parallel structure or other element elements on the existing input pin, when the change of the branch connected with the pins of the functional block is monitored, whether the space adjustment is needed is determined according to the change.
In an embodiment, in the process of performing ladder programming, editing operations with high repeatability are required, for example, adding or deleting new element elements on a branch (main branch, branch or sub-branch) and setting types (contacts, coils or function blocks) and variable types of elements, and for example, when a large number of branches with the same number are repeatedly added, the ladder may be edited by means of a shortcut key, and the shortcut key is not limited herein.
Step 105, if necessary, adjusting the intervals between the pins of the functional block and the intervals between the branches connected with the pins according to a preset interval adjustment rule in the vertical direction of the ladder diagram editing interface according to the change.
In a specific embodiment, the following cases exist for adjusting the intervals between the pins of the functional block and the intervals between the branches connected with the pins according to the preset interval adjustment rule:
1) And adding a parallel structure in the branch circuit connected with the pin of the monitored functional block, wherein the added parallel structure enables the distance between the branch circuit and the adjacent branch circuit in the vertical direction to be smaller than a first preset threshold value, and then determining that the distance adjustment is required. In an embodiment, the interval adjustment mode is to increase the interval between the branch circuit where the parallel structure is located and the adjacent branch circuit thereof in the vertical direction, and increase the interval between the pins connecting the branch circuit where the parallel structure is located and the adjacent branch circuit thereof with the functional block respectively.
Please refer to fig. 5 and fig. 6, which are a schematic diagram of a functional block pin connection and a schematic diagram of a branch adding parallel structure in an embodiment, respectively, in which a parallel structure element gvl.eee (see the parallel structure portion in fig. 6) is added between a pin AAA and a pin BBB, so that a distance between the pin AAA and the pin BBB of the functional block is smaller than a first preset threshold, and then the distance between the pin AAA and the pin BBB is increased, that is, a length of the distance D1 is increased.
2) Deleting the parallel structure in the branch circuit connected with the pin of the monitored functional block, and determining that the distance between the branch circuit and the adjacent branch circuit is required to be adjusted if the distance between the branch circuit and the adjacent branch circuit in the vertical direction is larger than a second preset threshold value due to the deleted parallel structure. In an embodiment, the pitch adjustment method is to reduce the pitch between the branch circuit with the deleted parallel structure and the adjacent branch circuit in the vertical direction, and reduce the pitch between the branch circuit with the deleted parallel structure and the pins with the adjacent branch circuit connected with the functional blocks respectively. The process of shifting from fig. 6 to fig. 5, the parallel structure is eliminated, correspondingly shortening the length of the pitch D1.
3) And when a pin of the functional block is detected to be newly connected with a branch, and the distance between the newly connected branch and the adjacent branch in the vertical direction is smaller than a third preset threshold value, determining that the distance adjustment is required. In an embodiment, the pitch adjustment method is to increase the pitch between the new connection branch and its adjacent branch in the vertical direction, and the pitch between the pins connecting the new connection branch and its adjacent branch with the functional blocks respectively. Referring to fig. 7, in an embodiment, a schematic diagram of a new connection leg of a functional block pin is shown, where a connection is established between a pin CCC and the new leg, and a distance between the new leg and an adjacent leg is smaller than a third preset threshold, and a distance between the pin CCC and a pin BBB is increased, i.e. a length of a distance D2 is increased.
4) And when the fact that the branch circuit connected with one pin of the functional block is deleted is detected, and the branch circuit connected with two other pins in the functional block is adjacent due to the fact that the branch circuit is deleted, and the distance between the two other pins in the functional block in the vertical direction is larger than a fourth preset threshold value, determining that the distance adjustment is needed. In one embodiment, the pitch adjustment method is to reduce the pitch between the branches connected to two other pins in the functional block in the vertical direction, and reduce the pitch between the two other pins in the functional block and the pins of the deleted branch. As in the process of fig. 7 through fig. 6, the leg to which pin CCC is connected is deleted, correspondingly shortening the length of space D2.
5) When the fact that the annotation information is added to the element elements is monitored, judging whether the distance between any two adjacent branches connected with the functional block in the vertical direction is smaller than a fifth preset threshold value, and if so, determining that the distance adjustment is needed. In one embodiment, a user operation is received to augment annotation information for an element. In an embodiment, the pitch adjustment method is to increase the pitch between two adjacent branches with a pitch smaller than a fifth preset threshold in the vertical direction, and increase the pitch between pins connecting the two adjacent branches with the functional block respectively. Referring to fig. 8, a schematic diagram of adding annotation information to an element original in an embodiment is shown in fig. 2 to 8, in which the pins BBB, DDD, and EEE of the functional block are added with annotation information, and the pins CCC are not added with annotation information, so that the pitches between the pins BBB, CCC, DDD, and EEE are adaptively adjusted.
6) When the deleted annotation information of the element elements is monitored, judging whether the distance between any two adjacent branches connected with the functional block in the vertical direction is larger than a sixth preset threshold value, and if so, determining that the distance adjustment is needed. In one embodiment, user operation is received, and annotation information for the element is deleted. In an embodiment, the pitch adjustment method is to reduce the pitch between two adjacent branches with a pitch greater than a sixth preset threshold in the vertical direction, and reduce the pitch between pins connecting the two adjacent branches with the functional block respectively. As in the process of fig. 8 to fig. 2, the pitch between the pins of the functional block is reduced after the annotation information of the element is deleted.
When the pitch change between the adjacent branches is not increased or decreased in the process of adding or deleting the element elements to or from the ladder diagram, the pitch between the pins of the functional block and the pitch between the branches connected to the pins are not adjusted.
In an embodiment of the present application, the first preset threshold, the third preset threshold and the fifth preset threshold are the same in value, and the second preset threshold, the fourth preset threshold and the sixth preset threshold are the same in value.
In one embodiment, when the pitch adjustment is performed as described above, the pins and the branches connected thereto that are not pitch-adjusted in the functional block are adaptively moved in the vertical direction based on the pitch-adjusted branches, pins, and pitch after adjustment. As in the transition from fig. 5 to fig. 6, the spacing between functional block pins AAA and BBB (spacing D1) increases, while the spacing between pins BBB, CCC and DDD is unchanged, but is translated in the parallel direction along the bus bar.
In one embodiment, the distance between any two adjacent branches connected by the functional block in the vertical direction is the distance between the lowest point of the element at the lowest position of the upper branch and the highest point of the element at the main branch of the lower branch in the two adjacent branches in the vertical direction, and as shown in fig. 7, the two branches of the pin AAA and the pin BBB connected by the functional block are adjacent branches, and the distance in the vertical direction is the distance D3, that is, the distance D3 is the distance between the two branches of the connection pin AAA and the connection pin BBB. The display mode of the ladder diagram in the prior art for the annotation information of the element is that whether the element annotation information is displayed or not (or not), so that the ladder diagram is pulled very long, the function blocks are pulled very large, and the program monitoring of a client is not facilitated. By improving the display mode of the annotation information, the display is not performed when the annotation information is not available, the ladder diagram does not need to be subjected to self-adaptive stretching adjustment, the area of the ladder diagram is shortened, the monitorable program quantity of the same interface is greatly improved, and the monitoring attractiveness of the ladder diagram is improved.
Referring to fig. 9, a schematic diagram of variable type distinguishing display of an element in an embodiment, the editing adaptive display method further sets a variable type distinguishing function, which specifically includes:
And acquiring the variable type of each element in the ladder diagram, and selecting a color corresponding to the variable type of each element based on the variable type of each element to perform color identification of the element. Wherein different variable types correspond to different colors. In one embodiment, the variable types include global variables, local variables, and/or power down holding variables. And then selecting a color identifier corresponding to the variable type according to the variable type of the displayed element. In one embodiment, the colors of the global variable, the local variable and the power-down variable can be customized and selected through a ladder color processing setting interface, and the corresponding ladder can be seen to be displayed after the setting is completed, for example, the power-down variable is red, the global variable is green and the local variable is black.
Referring to fig. 10, a schematic view of displaying a contact expression in an embodiment, the editing adaptive display method further sets a contact expression display function, which specifically includes:
firstly, receiving user operation, and acquiring contacts with confirmed expressions;
then dividing the expression of the contacts to extract the variable name and the operation symbol name of each contact;
And finally, displaying the variable name and the operation symbol name corresponding to the contact in a matching display area of the contact.
In one embodiment, the variable names and operator names are displayed in parallel. As shown in fig. 10, the contact variable name is aaa+bbb=ccc+ddd, and the operation symbol name 0+0=0+0. When the contact information of the ladder diagram in the prior art displays the expression, real-time monitoring of the variable of the expression is realized, so that a customer needs to go to other places to check the variable value of the current expression when debugging equipment. The touch expression display function client can clearly see the values of all variables of the current expression above the expression, so that the debugging efficiency of the client is improved.
In one embodiment, the editing adaptive display method further sets a program folding function, and specifically includes:
First, in response to a user operation, a folding display starting point and a corresponding folding display ending point are created on the ladder diagram. And then responding to the operation of a user on the folding display starting point, if the ladder diagram between the folding display starting point and the corresponding folding display terminal point is in a non-folding hiding state, carrying out folding hiding on the ladder diagram between the folding display starting point and the corresponding folding display terminal point, and if the ladder diagram between the folding display starting point and the corresponding folding display terminal point is in a folding hiding state, opening the ladder diagram between the folding display starting point and the corresponding folding display terminal point and displaying. The program folding function can fold the ladder diagram network, so that the searching process is more convenient, and more programs can be displayed in a limited display interface.
Referring to fig. 11, a schematic flow chart of a tag navigation function in an embodiment is shown, and in an embodiment, the editing adaptive display method further sets the tag navigation function, which specifically includes:
in step 201, the ladder diagram is divided into program organization units according to the relevance of functions.
Step 202, each program organization unit is provided with a unique navigation tag, and the program organization units establish a tag navigation list through the navigation tags of each program unit according to the connection relation and the sequence in the ladder diagram.
In one embodiment, the organization unit identifier is obtained in the ladder diagram and used as a navigation tag. Wherein the organization unit identifier is used to identify and distinguish program organization units. In one embodiment, the organization unit identifier is a title hierarchical number (e.g., natural number, arabic, english letter, etc.) that is arranged in a predetermined sequence.
And 203, responding to the operation of a user on any navigation tag, and displaying the ladder diagram content of the program organization unit corresponding to the navigation tag in the current displayable range of the ladder diagram editing interface.
Please refer to fig. 12, which is a schematic diagram showing a tag navigation list in an embodiment, wherein the POU name is a navigation list name, and the position of the program can be quickly located by double-clicking the navigation tags (1 to 6) of the program in the map, and a corresponding program network is opened, so that the complex searching by a programmer is avoided, and the working efficiency is improved.
In the process of performing ladder diagram programming, editing operations with high repeatability are required, for example, adding or deleting new element elements on branches (main branches, branch branches or sub-branches) and setting types (contacts, coils or functional blocks) and variable types of elements, and for example, when a plurality of branches with the same quantity are repeatedly added, the element adding mode at the present stage cannot meet the actual operation requirement of ladder diagram editing. Referring to fig. 13, a flow chart of a single-key shortcut adding method for shortcut adding an element in an embodiment of the application is shown, and in an embodiment of the application, when executing a ladder diagram editing operation, the single-key shortcut adding method is applied to perform an operation of adding a new element, which specifically includes:
in step 301, in response to a user operation, an addition reference position is determined in the ladder diagram editing interface.
In an embodiment, the adding reference position is determined by clicking a mouse pointer in a ladder editing interface, and the type of the adding reference position includes an element, a connecting line and/or any coordinate point in the ladder editing interface.
In step 302, in response to the shortcut key input operation, an element of the type corresponding to the shortcut key is added at the addition reference position.
In an embodiment, the types of elemental elements include contacts, functional blocks, and/or coils. In an embodiment, the shortcut key input operation includes an add function instruction input through a preset keyboard shortcut key, and add function instructions corresponding to different keyboard shortcut keys are different. In an embodiment, the corresponding relationship between the keyboard shortcut key and the function adding instruction is determined by performing pre-editing through the shortcut key setting operation interface, and can be preset or personalized adjustment. For example, the shortcut key set by the add function instruction for copy and paste is a v key, the shortcut key set by the add function instruction for adding the function block is a g key, the shortcut key set by the add function instruction for adding the contact of the function block is a p key, and the shortcut key set by the add function instruction for adding the coil of the function block is an o key.
Step 303, establishing the connection relation of the new element in the ladder diagram according to the type of the added reference position and the type of the new added element.
When the determined addition reference position is one element in the ladder diagram and the element added corresponding to the addition function instruction is a coil, a new coil is added on a connecting line behind the determined element.
When the determined addition reference position is one element in the ladder diagram and the addition function instruction corresponds to the added element being a contact or a function block, the newly added contact or function block is connected in parallel with the determined element.
When the determined addition reference position is one element in the ladder diagram and the addition function instruction is copy and paste, a parallel connection is established between the newly copy and paste branch and the determined element.
When the determined addition reference position is one connecting line in the ladder diagram and the element added corresponding to the addition function instruction is a coil, inserting a new branch and a new coil by taking the determined connecting line as a node.
When the determined addition reference position is one connecting line in the ladder diagram and the element added corresponding to the addition function instruction is a contact or a function block, connecting the newly added contact or function block in series on the determined connecting line.
When the determined adding reference position is one connecting line in the ladder diagram and the adding function instruction is copy and paste, connecting the newly copy and paste branch on the determined connecting line in series.
In one embodiment, when the determined add reference position is a blank point (blank point in the ladder editing interface), then the newly added element is connected to the left bus. And when the determined adding reference position is a blank point and the adding function instruction is copy and paste, connecting a newly copy and paste branch to the left bus.
The editing self-adaptive display method in the embodiment of the application can beautify the ladder diagram editing interface, and can not only make the interface simpler and clearer, but also rapidly locate and process program abnormality through the self-adaptation of the annotation and the self-adaptation function of the ladder diagram. The added shortcut key setting function can be programmed in quick succession, simplifying the insertion of branches, contacts or functional blocks. In addition, the functions of label navigation, program folding, color processing and the like are improved, the user programming experience is improved, the ladder diagram interface is beautified, the simplicity of online monitoring is improved, the usability of software is improved, the intuitiveness of ladder diagram monitoring is improved, and compared with the traditional dragging operation, the method is simpler and quicker, and the content display is more intuitionistic and clear.
According to the editing self-adaptive display method disclosed by the embodiment of the application, a ladder diagram editing interface is firstly generated and displayed, and then the ladder diagram is edited and displayed in the ladder diagram editing interface in response to user operation. In the editing process, if the ladder diagram has the functional block, acquiring and monitoring branches connected with all pins of the functional block, determining whether spacing adjustment is needed according to the change when the branches connected with the pins of the functional block are monitored to change, and adjusting the spacing between the pins of the functional block and the spacing between the branches connected with the pins according to a preset spacing adjustment rule in the vertical direction of the ladder diagram editing interface according to the change if the spacing adjustment is needed. Because the distance between the branches and the distance between the corresponding connecting pins of the functional blocks can be dynamically adjusted according to the change of the connecting branches of the functional blocks, when the functional blocks are displayed on the ladder diagram, the connection relationship is more concise, attractive and practical, and the ladder diagram display mode is optimized, so that the editing efficiency of the ladder diagram is improved.
Those skilled in the art will appreciate that all or part of the functions of the various methods in the above embodiments may be implemented by hardware, or may be implemented by a computer program. When all or part of the functions in the above embodiments are implemented by means of a computer program, the program may be stored in a computer-readable storage medium, which may include a read-only memory, a random access memory, a magnetic disk, an optical disk, a hard disk, etc., and the program is executed by a computer to implement the 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 functions described above can be realized. In addition, when all or part of the functions in the above embodiments are implemented by means of a computer program, the program may be stored in a storage medium such as a server, another computer, a magnetic disk, an optical disk, a flash disk, or a removable hard disk, and the program in the above embodiments may be implemented by downloading or copying the program into a memory of a local device or updating a version of a system of the local device, and when the program in the memory is executed by a processor.
The foregoing description of the invention has been presented for purposes of illustration and description, and is not intended to be limiting. Several simple deductions, modifications or substitutions may also be made by a person skilled in the art to which the invention pertains, based on the idea of the invention.

Claims (11)

1. An edit adaptive display method for ladder programming, comprising:
Generating and displaying a ladder diagram editing interface;
Editing and displaying a ladder diagram in response to a user operation, wherein the ladder diagram comprises element elements, and types of the element elements comprise functional blocks, contacts and/or coils, and the ladder diagram comprises the following steps:
If the ladder diagram has a functional block, acquiring and monitoring a branch circuit connected with each pin of the functional block;
When the change of the branch circuit connected with the pin of the functional block is monitored, determining whether the space adjustment is required according to the change;
And if so, adjusting the intervals among the pins of the functional block and the intervals among the branches connected with the pins according to a preset interval adjustment rule in the vertical direction of the ladder diagram editing interface according to the change.
2. The method for adaptively displaying editing according to claim 1, wherein when it is detected that a change occurs in a branch connected to a pin of the functional block, determining whether a pitch adjustment is required according to the change comprises:
Adding a parallel structure in a branch circuit connected with the pin of the functional block, wherein the added parallel structure enables the distance between the branch circuit and the adjacent branch circuit in the vertical direction to be smaller than a first preset threshold value, and then determining that the distance adjustment is required;
The adjusting the interval between pins of the functional block and the interval between branches connected with the pins according to the preset interval adjustment rule in the vertical direction of the ladder diagram editing interface according to the change comprises the following steps:
Increasing the distance between the branch circuit where the parallel structure is located and the adjacent branch circuit thereof in the vertical direction, and increasing the distance between the branch circuit where the parallel structure is located and the pins of the adjacent branch circuit thereof, which are respectively connected with the functional blocks;
And/or the number of the groups of groups,
When the change of the branch circuit connected with the pin of the functional block is monitored, determining whether the space adjustment is needed according to the change comprises the following steps:
Deleting the parallel structure in the branch circuit connected with the pin of the functional block, and determining that the distance between the branch circuit and the adjacent branch circuit in the vertical direction is larger than a second preset threshold value by the deleted parallel structure, wherein the distance needs to be adjusted;
The adjusting the interval between pins of the functional block and the interval between branches connected with the pins according to the preset interval adjustment rule in the vertical direction of the ladder diagram editing interface according to the change comprises the following steps:
And reducing the distance between the branch circuit of the parallel structure and the adjacent branch circuit thereof in the vertical direction, and reducing the distance between the branch circuit of the parallel structure and the pins of the adjacent branch circuit thereof, which are respectively connected with the functional blocks.
3. The method for adaptively displaying editing according to claim 1, wherein when it is detected that a change occurs in a branch connected to a pin of the functional block, determining whether a pitch adjustment is required according to the change comprises:
when a pin of the functional block is detected to be newly connected with a branch, and the distance between the newly connected branch and the adjacent branch in the vertical direction is smaller than a third preset threshold, determining that the distance adjustment is required;
The adjusting the interval between pins of the functional block and the interval between branches connected with the pins according to the preset interval adjustment rule in the vertical direction of the ladder diagram editing interface according to the change comprises the following steps:
Increasing the distance between the new connection branch and the adjacent branch in the vertical direction, and increasing the distance between the pins respectively connecting the new connection branch and the adjacent branch with the functional block;
And/or the number of the groups of groups,
When the change of the branch circuit connected with the pin of the functional block is monitored, determining whether the space adjustment is needed according to the change comprises the following steps:
When the fact that one pin of the functional block is deleted and a branch connected with the pin is deleted is monitored, and the branches connected with two other pins in the functional block are adjacent and the distance between the branches in the vertical direction is larger than a fourth preset threshold value due to the fact that the branches are deleted, it is determined that distance adjustment is needed;
The adjusting the interval between pins of the functional block and the interval between branches connected with the pins according to the preset interval adjustment rule in the vertical direction of the ladder diagram editing interface according to the change comprises the following steps:
And reducing the distance between the branches connected with the two other pins in the functional block in the vertical direction, and reducing the distance between the two other pins in the functional block and the pins of the deleted branch.
4. The editing adaptive display method according to claim 1, further comprising:
receiving user operation, and adding annotation information of the element;
When the change of the branch circuit connected with the pin of the functional block is monitored, determining whether the space adjustment is needed according to the change comprises the following steps:
When the fact that the element elements are added with annotation information is detected, judging whether the distance between any two adjacent branches connected with the functional block in the vertical direction is smaller than a fifth preset threshold value, and if so, determining that the distance adjustment is needed;
The adjusting the interval between pins of the functional block and the interval between branches connected with the pins according to the preset interval adjustment rule in the vertical direction of the ladder diagram editing interface according to the change comprises the following steps:
Increasing the distance between the two adjacent branches with the distance smaller than the fifth preset threshold value in the vertical direction, and increasing the distance between the two adjacent branches and pins connected with the functional block respectively;
and/or, the editing adaptive display method further comprises:
receiving user operation, deleting annotation information of the element;
When the change of the branch circuit connected with the pin of the functional block is monitored, determining whether the space adjustment is needed according to the change comprises the following steps:
When the deleted annotation information of the element elements is detected, judging whether the distance between any two adjacent branches connected with the functional block in the vertical direction is larger than a sixth preset threshold value, and if so, determining that the distance adjustment is required;
The adjusting the interval between pins of the functional block and the interval between branches connected with the pins according to the preset interval adjustment rule in the vertical direction of the ladder diagram editing interface according to the change comprises the following steps:
And reducing the distance between the two adjacent branches with the distance larger than the sixth preset threshold in the vertical direction, and reducing the distance between the two adjacent branches and pins connected with the functional block respectively.
5. The editing adaptive display method according to any one of claims 1 to 4, further comprising:
And adaptively moving pins which are not adjusted in the functional block and the branches connected with the pins in the functional block in the vertical direction based on the branches with adjusted pitches, the pins and the adjusted pitches.
6. The editing adaptive display method according to claim 1, wherein a distance in the vertical direction between any two adjacent branches to which the functional block is connected is a distance in the vertical direction between a lowest point of a lowermost element of an upper branch and a highest point of an element of a main branch of a lower branch of the two adjacent branches.
7. The editing adaptive display method according to claim 1, further comprising:
obtaining the variable type of each element in the ladder diagram;
and selecting colors corresponding to the variable types of the element elements based on the variable types of the element elements to perform color identification of the element elements, wherein different variable types correspond to different colors.
8. The editing adaptive display method according to claim 1, further comprising:
acquiring an expression of the contact;
dividing the expression of each contact to extract the variable name and the operation symbol name of each contact;
and displaying the variable name and the operation symbol name corresponding to the contact in a matching display area of the contact.
9. The editing adaptive display method according to claim 1, further comprising:
Responding to user operation, and creating a folding display starting point and a corresponding folding display ending point on the ladder diagram;
Responding to the operation of a user on the folding display starting point, if the ladder diagram between the folding display starting point and the corresponding folding display final point is in a non-folding hiding state, carrying out folding hiding on the ladder diagram between the folding display starting point and the corresponding folding display final point, and if the ladder diagram between the folding display starting point and the corresponding folding display final point is in a folding hiding state, opening the ladder diagram between the folding display starting point and the corresponding folding display final point and displaying.
10. The editing adaptive display method according to claim 1, further comprising:
The ladder diagram is divided into program organization units according to the relevance of functions;
Each program organization unit is provided with a unique navigation tag, and the program organization units establish a tag navigation list through the navigation tag of each program unit according to the connection relation and the sequence of the ladder diagram;
and responding to the operation of a user on any navigation tag, and displaying the ladder diagram content of the program organization unit corresponding to the navigation tag in the current displayable range of the ladder diagram editing interface.
11. A computer program product comprising a computer program and/or instructions which, when executed by a processor, implement the editing adaptive display method of any of claims 1-10.
CN202411385850.8A 2024-09-30 2024-09-30 An Editing Adaptive Display Method for Ladder Diagram Programming Pending CN119225269A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202411385850.8A CN119225269A (en) 2024-09-30 2024-09-30 An Editing Adaptive Display Method for Ladder Diagram Programming

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202411385850.8A CN119225269A (en) 2024-09-30 2024-09-30 An Editing Adaptive Display Method for Ladder Diagram Programming

Publications (1)

Publication Number Publication Date
CN119225269A true CN119225269A (en) 2024-12-31

Family

ID=94046026

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202411385850.8A Pending CN119225269A (en) 2024-09-30 2024-09-30 An Editing Adaptive Display Method for Ladder Diagram Programming

Country Status (1)

Country Link
CN (1) CN119225269A (en)

Similar Documents

Publication Publication Date Title
CA2937964C (en) Systems and methods for bi-directional visual scripting for programming languages
US7954082B2 (en) Automatically analyzing and modifying a graphical program
US8830266B1 (en) Merging electronic diagrams
CN112433702B (en) Lightweight process design system and method
US10983678B2 (en) Facilitating the prototyping and previewing of design element state transitions in a graphical design environment
US20060089728A1 (en) Sequence program editing apparatus
CN113805883A (en) Method and system for creating application program
CN115422621A (en) Method, system, device and storage medium for modifying colors of digital-analog parts in batch
CN117215585B (en) Visual description and dynamic control method and device for interface component attribute
CN119225269A (en) An Editing Adaptive Display Method for Ladder Diagram Programming
KR100528833B1 (en) Computer readable medium having thereon computer executable instruction for performing circuit simulation using real image circuit diagram
CN114238072A (en) HIL requirement design method, HIL requirement design device, computer equipment and storage medium
KR101940719B1 (en) Task graph construct apparatus and method of conversational processing system based on task graph
JP2003223204A (en) Programming method of programmable controller, system thereof and recording medium thereof
EP4498229A1 (en) Information processing apparatus, information processing method, and program
CN119126664A (en) An editing auxiliary method and device for ladder diagram programming
CN114428604B (en) A method for constructing interactive data large-screen visualization system based on blueprint
US20250110706A1 (en) Managing an app, such as developing an app including developing a user interface of the app, method, and system
KR100528832B1 (en) Method for circuit simulation using real image circuit diagram
CN119806662A (en) Method, device, equipment and medium for configuring visual mode of operating system
JP5151671B2 (en) Display control apparatus, display control method, and display control program
CN117170711A (en) Method, device, equipment and storage medium for updating function block parameters
JP2025008036A (en) Information processing system, control method for information processing system, and program
CN119003028A (en) Service logic dynamic execution method, system and equipment for low code development
KR100926832B1 (en) Efficient Shaping Method for Network Element Management

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination