CN102508654A - Method for designing ladder diagram editing software of embedded PLC (Programmable Logic Controller) - Google Patents

Method for designing ladder diagram editing software of embedded PLC (Programmable Logic Controller) Download PDF

Info

Publication number
CN102508654A
CN102508654A CN2011103081007A CN201110308100A CN102508654A CN 102508654 A CN102508654 A CN 102508654A CN 2011103081007 A CN2011103081007 A CN 2011103081007A CN 201110308100 A CN201110308100 A CN 201110308100A CN 102508654 A CN102508654 A CN 102508654A
Authority
CN
China
Prior art keywords
node
binary tree
instruction
ladder diagram
scanning
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.)
Granted
Application number
CN2011103081007A
Other languages
Chinese (zh)
Other versions
CN102508654B (en
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.)
Jiangsu University of Science and Technology
Original Assignee
Jiangsu University of Science and Technology
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 Jiangsu University of Science and Technology filed Critical Jiangsu University of Science and Technology
Priority to CN201110308100.7A priority Critical patent/CN102508654B/en
Publication of CN102508654A publication Critical patent/CN102508654A/en
Application granted granted Critical
Publication of CN102508654B publication Critical patent/CN102508654B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Programmable Controllers (AREA)

Abstract

The invention provides a method for designing ladder diagram editing software of an embedded PLC (Programmable Logic Controller) and provides a method for establishing a binary tree by scanning a ladder diagram according to the direction of an 'energy flow' in the ladder diagram. According to the invention, the binary tree is taken as a center so that the conversion between the ladder diagram form and instruction list form of a user control program of the PLC is realized; and by utilizing a method for converting an instruction language into the binary tree, the mutual conversion between the ladder diagram which takes the binary tree as the center and an instruction list is finished. And finally, one editor of the embedded PLC is developed by applying VC++6.0 under a Windows platform; and the editor has the functions of realizing the drawing of the ladder diagram, and the mutual conversion between a ladder diagram language and an instruction list language and the like.

Description

The ladder Diagram Edit Software method for designing of embedded programmable controller
Technical field
The present invention is specifically related to a kind of method for designing of ladder Diagram Edit Software of embedded programmable controller, belongs to control system and electronic technology field.
Background technology
For a long time, PLC is in the main battle ground in industrial control automation field all the time, for various automation control appliances provide controlling schemes very reliably.Along with industrial expansion, the application of Programmable Logic Controller in Industry Control more and more widely, and be also increasingly high to the requirement of Programmable Logic Controller, so the Programmable Logic Controller of development of new is a development in future trend.
The PLC major part of China's use at present comes from Japan and more American-European countries; External PLC is mainly monopolized by Siemens Company, A-B company, Schneider company, Mitsubishi, Omron Corp, and the core technology of PLC is grasped in these countries and some large-scale foreign company's hands always.In recent years, China digested and assimilated through introducing these national technology, copied; Make the PLC product of China that certain development arranged; Small-sized PLC produces in batches at present, and medium-sized PLC has also had finished product, and large-scale PLC at present also under study for action.The product that has is not only supplied the home market, and the product that also has also exports.In the PLC application facet, China is very active, and the industry of application is also very wide.
Many industrial automatic control products are arranged at present, electromechanical integrated product begins to turn to the computing machine is the control mode of platform.The up-to-date release of German Industrial circle is the soft PLC of platform with the computing machine.The actual function of utilizing software to realize conventional P LC of soft PLC.The characteristics of soft PLC are:
(1) based on the flexible programmable logic control of industrial computer technology, can make full use of the latest computed machine high speed, high capacity, enrich function and various software resource.
(2) soft PLC is open programmable logic controller (PLC), can obtain to use widely in control in real time, network control and step control field.
(3) soft PLC is a real-time multi-task operating system, and strong instruction can be provided, the operation of scanning more fast and safety.
(4) open structure is connected to I/O module, PID module, motion-control module and device, network easily.
The maximum advantage of soft PLC is to possess the flexible extension ability, and the user can select the various hardware products of different manufacturers production, makes full use of the optkmal characteristics of each software, forms the best control system.Simultaneously also very convenient with being connected of hardware.There is a lot of I/O cards can be directly connected on the soft PLC computer bus.Thereby aspect soft, hardware two, can reach the perfect adaptation of industrial computer and PLC performance, make things convenient for performance expansion and man-machine communication, be following great development trend of PLC.
Up to the present; The embedded programmable controller of China has had very big development, and the famous institutions of higher learning such as Wuhan University of Technology, Beijing University of Technology, Nanjing space flight and aviation university are obtaining certain achievement aspect the research of embedded programmable controller.In addition, the exploitation that the prestige automatic control company of section of Huangshi is successful be the embedded programmable controller of hardware platform with 8051 single-chip microcomputers, independent intellectual property right has been arranged, product has come into the market to sell.
There is great demand in China to PLC, but the PLC that China uses is external product basically.Along with industrial expansion, novel and intelligent Programmable Logic Controller must be a development in future trend.Develop autonomous embedded programmable controller and not only can adapt to the development trend of PLC in the future, and China is broken external monopolization certain meaning is also arranged.
Soft PLC utilizes software to realize the function of conventional P LC, is the recent tendency of PLC technical development.But the whole design of embedded programmable controller at present also is in the elementary step, all await aspect theory research and the practical applications further perfect.Develop out a kind of product of maturation, have got long long way to go, be mainly reflected in the following aspects:
1, how to convert the successful instruction list of host computer ladder diagram conversion into language that slave computer can be discerned.
2, continue to improve the optimization Algorithm of ladder diagram to the instruction list language conversion.
3, improve the error detecing capability of ladder diagram instruction in the editing machine.
4, can design a cover in the face of the independently download tool of host computer editing machine, the code of conversion can be downloaded in the slave computer move.
Summary of the invention
Ladder diagram is that PLC is the most basic, and the programming language of imagery is very convenient for the operating personnel that are familiar with relay.Therefore, the trapezoidal pattern programming language of the embedded programmable controller of the present invention design remains ladder diagram, only will with trapezoid figure language convert to embedded slave computer the language that can discern.The objective of the invention is to provide a kind of ladder Diagram Edit Software method for designing of embedded programmable controller according to the defective that prior art exists.
The ladder Diagram Edit Software method for designing of embedded programmable controller of the present invention is characterized in that comprising the steps:
Step 1: the design of component library;
Step 2: the drafting of ladder diagram;
Step 3: the modification of component attributes and deletion;
Step 4: syntax check:
At first, whether be output winding perhaps carry out coil, if do not have, then report an error if detect each ladder diagram; Secondly whether inspection has the generation of short circuit, open circuit conditions: check in order whether the branch road between two adjacent parallel wires has straight line directly to link to each other; Can whether there be element to judge through scanning between two parallel wires; Be not short circuit if element is arranged then prove, if the number of element be zero then be exactly short circuit, scanned element is all carried out record; If finish the element that the back discovery does not scan in addition in the inspection scanning process, the branch road that then just proves this element place is for opening circuit;
Step 5: ladder diagram changes into instruction list
Employing is that the method at center realizes the conversion of ladder diagram to instruction list with " binary tree ";
Step 6: instruction list converts ladder diagram to.
The method for building up of the said binary tree of step 5 comprises the steps:
The 1st step, at first confirm the direction of scanning, if scanning from left to right, then write down the inflow node and the chain tabular value that flows out node of element respectively; If scanning from top to bottom, then with the outflow node of the element that scans earlier with after the inflow node of the element that scans be designated as a value.The mode of judging scanning is, judges whether the ordinate of inflow node of the element that ordinate and the next one of the outflow node of the element that scans earlier will scan identical, if identical be from top to bottom direction of scanning, otherwise, then be scan mode from left to right;
The 2nd step; If identical if first node flows into the inflow node chained list of node chained list and second node, the outflow node chained list that first node flows out node chained list and second node is identical, then two nodes be or relation; Set up the OR node; Set up a little binary tree, two elements are respectively left and right sides subtree, and what scan earlier is left subtree; If there are a plurality of elements in parallel, then according to after preceding two the element parallel connections of sequencing, result in parallel and the 3rd element parallel connection are set up binary tree, by that analogy;
In the 3rd step, the inflow node chained list of first node is identical with the outflow node chained list of second node, then two nodes be with relation, set up the AND node, set up a little binary tree, two elements are respectively left and right sides subtree, what scan earlier is left subtree.If a plurality of element connected in series are arranged, then according to after preceding two element connected in series of sequencing, series connection result and the 3rd element connected in series are set up binary tree, by that analogy;
In the 4th step, the AND node of foundation and OR node also can be set up new logical relation according to this principle and other element, set up new binary tree, by that analogy, convert ladder diagram to binary tree.
The 5th step: convert binary tree to the instruction list language.
When setting up binary tree; Series connection piece and parallel-connected blocks all are saved in the chained list as data; Set in the transfer process of instruction set in realization, adopt the postorder traversal method that tree is traveled through, convert binary tree to the instruction list language; The left subtree of first access tree just, postorder traversal right subtree and root node successively then.
When converting instruction list to ladder diagram, under the situation of confirming no grammer and logic error, at first will scan instruction list, concrete performing step is following:
1) confirming that grammer does not have under the wrong situation; Scan instruction table: when reading LD or LDN instruction; Apply for that a node sets up binary tree; First node is revised the node data of binary tree based on the component data that after scanning, is kept in the chained list in instruction and the step 5 simultaneously as the left subtree of binary tree;
2) if when reading AND or AND NOT instruction; Be exactly that row increase instruction; Require two new nodes of application this moment; Father node as binary tree, another revises each node data of new binary tree based on the component data that after scanning, is kept in the chained list in present instruction and the step 5 then as the right subtree of binary tree;
3) if when reading OR or OR NOT instruction; Be exactly that row increases instruction; Two new nodes of same requirement application this moment; Father node as binary tree, another revises each node data of new binary tree based on the component data that after scanning, is kept in the chained list in present instruction and the step 5 then as the right subtree of binary tree;
4) if read ALD instruction or OLD instruction; Require this moment application one new node as father node; Current binary tree and last binary tree are merged, form a new binary tree, wherein previous binary tree is a left sibling; Current binary tree is right node, revises each node data of new binary tree based on the component data that after scanning, is kept in the chained list in present instruction and the step 5 then;
5) when logical block and individual node were operated, individual node was equivalent to us and has read the LD instruction, be as left subtree; When a plurality of logical blocks and individual node are operated; We will operate individual node and first logical block; Operate with other logical blocks successively then, revise each node data of new binary tree according to the component data that after scanning, is kept in the chained list in present instruction and the step 5 then;
6) repeat above-mentioned achievement method,, revise each node data of new binary tree according to the component data that after scanning, is kept in the chained list in present instruction and the step 5 then, can the instruction list language conversion be become binary tree up to reading the OUT instruction;
7) adopt the postorder traversal method, convert binary tree to ladder diagram.
The present invention has provided the interpretation procedure of embedded programmable controller (PLC) ladder diagram instruction, proposed according to " flowing " in the ladder diagram thus direction scan the method that ladder diagram is set up binary tree.With the binary tree is the center, has realized the conversion between the diagram in ladder form and instruction sheet form of PLC user control program, and the instruction list language conversion is the method for binary tree, has accomplished the mutual conversion of the ladder diagram and the instruction list that with the binary tree are the center.Last under windows platform Application V C++6.0 developed a cover editing machine of embedded programmable controller, this editing machine can be realized functions such as ladder diagram is drawn, trapezoid figure language and instruction list language is changed each other.The ladder Diagram Edit Software of exploitation, its function comprise that user interface, ladder diagram editor module, ladder diagram are to the modular converter of instruction list etc.This software support is drawn the ladder diagram element with the dilatory mode of mouse, and the change to the component attributes in the ladder diagram is supported in operations such as the insertion of support ladder diagram element, deletion, prompting mistake when supporting to run into grammer, morphology mistake in editor's ladder diagram process, etc.
Description of drawings
Fig. 1: element is drawn flow process;
Fig. 2: the drafting flow process of row;
Fig. 3: syntax check flow process;
Fig. 4: the process flow diagram of setting up binary tree;
Fig. 5: ladder diagram and instruction table conversion regime.
Embodiment
Below in conjunction with accompanying drawing embodiments of the invention are done detailed explanation.
Program master interface
Main interface mainly partly is made up of title block, menu bar, tool bar hurdle, status bar, ladder diagram drawing district, instruction code/mistake viewing area etc.
1, title block is used to show the title of the software that is using and the title of the file edited.
2, menu bar has held the option of all software functions that can use.As to the processing of file (comprise newly-built, open, close, preserve, save as, attribute and withdraw from etc.), editor's (comprise shearing, paste and duplicate), search etc.
3, tool bar hurdle is generally used for placing the software function option that needs frequent use.Comprise editting function commonly used, ladder diagram element commonly used and connecting line, and the function of program run etc.
4, ladder diagram is drawn and is distinguished, and is used to draw the PLC trapezoid figure program.
5, instruction list viewing area is used for the idsplay order list language.
6, instruction code/mistake viewing area is used to show the result after the PLC program compilation, makes things convenient for the user to understand the problem place of program.
The design of component library
Describing an element, mainly is the various attributes of describing it, mainly is to embody graphic attribute and physical attribute in the middle of software.Graphic attribute is meant: the slip-stick artist uses trapezoidal pattern programming software that element is drawn on the computer screen; Form ladder diagram; When being drawn in element on the computer screen with the element figure, the attribute such as coordinate, size of describing this element just is called as the graphic attribute of element.Physical attribute is exactly attributes such as the title, note of finger element.
The attribute of element can be used a quadruple notation in the ladder diagram: (component type, position, title).Wherein, component type is represented the species of element, like horizontal line, normally opened contact, normally closed contact, often burst at the seams circle, timer, counter etc.; In order to represent the position of element, can regard whole ladder diagram as a plane, again this plane is divided into a grid matrix, use the ranks of element in grid matrix just can represent; Title also is a necessary attribute of element, and it has represented the specific address in the PLC hardware, like the 0th contact of 10.0 expression PLC hardware.
Utilize OO notion; With the attribute representation of element is a CLdsymbol class; When in compiler, working out trapezoid figure program, the information of ladder diagram element has been recorded in the corresponding class formation, and they are: the symbol of ranks position, element place, element, the variable that element is corresponding etc.
The drafting of ladder diagram
The contact that ladder diagram editor only need clearly be expressed between each graphic element and graphic element gets final product.Step in the ladder diagram, row and element all are the entity objects that is generated by separately class, get in touch through chained list between them.In drawing the process of ladder diagram, mainly be through creating new step object, row object and element object and its address pointer being inserted in the corresponding chained list or changes the attribute of the element object that has existed.In the ladder diagram editor process, mainly be the drafting and the editor of element, row, step.
1, the drafting of element
Element is a least unit of forming ladder diagram, and the drafting of row and step has all comprised the drafting of element.Realize the drafting of element through the attribute that changes the element object that has existed.Its flow process is as shown in Figure 1.
2, the drafting of row
The design philosophy of drawing row generates a capable object exactly, inserts in the corresponding step chained list based on the insertion position of appointment on the ladder diagram address pointer with this row object again, and its flow process as shown in Figure 2.
3, the drafting of step
The design philosophy of drawing step is identical with the design philosophy of drawing row, and implementation method is similar.
The modification of component attributes and deletion
The element that has just drawn and, its each item attribute generally can not meet the demands fully, needs it is made amendment.The form that adopts traditional attribute that dialog box is set is provided with the property value of each element.Double-click element, will show a dialog box, the value that explicit user can be revised in the dialog box.After user's modification finishes, click " confirming " close box, the value of the new input of user will be presented on the ladder diagram, i.e. the value of the new input of user has replaced original component attributes.
The deletion of element is exactly to choose element, utilizes delete key or the DEL key in the keyboard in the toolbar to accomplish.
Syntax check
Carrying out ladder diagram before the instruction list conversion, guarantee that the ladder diagram of being write does not meet the problem of standard.If have, possibly in the process of compiling, can provide error message.Therefore before the instruction list conversion, carry out syntax check.
According to the characteristics of ladder diagram editor, at first, whether have output winding or carry out coil, if do not have, then report an error if detect each ladder diagram.Secondly whether inspection has short circuit, open circuit conditions.The situation of short circuit is exactly to exist the situation that straight line directly links to each other between two parallel wires.Be exactly to check in order whether whether the branch road between two adjacent parallel wires has straight line directly to link to each other, can have element to judge through scanning between two parallel wires in the time of inspection.Not short circuit if element is arranged then prove, if the number of element is zero then is exactly short circuit.As for opening circuit, can scanned element all be carried out record, if finish the element that the back discovery does not scan in addition in the inspection scanning process, the branch road that then just proves this element place is for opening circuit.
After accomplishing syntax check, can carry out next step work, promptly ladder diagram is to the instruction list conversion process, comprises in this process that ladder diagram arrives the transformation of tree, produced several steps such as instruction list language by tree, and process flow diagram is as shown in Figure 3.
Ladder diagram changes into instruction list
Ladder diagram is as a kind of graphical language; Sequence of positions and the attribute of each element self between row and capable, element and the element in writing the process of trapezoid figure program, have just been stored; Logical relation between the element is not stored, and this is a difficult problem that must solve in the transfer process of ladder diagram.It is that the method at center realizes the conversion of ladder diagram to instruction list that the present invention adopts with " binary tree ".
Ladder diagram is well-regulated when being visited; Generally be to begin from left to right from bus; From top to bottom; Therefore certain rules is arranged when setting up binary tree: regard each element of ladder diagram the node of binary tree as, begin scanning by first element of each step of ladder diagram, scanning is set up a binary tree with each step after accomplishing.According to the similarity of ladder diagram and binary tree structure, will export as root node, other elements just look like to be the branch of binary tree.It should be noted that owing to there is the serial or parallel connection of piece, must the logical relation between element also be expressed as the node of binary tree.Like this, can all utilize logical relation to associate all elements through scanning whole ladder diagram.Each ladder diagram network can be expressed as a binary tree so, and whole PLC user program is exactly the orderly arrangement of a series of binary trees, just the binary tree forest.
The present invention has provided a kind of direction that " can flow " according to ladder diagram and scanned ladder diagram, concerns the method for setting up binary tree through the inflow node of element in the ladder diagram and the location logic that flows out between the node then, and is as shown in Figure 4.
The order of scanning ladder diagram is according to from left to right, order from top to bottom, the inflow node that has just obtained each element with flow out node, and these data are existed in the storehouse.When scanning, when the inflow node of the outflow node of certain element and certain element is identical, be designated as a value, just the realization for the back parallel-connected blocks provides convenience.Specific algorithm is following:
The 1st step, at first confirm the direction of scanning, if scanning from left to right, then write down the inflow node and the chain tabular value that flows out node of element respectively; If scanning from top to bottom, then with the outflow node of the element that scans earlier with after the inflow node of the element that scans be designated as a value.The mode of judging scanning is, judges whether the ordinate of inflow node of the element that ordinate and the next one of the outflow node of the element that scans earlier will scan identical, if identical be from top to bottom direction of scanning, otherwise, then be scan mode from left to right.
The 2nd step; If identical if first node flows into the inflow node chained list of node chained list and second node, the outflow node chained list that first node flows out node chained list and second node is identical, then two nodes be or relation; Set up the OR node; Set up a little binary tree, two elements are respectively left and right sides subtree, and what scan earlier is left subtree.If there are a plurality of elements in parallel, then according to after preceding two the element parallel connections of sequencing, binary tree is set up in result in parallel and the 3rd element parallel connection, and other by that analogy.
In the 3rd step, the inflow node chained list of first node is identical with the outflow node chained list of second node, then two nodes be with relation, set up the AND node, set up a little binary tree, two elements are respectively left and right sides subtree, what scan earlier is left subtree.If a plurality of element connected in series are arranged, then according to after preceding two element connected in series of sequencing, series connection result and the 3rd element connected in series are set up binary tree, and other by that analogy.
In the 4th step, the AND node of foundation and OR node also can be set up new logical relation according to this principle and other element, set up new binary tree, by that analogy, convert ladder diagram to binary tree.
The 5th step: convert binary tree to the instruction list language.
When setting up binary tree, series connection piece and parallel-connected blocks all are saved in chained list as data and have suffered.Therefore, set in the transfer process of instruction set realizing, the present invention adopts the postorder traversal method that tree is traveled through, and converts binary tree to the instruction list language, the left subtree of first access tree just, postorder traversal right subtree and root node successively then.
Instruction list converts ladder diagram to
Converting trapezoid figure program into from instruction catalogue program is the inverse process of trapezoid figure program to the instruction catalogue program conversion.Therefore, above-mentioned is that the transfer algorithm at center is equally applicable to the conversion of instruction catalogue program to trapezoid figure program with the binary tree, as shown in Figure 5.
Convert trapezoid figure program into by instruction catalogue program, the problem that needs to handle is through the analysis to the PLC instruction list, finds out its internal logic relation, and then obtains the logic state of output element, thereby realizes the conversion of instruction list to ladder diagram.For instruction list and ladder diagram, the difference between the two is that ladder diagram is an one-dimensional representation, and instruction code is a two-dimensional representation.
When converting instruction list to ladder diagram, under the situation of confirming no grammer and logic error, at first to scan instruction list.Concrete performing step is following:
1, confirming that grammer does not have under the wrong situation scan instruction table.Read LD or LDN instruction time, apply for that a node sets up binary tree, first node is as the left subtree of binary tree, and the while is according to the node data of modifying of order binary tree.Generally say, conversion adapts to obeys some rules, as be LD or LDN instruction with bus links to each other.
If 2 when reading AND or AND NOT instruction; Be exactly that row increase instruction, require two new nodes of application this moment, a father node as binary tree; Another revises each node data of new binary tree according to present instruction then as the right subtree of binary tree.
If 3 when reading OR or OR NOT instruction; Be exactly that row increases instruction, require two new nodes of application, a father node this moment equally as binary tree; Another revises each node data of new binary tree according to present instruction then as the right subtree of binary tree.
If 4 read ALD instruction or OLD instruction; Require this moment application one new node as father node; Merge current binary tree and last binary tree, form a new binary tree, wherein previous binary tree is a left sibling; Current binary tree is right node, revises each node data of new binary tree according to present instruction then.
5, when logical block and individual node were operated, individual node was equivalent to us and has read the LD instruction, be as left subtree; When a plurality of logical blocks and individual node were operated, we will operate individual node and first logical block, operate with other logical blocks successively then, revise each node data of new binary tree according to present instruction then.
6, repeat above-mentioned achievement method,, revise each node data of new binary tree according to present instruction then, can the instruction list language conversion be become binary tree up to reading the OUT instruction.
7, adopt the postorder traversal algorithm, convert binary tree to ladder diagram.

Claims (4)

1. the ladder Diagram Edit Software method for designing of an embedded programmable controller is characterized in that comprising the steps:
Step 1: the design of component library;
Step 2: the drafting of ladder diagram;
Step 3: the modification of component attributes and deletion;
Step 4: syntax check:
At first, whether be output winding perhaps carry out coil, if do not have, then report an error if detect each ladder diagram; Secondly whether inspection has the generation of short circuit, open circuit conditions: check in order whether the branch road between two adjacent parallel wires has straight line directly to link to each other; Can whether there be element to judge through scanning between two parallel wires; Be not short circuit if element is arranged then prove, if the number of element be zero then be exactly short circuit, scanned element is all carried out record; If finish the element that the back discovery does not scan in addition in the inspection scanning process, the branch road that then just proves this element place is for opening circuit;
Step 5: ladder diagram changes into instruction list
Employing is that the method at center realizes the conversion of ladder diagram to instruction list with " binary tree ";
Step 6: instruction list converts ladder diagram to.
2. the ladder Diagram Edit Software method for designing of embedded programmable controller according to claim 1 is characterized in that the method for building up of the said binary tree of step 5 comprises the steps:
The 1st step, at first confirm the direction of scanning, if scanning from left to right, then write down the inflow node and the chain tabular value that flows out node of element respectively; If scanning from top to bottom, then with the outflow node of the element that scans earlier with after the inflow node of the element that scans be designated as a value.The mode of judging scanning is, judges whether the ordinate of inflow node of the element that ordinate and the next one of the outflow node of the element that scans earlier will scan identical, if identical be from top to bottom direction of scanning, otherwise, then be scan mode from left to right;
The 2nd step; If identical if first node flows into the inflow node chained list of node chained list and second node, the outflow node chained list that first node flows out node chained list and second node is identical, then two nodes be or relation; Set up the OR node; Set up a little binary tree, two elements are respectively left and right sides subtree, and what scan earlier is left subtree; If there are a plurality of elements in parallel, then according to after preceding two the element parallel connections of sequencing, result in parallel and the 3rd element parallel connection are set up binary tree, by that analogy;
In the 3rd step, the inflow node chained list of first node is identical with the outflow node chained list of second node, then two nodes be with relation, set up the AND node, set up a little binary tree, two elements are respectively left and right sides subtree, what scan earlier is left subtree.If a plurality of element connected in series are arranged, then according to after preceding two element connected in series of sequencing, series connection result and the 3rd element connected in series are set up binary tree, by that analogy;
In the 4th step, the AND node of foundation and OR node also can be set up new logical relation according to this principle and other element, set up new binary tree, by that analogy, convert ladder diagram to binary tree.
The 5th step: convert binary tree to the instruction list language.
3. the ladder Diagram Edit Software method for designing of embedded programmable controller according to claim 2; It is characterized in that when setting up binary tree series connection piece and parallel-connected blocks all are saved in the chained list as data, set in the transfer process of instruction set in realization; Adopt the postorder traversal method that tree is traveled through; Convert binary tree to the instruction list language, the left subtree of first access tree just, postorder traversal right subtree and root node successively then.
4. the ladder Diagram Edit Software method for designing of embedded programmable controller according to claim 1; When it is characterized in that converting instruction list to ladder diagram; Under the situation of confirming no grammer and logic error, at first to scan instruction list, concrete performing step is following:
1) confirming that grammer does not have under the wrong situation; Scan instruction table: when reading LD or LDN instruction; Apply for that a node sets up binary tree; First node is revised the node data of binary tree based on the component data that after scanning, is kept in the chained list in instruction and the step 5 simultaneously as the left subtree of binary tree;
2) if when reading AND or AND NOT instruction; Be exactly that row increase instruction; Require two new nodes of application this moment; Father node as binary tree, another revises each node data of new binary tree based on the component data that after scanning, is kept in the chained list in present instruction and the step 5 then as the right subtree of binary tree;
3) if when reading OR or OR NOT instruction; Be exactly that row increases instruction; Two new nodes of same requirement application this moment; Father node as binary tree, another revises each node data of new binary tree based on the component data that after scanning, is kept in the chained list in present instruction and the step 5 then as the right subtree of binary tree;
4) if read ALD instruction or OLD instruction; Require this moment application one new node as father node; Current binary tree and last binary tree are merged, form a new binary tree, wherein previous binary tree is a left sibling; Current binary tree is right node, revises each node data of new binary tree based on the component data that after scanning, is kept in the chained list in present instruction and the step 5 then;
5) when logical block and individual node were operated, individual node was equivalent to us and has read the LD instruction, be as left subtree; When a plurality of logical blocks and individual node are operated; We will operate individual node and first logical block; Operate with other logical blocks successively then, revise each node data of new binary tree according to the component data that after scanning, is kept in the chained list in present instruction and the step 5 then;
6) repeat above-mentioned achievement method,, revise each node data of new binary tree according to the component data that after scanning, is kept in the chained list in present instruction and the step 5 then, can the instruction list language conversion be become binary tree up to reading the OUT instruction;
7) adopt the postorder traversal method, convert binary tree to ladder diagram.
CN201110308100.7A 2011-10-11 2011-10-11 Method for designing ladder diagram editing software of embedded PLC (Programmable Logic Controller) Expired - Fee Related CN102508654B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201110308100.7A CN102508654B (en) 2011-10-11 2011-10-11 Method for designing ladder diagram editing software of embedded PLC (Programmable Logic Controller)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201110308100.7A CN102508654B (en) 2011-10-11 2011-10-11 Method for designing ladder diagram editing software of embedded PLC (Programmable Logic Controller)

Publications (2)

Publication Number Publication Date
CN102508654A true CN102508654A (en) 2012-06-20
CN102508654B CN102508654B (en) 2014-07-02

Family

ID=46220747

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201110308100.7A Expired - Fee Related CN102508654B (en) 2011-10-11 2011-10-11 Method for designing ladder diagram editing software of embedded PLC (Programmable Logic Controller)

Country Status (1)

Country Link
CN (1) CN102508654B (en)

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103559727A (en) * 2013-11-20 2014-02-05 北京四方继保自动化股份有限公司 Ladder diagram data structural description and scanning analytic method
CN103942081A (en) * 2014-03-07 2014-07-23 东莞市升力智能科技有限公司 Method for generating IL instruction lists of PLC ladder diagrams
CN104317631A (en) * 2014-10-24 2015-01-28 湖南先步信息股份有限公司 Statement list to ladder diagram conversion method
CN104331314A (en) * 2014-10-31 2015-02-04 郑州众智科技股份有限公司 Method for converting PLC (Programmable Logic Controller) ladder diagram into instruction list based on generator set controller
CN104460489A (en) * 2014-11-12 2015-03-25 郑州众智科技股份有限公司 Method for converting PLC instruction list into ladder diagram based on generator set controller
CN104834525A (en) * 2015-05-14 2015-08-12 南京南瑞继保电气有限公司 Graphical page linked network processing method based on relay points
CN106547252A (en) * 2015-09-17 2017-03-29 发那科株式会社 The ladder diagram supervising device for showing CNC operation conditions can be added in annotation
CN106990750A (en) * 2017-04-01 2017-07-28 贝加莱工业自动化(中国)有限公司 A kind of ladder diagram online editing system and method
CN107678393A (en) * 2017-08-30 2018-02-09 广东工业大学 A kind of intelligent spraying control system and method based on Soft- PLC
CN110471700A (en) * 2019-08-06 2019-11-19 Oppo广东移动通信有限公司 Graphic processing method, device, storage medium and electronic equipment
CN112180817A (en) * 2019-07-02 2021-01-05 北京东土科技股份有限公司 Method, device, equipment and storage medium for transforming ladder diagram into binary tree
CN112327744A (en) * 2020-11-20 2021-02-05 深圳市海浦蒙特科技有限公司 Method for interconverting ladder diagram and instruction list for programmable logic controller

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1588256A (en) * 2004-09-23 2005-03-02 艾默生网络能源有限公司 Method and system for changing ladder diagram program into instruction listing program
CN101364098A (en) * 2008-09-12 2009-02-11 南京航空航天大学 Method and system for conversing trapezoidal pattern to be instruction catalogue program, and interpretation execution method and system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1588256A (en) * 2004-09-23 2005-03-02 艾默生网络能源有限公司 Method and system for changing ladder diagram program into instruction listing program
CN101364098A (en) * 2008-09-12 2009-02-11 南京航空航天大学 Method and system for conversing trapezoidal pattern to be instruction catalogue program, and interpretation execution method and system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
袁海英等: "基于嵌入式系统的软PLC技术研究", 《广西工学院学报》 *

Cited By (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103559727A (en) * 2013-11-20 2014-02-05 北京四方继保自动化股份有限公司 Ladder diagram data structural description and scanning analytic method
CN103559727B (en) * 2013-11-20 2016-04-20 北京四方继保自动化股份有限公司 A kind of ladder diagram data structure describes and scanning analytic method
CN103942081A (en) * 2014-03-07 2014-07-23 东莞市升力智能科技有限公司 Method for generating IL instruction lists of PLC ladder diagrams
CN104317631A (en) * 2014-10-24 2015-01-28 湖南先步信息股份有限公司 Statement list to ladder diagram conversion method
CN104317631B (en) * 2014-10-24 2018-02-09 湖南先步信息股份有限公司 Conversion method of the statement list to ladder diagram
CN104331314B (en) * 2014-10-31 2017-06-27 郑州众智科技股份有限公司 A kind of method that PLC ladder diagrams based on generator set controller turn instruction catalogue
CN104331314A (en) * 2014-10-31 2015-02-04 郑州众智科技股份有限公司 Method for converting PLC (Programmable Logic Controller) ladder diagram into instruction list based on generator set controller
CN104460489A (en) * 2014-11-12 2015-03-25 郑州众智科技股份有限公司 Method for converting PLC instruction list into ladder diagram based on generator set controller
CN104460489B (en) * 2014-11-12 2017-04-12 郑州众智科技股份有限公司 Method for converting PLC instruction list into ladder diagram based on generator set controller
CN104834525A (en) * 2015-05-14 2015-08-12 南京南瑞继保电气有限公司 Graphical page linked network processing method based on relay points
CN106547252A (en) * 2015-09-17 2017-03-29 发那科株式会社 The ladder diagram supervising device for showing CNC operation conditions can be added in annotation
CN106547252B (en) * 2015-09-17 2019-03-29 发那科株式会社 The ladder diagram monitoring device of display CNC operation conditions can be added in annotation
CN106990750A (en) * 2017-04-01 2017-07-28 贝加莱工业自动化(中国)有限公司 A kind of ladder diagram online editing system and method
CN107678393A (en) * 2017-08-30 2018-02-09 广东工业大学 A kind of intelligent spraying control system and method based on Soft- PLC
CN112180817A (en) * 2019-07-02 2021-01-05 北京东土科技股份有限公司 Method, device, equipment and storage medium for transforming ladder diagram into binary tree
CN110471700A (en) * 2019-08-06 2019-11-19 Oppo广东移动通信有限公司 Graphic processing method, device, storage medium and electronic equipment
CN112327744A (en) * 2020-11-20 2021-02-05 深圳市海浦蒙特科技有限公司 Method for interconverting ladder diagram and instruction list for programmable logic controller
CN112327744B (en) * 2020-11-20 2021-10-22 深圳市海浦蒙特科技有限公司 Method for interconverting ladder diagram and instruction list for programmable logic controller

Also Published As

Publication number Publication date
CN102508654B (en) 2014-07-02

Similar Documents

Publication Publication Date Title
CN102508654B (en) Method for designing ladder diagram editing software of embedded PLC (Programmable Logic Controller)
JP7054250B2 (en) Quick custom design methods and systems for smart factories
Drath et al. AutomationML-the glue for seamless automation engineering
CN101739484B (en) Knowledge component-based engineering design method
CN101957745B (en) Method for converting ladder diagram language into structure text language
CN102044016A (en) Method and device for realizing automatic product configuration by utilizing spreadsheet definition rule
CN101802826B (en) Configuring of intelligent electronic device
CN104484499A (en) Dynamic simulation image rapid generation method for substation secondary circuit
CN103941650B (en) Logical AND motion integrated manipulator
CN103605660B (en) Graphic processing method for SCD (Substation Configuration Description) file
Liu Fast industrial product design method and its application based on 3D CAD system
CN115098218B (en) Description and simulation method from FMU model to functional block model in configuration software
CN103077448A (en) CAPP (computer aided progress planning) system of sheetmetal
CN103942081A (en) Method for generating IL instruction lists of PLC ladder diagrams
CN109783886A (en) Emerging system and method for GIM model and IFC model
CN101206468B (en) Modelling method in computer numerical control field
CN115562629A (en) RPA flow representation method, system, device and storage medium
CN101561671A (en) Method for deigning ladder diagram based on components
CN103324541A (en) Method for automatically transmitting data between software
CN111462272A (en) Computer interlocking station yard data configuration method and control system
JP5777842B2 (en) Programming tools
CN113434798B (en) Code-free RPA automatic process file generation method and system
CN104656543A (en) PLC gradient diagram matrix editing display method
CN104750887A (en) Method for generating parameterized unit in modularized mode
CN103885810A (en) Gerber file compiler based on regular expressions

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20140702

Termination date: 20161011

CF01 Termination of patent right due to non-payment of annual fee