CN103941627B - Conversion methods of the SFC to ladder diagram in a kind of programming based on PLC - Google Patents

Conversion methods of the SFC to ladder diagram in a kind of programming based on PLC Download PDF

Info

Publication number
CN103941627B
CN103941627B CN201410009324.1A CN201410009324A CN103941627B CN 103941627 B CN103941627 B CN 103941627B CN 201410009324 A CN201410009324 A CN 201410009324A CN 103941627 B CN103941627 B CN 103941627B
Authority
CN
China
Prior art keywords
branch
parallel
program block
row
starting
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.)
Expired - Fee Related
Application number
CN201410009324.1A
Other languages
Chinese (zh)
Other versions
CN103941627A (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.)
Southeast University
Original Assignee
Southeast University
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 Southeast University filed Critical Southeast University
Priority to CN201410009324.1A priority Critical patent/CN103941627B/en
Publication of CN103941627A publication Critical patent/CN103941627A/en
Application granted granted Critical
Publication of CN103941627B publication Critical patent/CN103941627B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Programmable Controllers (AREA)

Abstract

The invention discloses SFC in a kind of programming based on PLC to the conversion method of ladder diagram, comprise the following steps:(1)SFC program row chained lists are traveled through, the program block containing effective icon is obtained and converts it into two-dimensional array storage;(2)By step(1)In program block divided, be divided into simple sequence program block and connection in series-parallel program block, if simple sequence program block is then converted directly into ladder diagram, otherwise into step(3);(3)Judgment step(2)In connection in series-parallel program block be cascaded structure or parallel-connection structure;(4)By step(2)In connection in series-parallel program block partition be some branches, and check each branch;If branching into simple sequence structure, ladder diagram is directly converted into, otherwise into step(2).The invention provides a kind of SFC to ladder diagram conversion method, SFC is completed to ladder diagram, then the ladder diagram of the present invention is further converted into the work of instruction catalogue, can realize the communication of PLC and slave computer.

Description

Conversion methods of the SFC to ladder diagram in a kind of programming based on PLC
Technical field
The present invention relates to a kind of SFC in programming based on PLC to ladder diagram conversion method.
Background technology
Sequential control is a kind of important way of PLC programmings, is referred to according to the prespecified order of production technology,
In the presence of each input signal, according to internal state and event sequence, make each executing agency's automatic order Progress operate.SFC (Sequential Function Chart) language defined in IEC61131-3 standards is a kind of description The state transition diagram language of the control process of control system, function and characteristic, mainly by step, oriented line, switch condition and dynamic Make (or order) composition.The features such as it has simple, directly perceived, the book of complexity can be relatively easily write using this programmed method Sequence control program, so that operating efficiency is improved, for program debugging also extremely convenient.Ladder diagram, instruction catalogue, ladder diagram etc. All it is PLC important programming language.
For the conversion between ladder diagram and instruction catalogue, there is the method that many people propose maturation, for example:Application number Propose for 200410078297.X Chinese invention patent application and a kind of trapezoid figure program is converted into instruction list program Method and system;The Chinese invention patent application of Application No. 201210222777.3 propose it is a kind of applied to PLC develop The method that ladder diagram is converted to statement list.However, not yet it has been proposed that sequence control program is changed into ladder diagram or instruction catalogue Method.In order to realize the communication with slave computer, sequence control program must be converted into ladder diagram again, and be converted further into referring to Make table.The algorithm that rationally efficient sequence control program turns ladder diagram is particularly important in PLC programming softwares.
The content of the invention
Goal of the invention:The purpose of the present invention is to provide SFC in a kind of programming based on PLC in view of the shortcomings of the prior art and arrive The conversion method of ladder diagram, completes SFC to ladder diagram, then the ladder diagram of the present invention is further converted into the work of instruction catalogue Make, the communication of PLC and slave computer can be realized.
Technical scheme:In order to realize goal of the invention, the invention discloses a kind of SFC in programming based on PLC to ladder diagram Conversion method, it is characterised in that comprise the following steps:
(1) SFC program row chained lists are traveled through, obtain the program block containing effective icon and convert it into two-dimensional array depositing Storage;
(2) program block in step (1) is divided, is divided into simple sequence program block and connection in series-parallel program block, if single Sequencer program block is then converted directly into ladder diagram, otherwise into step (3).
(3) the connection in series-parallel program block in judgment step (2) is cascaded structure or parallel-connection structure;If series connection
Structure, then carry out the processing of cascaded structure from the starting position of cascaded structure, will each select the first of branch The inside ladder diagram of individual switch condition combines the foremost of antitheft cascaded structure;If parallel-connection structure, then in the knot of parallel-connection structure Beam position is that each branch increases STL+SXXX sentences, and wherein SXXX walks parameter for last state of branch;
(4) it is some branches by the connection in series-parallel program block partition in step (2), and checks each branch;If branching into list Sequential structure, then be directly converted into ladder diagram.
Preferably, being that blockette goes processing, this hair by SFC procedure divisions one big to improve conversion efficiency Bright that division is realized in step (2), step (2) comprises the following steps:
(2.1) whether the starting point of decision block is to select starting over or starting row in parallel and end line point for branch Branch line;
(2.2) first row of traversal said procedure block downwards, until there is selection the starting over of branch, starting row in parallel With end line branch line or end line, a blockette is divided into;If step (2.1) condition is set up, the blockette is The row of connection in series-parallel program block and starting over comprising selection branch or starting row in parallel and end line branch line, the otherwise sub- journey Sequence block is the row of simple sequence program block and starting over not comprising selection branch or starting row branch line in parallel;
(2.3) traversal downwards, repeat step (2.1) and step (2.2) are continued, until end line.Preferably, in order to carry The efficiency of each branch is checked in high step (4), step (4) of the invention comprises the following steps:
(4.1) by the connection in series-parallel program block partition in step (2) be some branches, find connection in series-parallel program block last The starting point row number of branch;
(4.2) whether starting over or starting row in parallel and end line point for selection branch is had according to the first row of the branch Branch line icon judges that this branches into simple sequence structure or series parallel structure;If simple sequence structure is then converted directly into trapezoidal Scheme and enter step (4.4), otherwise into step (4.3);
(4.3) since the starting point of branch downwards traversal, until run into selection branch start over or parallel connection starts Row branch line and end line, then traversal is until this line terminates to the right, and traversal downwards again repeats above-mentioned circulation, when running into Blank icon then jumps out circulation, and row number now is the end row number of the branch, a new program block is obtained, into step (4.2);
(4.4) judge whether the right also has branch, have, continue the processing of next branch, be not put into next step;Under One step is to judge whether starting point is starting row in parallel and end line branch line.
Beneficial effect:The present invention is completed compared with prior art there is provided a kind of SFC to ladder diagram conversion method SFC is further converted into the work of instruction catalogue to ladder diagram, then by the ladder diagram of the present invention, can realize PLC and slave computer Communication.
Brief description of the drawings
Fig. 1 is flow charts of the SFC of the present invention to the conversion method of ladder diagram;
Fig. 2 is SFC program examples of the invention;
Fig. 3 is the conversion ladder diagram of SFC program examples in Fig. 2.
Embodiment
The present invention is further described below in conjunction with the accompanying drawings.
Whether as shown in figure 1, starting to change a program block, it is the beginning for selecting branch to first determine whether its starting point Terminate or starting row in parallel and end line branch line, if not then determining that it is simple sequence program block, then travel through downwards until meeting Starting over or starting row branch line in parallel and end line and be converted into ladder diagram to selection branch, then judges whether Last column is reached, if last column then carries out the conversion of next program block, otherwise continues the subsequent cycle of this program block; If otherwise selection branch start over or starting row in parallel and end line branch line then determine that it is connection in series-parallel program block, then Further judged, whether be select the starting over of branch, if then judging that it, for series branch's structure, is looked for if judging it To the end line of connection in series-parallel program block, the starting point row number of last branch of connection in series-parallel program block is then found out;Judge branch Whether it is simple sequence branch, if simple sequence branch is then directly converted into ladder diagram, divides judging whether to also have on the right of it Branch, has, continues the processing of next branch, be not put into next step, and the branch is found if branch is not simple sequence branch Terminate row number and obtain a new program block, then also judge whether its right also has branch, have, continue the place of next branch Reason, is not put into next step;Next step is to judge whether starting point is starting row in parallel and end line branch line, if then direct Progress determines whether last column, otherwise increases STL+SXXX sentences for each branch, and wherein SXXX is last of branch Individual state walks parameter.
It is a SFC program example in Fig. 2, what Fig. 3 was then obtained for the SFC program examples by the conversion method of the present invention Ladder diagram.

Claims (2)

1. conversion methods of the SFC to ladder diagram in a kind of programming based on PLC, it is characterised in that comprise the following steps:
(1) SFC program row chained lists are traveled through, the program block containing effective icon is obtained and converts it into two-dimensional array storage;
(2) program block in step (1) is divided, is divided into simple sequence program block and connection in series-parallel program block, if simple sequence Program block is then converted directly into ladder diagram, otherwise into step (3);
(3) the connection in series-parallel program block in judgment step (2) is cascaded structure or parallel-connection structure;If cascaded structure, then from string The starting position for being coupled structure carries out the processing of cascaded structure, will each select the inside of first switch condition of branch trapezoidal Figure combination is put into the foremost of cascaded structure;If parallel-connection structure, then increase in the end position of parallel-connection structure for each branch STL+SXXX sentences, wherein SXXX walk parameter for last state of branch;
(4) it is some branches by the connection in series-parallel program block partition in step (2), and checks each branch;Step (4) includes following Step:
(4.1) it is some branches by the connection in series-parallel program block partition in step (2), finds last branch of connection in series-parallel program block Starting point row number;
(4.2) whether starting over or starting row in parallel and end line branch line for selection branch is had according to the first row of the branch Icon judges that this branches into simple sequence structure or series parallel structure;If simple sequence structure is then converted directly into ladder diagram simultaneously Into step (4.4), otherwise into step (4.3);
(4.3) traveled through downwards since the starting point of branch, until running into starting over or starting row point in parallel for selection branch Branch line and end line, then traversal is until this line terminates to the right, and traversal downwards again repeats above-mentioned circulation, when running into blank Icon then jumps out circulation, and row number now is the end row number of the branch, a new program block is obtained, into step (4.2);
(4.4) judge whether the right also has branch, have, continue the processing of next branch, be not put into next step;Next step To judge whether starting point is starting row in parallel and end line branch line.
2. conversion methods of the SFC to ladder diagram in a kind of programming based on PLC as claimed in claim 1, it is characterised in that step (2) comprise the following steps:
(2.1) whether the starting point of decision block is to select starting over or starting row in parallel and end line branch for branch Line;
(2.2) first row of traversal said procedure block downwards, until there is selection the starting over of branch, starting row in parallel and knot Beam row branch line or end line, are divided into a blockette;If step (2.1) condition is set up, the blockette is to go here and there simultaneously Join the row of program block and starting over comprising selection branch or starting row in parallel and end line branch line, otherwise the blockette Starting over for simple sequence program block and not comprising selection branch or the row of starting row branch line in parallel;
(2.3) traversal downwards, repeat step (2.1) and step (2.2) are continued, until end line.
CN201410009324.1A 2014-01-08 2014-01-08 Conversion methods of the SFC to ladder diagram in a kind of programming based on PLC Expired - Fee Related CN103941627B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410009324.1A CN103941627B (en) 2014-01-08 2014-01-08 Conversion methods of the SFC to ladder diagram in a kind of programming based on PLC

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410009324.1A CN103941627B (en) 2014-01-08 2014-01-08 Conversion methods of the SFC to ladder diagram in a kind of programming based on PLC

Publications (2)

Publication Number Publication Date
CN103941627A CN103941627A (en) 2014-07-23
CN103941627B true CN103941627B (en) 2017-09-08

Family

ID=51189346

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410009324.1A Expired - Fee Related CN103941627B (en) 2014-01-08 2014-01-08 Conversion methods of the SFC to ladder diagram in a kind of programming based on PLC

Country Status (1)

Country Link
CN (1) CN103941627B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102041772B1 (en) * 2016-08-30 2019-11-07 미쓰비시덴키 가부시키가이샤 Program editing device, program editing method and program editing program stored in the storage medium
CN107203380B (en) * 2017-05-24 2021-02-19 浙江中控技术股份有限公司 SFC program interpretation operation method and device
CN109933030B (en) * 2019-03-22 2020-05-08 江西蓝星星火有机硅有限公司 Sequence control method of chemical process, chemical equipment and storage medium
CN112327744B (en) * 2020-11-20 2021-10-22 深圳市海浦蒙特科技有限公司 Method for interconverting ladder diagram and instruction list for programmable logic controller

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101957745B (en) * 2009-07-16 2013-04-17 沈阳高精数控技术有限公司 Method for converting ladder diagram language into structure text language
CN102541514B (en) * 2010-12-09 2014-07-23 沈阳高精数控技术有限公司 Method for converting structural text language into trapezoidal graph language
KR101373442B1 (en) * 2011-09-16 2014-03-13 미쓰비시덴키 가부시키가이샤 Sequence program creating apparatus

Also Published As

Publication number Publication date
CN103941627A (en) 2014-07-23

Similar Documents

Publication Publication Date Title
CN103941627B (en) Conversion methods of the SFC to ladder diagram in a kind of programming based on PLC
CN104732355B (en) The device drives integrated dispatch method of equipment free time section adjustment
CN107861716B (en) Software-defined control system and control method
CN103279124B (en) Experiment system oriented to development of motor controller of electric vehicle
CN103259718B (en) A kind of stream table conversion method and device
CN104866334B (en) A kind of controller software code partitions method and its operation method
CN106648681A (en) System and method for compiling and loading programmable language
CN103927779B (en) Method for generating two-dimensional animation on basis of configuration
CN101551748B (en) Optimized compiling method
CN103942081A (en) Method for generating IL instruction lists of PLC ladder diagrams
CN107861458A (en) It is a kind of can autonomous configuration hardware resource PLC fast construction methods
CN110246208A (en) A kind of plug-in unit that cartoon making flow path efficiency can be improved
CN110630236B (en) Fracturing pump unit process control method and system based on fracturing technology
CN102799749B (en) Automatic generating method and generating system for distributed music lamplight performance scheme
CN104360906A (en) High-level comprehensive scheduling method based on difference constraint system and iterative model
CN110929850A (en) Deep learning operator automatic optimization system and method based on Shenwei processor
CN106096159A (en) Distributed system behavior simulation under a kind of cloud platform analyzes the implementation method of system
CN109471636A (en) The operator mapping method and system of coarseness reconfigurable architecture
CN105930162B (en) A kind of characteristic positioning method based on subgraph search
CN103116319B (en) The method that process tool selects control is automatically realized in digital control system
CN104572774A (en) Searching method and device
CN102736551B (en) The soft solution approach of a kind of PLC ladder diagram code
CN103419201B (en) Multi-knuckle robot control system based on FPGA (Field Programmable Gate Array) and control method thereof
CN107203380A (en) A kind of SFC interpretation of programs operation method and device
CN104375879B (en) Based on the binary translation method and device for performing tree depth

Legal Events

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

Granted publication date: 20170908

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