[go: up one dir, main page]

WO2018030831A1 - Apparatus and method for converting plc control program into structured data - Google Patents

Apparatus and method for converting plc control program into structured data Download PDF

Info

Publication number
WO2018030831A1
WO2018030831A1 PCT/KR2017/008728 KR2017008728W WO2018030831A1 WO 2018030831 A1 WO2018030831 A1 WO 2018030831A1 KR 2017008728 W KR2017008728 W KR 2017008728W WO 2018030831 A1 WO2018030831 A1 WO 2018030831A1
Authority
WO
WIPO (PCT)
Prior art keywords
contact
relationship
block
plc control
control program
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.)
Ceased
Application number
PCT/KR2017/008728
Other languages
French (fr)
Korean (ko)
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.)
UDMTEK
Original Assignee
UDMTEK
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
Priority claimed from KR1020170101465A external-priority patent/KR102004456B1/en
Application filed by UDMTEK filed Critical UDMTEK
Priority to CN201780049616.XA priority Critical patent/CN109643100B/en
Publication of WO2018030831A1 publication Critical patent/WO2018030831A1/en
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

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/18Numerical control [NC], i.e. automatically operating machines, in particular machine tools, e.g. in a manufacturing environment, so as to execute positioning, movement or co-ordinated operations by means of programme data in numerical form
    • G05B19/408Numerical control [NC], i.e. automatically operating machines, in particular machine tools, e.g. in a manufacturing environment, so as to execute positioning, movement or co-ordinated operations by means of programme data in numerical form characterised by data handling or data format, e.g. reading, buffering or conversion of data

Definitions

  • the present invention relates to a PLC control program, and more particularly, to an apparatus and method for converting a text-based PLC control program into a structure data consisting of objects.
  • PLC Programmable Logic Controller
  • LD Layer Diagram
  • BFD Function Block Diagram
  • ST Structured Text
  • IL Instruction List
  • SFC Sequential Function Chart
  • CFC Continuous Function Chart
  • the structure of the PLC control program can be largely divided into tag information containing information about a PLC contact point and logic information containing information about a driven PLC control program.
  • logic information is the most basic element in operating an automated process, and includes all the information about sequences and conditions for facility / process / line control. Can be used as key information for
  • a key element of the automated process operation analysis is to enable rapid and accurate cause identification and response to various abnormal situations occurring in the automated process, which aims to improve productivity and process optimization.
  • the abnormal occurrence of the automation process is caused by the occurrence (ON or OFF) of an abnormal symbol (ON or OFF) on the PLC control program that operates the automation process.
  • a myriad of abnormal signals are included for each process up to and including the abnormal signal.
  • the abnormal situation information displayed on the HMI controller is an abnormal signal belonging to the upper stage among the abnormal signals of the process in which the abnormality occurred, and does not include information on the actual cause of the abnormality (abnormal signal belonging to the lower stage). It is impossible to reproduce the situation.
  • a PLC control program in the form of a structure data is required, but at present, a PLC manufacturer or a PLC programming software, for example, an LD-based PLC control program or a text-based PLC control program converted therefrom. It does not provide PLC control program of structure data format.
  • an object of the present invention is to provide an apparatus and method for automatically converting a text-based PLC control program into a PLC control program having a structure data format.
  • An apparatus for converting a PLC control program into structure data according to the present invention for solving the above technical problem is to build a class library including classes for each of the rung (Rung), input contact and output contact of the PLC control program Class library construction unit; And receiving a common PLC control program converted from a text-based PLC control program, and based on the class library, an object for each of a rung, an input contact, and an output contact of the PLC control program of the common type. And a structure generator for generating structure data to be included.
  • the class library further includes a relationship class for representing a relationship between a corresponding input contact or output contact for each input contact or output contact and at least one other input contact or output contact, wherein the structure data is in the common format.
  • the apparatus may further include a relationship object representing a relationship between a corresponding input contact or output contact for each input contact or output contact of the PLC control program and at least one other input contact or output contact.
  • the relationship class and the relationship object may be data fields and may have a data field for representing a previous input contact, a previous output contact, a next input contact, or a next output contact based on the corresponding input contact or output contact.
  • the structure generating unit may include: an index generating unit for assigning an index to each contact included in the corresponding rung for each rung of the common type PLC control program; An object generation unit for generating an object and a relationship object for each of a rung, an input contact and an output contact of the PLC control program of the common type by reflecting the given index based on the class library; And a relationship forming unit defining the data field of the relationship object.
  • the relationship forming unit may define an index of a previous input contact, a previous output contact, a next input contact, or a next output contact as the data field.
  • the common type PLC control program includes a symbol indicating an OR coupling relationship, and the relationship forming unit uses a symbol indicating the OR coupling relationship, and the common type is combined in an OR relationship in the PLC control program of the common type.
  • a relation block generator that defines a relation block, wherein the relation block has a data field for representing a previous input contact, a previous output contact, a next input contact, or a next output contact;
  • An in-step relationship forming unit defining, for each rung of the PLC control program of the common type represented by the relationship block, the data field for the relationship block, the input contact point, and the output contact constituting the rung;
  • a relationship forming unit in a relationship block defining the data field with respect to the contacts included in the relationship block.
  • the relationship forming unit in the relationship block may distinguish internal elements coupled in an OR relationship in the relationship block, and may include at least one input contact included in the internal elements based on the data field defined for the relationship block, or The data field of the output contact can be defined.
  • the relationship forming unit in the relationship block may redefine the data field of the previous or next input contact or output contact of the corresponding relationship block based on the data field defined for the contacts included in the relationship block.
  • a method for converting a PLC control program into structure data includes: constructing a class library including classes for each of a rung, an input contact, and an output contact of the PLC control program; step; And receiving a common PLC control program converted from a text-based PLC control program, and based on the class library, an object for each of a rung, an input contact, and an output contact of the PLC control program of the common type. And generating the structure data to include.
  • the class library further includes a relationship class for representing a relationship between a corresponding input contact or output contact for each input contact or output contact and at least one other input contact or output contact, wherein the structure data is in the common format.
  • the apparatus may further include a relationship object representing a relationship between a corresponding input contact or output contact for each input contact or output contact of the PLC control program and at least one other input contact or output contact.
  • the relationship class and the relationship object may be data fields and may have a data field for representing a previous input contact, a previous output contact, a next input contact, or a next output contact based on the corresponding input contact or output contact.
  • the generating of the structure data may include: assigning an index to each contact included in the corresponding rung for each rung of the PLC control program of the common type; Generating an object and a relationship object for each of a rung, an input contact and an output contact of the PLC control program of the common type by reflecting the given index based on the class library; And defining the data field of the relationship object.
  • an index of a previous input contact, a previous output contact, a next input contact, or a next output contact may be defined as the data field.
  • the common type PLC control program includes a symbol indicating an OR coupling relationship
  • the step of defining the data field includes: (a) OR in the common type PLC control program using a symbol indicating the OR coupling relationship; Defining a common type combined in a relationship as a relationship block, wherein the relationship block has a data field for representing a previous input contact, a previous output contact, a next input contact, or a next output contact based on the relationship block; ; (b) defining, for each rung of the PLC control program of the common format represented by the relationship block, the data field for the relationship block, the input contact point and the output contact point constituting the rung; And (c) defining the data field with respect to the contacts included in the relationship block.
  • step (c) the internal elements coupled in the OR relationship in the relationship block are distinguished, and at least one input contact or output included in the internal elements based on the data field defined for the relationship block. And defining the data field of the contact.
  • the step (c) may include redefining the data field of a previous or next input contact or output contact of the relation block based on the data field defined for the contacts included in the relation block. Can be.
  • the PLC control program of the structure data format can be the basis of a system that visualizes and traces the actual cause of the occurrence of an abnormal situation in the automation process, thereby contributing to the improvement of the productivity of the automation process and the optimization of the process operation. Can be.
  • FIG. 1 is a block diagram of an apparatus for converting a PLC control program into structure data according to an embodiment of the present invention.
  • 5A shows an example of a PLC control program of the Mitsubishi LD structure.
  • FIG. 5B illustrates a text-based PLC control program converted from the PLC control program of FIG. 5A.
  • FIG. 6 shows IL objects generated by the IL object generator 14 for the first rung and the second rung, respectively.
  • FIG. 7A shows IL blocks generated by the IL block generator 15 for the first rung.
  • FIG. 7B shows IL blocks generated by the IL block generator 15 for the second rung.
  • FIG. 8A illustrates a process of expressing a coupling relationship between common blocks by applying a joint instruction OR to the common blocks shown in FIG. 7A in a common format.
  • FIG. 8B illustrates a process of expressing a coupling relationship between common blocks by applying a joint instruction OR to the common blocks shown in FIG. 7B in a common format.
  • FIG. 9 illustrates a process of expressing a coupling relationship between common blocks by applying a joint command ORB to common blocks after applying the joint command OR through FIG. 8B.
  • FIG. 12 shows common formats of common blocks represented through FIGS. 9 through 11 for the second rung.
  • FIG. 13 shows the final common format for the first rung N0 and the second rung N5, converted from the text-based PLC control program of FIG. 5B.
  • 15A to 15E illustrate data field structures of a 'Step' class, a 'Coil' class, a 'Contact' class, a 'Relation' class, and a 'Tag' class, respectively.
  • FIG. 16 shows a specific configuration of the structure generation unit 22 according to an embodiment of the present invention.
  • FIG. 17 shows an example of the indices given to the contacts for the PLC control program of the common type shown in FIG.
  • FIG. 18 illustrates examples of objects generated from a PLC-type control program of a common type indexed as shown in FIG. 17 based on the class libraries of FIGS. 14 and 15.
  • FIG. 19 illustrates a PLC control program in which the common type PLC control program with an index is expressed in the form of an object as shown in FIG. 17.
  • 21 shows a result of expressing NO step using a relationship block.
  • FIG. 24A shows a result of applying the relation block RBK 0 shown in FIG. 22 to the format of FIG. 23.
  • 24B shows a result of defining a relationship with other contacts for each contact included in the relationship block RBK 0 .
  • FIG. 25 illustrates a result in which all of the relationships between the corresponding input contact or output contact and another input contact or output contact are expressed for each input contact or output contact of the NO step.
  • 26 shows the result of expressing N5 Step using a relationship block.
  • FIG. 28 shows the result of applying the relationship block RBK 0 and the relationship block RBK 1 shown in FIG. 27 to the format of FIG. 23 and defining the relationship with other contacts for each contact included in the RBK 0 and RBK 1 .
  • FIG. 29 illustrates a result of replacing relation block RBK 1 in relation block RBK 0 with contacts I2 and I3 included in FIG. 28.
  • Figure 30 shows the results of replacing with a, a relationship is defined between the contact included in the block RBK 0, i.e. RBK 0 in FIG. 29 the relationship block RBK 0 of Fig.
  • FIG. 31 shows a result of applying the relation block RBK 2 shown in FIG. 27 to the format of FIG. 23.
  • Figure 32 shows the results of replacing with a, a relationship is defined, the contact in the relation RBK block 2, i.e. 2 RBK of the relationship RBK block 2 of Fig. 30 Fig. 31.
  • 34 is a flowchart of a method of converting a common PLC control program into structure data according to an embodiment of the present invention.
  • FIG. 1 is a block diagram of an apparatus for converting a PLC control program into structure data (hereinafter, referred to as a structure data converting apparatus) according to an embodiment of the present invention.
  • the structure data converting apparatus includes a common instruction library constructing unit 11, a storage unit 12, a common format converting unit 13, a class library constructing unit 21, and a structure forming unit 22. can do.
  • the common instruction library construction unit 11, the storage unit 12, and the common format conversion unit 13 share a PLC control program having a different text format for each PLC manufacturer.
  • a so-called common type conversion device hereinafter, referred to as a common type conversion device
  • the common format conversion apparatus is disclosed in detail and in detail in Korean Patent Application No. 10-2015-0181242 filed by the applicant of the present invention, the entire contents of which are incorporated herein by reference.
  • the common format converting apparatus is composed of a common instruction library constructing unit 11, a storage unit 12, and a common format converting unit 13, and the structure data converting apparatus is connected to the class library constructing unit 21. It may be composed of the structure forming part 22.
  • the common instruction library construction unit 11 generates a common instruction library for instructions used in text-based PLC control programs having different formats according to the common instruction generation algorithm, constructs a common instruction library, and stores the storage unit 12. ).
  • the instruction information used in the PLC control program for each PLC manufacturer and the corresponding instruction information corresponding to the PLC instruction before the start of construction of the common instruction library are already in the common instruction library construction unit 11. It is preferable that the storing or input is completed.
  • the common instruction library building unit 11 constructs the common instruction library according to the common instruction generation algorithm.
  • the common command generation algorithm is an algorithm that sequentially performs the first step, the second step and the third step to generate a common command for the commands used in text-based PLC control programs having different formats to be.
  • the first step is to classify the commands used for text-based PLC control programs having different formats into the same display command groups having the same meaning on the display.
  • the second step is to check whether all the commands belonging to the same display command group have the same function.
  • the third step is to generate a common command in a different manner depending on whether all of the commands belonging to the same display command group are the same function or not.
  • a dictionary word indicating the same commands belonging to the same display command group and having the same function is a common command for the commands having the same function. Is generated.
  • a parameter qualifier included in the command having the same function may be inserted into the common command for the command having the same function.
  • the position at which the parameter qualifier is inserted is not limited thereto.
  • AB's command 'DEQU' for 'equal' is a command with the parameter qualifier D (Double) appended to the command 'EQU'.
  • 'D' limits the parameter size of the command 'EQU'.
  • the 'EQU' command processes 1 Word (16bit), and the 'DEQU' command processes 2 Word (32bit).
  • parameter qualifiers that define command parameters may be inserted as prefixes of common commands.
  • an operation modifier included in the command having the same function may be inserted into the common command for the commands having the same function. If any one of the operation qualifiers limiting the operation of the command, that is, P (Negative Pulse) or N (Negative Pulse) is included in the corresponding command, the operation qualifier may be inserted as a suffix in the common command of the command. However, the position at which the operation modifier is inserted is not limited thereto.
  • Mitsubishi's 'ANDP' command is 'P', an operation qualifier that converts 'AND', which has a function to turn on when the address value is On, to a positive pulse form. (Positive pulse) '. Therefore, 'XICP', a common command for 'ANDP', may be generated by suffixing an operation modifier 'P' to 'XIC (eXamine If Closed)', a common command for 'AND'.
  • the dictionary words for displaying the same commands belonging to the same display command group but not all have the same function do not have the same function. It is possible to generate a common command for the commands, and insert the manufacturer name of the PLC controlled by the PLC control program in which the command having the same function is not used in the common command for the commands having the same function.
  • the command 'LIMIT' may be mentioned.
  • the command 'LIMIT' is used the same in the PLC control program of Mitsubishi, LS Industrial Systems and AB, but it does not have the same function.
  • 'LIMIT' command is not used in Siemens PLC control program.
  • the common command for the command 'LIMIT' may be generated as the word 'LIMIT' in the dictionary. Since the command 'LIMIT' does not have the same function for each PLC manufacturer, the manufacturer name of each PLC can be inserted in the common command 'LIMIT'. For example, Mitsubishi's 'm', 'S' for Siemens, 'ab' for AB, and 'ls' for LS prenatal can be inserted as a prefix of the common command 'LIMIT'. In other words, it can be 'mLIMIT' for Mitsubishi, 'sLIMIT' for Siemens, 'abLIMIT' for AB, and 'lsLIMIT' for LS.
  • a parameter qualifier included in the command that does not have the same function may be inserted into the common command for the commands that do not have the same function.
  • AB's command 'DLIMIT' is a command with the parameter qualifier D (Double) appended to the command 'LIMIT'.
  • 'D' limits the parameter size of the command 'LIMIT'.
  • the 'LIMIT' command processes 1 Word (16bit), and the 'DLIMIT' command processes 2 Word (32bit).
  • parameter qualifiers that define command parameters may be inserted into common commands, which may be placed after a prefix indicating the PLC manufacturer, for example, 'ab' indicating the AB company. After all, the common command for AB 'DLIMIT' may be 'abDLIMIT'.
  • an operation modifier included in the command that does not have the same function may be inserted into the common command for the commands that do not have the same function.
  • Mitsubishi's 'LIMITP' command includes 'P (Postive Pulse)', an operation modifier that converts the positive 'pulse' form of the command 'LIMIT'.
  • an action modifier that restricts the operation of the command may be inserted as a suffix to the public command.
  • the public command for Mitsubishi's command 'LIMITP' may be 'mLIMITP'.
  • the common command generated by sequentially performing steps 1 to 3 may be converted into an XML (eXtensible Markup Language) file format to build a common command library in the storage unit 12.
  • XML eXtensible Markup Language
  • the XML file for the common command includes instructions corresponding to each of the Instructio Name 'XIC', 'XICP', and 'XICF' for each PLC manufacturer.
  • the command 'XIC' corresponds to AB
  • the command 'XIC' corresponds to AB
  • Mitsubishi's' LD ',' AND 'and' OR ' respectively
  • the common format converting unit 13 converts the text-based PLC control program that is requested to be converted into a common format into a common PLC control program, and uses the common command library to read the text-based PLC control program. Convert to a common PLC control program.
  • the common format conversion unit 13 includes an IL object generation unit 14, an IL block generation unit 15, a common block conversion unit 16, and a joint relationship expression unit 17.
  • the text-based PLC control program is converted into the PLC control program of the common format.
  • the IL object generation unit 14 confirms whether the text-based PLC control program requested for conversion to the common format can be converted to the PLC control program of the common format.
  • whether the text-based PLC control program can be converted to the common format can be determined using at least one of a file extension and a data structure of the text-based PLC control program.
  • the text-based PLC control program cannot be converted into a common PLC control program.
  • the IL object generation unit 14 performs a rung constituting the control logic of the text-based PLC control program as the text-based PLC control program requested to be converted to the common format can be converted to the PLC control program of the common format.
  • At least one contact point is generated as an IL object including a command and a tag, respectively, according to a logic order. That is, the IL object used throughout the present invention is used in the same sense as the contact point.
  • the IL block generation unit 15 generates at least one IL block by blocking at least one IL object generated by the IL object generation unit 14 using a block command.
  • the block instruction includes LD, LDI, ANB, OR, ORB, MPP, MRD, and MPS.
  • LD is an abbreviation of Load and indicates that the contact point on the control logic is loaded.
  • the LD may continue to produce blocks of control logic of the PLC program.
  • LDI Load Inverse. It contains Inverse meaning, so the contact is ON when the tag is OFF.
  • ANB stands for AND Block, indicating that two blocks created before the ANB instruction are in AND relationship with each other.
  • OR indicates that the symbol preceding the OR command and the symbol of the OR command are ORed together.
  • ORB stands for OR Block, indicating that two blocks created before the ORB instruction are OR'ed together.
  • MPS Multi Point Start. When multiple output contacts appear, the first output contact is written to the front of the first output contact and the contacts associated with that output contact.
  • MRD Multi Read Down and is used when three or more output contacts appear.
  • MPP Multi Point Period. When multiple output contacts appear, the MPP is written at the front of the last output contact and the contacts associated with that output contact.
  • OR, ORB, ANB, MPS, MRD, and MPP among the block commands are combined commands used in the connection relationship expression unit 17.
  • the combined instruction except the OR instruction includes only the instruction when expressing the IL object, and expresses only the association relationship between each block. Therefore, since the block combining instruction indicating the relationship between the blocks, the instruction of the IL object including the block combining instruction is not converted into the common instruction when the transform unit 16 is executed to the common block.
  • the IL block generation unit 15 checks whether a block instruction is included in the IL objects while moving the IL objects arranged in the control logic order, and generates a new IL block if the block instructions are included. On the other hand, if the block instruction is not included, the IL object is sequentially included in the previously generated IL block until a new block instruction appears.
  • the common block converting unit 16 generates a common object by converting the instruction into a common instruction for each of the at least one IL object in the at least one IL block by using the common instruction library, and thus, the at least one IL block. Converts to at least one shared block.
  • the coupling relationship expression unit 17 expresses the coupling relationship between the at least one shared block by at least one of the symbols "[", "]” and ",” using a coupling command.
  • the combined instruction may include OR, ORB, ANB, MPP, MPS, and MRD.
  • the combined instructions used for the input (conditional) are OR, ANB and ORB, and the combined instructions used for the output are MPS, MRD and MPP.
  • the coupling relationship expression unit 17 may express the coupling relationship between the common blocks expressed in the common format with at least one of the symbols "[", “]” and “,”. To this end, the coupling relationship expression unit 17 expresses the coupling relationship between the common blocks expressed in the common form according to the coupling instruction used in the input unit (conditional) with at least one of the symbols "[", “]” and ",” After that, the coupling relationship between the common blocks represented by the coupling command used in the input unit may be expressed by at least one of the symbols "[", "]” and ",” according to the combining command used in the output unit.
  • the coupling command used in the input unit is applied to the common blocks expressed in the common format in the order of OR-> ANB-> ORB, and the symbol "[" , "]" And ",” can be expressed by at least one.
  • the application of the combined command used in the input unit to the common blocks expressed in the common format in the order of OR-> ANB-> ORB is just one embodiment, but is not limited thereto.
  • the common blocks represented by the combined command used in the input unit may be applied to the common blocks represented by the combined command used in the input unit in the order of MPS-> MRD-> MPP.
  • the coupling relationship between the two may be expressed by at least one of the symbols "[", "]" and ",".
  • the application of the combined command used in the output unit to the common blocks represented by the combined command used in the input unit in the order of MPS-> MRD-> MPP is just one embodiment and is not limited thereto.
  • the IL object generating unit 14 converts the control logic of the text-based PLC control program as the text-based PLC control program requested to be converted into a common format can be converted into a PLC control program of the common format.
  • at least one contact point is generated as an IL object including a command and a tag, respectively, in a logic order (S71).
  • the IL block generation unit 15 generates at least one IL block by blocking the at least one IL object by using a block command. This may correspond to steps S72 to S76 in FIG. 4.
  • the IL block generation unit 15 sequentially extracts the IL object from the IL object list (S72), until the final IL object of the rung (S73) is assigned to the block instruction 'LD, AND, Check whether OR, ORB, MPP, MRD, and MPS 'are included (S74), and if so, create a new IL block (S75), and if not, insert the IL object into the most recently generated IL block. Repeat (S76).
  • the common block converting unit 16 generates a common object by converting an instruction into a common instruction for each of at least one IL object in the at least one IL block by using a common instruction library to generate the at least one IL block. At least one common block is converted (S77).
  • the coupling relationship expression unit 17 expresses the coupling relationship between the at least one shared block by at least one of the symbols "[", "]” and ",” using a coupling command. This may be performed by steps S78 to S90 in FIG. 4.
  • the coupling relationship expression unit 17 sequentially extracts the public blocks shown in FIG. 8 (S78), and checks whether the extracted public block is the last public block (S79).
  • the association relationship expression unit 17 checks whether the combined instruction ORB or OR is included in the extracted common block (S80). If included, "[", ",", “]” is inserted into the two previous shared blocks (S81).
  • the association relation expression unit 17 checks whether the combined common block ANB is included in the extracted common block (S82). If included, the two preceding public blocks of the extracted common block are pasted (S83).
  • the association relationship expression unit 17 checks whether the combined common block MPS is included in the extracted common block. If included, insert "[" in front of the corresponding common block (S85).
  • the association relationship expression unit 17 checks whether the joint command MRD is included in the extracted common block (S86). If included, the ",” is inserted in front of the corresponding common block (S87).
  • the association relationship expression unit 17 determines that the combined common block MPP is included in the extracted common block, and inserts ",” in front of the corresponding common block. Insert "]" at the rear (S88).
  • the joint relationship expression unit 17 sequentially merges the common blocks in which the joint relationship is indicated in the common format (S89), and the joint relationship between the merged public blocks. Output the common format indicated by (S90).
  • FIG. 5A illustrates an example of a PLC control program of an LD structure of Mitsubishi
  • FIG. 5B illustrates a text-based PLC control program converted from the PLC control program of FIG. 5A.
  • the process of converting the text-based PLC control program of FIG. 5B into the common control PLC control program by the above-described common format conversion unit 13 will be described.
  • the PLC control program of FIGS. 5A and 5B is composed of two rungs, and includes, as instructions, LD, OR, AND, ANI, OUT, LDI, ORB, MPS, MPP, and the like with tags X0, X1, M0. , X3, Y0, X4, X5, X6, X8, X7, X9, X10, Y2 and the like.
  • FIG. 6 shows IL objects generated by the IL object generator 14 for the first rung and the second rung, respectively.
  • the IL objects may be arranged according to the control logic order of the text-based PLC control program illustrated in FIG. 5B. That is, the order of the IL objects is the same as the control logic order of the text-based PLC control program. Specifically, if the order of IL objects is listed in the order of Command, LD, OR, AND, ANI, OUT for the first rung, and LDI, AND, for the second rung.
  • FIG. 7A shows IL blocks generated by the IL block generator 15 for the first rung.
  • an IL block 1 is generated by a block instruction 'LD' and includes one IL object, that is, an IL object that is an instruction LD.
  • the IL block 2 is generated by the block instruction 'OR' and includes four IL objects, that is, an IL object that is an instruction OR, an IL object that is an instruction AND, an IL object that is an instruction ANI, and an IL object that is an instruction OUT.
  • FIG. 7A illustrates a result of converting IL blocks into shared blocks by the common block converter 16.
  • the common block converting unit 16 converts the IL block # 1 by converting an IL object having an instruction 'LD' into a common object having a common command 'XIC' using the common command library. Convert to shared block # 1. Therefore, the common type of shared block 1 can be expressed as 'XIC (X0)'.
  • the common block converting unit 16 converts the IL object having the instruction 'OR' into the common object having the common instruction 'XIC' using the common instruction library, and the IL object having the instruction 'AND'. Is converted to a public object with public command 'XIC', IL object with command 'ANI' is converted to a public object with public command 'XIO', and IL object with command 'OUT' is converted to a public object with public command 'OUT' By transforming, the IL block 2 is converted into the 2 common block. Therefore, the common type of shared block 2 can be expressed as 'XIC (X1) XIC (M0) XIO (X3) OUT (Y0)'.
  • FIG. 7B shows IL blocks generated by the IL block generator 15 for the second rung.
  • the IL block # 1 is generated by the block instruction 'LDI' and includes two IL objects, that is, the IL object that is the instruction LDI, and the instruction AND. Contains an IL object.
  • the IL block 2 is generated by the block instruction 'LDI' and includes one IL object, that is, the IL object which is the instruction LDI.
  • the IL block 3 is generated by the block instruction 'OR' and includes two IL objects, that is, an IL object that is an instruction OR and an IL object that is an instruction AND.
  • the IL block 4 is generated by the block instruction 'ORB' and includes two IL objects, that is, an IL object that is an instruction ORB and an IL object that is an instruction AND.
  • the IL block 5 is generated by the block instruction 'MPS' and includes two IL objects, that is, the IL object which is the instruction MPS and the IL object which is the instruction OUT.
  • the IL block 6 is generated by the block instruction 'MPP' and includes three IL objects, that is, the IL object which is the instruction MPS, the IL object which is the instruction ANI, and the IL object which is the instruction OUT.
  • FIG. 7B illustrates a result of converting IL blocks into shared blocks by the common block converter 16.
  • the common block converting unit 16 converts the IL object having the instruction 'LDI' into a common object having the common instruction 'XIC' using the common instruction library, and has the instruction 'AND'
  • the common type of common block 1 can be expressed as 'XIC (X4) XIC (X5)'.
  • the common block converting unit 16 converts the IL object having the instruction 'LDI' to a common object having the common instruction 'XIC' using the common instruction library, thereby converting the IL block # 2 twice. Convert to shared block. Therefore, the common type of common block 2 can be expressed as 'XIC (X6)'.
  • the common block converting unit 16 converts the IL object having the instruction 'OR' into the common object having the common instruction 'XIC' using the common instruction library, and the IL object having the instruction 'AND'. Converts IL block 3 to public block 3 by converting it to a public object with public command 'XIC'. Therefore, the common type of common block 3 can be expressed as 'XIC (X8) XIC (X7)'.
  • the common block converting unit 16 does not convert the IL object that is the block combining instruction 'ORB' into the common instruction using the common instruction library, and converts the IL object that is the instruction 'AND' into the common instruction.
  • IL block 4 is converted to 4 public blocks. Therefore, the common type of common block 4 can be expressed as 'XIC (X9)'.
  • the common block converting unit 16 does not convert the IL object that is the block combining instruction 'MPS' into the common instruction using the common instruction library, and converts the IL object that is the instruction 'OUT' into the common instruction. Converts IL block 5 to public block 5 by converting it to a public object that is 'OUT'. Therefore, the common type of common block 5 can be expressed as 'OUT (M0)'.
  • the common block converting unit 16 does not convert the IL object that is the block combining instruction 'MPP' into the common instruction using the common instruction library, and converts the IL object that is the instruction 'ANI' into the common instruction.
  • the IL block 6 is converted to the common block 6 by converting the IL object of the instruction 'OUT' into an IL object of the common instruction 'OUT'. Therefore, the common type of common block 6 can be expressed as 'XIO (X10) OUT (Y2)'.
  • the PLC control program of the common format may be expressed in a common format for at least one rung constituting the control logic of the text-based PLC control program.
  • At least one point of contact in the text-based rung is represented as a common object including a common instruction and a tag, and the at least one common object is A coupling relationship between at least one common block generated by blocking may be represented by at least one of the symbols "[", “]” and ",”.
  • the symbols "[”, “]” represent a coupling point
  • the symbol ",” represents a branch point.
  • the association relation representation between these common blocks may be performed by the association relation representation unit 17.
  • FIG. 8A is a diagram illustrating a process of expressing a coupling relationship between common blocks by applying a joint instruction OR to the common blocks shown in FIG. 7A in a common format.
  • the coupling relationship expression unit 17 checks whether the common block shown in FIG. 7A includes a common block including a coupling instruction OR.
  • the coupling relationship between the public block and the two public blocks of the previous public block is expressed using the symbols "[", "]" and ",”.
  • FIG. 8A a coupling relationship between a common block 2 including a joint instruction OR and a shared block 1 is expressed using the symbols "[", "]" and ",”.
  • next public block of the common block 2 including the combined instruction OR does not include the combined instruction OR, inserts "]" after the common format of the IL object including the OR instruction among the common forms of the current public block 2 (S3). If the next public block of the current public block containing an OR contains a combined instruction OR, insert "," at the end of the public format of the current public block.
  • the common type of the 2nd common block of the first rung becomes '[XIC (X0), XIC (X1)] XIC (M0) XIO (X3) OUT (Y0)'.
  • FIG. 8B is a diagram illustrating a process of expressing a coupling relationship between common blocks by applying a joint instruction OR to the common blocks shown in FIG. 7B in a common format.
  • the coupling relationship expression unit 17 checks whether the common block including the coupling instruction OR is present in the common blocks illustrated in FIG. 7B.
  • the coupling relationship between the public block and the two public blocks of the previous public block is expressed using the symbols "[", "]" and ",”.
  • next public block of the common block 3 including the combined instruction OR does not include the combined instruction OR, inserts "]" after the common format of the IL object including the OR instruction among the common forms of the current public block 3 (S7). . If the next public block of the current public block containing an OR contains a combined instruction OR, insert "," at the end of the public format of the current public block.
  • FIG. 9 is a diagram illustrating a process of expressing a coupling relationship between common blocks by applying a joint command ORB to common blocks after applying the joint command OR through FIG. 8B.
  • the coupling relationship expression unit 17 checks whether the common block including the coupling instruction ORB is present in the common blocks after applying the coupling instruction OR. Two non-empty public blocks in front of the public block including the included public block and the joint instruction ORB are used to express the association relationship to the public blocks.
  • association relationship expression unit 17 inserts "[" at the beginning of the common format expression of the first public block of the first non-empty public blocks of the two non-empty public blocks in front of the common block ORB. (S9).
  • association relationship unit 17 adds "," to the beginning of the common type representation of the third common block, which is the second common block of the two non-empty common blocks before the fourth common block including the joint instruction ORB. Insert (S10).
  • association relationship expression unit 17 checks whether the public block including the association instruction OR and the common block including the association instruction ORB exist in the public block after the fourth common block including the association instruction ORB, and only when it does not exist. Insert "]" at the beginning of the common type representation of the common block 4, including the combined instruction ORB (S11).
  • the joining relation expression unit 17 merges the first public block and the third public block into the fourth public block with the lowest number among the first public block, the third public block, and the fourth public block, and then merges the fourth public block.
  • the public object including the combined instruction ORB is deleted from the public block (S12).
  • the common type of shared block 4 of the second rung is '[XIC (X4) XIC (X5), [XIO (X6), XIC (X8)] XIC (X7)] XIC (X9)'. do.
  • 10 is a view showing a result of applying the combined command MPS used in the output unit.
  • the association relationship expression unit 17 checks whether there is a common block including the combined instruction MPS, and inserts "[" in front of the common form representation of the corresponding common block if there is a shared block including the combined instruction MPS. (S13).
  • association relation expression unit 17 inserts "[" at the beginning of the common format representation of the common block 5 including the association instruction MPS.
  • the common format of the 5th common block of the second rung is '[OUT (M0)'.
  • 11 is a view showing a result of applying the combined command MPP used in the output unit.
  • the association relationship expression unit 17 checks whether there is a common block including the combined instruction MPP, and if there is a shared block including the combined instruction MPP, inserts "," at the beginning of the common form representation of the corresponding common block. And inserting "]" at the end of the common format expression of the corresponding common block (S14).
  • association relationship expression unit 17 inserts ",” at the front and "]" at the front of the common format representation of the common block 6 including the association instruction MPP.
  • the common type of common block 6 of the second rung is ', XIO (X10) OUT (Y2)]'.
  • FIG. 12 shows common formats of common blocks represented through FIGS. 9 through 11 for the second rung. Referring to FIG. 12, when the common formats of the 4th, 5th and 6th common blocks are merged in order, the final common format for the second rung is obtained.
  • FIG. 13 shows a final common format for the first rung N0 and the second rung N5 converted from the text-based PLC control program of FIG. 5B through the above process.
  • the following describes a process of converting a PLC control program of a common format output from the common format conversion unit 13 into structure data by the class library construction unit 21 and the structure generation unit 22. .
  • the class library construction unit 21 is different from the rungs, input contacts, output contacts, tags for the PLC control program, and the corresponding input contact or output contact for each input contact or output contact. Constructs and stores a class library including relation classes, which are classes representing relations with input contacts or output contacts.
  • the class library includes 'StepS' representing a set of all 'Steps' as a top-level class, and a rung of the PLC control program as a subclass of 'StepS' (the logic of the PLC control program).
  • 'Step' which represents the constituent unit
  • 'CoilS' which represents the set of all 'Coil' as a subclass of 'Step'
  • 'C' which indicates the output contact which belongs to the rung as a subclass of 'CoilS'.
  • 15A to 15E illustrate data field structures of a 'Step' class, a 'Coil' class, a 'Contact' class, a 'Relation' class, and a 'Tag' class, respectively.
  • a 'Step' class has a step key, a unique identifier of a corresponding 'Step', a Program, a name of a PLC control program, and a Step Index, an index of the 'Step', as a data field. It has 'CoilS' and 'ContactS'.
  • Step key can consist of the name and rung number of the PLC control program. For example, if the name of the PLC control program is 'Main', the step index for the rung number '0' can be 'Main.0' and the step index for the rung number '5' can be 'Main.5'. . The rung number can be used as the step index.
  • the 'Coil' class has a command which is a command for a corresponding output contact as a data field, an Index which is a unique index in a corresponding Step, and has a 'Tag' and a 'Relation' as a subclass.
  • the 'Contact' class has a command which is a command for a corresponding input contact as a data field, an Index which is a unique index in a corresponding Step, and has a 'Tag' and a 'Relation' as subclasses.
  • the 'Relation' class is a data field based on a corresponding contact or coil, and includes a previous contact, a previous contact index, a previous coil, a previous coil, a next contact index, and a next contact. It has Next Coil which is the index of Coil of.
  • the 'Tag' class has a data field as an address of a corresponding tag and a description as a description of the corresponding tag.
  • the structure generation unit 22 receives a PLC control program of a common format from the common format conversion unit 13, and based on the class library constructed by the class library construction unit 21, Rungs, input contacts, output contacts, objects for tags, and other input contacts or outputs different from the corresponding input contact or output contact for each input contact or output contact of the PLC control program of the common type.
  • Structure data including a relationship object, which is an object representing a relationship with a contact point, is formed, and a PLC control program in the form of a structure is output.
  • a process in which the structure generation unit 22 generates structure data from the PLC control program of the common format will be described using the PLC control program of the common format shown in FIG. 13 as an example.
  • a PLC control program of a given common type is composed of two rungs, so there are two steps.
  • the structure generator may include an index generator 23, an object generator 24, and a relationship generator 25.
  • the index generator 23 internally assigns an index to each contact included in the corresponding rung for each rung (ie, one sentence or line) of the common PLC control program.
  • the index may be sequentially assigned to the contacts, for example, with integers of zero or more. These indices are used by the relationship forming unit 25 to be described later to express the relationship between the contacts.
  • FIG. 17 shows an example of the indices given to the contacts for the PLC control program of the common type shown in FIG.
  • the five contacts XIC (X0), XIC (X1), XIC (M0), XIO (X3) and OUT (Y0) of the first (zero) rung are respectively 0, 1, 2, Index of 3, 4 is given
  • 9 contacts of the second (5th) rung XIC (X4), XIC (X5), XIO (X6), XIC (X8), XIC (X7), XIC (X9) , OUT (M0), XIO (X10), and OUT (Y2) are given indices of 0, 1, 2, 3, 4, 5, 6, 7, and 8, respectively.
  • the object generator 24 divides the contacts of the command (Tag) type of the PLC control program of the given common type into an input contact and an output contact, and is given by the index generator 23. Reflecting the index, a step object, a contact object, a coil object, a tag object, a relation object, and the like are generated based on the class library. Step object, Contact object, Coil object, Tag object, and Relation object correspond to Step class, Contact class, Coil class, Tag class, Relation class of class library, respectively.
  • 'Command' in the form of 'Command (Tag)'.
  • 'Command' corresponding to the input contact point is a common command corresponding to the input such as XIC, XIO, AFI, INV, MEP, MEF, EGP, EGF, EQU, GEQ, GRT, LEQ, LES, MEQ, LIM, Including CMP, 'Command' corresponding to the output contact is the common command corresponding to the output, OUT, SET, RST, MOV, TON, TOFF, RTO, TMR, CTU, CTD, UDCNT, MCR, FOR, NEXT, Includes BREAK, LABEL, RET, CJ, SCJ, CALL, JMP, SBRT, FROM, TO, and more.
  • 'Command' for the distinction between input contact and output contact is a parameter qualifier (eg Double Word: D, Block: BK) or operation qualifier (eg Positive Pulse: P, Negative). Also included are common commands combined with Pulse: N).
  • a parameter qualifier eg Double Word: D, Block: BK
  • operation qualifier eg Positive Pulse: P, Negative
  • common commands eg Positive Pulse: N).
  • XIC (X0), XIC (X1), XIC (M0), and XIO (X3) correspond to an input contact and OUT (Y0) corresponds to an output contact in a first rung.
  • XIC (X4), XIC (X5), XIO (X6), XIC (X8), XIC (X7), XIC (X9), and XIO (X10) correspond to the input contacts and OUT ( M0) and OUT (Y2) correspond to output contacts.
  • FIG. 18 illustrates examples of objects generated from a PLC-type control program of a common type indexed as shown in FIG. 17 based on the class libraries of FIGS. 14 and 15.
  • Step 0 has a Step key, a Program, and a Step Index of Main.0, Main, and 0, respectively, and have four Contact objects and one Coil object.
  • a Contact object with an index of 0 has a command of 'XIC'
  • a Tag object belonging to it has an Address of X0 and a Description of IN0.
  • Step key, Program, and Step Index are Main.5, Main, and 5, respectively, and have 7 Contact objects and 2 Coil objects.
  • a Contact object with an index of 2 has a command of 'XIO'
  • a Tag object belonging to it has an Address of X6 and a Description of IN6.
  • each Contact object and the Relation object belonging to each Coil object are defined.
  • FIG. 19 illustrates a PLC control program in which the common type PLC control program with an index is expressed in the form of an object as shown in FIG. 17.
  • an input contact is represented by 'I'
  • an output contact is represented by 'O'
  • an index is represented by a subscript.
  • the relationship forming unit 25 may include a relationship block generating unit 26, an in-step relationship forming unit 27, and an relationship block forming unit 28.
  • the common type PLC control program includes symbols "[", "]” and ",” representing a coupling relationship, and has a common type structure beginning with "[" and ending with "]". Is defined as a 'Relation Block'.
  • the relationship block generator 26 generates such a relationship block.
  • the inner elements of the relation block are combined in an OR relationship, and the criteria for distinguishing the inner elements is ",".
  • a relation block may exist inside the relation block (for example, referring to FIG. 19, '[I 0 I 1 , [I 2 , I 3 ] I 4 ]' of N5 Step).
  • the relation block generation unit 26 may express the relation block to be generated as "RBK" and assign an index to each relation block in Step.
  • the relation block [I 0 , I 1 ] can be represented by RBK 0 .
  • N0 Step is expressed as 'RBK 0 I 2 I 3 O 4 ' as shown in FIG.
  • In-step relationship forming unit 27 defines a relationship with other contacts (or relationship blocks) with respect to the contacts (or relationship blocks) in Step. Specifically, the intra-step relationship forming unit 27 defines a previous contact, previous coil, next contact, or next coil of a relation object belonging to each contact or relationship block in the step. In this case, if the index to be included in the previous contact, previous coil, next contact, or next coil belongs to the relation block, 'R' may be indicated before the index to indicate the relation block.
  • Previous Contact, Previous Coil, Next Contact, or Next Coil of one contact (or relation block) if Next Contact or Next Coil is defined, Previous Contact, Previous Coil of the next contact (or relation block) should correspond to it. Can be defined automatically.
  • the Next Contact field of RBK 0 is defined as '2'.
  • the Previous Contact field of I 2 is defined as R 0. Since the next contact of I 2 is I 3 , that is, the input contact, the Next Contact field of I 2 is defined as '3', and the Previous Contact field of I 3 is defined as '2'. Since the next contact of I 3 is O 4 , that is, the output contact, the Next Coil field of I 3 is defined as 4, and correspondingly, the Previous Contact field of O 4 is defined as '3'.
  • the relationship forming unit 28 in the relationship block defines a relationship with other contacts (or relationship blocks) with respect to the contacts (or relationship blocks) included in the relationship block. Specifically, the relationship forming unit 28 in the relationship block defines a previous contact, previous coil, next contact, or next coil of a relation object belonging to each contact or relationship block in the relationship block. If there is a relation block in the relation block, first define the relation to the contacts (or relation blocks) of the outer relation block. Since the internal elements of the relationship block are combined in an OR relationship, the relationship forming unit 28 in the relationship block may distinguish the internal elements based on ",". Each inner element may be referred to as OR 1 , OR 2 , ..., OR n for convenience. 23 shows a format in which the relationship block is divided into internal elements.
  • FIG. 24A illustrates a result of applying RBK 0 illustrated in FIG. 22 to the format of FIG. 23.
  • RBK 0 [I 0 , I 1 ]
  • RBK 0 has I 0 and I 1 as internal elements
  • Next Contact is an index '2'.
  • a Relation object of I 0 is included in OR 1
  • a Relation object of I 1 is included in OR 2
  • Next Contact is represented by an index '2'.
  • the Previous Contact or Previous Coil of the relationship block becomes the Previous Contact or Previous Coil of the first (ie leftmost) contact that is placed for every internal element.
  • the next contact or next coil of the relation block becomes the next contact or next coil of the last (ie rightmost) contact point for all internal elements.
  • the contact becomes the first and last contact (in the case of Fig. 24).
  • both the contact I 0 of the OR1 and the contact I 1 of the OR2 are defined as the index '2'.
  • the relationship forming unit 28 in the relationship block selects the relationship block from the result of defining the relationship between the contacts (or relationship block) for the step. Replace with the contacts included therein.
  • the relationship forming part 28 in the relationship block is defined as 'R #' by the relationship forming part 27 in the step.
  • the contact point that has the relationship block as Previous Contact or Previous Coil
  • the index of the last contact point is defined as Previous Contact or Previous Coil for all internal elements of the relationship block
  • the relationship block is called Next Contact or Next Coil.
  • the index of the first contact is defined as Next Contact or Next Coil for all internal elements of the relation block.
  • FIG. 25 illustrates a result in which all of the relationships between the corresponding input contact or output contact and another input contact or output contact are expressed with respect to each input contact or output contact of the NO step.
  • N5 Step between blocks is represented by the RBK 0 [I 0 I 1, [I 2, I 3] I 4], the relationship block in the RBK 0 [I 2, I 3 ] is represented by RBK 1, between the block [O 6 , I 7 O 8 ] may be represented by RBK 2 .
  • the Next Contact field of RBK 0 is defined as '5'
  • the Previous Contact field of I 5 is correspondingly defined as R0.
  • the next contact of I 5 is RBK 2
  • the Next Contact field of I 5 is defined as 'R2'
  • the Previous Contact field of RBK 2 is defined as '5'.
  • FIG. 28 shows the results of applying RBK 0 and RBK 1 shown in FIG. 27 to the format of FIG. 23.
  • the contact of the I 0 is defined as a "1" Next Contact field of the I 0 Since I 1, I correspond be defined as one of the Previous Contact field is '0' it. Since the next contact of RBK 1 is I 4 , the Next Contact field of RBK 1 is defined as '4' and the Previous Contact field of I 4 is defined as 'R1'. RBK 0 is Next Contact index "5" Because this Next Contact of I 1 contacts placed at the end of the OR1 is defined as a '5', the last Next Contact the junction of I 4 is placed in OR2 also '5' Is defined as
  • next contact is defined as the index '4' for both the contact I 2 of OR1 and the contact I 3 of OR2.
  • FIG. 29 shows a result of replacing RBK 1 in RBK 0 with I 2 and I 3 included in the contacts in FIG. 28.
  • I 4 since I 4 has RBK 1 as a previous contact and the last contact point of all internal elements of RBK 1 is I 2 and I 3 , as shown in FIG. 29, the previous contact of I 4 is '2, 3'. To be redefined.
  • Figure 30 shows the results of replacing with a, the relationship between the contact point included in the definition RBK 0, i.e. 0 RBK of the RBK 29 0 of Fig.
  • I 5 has a RBK 0 to RBK 0 to Previous Contact and the RBK Since the last contact point of all the internal elements of 0 I 1 and I 4, as shown in Fig. 30 I 5 Previous Contact is redefined as '1, 4.'
  • FIG. 31 shows a result of applying RBK 2 shown in FIG. 27 to the format of FIG. 23.
  • RBK 2 [O 6 , I 7 O 8 ]
  • RBK 2 has O 6 and I 7 O 8 as internal elements
  • Previous Contact is '5'. Therefore, as shown in FIG. 31, a Relation object of O 6 is inserted into OR 1 , and a Relation object of I 7 O 8 is contained in OR 2 , Previous Contact is represented by index '5'.
  • the Next Coil field of I 7 is defined as '8', and correspondingly, the Previous Contact field of O 8 is defined as '7'.
  • RBK 2 is because the Previous Contact index "5", the contact O 6 placed at the beginning of the OR1 Previous Contact is defined as a '5', the contacts I 7 placed at the beginning of the OR2 Previous Contact is also defined as a '5' do.
  • Figure 32 shows the results of replacing with a, the relationship between the contact point included in the definition RBK 2, i.e. RBK 2 of the RBK 2 of Fig. 30 Fig. 31. 30 and 31, since I 5 has RBK 2 as a next contact and the first contact point of all internal elements of RBK 2 is O 6 and I 7 , the next contact of I 5 as shown in FIG. 32. Is redefined to '7' and Next Coil to '6'.
  • FIG. 33 is structure data finally generated through the above process, in which the relations are defined in the objects of FIG. 18 for each contact point of N0 Step as shown in FIG. 25 and each contact point of N5 Step as shown in FIG. Represents the structure data that reflects the result of defining relations.
  • FIG. 34 is a flowchart of a method of converting a common PLC control program into structure data according to an embodiment of the present invention.
  • the method according to the present embodiment consists of the steps processed in the structure data converting apparatus described above. Therefore, even if omitted below, the above description of the structure data converting apparatus also applies to the method according to the present embodiment.
  • the common instruction library building unit 11 constructs a common instruction library by generating common instructions for instructions used in text-based PLC control programs having different formats.
  • the class library building unit 21 includes a class library including a rung of the PLC control program, a class for an input contact, an output contact, and a class for expressing a relationship between a corresponding contact and another contact for each contact. Build.
  • step 130 the common format converting unit 13 converts the text-based PLC control program into a common PLC control program using the common command library.
  • step 140 the structure generating unit 22 establishes a relationship between the rung, the input contact and the output contact of the PLC control program of the common type, the corresponding contact for each contact, and the other contact, based on the class library. Create structure data containing the objects to represent.
  • Combinations of each block of the block diagrams and respective steps of the flowcharts attached to the present invention may be performed by computer program instructions.
  • These computer program instructions may be mounted on a processor of a general purpose computer, special purpose computer, or other programmable data processing equipment such that instructions executed through the processor of the computer or other programmable data processing equipment may not be included in each block or flowchart of the block diagram. It will create means for performing the functions described in each step.
  • These computer program instructions may be stored in a computer usable or computer readable memory that can be directed to a computer or other programmable data processing equipment to implement functionality in a particular manner, and thus the computer usable or computer readable memory.
  • instructions stored in may produce an article of manufacture containing instruction means for performing the functions described in each block or flowchart of each step of the block diagram.
  • Computer program instructions may also be mounted on a computer or other programmable data processing equipment, such that a series of operating steps may be performed on the computer or other programmable data processing equipment to create a computer-implemented process to create a computer or other programmable data. Instructions that perform processing equipment may also provide steps for performing the functions described in each block of the block diagram and in each step of the flowchart.
  • each block or step may represent a portion of a module, segment or code that includes one or more executable instructions for executing a specified logical function (s).
  • a specified logical function s.
  • the functions noted in the blocks or steps may occur out of order.
  • the two blocks or steps shown in succession may in fact be executed substantially concurrently or the blocks or steps may sometimes be performed in the reverse order, depending on the functionality involved.

Landscapes

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

Abstract

An apparatus for converting a PLC control program into structured data according to the present invention is characterised by comprising: a class library construction unit for building a class library including rungs and classes for each of an input contact point and an output contact point of the PLC control program; and a structure generation unit for receiving input of a common format PLC control program that is converted from a text-based PLC control program, and generating structured data including rungs and objects for each of an input contact point and an output contact point of the common format PLC control program, based on the class library.

Description

PLC 제어 프로그램을 구조체 데이터로 변환하는 장치 및 방법Apparatus and method for converting a PLC control program into structure data

본 발명은 PLC 제어 프로그램에 관한 것으로, 보다 상세하게는 텍스트 기반의 PLC 제어 프로그램을 오브젝트들로 구성되는 구조체 데이터로 변환하는 장치 및 방법에 관한 것이다.The present invention relates to a PLC control program, and more particularly, to an apparatus and method for converting a text-based PLC control program into a structure data consisting of objects.

PLC(Programmable Logic Controller)는 자동화 산업의 공정제어를 위한 안정성이 보장된 제어장치로써 다품종 소량생산으로 인한 현장의 잦은 시스템 변경에 대응하기 위해 프로그램이 가능하며 소규모이고 시스템 변경에 비교적 자유로운 제어기의 필요성에서부터 개발되었다. Programmable Logic Controller (PLC) is a stable control device for process control in the automation industry.It is programmable to cope with frequent system changes in the field caused by small quantity production of various products, and from the need for a controller that is small and relatively free of system changes. Developed.

PLC를 동작하기 위한 프로그래밍 언어는 LD(Ladder Diagram), FBD(Function Block Diagram), ST(Structured Text), IL(Instruction List), SFC(Sequential Function Chart), CFC(Continuous Function Chart)로 국제 규격 IEC 61131-3에 규정되어 있다. Programming language to operate PLC is LD (Ladder Diagram), Function Block Diagram (FBD), Structured Text (ST), Instruction List (IL), Sequential Function Chart (SFC) and Continuous Function Chart (CFC). It is specified in 61131-3.

PLC 제어 프로그램의 구조는 크게 PLC의 접점에 대한 정보를 담고 있는 태그 정보와 구동되는 PLC 제어 프로그램에 대한 정보를 담고 있는 로직 정보로 구분할 수 있다. 이 중 로직 정보는 자동화 공정을 운영하는데 있어서 가장 기본이 되는 요소로써 설비/공정/라인 제어를 위한 시퀀스와 조건 등에 대한 정보를 모두 포함하고 있어 공정 운영 최적화 방법에 대한 관심이 높아지고 있는 오늘날 공정 운영 분석을 위한 핵심 정보로 사용될 수 있다. The structure of the PLC control program can be largely divided into tag information containing information about a PLC contact point and logic information containing information about a driven PLC control program. Among these, logic information is the most basic element in operating an automated process, and includes all the information about sequences and conditions for facility / process / line control. Can be used as key information for

자동화 공정 운영 분석의 핵심적 요소는 자동화 공정에서 발생하는 다양한 이상 상황에 대한 신속 정확한 원인 파악 및 조치 대응을 가능케 하는 것으로 이를 통해 생산성 향상 및 공정 최적화를 실현시키는 것에 목적이 있다.A key element of the automated process operation analysis is to enable rapid and accurate cause identification and response to various abnormal situations occurring in the automated process, which aims to improve productivity and process optimization.

자동화 공정의 이상 발생은 자동화 공정을 운영시키는 PLC 제어 프로그램 상의 이상 신호(Abnormal Symbol)의 발현(ON or OFF)으로 발생되며, 이 이상 신호는 Tree 구조의 형태로 상위 단의 이상 신호부터 이어지는 하위 단의 이상 신호까지 무수히 많은 이상 신호를 각 공정별로 포함하고 있다.The abnormal occurrence of the automation process is caused by the occurrence (ON or OFF) of an abnormal symbol (ON or OFF) on the PLC control program that operates the automation process. A myriad of abnormal signals are included for each process up to and including the abnormal signal.

현재 산업 현장에서는 자동화 공정의 이상 상황 발생 시 이상이 발생한 공정의 가장 상위 단의 이상 신호(Abnormal Symbol)의 발현을 HMI(Human-Machine Interface) 제어기의 Alarm List를 통해 Alarm을 진행하고, 현행 엔지니어의 경험을 통해 문제를 해결하고 있다.In the current industrial field, when the abnormal situation of the automation process occurs, the alarm is displayed through the Alarm List of the HMI (Human-Machine Interface) controller. Experience is solving the problem.

HMI 제어기 상에서 나타나지는 이상 상황 정보는 이상이 발생한 공정의 이상 신호 중 상위단에 속하는 이상 신호로서 실질적 이상 원인(하위 단에 속한 이상 신호)에 대한 정보를 포함하고 있지 않으며, 휘발성 데이터로 이력화 및 상황 재현이 불가능한 실정이다.The abnormal situation information displayed on the HMI controller is an abnormal signal belonging to the upper stage among the abnormal signals of the process in which the abnormality occurred, and does not include information on the actual cause of the abnormality (abnormal signal belonging to the lower stage). It is impossible to reproduce the situation.

이러한 이상 상황 발생을 해결하거나 혹은 공정 운영 최적화를 위해서는 구조체 데이터 형식의 PLC 제어 프로그램이 요구되나, 현재 PLC 제조사나 PLC 프로그래밍 소프트웨어는 예컨대 LD 기반의 PLC 제어프로그램 혹은 이로부터 변환된 텍스트 기반의 PLC 제어프로그램을 제공할 뿐, 구조체 데이터 형식의 PLC 제어 프로그램을 제공하지 않고 있다.In order to solve such an abnormal situation or to optimize the process operation, a PLC control program in the form of a structure data is required, but at present, a PLC manufacturer or a PLC programming software, for example, an LD-based PLC control program or a text-based PLC control program converted therefrom. It does not provide PLC control program of structure data format.

따라서 본 발명이 해결하고자 하는 과제는 텍스트 기반의 PLC 제어 프로그램을 자동으로 구조체 데이터 형식의 PLC 제어프로그램으로 변환하는 장치 및 방법을 제공하는 데 있다. Accordingly, an object of the present invention is to provide an apparatus and method for automatically converting a text-based PLC control program into a PLC control program having a structure data format.

상기 기술적 과제를 해결하기 위한 본 발명에 따른, PLC 제어 프로그램을 구조체 데이터로 변환하는 장치는, PLC 제어 프로그램의 렁(rung), 입력 접점 및 출력 접점 각각에 대한 클래스를 포함하는 클래스 라이브러리를 구축하는 클래스 라이브러리 구축부; 및 텍스트 기반의 PLC 제어 프로그램으로부터 변환된 공용형식의 PLC 제어프로그램을 입력받아, 상기 클래스 라이브러리를 바탕으로, 상기 공용형식의 PLC 제어프로그램의 렁(rung), 입력 접점 및 출력 접점 각각에 대한 오브젝트를 포함하는 구조체 데이터를 생성하는 구조체 생성부를 포함하는 것을 특징으로 한다.An apparatus for converting a PLC control program into structure data according to the present invention for solving the above technical problem is to build a class library including classes for each of the rung (Rung), input contact and output contact of the PLC control program Class library construction unit; And receiving a common PLC control program converted from a text-based PLC control program, and based on the class library, an object for each of a rung, an input contact, and an output contact of the PLC control program of the common type. And a structure generator for generating structure data to be included.

상기 클래스 라이브러리는 각 입력 접점 또는 출력 접점에 대한 해당 입력 접점 또는 출력 접점과 적어도 하나의 다른 입력 접점 또는 출력 접점과의 관계를 표현하기 위한 관계 클래스를 더 포함하고, 상기 구조체 데이터는 상기 공용형식의 PLC 제어프로그램의 각 입력 접점 또는 출력 접점에 대한 해당 입력 접점 또는 출력 접점과 적어도 하나의 다른 입력 접점 또는 출력 접점과의 관계를 표현하는 관계 오브젝트를 더 포함할 수 있다. 여기서 상기 관계 클래스 및 상기 관계 오브젝트는 데이터 필드로, 해당 입력 접점 또는 출력 접점을 기준으로 이전 입력 접점, 이전 출력 접점, 다음 입력 접점, 또는 다음 출력 접점을 표현하기 위한 데이터 필드를 가질 수 있다.The class library further includes a relationship class for representing a relationship between a corresponding input contact or output contact for each input contact or output contact and at least one other input contact or output contact, wherein the structure data is in the common format. The apparatus may further include a relationship object representing a relationship between a corresponding input contact or output contact for each input contact or output contact of the PLC control program and at least one other input contact or output contact. Here, the relationship class and the relationship object may be data fields and may have a data field for representing a previous input contact, a previous output contact, a next input contact, or a next output contact based on the corresponding input contact or output contact.

상기 구조체 생성부는, 상기 공용형식의 PLC 제어프로그램의 각 렁마다, 해당 렁에 포함되는 각 접점에 인덱스를 부여하는 인덱스 생성부; 상기 클래스 라이브러리를 바탕으로, 상기 부여된 인덱스를 반영하여, 상기 공용형식의 PLC 제어프로그램의 렁(rung), 입력 접점 및 출력 접점 각각에 대한 오브젝트 및 상기 관계 오브젝트를 생성하는 오브젝트 생성부; 및 상기 관계 오브젝트의 상기 데이터 필드를 정의하는 관계 형성부를 포함할 수 있다.The structure generating unit may include: an index generating unit for assigning an index to each contact included in the corresponding rung for each rung of the common type PLC control program; An object generation unit for generating an object and a relationship object for each of a rung, an input contact and an output contact of the PLC control program of the common type by reflecting the given index based on the class library; And a relationship forming unit defining the data field of the relationship object.

상기 관계 형성부는, 상기 데이터 필드로 이전 입력 접점, 이전 출력 접점, 다음 입력 접점, 또는 다음 출력 접점의 인덱스를 정의할 수 있다.The relationship forming unit may define an index of a previous input contact, a previous output contact, a next input contact, or a next output contact as the data field.

상기 공용형식의 PLC 제어프로그램은 OR 결합관계를 나타내는 기호를 포함하고, 상기 관계 형성부는, 상기 OR 결합관계를 나타내는 기호를 이용하여, 상기 공용형식의 PLC 제어프로그램에서 OR 관계로 결합되어 있는 공용형식을 관계블록-상기 관계블록은 해당 관계블록을 기준으로 이전 입력 접점, 이전 출력 접점, 다음 입력 접점, 또는 다음 출력 접점을 표현하기 위한 데이터 필드를 가짐-으로 정의하는 관계블록 생성부; 상기 관계블록으로 표현된 공용형식의 PLC 제어프로그램의 각 렁에 대하여, 해당 렁을 구성하는 관계블록, 입력 접점 및 출력 접점에 대한 상기 데이터 필드를 정의하는 스텝내 관계 형성부; 및 상기 관계블록에 포함된 접점들에 대하여 상기 데이터 필드를 정의하는 관계블록내 관계 형성부를 포함할 수 있다.The common type PLC control program includes a symbol indicating an OR coupling relationship, and the relationship forming unit uses a symbol indicating the OR coupling relationship, and the common type is combined in an OR relationship in the PLC control program of the common type. A relation block generator that defines a relation block, wherein the relation block has a data field for representing a previous input contact, a previous output contact, a next input contact, or a next output contact; An in-step relationship forming unit defining, for each rung of the PLC control program of the common type represented by the relationship block, the data field for the relationship block, the input contact point, and the output contact constituting the rung; And a relationship forming unit in a relationship block defining the data field with respect to the contacts included in the relationship block.

상기 관계블록내 관계 형성부는, 상기 관계블록 내의 OR 관계로 결합되어 있는 내부 요소들을 구분하고, 상기 관계블록에 대해 정의된 상기 데이터 필드를 바탕으로 상기 내부 요소들에 포함된 적어도 하나의 입력 접점 또는 출력 접점의 상기 데이터 필드를 정의할 수 있다.The relationship forming unit in the relationship block may distinguish internal elements coupled in an OR relationship in the relationship block, and may include at least one input contact included in the internal elements based on the data field defined for the relationship block, or The data field of the output contact can be defined.

상기 관계블록내 관계 형성부는, 상기 관계블록에 포함된 접점들에 대하여 정의된 상기 데이터 필드를 바탕으로, 해당 관계블록의 이전 또는 다음의 입력 접점 또는 출력 접점의 상기 데이터 필드를 재정의할 수 있다.The relationship forming unit in the relationship block may redefine the data field of the previous or next input contact or output contact of the corresponding relationship block based on the data field defined for the contacts included in the relationship block.

상기 기술적 과제를 해결하기 위한 본 발명에 따른, PLC 제어 프로그램을 구조체 데이터로 변환하는 방법은, PLC 제어 프로그램의 렁(rung), 입력 접점 및 출력 접점 각각에 대한 클래스를 포함하는 클래스 라이브러리를 구축하는 단계; 및 텍스트 기반의 PLC 제어 프로그램으로부터 변환된 공용형식의 PLC 제어프로그램을 입력받아, 상기 클래스 라이브러리를 바탕으로, 상기 공용형식의 PLC 제어프로그램의 렁(rung), 입력 접점 및 출력 접점 각각에 대한 오브젝트를 포함하는 구조체 데이터를 생성하는 단계를 포함하는 것을 특징으로 한다.According to an embodiment of the present invention for solving the above technical problem, a method for converting a PLC control program into structure data includes: constructing a class library including classes for each of a rung, an input contact, and an output contact of the PLC control program; step; And receiving a common PLC control program converted from a text-based PLC control program, and based on the class library, an object for each of a rung, an input contact, and an output contact of the PLC control program of the common type. And generating the structure data to include.

상기 클래스 라이브러리는 각 입력 접점 또는 출력 접점에 대한 해당 입력 접점 또는 출력 접점과 적어도 하나의 다른 입력 접점 또는 출력 접점과의 관계를 표현하기 위한 관계 클래스를 더 포함하고, 상기 구조체 데이터는 상기 공용형식의 PLC 제어프로그램의 각 입력 접점 또는 출력 접점에 대한 해당 입력 접점 또는 출력 접점과 적어도 하나의 다른 입력 접점 또는 출력 접점과의 관계를 표현하는 관계 오브젝트를 더 포함할 수 있다. 여기서 상기 관계 클래스 및 상기 관계 오브젝트는 데이터 필드로, 해당 입력 접점 또는 출력 접점을 기준으로 이전 입력 접점, 이전 출력 접점, 다음 입력 접점, 또는 다음 출력 접점을 표현하기 위한 데이터 필드를 가질 수 있다.The class library further includes a relationship class for representing a relationship between a corresponding input contact or output contact for each input contact or output contact and at least one other input contact or output contact, wherein the structure data is in the common format. The apparatus may further include a relationship object representing a relationship between a corresponding input contact or output contact for each input contact or output contact of the PLC control program and at least one other input contact or output contact. Here, the relationship class and the relationship object may be data fields and may have a data field for representing a previous input contact, a previous output contact, a next input contact, or a next output contact based on the corresponding input contact or output contact.

상기 구조체 데이터를 생성하는 단계는, 상기 공용형식의 PLC 제어프로그램의 각 렁마다, 해당 렁에 포함되는 각 접점에 인덱스를 부여하는 단계; 상기 클래스 라이브러리를 바탕으로, 상기 부여된 인덱스를 반영하여, 상기 공용형식의 PLC 제어프로그램의 렁(rung), 입력 접점 및 출력 접점 각각에 대한 오브젝트 및 상기 관계 오브젝트를 생성하는 단계; 및 상기 관계 오브젝트의 상기 데이터 필드를 정의하는 단계를 포함할 수 있다.The generating of the structure data may include: assigning an index to each contact included in the corresponding rung for each rung of the PLC control program of the common type; Generating an object and a relationship object for each of a rung, an input contact and an output contact of the PLC control program of the common type by reflecting the given index based on the class library; And defining the data field of the relationship object.

상기 데이터 필드를 정의하는 단계는, 상기 데이터 필드로 이전 입력 접점, 이전 출력 접점, 다음 입력 접점, 또는 다음 출력 접점의 인덱스를 정의할 수 있다.In the defining of the data field, an index of a previous input contact, a previous output contact, a next input contact, or a next output contact may be defined as the data field.

상기 공용형식의 PLC 제어프로그램은 OR 결합관계를 나타내는 기호를 포함하고, 상기 데이터 필드를 정의하는 단계는, (a) 상기 OR 결합관계를 나타내는 기호를 이용하여, 상기 공용형식의 PLC 제어프로그램에서 OR 관계로 결합되어 있는 공용형식을 관계블록-상기 관계블록은 해당 관계블록을 기준으로 이전 입력 접점, 이전 출력 접점, 다음 입력 접점, 또는 다음 출력 접점을 표현하기 위한 데이터 필드를 가짐-으로 정의하는 단계; (b) 상기 관계블록으로 표현된 공용형식의 PLC 제어프로그램의 각 렁에 대하여, 해당 렁을 구성하는 관계블록, 입력 접점 및 출력 접점에 대한 상기 데이터 필드를 정의하는 단계; 및 (c) 상기 관계블록에 포함된 접점들에 대하여 상기 데이터 필드를 정의하는 단계를 포함할 수 있다.The common type PLC control program includes a symbol indicating an OR coupling relationship, and the step of defining the data field includes: (a) OR in the common type PLC control program using a symbol indicating the OR coupling relationship; Defining a common type combined in a relationship as a relationship block, wherein the relationship block has a data field for representing a previous input contact, a previous output contact, a next input contact, or a next output contact based on the relationship block; ; (b) defining, for each rung of the PLC control program of the common format represented by the relationship block, the data field for the relationship block, the input contact point and the output contact point constituting the rung; And (c) defining the data field with respect to the contacts included in the relationship block.

상기 (c) 단계는, 상기 관계블록 내의 OR 관계로 결합되어 있는 내부 요소들을 구분하고, 상기 관계블록에 대해 정의된 상기 데이터 필드를 바탕으로 상기 내부 요소들에 포함된 적어도 하나의 입력 접점 또는 출력 접점의 상기 데이터 필드를 정의하는 단계를 포함할 수 있다.In step (c), the internal elements coupled in the OR relationship in the relationship block are distinguished, and at least one input contact or output included in the internal elements based on the data field defined for the relationship block. And defining the data field of the contact.

상기 (c) 단계는, 상기 관계블록에 포함된 접점들에 대하여 정의된 상기 데이터 필드를 바탕으로, 해당 관계블록의 이전 또는 다음의 입력 접점 또는 출력 접점의 상기 데이터 필드를 재정의하는 단계를 포함할 수 있다.The step (c) may include redefining the data field of a previous or next input contact or output contact of the relation block based on the data field defined for the contacts included in the relation block. Can be.

본 발명에 의하면, 텍스트 기반의 PLC 제어 프로그램을 자동으로 구조체 데이터 형식의 PLC 제어프로그램으로 변환함으로써, 구조체 데이터 형식의 PLC 제어프로그램을 이용하여 자동화 공정의 이상 상황 발생 시 이상이 발생한 공정의 가장 상위 단의 이상 신호로부터 실질적 원인이 되는 가장 하위 단의 이상 신호까지의 자동 추적을 가능케 할 수 있다. 또한 이러한 구조체 데이터 형식의 PLC 제어 프로그램은, 자동화 공정의 이상 상황 발생에 대한 실질적 원인 가시화 및 이력화를 진행하는 시스템의 기반이 될 수 있고, 이를 통해 자동화 공정의 생산성 향상 및 공정 운영 최적화 실현에 기여할 수 있다.According to the present invention, by converting a text-based PLC control program to a PLC control program of the structure data format automatically, using the PLC control program of the structure data format, the highest stage of the process where an error occurs when an abnormal situation of the automation process occurs. It is possible to enable automatic tracking from the abnormal signal of to the lowest abnormal signal of the actual cause. In addition, the PLC control program of the structure data format can be the basis of a system that visualizes and traces the actual cause of the occurrence of an abnormal situation in the automation process, thereby contributing to the improvement of the productivity of the automation process and the optimization of the process operation. Can be.

도 1은 본 발명의 일 실시예에 따른, PLC 제어 프로그램을 구조체 데이터로 변환하는 장치의 블록도를 나타낸다.1 is a block diagram of an apparatus for converting a PLC control program into structure data according to an embodiment of the present invention.

도 2는 공용명령어에 대한 XML 파일 형식에 대한 예시이다.2 is an example of an XML file format for a common command.

도 3은 공용형식 변환부(13)의 구체적인 구성을 나타낸다.3 shows a specific configuration of the common format conversion unit 13.

도 4는 공용형식 변환부(13)에 의해서 수행되는, 텍스트 기반의 PLC 제어프로그램에 대한 공용형식으로의 변환방법의 흐름도이다.4 is a flowchart of a conversion method to a common format for a text-based PLC control program performed by the common format conversion unit 13.

도 5a는 미츠비시의 LD 구조의 PLC 제어 프로그램의 일 예를 나타낸다.5A shows an example of a PLC control program of the Mitsubishi LD structure.

도 5b는 도 5a의 PLC 제어 프로그램으로부터 변환된 텍스트 기반의 PLC 제어 프로그램을 나타낸다.FIG. 5B illustrates a text-based PLC control program converted from the PLC control program of FIG. 5A.

도 6은 IL 오브젝트 생성부(14)에 의해 첫 번째 렁(rung)과 두 번째 렁(rung)에 대하여 각각 생성되는 IL 오브젝트들을 나타낸다.FIG. 6 shows IL objects generated by the IL object generator 14 for the first rung and the second rung, respectively.

도 7a는 첫 번째 렁(rung)에 대하여 IL 블록 생성부(15)에 의해 생성된 IL 블록들을 나타낸다.7A shows IL blocks generated by the IL block generator 15 for the first rung.

도 7b는 두 번째 렁(rung)에 대하여 IL 블록 생성부(15)에 의해 생성된 IL 블록들을 나타낸다.FIG. 7B shows IL blocks generated by the IL block generator 15 for the second rung.

도 8a는 도 7a에 도시된 공용블록들에 대해서 결합 명령어 OR을 적용하여 공용블록들 간의 결합관계를 공용형식으로 표현하는 과정을 나타낸다.FIG. 8A illustrates a process of expressing a coupling relationship between common blocks by applying a joint instruction OR to the common blocks shown in FIG. 7A in a common format.

도 8b는 도 7b에 도시된 공용블록들에 대해서 결합 명령어 OR을 적용하여 공용블록들 간의 결합관계를 공용형식으로 표현하는 과정을 나타낸다.8B illustrates a process of expressing a coupling relationship between common blocks by applying a joint instruction OR to the common blocks shown in FIG. 7B in a common format.

도 9는 도 8b를 통해 결합명령어 OR를 적용한 이후의 공용블록들에 대해서 결합 명령어 ORB를 적용하여 공용블록들 간의 결합관계를 공용형식으로 표현하는 과정을 나타낸다.FIG. 9 illustrates a process of expressing a coupling relationship between common blocks by applying a joint command ORB to common blocks after applying the joint command OR through FIG. 8B.

도 10은 출력부에 사용되는 결합명령어 MPS를 적용한 결과를 나타낸다.10 shows the result of applying the combined command MPS used in the output unit.

도 11은 출력부에 사용되는 결합명령어 MPP를 적용한 결과를 나타낸다.11 shows the result of applying the combined command MPP used in the output unit.

도 12는 두 번째 렁(rung)에 대하여 도 9 내지 11를 통해 표현된 공용블록들의 공용형식들을 나타낸다.FIG. 12 shows common formats of common blocks represented through FIGS. 9 through 11 for the second rung.

도 13은 도 5b의 텍스트 기반의 PLC 제어 프로그램으로부터 변환된, 첫 번째 렁(rung)(N0)과 두 번째 렁(rung)(N5)에 대한 최종 공용형식을 나타낸다.FIG. 13 shows the final common format for the first rung N0 and the second rung N5, converted from the text-based PLC control program of FIG. 5B.

도 14는 클래스 라이브러리 구축부(21)에 의해 구축되는 클래스 라이브러이의 구조를 나타낸다.14 shows the structure of a class library constructed by the class library constructing unit 21.

도 15a 내지 15e는 각각 'Step' 클래스, 'Coil' 클래스, 'Contact' 클래스, 'Relation' 클래스, 'Tag' 클래스의 데이터 필드 구조를 나타낸다. 15A to 15E illustrate data field structures of a 'Step' class, a 'Coil' class, a 'Contact' class, a 'Relation' class, and a 'Tag' class, respectively.

도 16은 본 발명의 일 실시예에 따른 구조체 생성부(22)의 구체적인 구성을 나타낸다. 16 shows a specific configuration of the structure generation unit 22 according to an embodiment of the present invention.

도 17은 도 13에 도시된 공용형식의 PLC 제어프로그램에 대하여 접점들에 부여된 인덱스들의 예를 나타낸다.FIG. 17 shows an example of the indices given to the contacts for the PLC control program of the common type shown in FIG.

도 18은 도 14 및 15의 클래스 라이브러리를 바탕으로, 도 17과 같이 인덱스가 부여된 공용형식의 PLC 제어프로그램으로부터 생성된 오브젝트들의 예를 나타낸다.FIG. 18 illustrates examples of objects generated from a PLC-type control program of a common type indexed as shown in FIG. 17 based on the class libraries of FIGS. 14 and 15.

도 19는 도 17과 같이 인덱스가 부여된 공용형식의 PLC 제어프로그램을 편의상 오브젝트 형태로 표현한 PLC 제어프로그램을 나타낸다.FIG. 19 illustrates a PLC control program in which the common type PLC control program with an index is expressed in the form of an object as shown in FIG. 17.

도 20은 본 발명의 일 실시예에 따른 관계 형성부(25)의 구체적인 구성을 나타낸다.20 shows a specific configuration of the relationship forming unit 25 according to an embodiment of the present invention.

도 21은 N0 Step을 관계블록을 이용하여 표현한 결과를 보여준다.21 shows a result of expressing NO step using a relationship block.

도 22은 N0 Step에 대하여 접점들(또는 관계블록) 간의 관계가 정의된 결과를 보여준다. 22 shows the result of defining the relationship between the contacts (or the relationship block) for the NO step.

도 23은 관계블록을 내부 요소들로 구분한 형식을 나타낸다.23 shows a format in which the relationship block is divided into internal elements.

도 24a는 도 23의 형식에 도 22에 도시된 관계블록 RBK0를 적용한 결과를 보여준다.FIG. 24A shows a result of applying the relation block RBK 0 shown in FIG. 22 to the format of FIG. 23.

도 24b는 관계블록 RBK0에 포함된 각 접점에 대하여 다른 접점과의 관계를 정의한 결과를 보여준다.24B shows a result of defining a relationship with other contacts for each contact included in the relationship block RBK 0 .

도 25는 N0 Step의 각 입력 접점 또는 출력 접점에 대하여 해당 입력 접점 또는 출력 접점과 다른 입력 접점 또는 출력 접점과의 관계가 모두 표현된 결과를 보여준다.FIG. 25 illustrates a result in which all of the relationships between the corresponding input contact or output contact and another input contact or output contact are expressed for each input contact or output contact of the NO step.

도 26은 N5 Step을 관계블록을 이용하여 표현한 결과를 보여준다.26 shows the result of expressing N5 Step using a relationship block.

도 27은 N5 Step에 대하여 접점들(또는 관계블록) 간의 관계가 정의된 결과를 보여준다.27 shows a result of defining a relationship between contacts (or a relationship block) for N5 Step.

도 28은 도 23의 형식에 도 27에 도시된 관계블록 RBK0와 관계블록 RBK1을 적용하고, RBK0와 RBK1에 포함된 각 접점에 대하여 다른 접점과의 관계를 정의한 결과를 보여준다.FIG. 28 shows the result of applying the relationship block RBK 0 and the relationship block RBK 1 shown in FIG. 27 to the format of FIG. 23 and defining the relationship with other contacts for each contact included in the RBK 0 and RBK 1 .

도 29는 도 28에서 관계블록 RBK0 내의 관계블록 RBK1을 그에 포함된 접점들인 I2와 I3로 대체한 결과를 보여준다.FIG. 29 illustrates a result of replacing relation block RBK 1 in relation block RBK 0 with contacts I2 and I3 included in FIG. 28.

도 30은 도 27의 관계블록 RBK0를 도 29의 관계블록 RBK0, 즉 RBK0에 포함된, 관계가 정의된 접점들로 대체한 결과를 보여준다.Figure 30 shows the results of replacing with a, a relationship is defined between the contact included in the block RBK 0, i.e. RBK 0 in FIG. 29 the relationship block RBK 0 of Fig.

도 31은 도 23의 형식에 도 27에 도시된 관계블록 RBK2를 적용한 결과를 보여준다. FIG. 31 shows a result of applying the relation block RBK 2 shown in FIG. 27 to the format of FIG. 23.

도 32는 도 30의 관계블록 RBK2를 도 31의 관계블록 RBK2, 즉 RBK2에 포함된, 관계가 정의된 접점들로 대체한 결과를 보여준다.Figure 32 shows the results of replacing with a, a relationship is defined, the contact in the relation RBK block 2, i.e. 2 RBK of the relationship RBK block 2 of Fig. 30 Fig. 31.

도 33은 본 발명의 실시예에 따라 최종적으로 생성된 구조체 데이터의 예를 보여준다.33 shows an example of structure data finally generated according to an embodiment of the present invention.

도 34는 본 발명의 일 실시예에 따른, 공용형식의 PLC 제어프로그램을 구조체 데이터로 변환하는 방법의 흐름도를 나타낸다.34 is a flowchart of a method of converting a common PLC control program into structure data according to an embodiment of the present invention.

이하에서는 도면을 참조하여 본 발명의 바람직한 실시예들을 상세히 설명한다. 이하 설명 및 첨부된 도면들에서 실질적으로 동일한 구성요소들은 각각 동일한 부호들로 나타냄으로써 중복 설명을 생략하기로 한다. 또한 본 발명을 설명함에 있어 관련된 공지기능 혹은 구성에 대한 구체적인 설명이 본 발명의 요지를 불필요하게 흐릴 수 있다고 판단되는 경우 그에 대한 상세한 설명은 생략하기로 한다.Hereinafter, exemplary embodiments of the present invention will be described in detail with reference to the accompanying drawings. In the following description and the accompanying drawings, the substantially identical components are represented by the same reference numerals, and thus redundant description will be omitted. In addition, in the following description of the present invention, if it is determined that a detailed description of a related known function or configuration may unnecessarily obscure the subject matter of the present invention, the detailed description thereof will be omitted.

도 1은 본 발명의 일 실시예에 따른, PLC 제어 프로그램을 구조체 데이터로 변환하는 장치(이하, 구조체 데이터 변환 장치)의 블록도를 나타낸다.1 is a block diagram of an apparatus for converting a PLC control program into structure data (hereinafter, referred to as a structure data converting apparatus) according to an embodiment of the present invention.

본 실시예에 따른 구조체 데이터 변환 장치는, 공용명령어 라이브러리 구축부(11), 저장부(12), 공용형식 변환부(13), 클래스 라이브러리 구축부(21), 구조체 형성부(22)를 포함할 수 있다. The structure data converting apparatus according to the present embodiment includes a common instruction library constructing unit 11, a storage unit 12, a common format converting unit 13, a class library constructing unit 21, and a structure forming unit 22. can do.

본 실시예에 따른 구조체 데이터 변환 장치의 구성 중 공용명령어 라이브러리 구축부(11), 저장부(12), 공용형식 변환부(13)는, PLC 제조사 별로 서로 다른 텍스트 형식을 갖는 PLC 제어 프로그램을 공용형식(common type)의 PLC 제어 프로그램으로 변환하는 기능을 하는 것으로, 이른바 PLC 제어 프로그램의 공용형식 변환 장치(이하, 공용형식 변환 장치)를 구성할 수 있다. 상기 공용형식 변환 장치에 관하여는 본 발명의 출원인이 출원한 대한민국 특허출원 제10-2015-0181242호에 구체적이고 상세하게 개시되어 있으며, 그 개시된 전체 내용은 본 명세서에서 참조로서 인용된다. In the structure of the structure data conversion apparatus according to the present embodiment, the common instruction library construction unit 11, the storage unit 12, and the common format conversion unit 13 share a PLC control program having a different text format for each PLC manufacturer. By converting into a PLC control program of a common type, a so-called common type conversion device (hereinafter, referred to as a common type conversion device) of a PLC control program can be configured. The common format conversion apparatus is disclosed in detail and in detail in Korean Patent Application No. 10-2015-0181242 filed by the applicant of the present invention, the entire contents of which are incorporated herein by reference.

실시예에 따라서는, 공용형식 변환 장치는 공용명령어 라이브러리 구축부(11), 저장부(12), 공용형식 변환부(13)로 구성되고, 구조체 데이터 변환 장치는 클래스 라이브러리 구축부(21)와 구조체 형성부(22)로 구성될 수도 있다.According to the embodiment, the common format converting apparatus is composed of a common instruction library constructing unit 11, a storage unit 12, and a common format converting unit 13, and the structure data converting apparatus is connected to the class library constructing unit 21. It may be composed of the structure forming part 22.

공용명령어 라이브러리 구축부(11)는 공용명령어 생성알고리즘에 따라, 서로 다른 형식을 가진 텍스트 기반의 PLC 제어프로그램들에 사용되는 명령어들에 대한 공용 명령어를 생성하여 공용 명령어 라이브러리를 구축하여 저장부(12)에 저장한다.The common instruction library construction unit 11 generates a common instruction library for instructions used in text-based PLC control programs having different formats according to the common instruction generation algorithm, constructs a common instruction library, and stores the storage unit 12. ).

이러한 공용 명령어 라이브러리의 구축이 원활하게 이루어지기 위해서, 먼저 공용 명령어 라이브러리의 구축 시작 전에 PLC 제조사별로 PLC 제어프로그램에서 사용되는 명령어 정보 및 이에 대응되는 공용명령어 정보가 이미 공용명령어 라이브러리 구축부(11)에 저장 또는 입력이 완료되어 있는 것이 바람직하다.In order to facilitate the construction of such a common instruction library, first, the instruction information used in the PLC control program for each PLC manufacturer and the corresponding instruction information corresponding to the PLC instruction before the start of construction of the common instruction library are already in the common instruction library construction unit 11. It is preferable that the storing or input is completed.

이렇게 PLC 제조사별 PLC 제어프로그램에서 사용되는 명령어들이 준비된 상태가 되면, 공용명령어 라이브러리 구축부(11)는 공용명령어 생성 알고리즘에 따라 공용 명령어 라이브러리를 구축한다.When the instructions used in the PLC control program for each PLC manufacturer are prepared in this way, the common instruction library building unit 11 constructs the common instruction library according to the common instruction generation algorithm.

이때, 공용 명령어 생성 알고리즘은, 서로 다른 형식을 가진 텍스트 기반의 PLC 제어프로그램들에 사용되는 명령어들에 대한 공용 명령어를 생성하기 위해서 제1단계, 제2단계 및 제3단계를 순차적으로 수행하는 알고리즘이다.At this time, the common command generation algorithm is an algorithm that sequentially performs the first step, the second step and the third step to generate a common command for the commands used in text-based PLC control programs having different formats to be.

제1단계는 서로 다른 형식을 가진 텍스트 기반의 PLC 제어프로그램들에 사용되는 명령어들을 표시상 동일 의미를 갖는 동일 표시 명령어 그룹들로 분류하는 단계이다.The first step is to classify the commands used for text-based PLC control programs having different formats into the same display command groups having the same meaning on the display.

예를 들어, 표시상 '같다'라는 명령어에 대해서 미츠비스(Mitsubishi) 사의 경우 'OR='로 표시되고, AB사의 경우 'EQU'로 표시되고, 지멘스(Siemens)사의 경우 '==I'로 표시되고, LS 산전의 경우 'OR='로 표시된다. 따라서 제1단계에서 '같다' 명령어 그룹에는, 미츠비시(Mitsubishi) 사의 경우 'OR=', AB사의 경우 'EQU', 지멘스(Siemens)사의 경우 '==I', LS 산전의 경우 'OR='이 포함될 수 있다. For example, the command 'equal' is displayed as 'OR =' for Mitsubishi, 'EQU' for AB, and '== I' for Siemens. In the case of LSIS, 'OR =' is displayed. Therefore, in the first step, the 'equal' command group includes 'OR =' for Mitsubishi, 'EQU' for AB, '== I' for Siemens, and 'OR =' for LS. This may be included.

이후 제2단계는 상기 동일표시 명령어 그룹에 속한 명령어들이 모두 동일 기능인가를 확인하는 단계이다.Thereafter, the second step is to check whether all the commands belonging to the same display command group have the same function.

예를 들어, 제2단계에서는 '같다' 명령어 그룹에 속한, 'OR=', 'EQU', '==I', 'OR='이 모두 동일기능인가의 확인이 이루어지게 되는 것이다.For example, in the second step, whether or not 'OR =', 'EQU', '== I' and 'OR =' belonging to the 'same' command group are all the same function.

제3단계는 상기 동일표시 명령어 그룹에 속한 명령어들이 모두 동일 기능인지 아니면 그렇지 않은 경우에 따라서 공용 명령어를 다른 방식으로 생성하는 단계이다. The third step is to generate a common command in a different manner depending on whether all of the commands belonging to the same display command group are the same function or not.

먼저, 상기 동일표시 명령어 그룹에 속한 명령어들이 모두 동일 기능인 경우, 상기 동일표시 명령어 그룹에 속하면서 동일 기능을 갖는 명령어들을 동일하게 표시하는 사전상 단어를, 상기 동일 기능을 갖는 명령어들에 대한 공용 명령어로 생성된다.First, when all the commands belonging to the same display command group have the same function, a dictionary word indicating the same commands belonging to the same display command group and having the same function is a common command for the commands having the same function. Is generated.

예를 들어, '같다' 명령어 그룹에 속한, 'OR=', 'EQU', '==I', 'OR='의 경우 모두 동일 기능을 가지므로, '같다'를 표시하는 사전상 단어인 'EQUAL'을 상기 동일 기능인 갖는 명령어들에 대한 공용명령어로 생성할 수 있다. 사전상 단어인 'EQUAL'만을 공용명령어로 하는 것에 국한되지 않는다.For example, the words 'OR =', 'EQU', '== I', and 'OR =' belonging to the 'Equal' command group all have the same function, so the dictionary word for 'equal' is 'EQUAL' may be generated as a common command for commands having the same function. It is not limited to using only the word 'EQUAL' as a common command in the dictionary.

그리고 상기 동일 기능을 갖는 명령어들에 대한 공용명령어 생성 시, 상기 동일 기능을 갖는 명령어에 포함된 파라미터(parameter) 한정자를 상기 동일 기능을 갖는 명령어들에 대한 공용명령어에 삽입할 수 있다. 이러한 명령어의 파라미터를 한정하는 한정자, 즉 D(Double), BK(Block), U(Unsigned), G(Group), R(Real), L(Long), 4(4bit), 8(8Bit), $(String), C(Complement) 들 중 어느 하나가 해당 명령어에 포함된 경우, 해당 명령어의 공용명령어에 파라미터 한정자가 접두사로 삽입될 수 있다. 그러나 파라미터 한정자가 삽입되는 위치는 이에 한정되지 않는다.When generating a common command for the commands having the same function, a parameter qualifier included in the command having the same function may be inserted into the common command for the command having the same function. Qualifiers that define the parameters of these instructions: D (Double), BK (Block), U (Unsigned), G (Group), R (Real), L (Long), 4 (4 bit), 8 (8 Bit), If any one of $ (String) and C (Complement) is included in the command, the parameter qualifier may be inserted as a prefix to the common command of the command. However, the position at which the parameter qualifier is inserted is not limited thereto.

예를 들어, '같다'에 대한 AB사의 명령어 'DEQU'는 명령어 'EQU'에 파라미터 한정자 D(Double)가 붙은 명령어이다. 'D'는 명령어 'EQU'의 파라미터 크기를 한정한다. 'EQU' 명령어는 1 Word(16bit)를 처리하는 명령어인데, 'DEQU'는 2 Word(32bit)를 처리하는 명령어이다. 이와 같이 명령어 파라미터(parameter)를 한정 짓는 파라미터 한정자는 공용명령어의 접두사로 삽입될 수 있다.For example, AB's command 'DEQU' for 'equal' is a command with the parameter qualifier D (Double) appended to the command 'EQU'. 'D' limits the parameter size of the command 'EQU'. The 'EQU' command processes 1 Word (16bit), and the 'DEQU' command processes 2 Word (32bit). As such, parameter qualifiers that define command parameters may be inserted as prefixes of common commands.

그리고 상기 동일 기능을 갖는 명령어들에 대한 공용명령어 생성 시, 상기 동일 기능을 갖는 명령어에 포함된 동작 한정자를 상기 동일 기능을 갖는 명령어들에 대한 공용명령어에 삽입할 수 있다. 이러한 명령어의 동작을 한정하는 동작 한정자, 즉 P(Postive Pulse), N(Negative Pulse) 들 중 어느 하나가 해당 명령어에 포함된 경우, 해당 명령어의 공용명령어에 동작 한정자가 접미사로 삽입될 수 있다. 그러나 동작 한정자가 삽입되는 위치는 이에 한정되지 않는다.When generating a common command for the commands having the same function, an operation modifier included in the command having the same function may be inserted into the common command for the commands having the same function. If any one of the operation qualifiers limiting the operation of the command, that is, P (Negative Pulse) or N (Negative Pulse) is included in the corresponding command, the operation qualifier may be inserted as a suffix in the common command of the command. However, the position at which the operation modifier is inserted is not limited thereto.

예를 들어, 미츠비시 사의 'ANDP' 명령어는 어드레스(address)의 값이 On 되면 On이 되는 기능을 가진 접점인 'AND'를 양(Positvie)의 펄스(Pulse) 형태로 변환하는 동작 한정자인 'P(Positive pulse)'를 포함한다. 따라서 'ANDP'에 대한 공용명령어인 'XICP'는 'AND'에 대한 공용명령어인 'XIC(eXamine If Closed)'에 동작 한정자인 'P'를 접미사로 붙여서 생성될 수 있다.For example, Mitsubishi's 'ANDP' command is 'P', an operation qualifier that converts 'AND', which has a function to turn on when the address value is On, to a positive pulse form. (Positive pulse) '. Therefore, 'XICP', a common command for 'ANDP', may be generated by suffixing an operation modifier 'P' to 'XIC (eXamine If Closed)', a common command for 'AND'.

한편, 상기 동일표시 명령어 그룹에 속한 명령어들이 모두 동일 기능을 갖지 않은 경우, 상기 동일표시 명령어 그룹에 속하지만 모두 동일 기능을 갖지 않은 명령어들을 동일하게 표시하는 사전상 단어를, 상기 동일 기능을 갖는 않는 명령어들에 대한 공용 명령어로 생성하고, 상기 동일 기능을 갖는 않는 명령어가 사용되는 PLC 제어프로그램에 의해 제어되는 PLC의 제조사 명칭을 상기 동일 기능을 갖는 않은 명령어들에 대한 공용명령어에 삽입할 수 있다.On the other hand, when the commands belonging to the same display command group do not all have the same function, the dictionary words for displaying the same commands belonging to the same display command group but not all have the same function do not have the same function. It is possible to generate a common command for the commands, and insert the manufacturer name of the PLC controlled by the PLC control program in which the command having the same function is not used in the common command for the commands having the same function.

예를 들어, 상기 동일표시 명령어 그룹에 속한 명령어들이 모두 동일 기능을 갖지 않는 경우로는, 명령어 'LIMIT' 등을 들 수 있다. 명령어 'LIMIT'는 미츠비시 사, LS 산전, AB 사의 PLC 제어 프로그램에서 표시상 동일하게 사용되고 있으나 동일한 기능을 갖지 않고 있다. 'LIMIT' 명령어는 지멘스 사의 PLC 제어 프로그램에서 사용되지 않는 명령어이다.For example, when all of the commands belonging to the same display command group do not have the same function, the command 'LIMIT' may be mentioned. The command 'LIMIT' is used the same in the PLC control program of Mitsubishi, LS Industrial Systems and AB, but it does not have the same function. 'LIMIT' command is not used in Siemens PLC control program.

따라서 명령어 'LIMIT'에 대한 공용 명령어는 사전상 단어인 'LIMIT'로 생성될 수 있다. 명령어 'LIMIT'는 PLC 제조사마다 모두 동일 기능을 하지 않으므로, 공용명령어 'LIMIT'에 각 PLC의 제조사 명칭을 삽입할 수 있다. 실시예로, 미츠비시 사의 경우 'm', 지멘스 사의 경우 's', AB 사의 경우 'ab', LS 산전의 경우 'ls'를 공용명령어 'LIMIT'의 접두사로 삽입할 수 있다. 즉 미츠비시 사의 경우 'mLIMIT'가 되고 지멘스 사의 경우 'sLIMIT'가 되고 AB 사의 경우 'abLIMIT'가 되고 LS 산전의 경우 'lsLIMIT'가 될 수 있다.Therefore, the common command for the command 'LIMIT' may be generated as the word 'LIMIT' in the dictionary. Since the command 'LIMIT' does not have the same function for each PLC manufacturer, the manufacturer name of each PLC can be inserted in the common command 'LIMIT'. For example, Mitsubishi's 'm', 'S' for Siemens, 'ab' for AB, and 'ls' for LS prenatal can be inserted as a prefix of the common command 'LIMIT'. In other words, it can be 'mLIMIT' for Mitsubishi, 'sLIMIT' for Siemens, 'abLIMIT' for AB, and 'lsLIMIT' for LS.

그리고 상기 동일 기능을 갖지 않는 명령어들에 대한 공용명령어 생성 시, 상기 동일 기능을 갖지 않는 명령어에 포함된 파라미터(parameter) 한정자를 상기 동일 기능을 갖지 않는 명령어들에 대한 공용명령어에 삽입할 수 있다.When generating a common command for the commands that do not have the same function, a parameter qualifier included in the command that does not have the same function may be inserted into the common command for the commands that do not have the same function.

예를 들어, AB사의 명령어 'DLIMIT'는 명령어 'LIMIT'에 파라미터 한정자 D(Double)가 붙은 명령어이다. 'D'는 명령어 'LIMIT'의 파라미터 크기를 한정한다. 'LIMIT' 명령어는 1 Word(16bit)를 처리하는 명령어인데, 'DLIMIT'는 2 Word(32bit)를 처리하는 명령어이다. 이와 같이 명령어 파라미터(parameter)를 한정 짓는 파라미터 한정자는 공용명령어에 삽입될 수 있는데, PLC 제조사를 나타내는 접두사, 예를 들어 AB사를 나타내는 'ab'가 나온 후 배치될 수 있다. 결국 AB사의 명령어 'DLIMIT'에 대한 공용명령어는 'abDLIMIT'일 수 있다.For example, AB's command 'DLIMIT' is a command with the parameter qualifier D (Double) appended to the command 'LIMIT'. 'D' limits the parameter size of the command 'LIMIT'. The 'LIMIT' command processes 1 Word (16bit), and the 'DLIMIT' command processes 2 Word (32bit). As such, parameter qualifiers that define command parameters may be inserted into common commands, which may be placed after a prefix indicating the PLC manufacturer, for example, 'ab' indicating the AB company. After all, the common command for AB 'DLIMIT' may be 'abDLIMIT'.

그리고, 상기 동일 기능을 갖지 않는 명령어들에 대한 공용 명령어 생성 시, 상기 동일 기능을 갖지 않는 명령어에 포함된 동작 한정자를 상기 동일 기능을 갖지 않는 명령어들에 대한 공용 명령어에 삽입할 수 있다. 예를 들어, 미츠비시 사의 'LIMITP'명령어는 명령어 'LIMIT'에 양(Positive)의 펄스(Pulse) 형태로 변환하는 동작 한정자인 'P(Postive Pulse)'를 포함한다. 이와 같이 명령어의 동작을 한정 짓는 동작 한정자는 공용 명령어에 접미사로 삽입될 수 있다. 결국 미츠비시 사의 명령어 'LIMITP'에 대한 공용 명령어는 'mLIMITP'일 수 있다.When generating a common command for the commands that do not have the same function, an operation modifier included in the command that does not have the same function may be inserted into the common command for the commands that do not have the same function. For example, Mitsubishi's 'LIMITP' command includes 'P (Postive Pulse)', an operation modifier that converts the positive 'pulse' form of the command 'LIMIT'. As such, an action modifier that restricts the operation of the command may be inserted as a suffix to the public command. After all, the public command for Mitsubishi's command 'LIMITP' may be 'mLIMITP'.

이렇게 1단계 내지 3단계를 순차적으로 수행하면서 생성된 공용명령어를 XML(eXtensible Markup Language) 파일 형식으로 변환하여 공용명령어 라이브러리를 저장부(12)에 구축할 수 있다. In this way, the common command generated by sequentially performing steps 1 to 3 may be converted into an XML (eXtensible Markup Language) file format to build a common command library in the storage unit 12.

이러한 공용명령어에 대한 XML 파일 형식에 대한 예시가 도 2에 도시되어 있다. 도 2를 참조하면, 공용명령어에 대한 XML 파일은 공용명령어(Instructio Name) 'XIC', 'XICP' 및 'XICF' 각각 마다 대응되는 명령어를 PLC 제조사별로 포함한다.An example of the XML file format for this common instruction is shown in FIG. 2. Referring to FIG. 2, the XML file for the common command includes instructions corresponding to each of the Instructio Name 'XIC', 'XICP', and 'XICF' for each PLC manufacturer.

예를 들어, 공용명령어 'XIC'에 대해서, AB 사의 경우 명령어 'XIC'가 대응되고, 미츠비시 사의 경우 'LD', 'AND', 'OR'가 각각 대응되고, 지멘스 사의 경우 'A', 'O'가 대응되고, LS 산전의 경우 'LOAD', 'AND', 'OR'가 대응될 수 있다.For example, for the common command 'XIC', the command 'XIC' corresponds to AB, and for Mitsubishi's' LD ',' AND 'and' OR ', respectively, and for Siemens' A', ' O 'corresponds and' LOAD ',' AND ', and' OR 'correspond to LS.

이와 같은 과정을 통해서 공용명령어 라이브러리가 구축된 후, 공용형식으로의 변환 요청이 있는 경우, 도 3에 도시된 공용형식 변환부(13)의 동작에 대해서 살펴보기로 한다.After the common instruction library is constructed through the above process, when there is a conversion request to the common format, the operation of the common format converting unit 13 shown in FIG. 3 will be described.

공용형식 변환부(13)는 공용형식으로 변환 요청된 텍스트 기반의 PLC 제어프로그램이 공용형식의 PLC 제어프로그램으로 변환가능함에 따라, 상기 공용 명령어 라이브러리를 이용하여, 상기 텍스트 기반의 PLC 제어프로그램을 상기 공용형식의 PLC 제어프로그램으로 변환한다.The common format converting unit 13 converts the text-based PLC control program that is requested to be converted into a common format into a common PLC control program, and uses the common command library to read the text-based PLC control program. Convert to a common PLC control program.

이러한 공용형식 변환부(13)는 도 3에 도시된 바와 같이, IL 오브젝트 생성부(14), IL 블록 생성부(15), 공용 블록 변환부(16) 및 결합관계 표현부(17)를 포함하여, 상기 텍스트 기반의 PLC 제어프로그램을 상기 공용형식의 PLC 제어프로그램으로 변환한다.As shown in FIG. 3, the common format conversion unit 13 includes an IL object generation unit 14, an IL block generation unit 15, a common block conversion unit 16, and a joint relationship expression unit 17. The text-based PLC control program is converted into the PLC control program of the common format.

IL 오브젝트 생성부(14)는, 공용형식으로 변환 요청된 텍스트 기반의 PLC 제어프로그램이 공용형식의 PLC 제어프로그램으로 변환가능한가를 확인한다.The IL object generation unit 14 confirms whether the text-based PLC control program requested for conversion to the common format can be converted to the PLC control program of the common format.

이때 공용형식으로 변환 요청된 텍스트 기반의 PLC 제어프로그램의 공용형식으로 변환가능 여부는 상기 텍스트 기반의 PLC 제어프로그램의 파일 확장자, 데이터 구조 중 적어도 하나를 이용하여 판단될 수 있다. In this case, whether the text-based PLC control program can be converted to the common format can be determined using at least one of a file extension and a data structure of the text-based PLC control program.

예컨대, 상기 텍스트 기반의 PLC 제어프로그램의 공용형식으로 변환가능 여부는 1차적으로 상기 텍스트 기반의 PLC 제어프로그램의 파일 확장자를 확인한다. For example, whether or not the text-based PLC control program can be converted to a common format is primarily checked for the file extension of the text-based PLC control program.

상기 확인된 파일 확장자가 설정된 파일 확장자에 해당 되면 2차적으로 상기 텍스트 기반의 PLC 제어프로그램의 데이터 구조가 설정된 데이터 구조에 해당되는가를 확인한다.If the checked file extension corresponds to the set file extension, it is secondly checked whether the data structure of the text-based PLC control program corresponds to the set data structure.

확인결과 상기 텍스트 기반의 PLC 제어프로그램의 데이터 구조가 설정된 데이터 구조에 해당 되면 상기 텍스트 기반의 PLC 제어프로그램이 공용형식의 PLC 제어프로그램으로 변환가능한 것으로 판단될 수 있다. As a result of the check, when the data structure of the text-based PLC control program corresponds to the set data structure, it may be determined that the text-based PLC control program can be converted into a common PLC control program.

이러한 설정된 데이터 구조가 아닌 데이터 구조를 갖는 경우는 텍스트 기반의 PLC 제어프로그램은 공용형식의 PLC 제어프로그램으로 변환될 수 없다. In the case of having a data structure other than such a set data structure, the text-based PLC control program cannot be converted into a common PLC control program.

IL 오브젝트 생성부(14)는, 공용형식으로 변환 요청된 텍스트 기반의 PLC 제어프로그램이 공용형식의 PLC 제어프로그램으로 변환가능함에 따라, 상기 텍스트 기반의 PLC 제어프로그램의 제어 로직을 구성하는 렁(rung)마다, 로직 순서에 따라 적어도 하나의 접점을 각각 명령어(Command) 및 태그(Tag)를 포함한 IL 오브젝트(Object)로 생성한다. 즉 본 발명의 전체에서 사용되는 IL 오브젝트는 접점과 동일한 의미로 사용된다.The IL object generation unit 14 performs a rung constituting the control logic of the text-based PLC control program as the text-based PLC control program requested to be converted to the common format can be converted to the PLC control program of the common format. ), At least one contact point is generated as an IL object including a command and a tag, respectively, according to a logic order. That is, the IL object used throughout the present invention is used in the same sense as the contact point.

IL 블록 생성부(15)는, 블록(Block) 명령어를 이용하여, IL 오브젝트 생성부(14)에서 생성된 적어도 하나의 IL 오브젝트를 블록화하여 적어도 하나의 IL 블록을 생성한다.The IL block generation unit 15 generates at least one IL block by blocking at least one IL object generated by the IL object generation unit 14 using a block command.

이때 블록 명령어는 LD, LDI, ANB, OR, ORB, MPP, MRD, MPS를 포함한다. In this case, the block instruction includes LD, LDI, ANB, OR, ORB, MPP, MRD, and MPS.

LD는 Load의 약어로 제어 로직 상의 접점이 로드(load)되어 있다는 것을 나타낸다. LD로 인해서 PLC 프로그램의 제어 로직의 블록들이 계속 생성될 수 있다.LD is an abbreviation of Load and indicates that the contact point on the control logic is loaded. The LD may continue to produce blocks of control logic of the PLC program.

LDI는 Load Inverse를 의미하는 것으로, Inverse의 의미를 담고 있으므로 해당 태그가 OFF 되었을 때 접점이 ON 된다. LDI stands for Load Inverse. It contains Inverse meaning, so the contact is ON when the tag is OFF.

ANB는 AND Block의 의미로써 ANB 명령어의 앞에 생성된 2개의 블록이 서로 AND 관계에 있다는 것을 나타낸다.ANB stands for AND Block, indicating that two blocks created before the ANB instruction are in AND relationship with each other.

OR는 OR 명령어 앞의 심볼(symbol)과 OR 명령어의 심볼이 서로 OR 관계에 있다는 것을 나타낸다.OR indicates that the symbol preceding the OR command and the symbol of the OR command are ORed together.

ORB는 OR Block의 의미로써 ORB 명령어의 앞에 생성된 2개의 블록이 서로 OR 관계에 있다는 것을 나타낸다.ORB stands for OR Block, indicating that two blocks created before the ORB instruction are OR'ed together.

MPS는 Multi Point Start의 의미로써 여러 개의 출력(Output) 접점이 나타날 때 첫 번째 출력(Output) 접점과 그 출력 접점과 관계가 있는 접점들의 가장 앞쪽에 쓰여 진다.MPS stands for Multi Point Start. When multiple output contacts appear, the first output contact is written to the front of the first output contact and the contacts associated with that output contact.

MRD는 Multi Read Down의 의미로써 3개 이상의 출력 접점이 나타날 때 사용된다.MRD stands for Multi Read Down and is used when three or more output contacts appear.

MPP는 Multi Point Period의 의미로써 여러 개의 출력 접점이 나타날 때 가장 마지막 출력 접점과 그 출력 접점과 관계가 있는 접점들의 가장 앞쪽에 쓰여 진다.MPP stands for Multi Point Period. When multiple output contacts appear, the MPP is written at the front of the last output contact and the contacts associated with that output contact.

이때 블록 명령어 중 OR, ORB, ANB, MPS, MRD, MPP는 결합관계 표현부(17)에서 사용되는 결합 명령어이다. 이 중 OR 명령어를 제외한 결합 명령어는 IL 오브젝트로 표현될 시에 명령어만을 포함하여 각 블록 간의 결합 관계만을 표현한다. 따라서 블록 간의 관계를 나타내는 블록 결합 명령어이기 때문에 공용 블록으로의 변환부(16)의 실행 시 해당 블록 결합 명령어를 포함한 IL 오브젝트의 명령어를 공용 명령어로 변환하지 않는다.At this time, OR, ORB, ANB, MPS, MRD, and MPP among the block commands are combined commands used in the connection relationship expression unit 17. Among these, the combined instruction except the OR instruction includes only the instruction when expressing the IL object, and expresses only the association relationship between each block. Therefore, since the block combining instruction indicating the relationship between the blocks, the instruction of the IL object including the block combining instruction is not converted into the common instruction when the transform unit 16 is executed to the common block.

IL 블록 생성부(15)는 제어 로직 순으로 배열된 IL 오브젝트들을 이동하면서 IL 오브젝트들에 블록 명령어가 포함되어 있는가를 확인하고, 블록 명령어가 포함되어 있으면 새로운 IL 블록을 생성한다. 한편, 블록 명령어가 포함되어 있지 않으면 새로운 블록 명령어가 나타나기 전까지 앞서 생성된 IL 블록에 순차적으로 IL 오브젝트를 포함 시킨다. The IL block generation unit 15 checks whether a block instruction is included in the IL objects while moving the IL objects arranged in the control logic order, and generates a new IL block if the block instructions are included. On the other hand, if the block instruction is not included, the IL object is sequentially included in the previously generated IL block until a new block instruction appears.

공용 블록 변환부(16)는 상기 공용 명령어 라이브러리를 이용하여, 상기 적어도 하나의 IL 블록 내 적어도 하나의 IL 오브젝트 마다 명령어의 공용명령어로의 변환을 통해 공용 오브젝트를 생성해서, 상기 적어도 하나의 IL 블록을 적어도 하나의 공용 블록으로 변환한다.The common block converting unit 16 generates a common object by converting the instruction into a common instruction for each of the at least one IL object in the at least one IL block by using the common instruction library, and thus, the at least one IL block. Converts to at least one shared block.

결합관계 표현부(17)는, 결합 명령어를 이용하여 상기 적어도 하나의 공용 블록 간의 결합관계를 기호 "[", "]" 및 "," 중 적어도 하나로 표현한다. The coupling relationship expression unit 17 expresses the coupling relationship between the at least one shared block by at least one of the symbols "[", "]" and "," using a coupling command.

이때 결합명령어는 OR, ORB, ANB, MPP, MPS, MRD를 포함할 수 있다. 입력부(조건부)에 사용되는 결합 명령어는 OR, ANB, ORB이고, 출력부에 사용되는 결합 명령어는 MPS, MRD, MPP이다.In this case, the combined instruction may include OR, ORB, ANB, MPP, MPS, and MRD. The combined instructions used for the input (conditional) are OR, ANB and ORB, and the combined instructions used for the output are MPS, MRD and MPP.

이러한 결합명령어를 이용하여 결합관계 표현부(17)는 공용형식으로 표현된 공용블록들 간의 결합관계를 기호 "[", "]" 및 "," 중 적어도 하나로 표현할 수 있다. 이를 위해서 결합관계 표현부(17)는 입력부(조건부)에 사용되는 결합 명령어에 따라 공용형식으로 표현된 공용블록들 간의 결합관계를 기호 "[", "]" 및 "," 중 적어도 하나로 표현하고, 이후 출력부에 사용되는 결합 명령어에 따라 상기 입력부에 사용되는 결합 명령어에 의해서 표현된 공용블록들 간의 결합관계를 기호 "[", "]" 및 "," 중 적어도 하나로 표현할 수 있다. Using such a coupling command, the coupling relationship expression unit 17 may express the coupling relationship between the common blocks expressed in the common format with at least one of the symbols "[", "]" and ",". To this end, the coupling relationship expression unit 17 expresses the coupling relationship between the common blocks expressed in the common form according to the coupling instruction used in the input unit (conditional) with at least one of the symbols "[", "]" and "," After that, the coupling relationship between the common blocks represented by the coupling command used in the input unit may be expressed by at least one of the symbols "[", "]" and "," according to the combining command used in the output unit.

본 발명의 실시예에서는 입력부에 사용되는 결합명령어를 OR->ANB->ORB 순서로 공용형식으로 표현된 공용블록들에 적용하여, 공용형식으로 표현된 공용블록들 간의 결합관계를 기호 "[", "]" 및 "," 중 적어도 하나로 표현할 수 있다. 입력부에 사용되는 결합명령어를 OR->ANB->ORB 순서로 공용형식으로 표현된 공용블록들에 적용하는 것은 하나의 실시예에 불과하며 이에 한정되지 않는다.In the exemplary embodiment of the present invention, the coupling command used in the input unit is applied to the common blocks expressed in the common format in the order of OR-> ANB-> ORB, and the symbol "[" , "]" And "," can be expressed by at least one. The application of the combined command used in the input unit to the common blocks expressed in the common format in the order of OR-> ANB-> ORB is just one embodiment, but is not limited thereto.

그리고 출력부에 사용되는 결합 명령어를 MPS->MRD->MPP 순서로 상기 입력부에 사용되는 결합 명령어에 의해서 표현된 공용블록들에 적용하여, 상기 입력부에 사용되는 결합 명령어에 의해서 표현된 공용블록들 간의 결합관계를 기호 "[", "]" 및 "," 중 적어도 하나로 표현할 수 있다. 출력부에 사용되는 결합 명령어를 MPS->MRD->MPP 순서로 상기 입력부에 사용되는 결합 명령어에 의해서 표현된 공용블록들에 적용하는 것은 하나의 실시예에 불과하며 이에 한정되지 않는다.The common blocks represented by the combined command used in the input unit may be applied to the common blocks represented by the combined command used in the input unit in the order of MPS-> MRD-> MPP. The coupling relationship between the two may be expressed by at least one of the symbols "[", "]" and ",". The application of the combined command used in the output unit to the common blocks represented by the combined command used in the input unit in the order of MPS-> MRD-> MPP is just one embodiment and is not limited thereto.

도 4는 공용형식 변환부(13)에 의해서 수행되는, 텍스트 기반의 PLC 제어프로그램에 대한 공용형식으로의 변환방법의 흐름도이다.4 is a flowchart of a conversion method to a common format for a text-based PLC control program performed by the common format conversion unit 13.

도 4를 참조하면, IL 오브젝트 생성부(14)는 공용형식으로 변환 요청된 텍스트 기반의 PLC 제어프로그램이 공용형식의 PLC 제어프로그램으로 변환가능함에 따라, 상기 텍스트 기반의 PLC 제어프로그램의 제어 로직을 구성하는 렁(rung)마다, 로직 순서에 따라 적어도 하나의 접점을 각각 명령어(Command) 및 태그(Tag)를 포함한 IL 오브젝트(Object)로 생성한다(S71).Referring to FIG. 4, the IL object generating unit 14 converts the control logic of the text-based PLC control program as the text-based PLC control program requested to be converted into a common format can be converted into a PLC control program of the common format. For each rung, at least one contact point is generated as an IL object including a command and a tag, respectively, in a logic order (S71).

IL 블록 생성부(15)는 블록(Block) 명령어를 이용하여 상기 적어도 하나의 IL 오브젝트를 블록화하여 적어도 하나의 IL 블록을 생성한다. 이는 도 4에서 단계 S72 내지 S76에 해당될 수 있다. The IL block generation unit 15 generates at least one IL block by blocking the at least one IL object by using a block command. This may correspond to steps S72 to S76 in FIG. 4.

즉 IL 블록 생성부(15)는 IL 오브젝트 리스트에서 순차적으로 IL 오브젝트를 추출하고(S72), 렁(rung)의 마지막 IL 오브젝트가 될 때까지(S73) IL 오브젝트에 블록 명령어에 'LD, AND, OR, ORB, MPP, MRD, MPS'가 포함되어 있는가를 확인하고(S74), 포함되어 있으면 새로운 IL 블록을 생성하고(S75) 포함되어 있지 않으면 가장 최근에 생성된 IL 블록에 IL 오브젝트를 삽입하는 단계(S76)를 반복한다.That is, the IL block generation unit 15 sequentially extracts the IL object from the IL object list (S72), until the final IL object of the rung (S73) is assigned to the block instruction 'LD, AND, Check whether OR, ORB, MPP, MRD, and MPS 'are included (S74), and if so, create a new IL block (S75), and if not, insert the IL object into the most recently generated IL block. Repeat (S76).

공용블록 변환부(16)는 공용 명령어 라이브러리를 이용하여, 상기 적어도 하나의 IL 블록 내 적어도 하나의 IL 오브젝트 마다 명령어의 공용명령어로의 변환을 통해 공용 오브젝트를 생성해서, 상기 적어도 하나의 IL 블록을 적어도 하나의 공용 블록으로 변환한다(S77).The common block converting unit 16 generates a common object by converting an instruction into a common instruction for each of at least one IL object in the at least one IL block by using a common instruction library to generate the at least one IL block. At least one common block is converted (S77).

결합관계 표현부(17)는 결합 명령어를 이용하여, 상기 적어도 하나의 공용 블록 간의 결합관계를 기호 "[", "]" 및 "," 중 적어도 하나로 표현한다. 이는 도 4에서 단계 S78 내지 단계 S90에 의해서 수행될 수 있다.The coupling relationship expression unit 17 expresses the coupling relationship between the at least one shared block by at least one of the symbols "[", "]" and "," using a coupling command. This may be performed by steps S78 to S90 in FIG. 4.

즉 결합관계 표현부(17)는 도 8에 도시된 공용블록들을 순차적으로 추출하며(S78), 추출된 공용블록이 마지막 공용블록인가를 확인한다(S79).That is, the coupling relationship expression unit 17 sequentially extracts the public blocks shown in FIG. 8 (S78), and checks whether the extracted public block is the last public block (S79).

추출된 공용블록이 마지막 공용블록이 아니면 결합관계 표현부(17)는 추출된 공용블록에 결합명령어 ORB 또는 OR이 포함되어 있는가를 확인한다(S80). 포함되어 있으면 앞선 2개의 공용블록에 "[", ",", "]"을 삽입한다(S81). If the extracted common block is not the last shared block, the association relationship expression unit 17 checks whether the combined instruction ORB or OR is included in the extracted common block (S80). If included, "[", ",", "]" is inserted into the two previous shared blocks (S81).

추출된 공용블록에 결합명령어 ORB 또는 OR이 포함되어 있지 않으면 결합관계 표현부(17)는 추출된 공용블록에 결합명령어 ANB가 포함되어 있는가를 확인한다(S82). 포함되어 있으면 추출된 공용블록의 앞선 2개의 공용블록을 붙인다(S83).If the combined common block ORB or OR is not included in the extracted common block, the association relation expression unit 17 checks whether the combined common block ANB is included in the extracted common block (S82). If included, the two preceding public blocks of the extracted common block are pasted (S83).

추출된 공용블록에 결합명령어 ANB가 포함되어 있지 않으면 결합관계 표현부(17)는 추출된 공용블록에 결합명령어 MPS가 포함되어 있는가를 확인한다. 포함되어 있으면 해당하는 공용블록의 앞쪽에 "["을 삽입한다(S85).If the combined common block ANB is not included in the extracted common block, the association relationship expression unit 17 checks whether the combined common block MPS is included in the extracted common block. If included, insert "[" in front of the corresponding common block (S85).

추출된 공용블록에 결합명령어 MPS가 포함되어 있지 않으면, 결합관계 표현부(17)는 추출된 공용블록에 결합명령어 MRD가 포함되어 있는가를 확인한다(S86). 포함되어 있으면 해당하는 공용블록의 앞쪽에 ","을 삽입한다(S87).If the joint command MPS is not included in the extracted common block, the association relationship expression unit 17 checks whether the joint command MRD is included in the extracted common block (S86). If included, the "," is inserted in front of the corresponding common block (S87).

추출된 공용블록에 결합명령어 MRD가 포함되어 있지 않으면, 결합관계 표현부(17)은 추출된 공용블록에 결합명령어 MPP가 포함되어 있는 것으로 판단하여, 해당 공용블록의 앞쪽에 ","을 삽입하고 뒤쪽에 "]"을 삽입한다(S88).If the combined common block MRD is not included in the extracted common block, the association relationship expression unit 17 determines that the combined common block MPP is included in the extracted common block, and inserts "," in front of the corresponding common block. Insert "]" at the rear (S88).

한편, 단계 S79에서 추출된 공용블록이 마지막 공용블록이면, 결합관계 표현부(17)는 공용형식에 결합관계가 표시된 공용블록들을 순차적으로 병합하고(S89), 이렇게 병합된 공용블록들 간의 결합관계가 표시된 공용형식을 출력한다(S90).On the other hand, if the common block extracted in step S79 is the last common block, the joint relationship expression unit 17 sequentially merges the common blocks in which the joint relationship is indicated in the common format (S89), and the joint relationship between the merged public blocks. Output the common format indicated by (S90).

도 5a는 미츠비시의 LD 구조의 PLC 제어 프로그램의 일 예를 나타내고, 도 5b는 도 5a의 PLC 제어 프로그램으로부터 변환된 텍스트 기반의 PLC 제어 프로그램을 나타낸다. 이하에서는 상술한 공용형식 변환부(13)에 의하여 도 5b의 텍스트 기반의 PLC 제어 프로그램이 공용형식의 PLC 제어 프로그램으로 변환되는 과정을 설명한다. FIG. 5A illustrates an example of a PLC control program of an LD structure of Mitsubishi, and FIG. 5B illustrates a text-based PLC control program converted from the PLC control program of FIG. 5A. Hereinafter, the process of converting the text-based PLC control program of FIG. 5B into the common control PLC control program by the above-described common format conversion unit 13 will be described.

도 5a, 5b의 PLC 제어 프로그램은 두 개의 렁(rung)으로 구성되고, 명령어로 LD, OR, AND, ANI, OUT, LDI, ORB, MPS, MPP 등을 포함하고, 태그로 X0, X1, M0, X3, Y0, X4, X5, X6, X8, X7, X9, X10, Y2 등을 포함한다.The PLC control program of FIGS. 5A and 5B is composed of two rungs, and includes, as instructions, LD, OR, AND, ANI, OUT, LDI, ORB, MPS, MPP, and the like with tags X0, X1, M0. , X3, Y0, X4, X5, X6, X8, X7, X9, X10, Y2 and the like.

도 6은 IL 오브젝트 생성부(14)에 의해 첫 번째 렁(rung)과 두 번째 렁(rung)에 대하여 각각 생성되는 IL 오브젝트들을 나타낸다. 도 6을 참조하면, IL 오브젝트들은 도 5b에 도시된 텍스트 기반의 PLC 제어 프로그램의 제어 로직 순서에 따라 배열됨을 확인할 수 있다. 즉, IL 오브젝트들의 순서는 텍스트 기반의 PLC 제어프로그램의 제어 로직 순서와 같다. 구체적으로, IL 오브젝트들의 순서를 명령어(Command)의 순서로 나열하면, 첫 번째 렁(rung)의 경우 LD, OR, AND, ANI, OUT 순이고, 두 번째 렁(rung)의 경우 LDI, AND, LDI, OR, AND, ORB, AND, MPS, OUT, MPP, ANI, OUT 순이다. FIG. 6 shows IL objects generated by the IL object generator 14 for the first rung and the second rung, respectively. Referring to FIG. 6, the IL objects may be arranged according to the control logic order of the text-based PLC control program illustrated in FIG. 5B. That is, the order of the IL objects is the same as the control logic order of the text-based PLC control program. Specifically, if the order of IL objects is listed in the order of Command, LD, OR, AND, ANI, OUT for the first rung, and LDI, AND, for the second rung. LDI, OR, AND, ORB, AND, MPS, OUT, MPP, ANI, OUT

도 7a는 첫 번째 렁(rung)에 대하여 IL 블록 생성부(15)에 의해 생성된 IL 블록들을 나타낸다.7A shows IL blocks generated by the IL block generator 15 for the first rung.

도 6의 첫 번째 렁(rung)의 IL 오브젝트들 및 도 7a를 참조하면, 1번 IL 블록은 블록 명령어 'LD'에 의해 생성되며, 1개의 IL 오브젝트, 즉 명령어 LD인 IL 오브젝트를 포함한다. Referring to the IL objects of the first rung of FIG. 6 and FIG. 7A, an IL block 1 is generated by a block instruction 'LD' and includes one IL object, that is, an IL object that is an instruction LD.

2번 IL 블록은 블록 명령어 'OR'에 의해 생성되며, 4개의 IL 오브젝트, 즉 명령어 OR인 IL 오브젝트, 명령어 AND인 IL 오브젝트, 명령어 ANI인 IL 오브젝트, 명령어 OUT인 IL 오브젝트를 포함한다.The IL block 2 is generated by the block instruction 'OR' and includes four IL objects, that is, an IL object that is an instruction OR, an IL object that is an instruction AND, an IL object that is an instruction ANI, and an IL object that is an instruction OUT.

또한 도 7a는 공용블록 변환부(16)에 의해 IL 블록들이 공용 블록들로 변환된 결과를 보여준다.In addition, FIG. 7A illustrates a result of converting IL blocks into shared blocks by the common block converter 16.

먼저, 1번 IL 블록에 대해서, 공용블록 변환부(16)는 상기 공용명령어 라이브러리를 이용하여, 명령어 'LD'인 IL 오브젝트를 공용명령어 'XIC'인 공용 오브젝트로 변환함으로써, 1번 IL 블록을 1번 공용블록으로 변환한다. 따라서 1번 공용블록의 공용형식은 'XIC(X0)'로 표현될 수 있다.First, for the IL block # 1, the common block converting unit 16 converts the IL block # 1 by converting an IL object having an instruction 'LD' into a common object having a common command 'XIC' using the common command library. Convert to shared block # 1. Therefore, the common type of shared block 1 can be expressed as 'XIC (X0)'.

2번 IL 블록에 대해서, 공용블록 변환부(16)는 상기 공용명령어 라이브러리를 이용하여, 명령어 'OR'인 IL 오브젝트를 공용명령어 'XIC'인 공용 오브젝트로 변환하고, 명령어 'AND'인 IL 오브젝트를 공용명령어 'XIC'인 공용 오브젝트로 변환하고, 명령어 'ANI'인 IL 오브젝트를 공용명령어 'XIO'인 공용 오브젝트로 변환하고, 명령어 'OUT'인 IL 오브젝트를 공용명령어 'OUT'인 공용 오브젝트로 변환함으로써, 2번 IL 블록을 2번 공용블록으로 변환한다. 따라서 2번 공용블록의 공용형식은 'XIC(X1)XIC(M0)XIO(X3)OUT(Y0)'으로 표현될 수 있다.For the IL block # 2, the common block converting unit 16 converts the IL object having the instruction 'OR' into the common object having the common instruction 'XIC' using the common instruction library, and the IL object having the instruction 'AND'. Is converted to a public object with public command 'XIC', IL object with command 'ANI' is converted to a public object with public command 'XIO', and IL object with command 'OUT' is converted to a public object with public command 'OUT' By transforming, the IL block 2 is converted into the 2 common block. Therefore, the common type of shared block 2 can be expressed as 'XIC (X1) XIC (M0) XIO (X3) OUT (Y0)'.

도 7b는 두 번째 렁(rung)에 대하여 IL 블록 생성부(15)에 의해 생성된 IL 블록들을 나타낸다.FIG. 7B shows IL blocks generated by the IL block generator 15 for the second rung.

도 6의 두 번째 렁(rung)의 IL 오브젝트들 및 도 7b를 참조하면, 1번 IL 블록은 블록 명령어 'LDI'에 의해 생성되며, 2개의 IL 오브젝트, 즉 명령어 LDI인 IL 오브젝트, 명령어 AND인 IL 오브젝트를 포함한다.Referring to the IL objects of the second rung of FIG. 6 and FIG. 7B, the IL block # 1 is generated by the block instruction 'LDI' and includes two IL objects, that is, the IL object that is the instruction LDI, and the instruction AND. Contains an IL object.

2번 IL 블록은 블록 명령어 'LDI'에 의해 생성되며, 1개의 IL 오브젝트, 즉 명령어 LDI인 IL 오브젝트를 포함한다.The IL block 2 is generated by the block instruction 'LDI' and includes one IL object, that is, the IL object which is the instruction LDI.

3번 IL 블록은 블록 명령어 'OR'에 의해 생성되며, 2개의 IL 오브젝트, 즉 명령어 OR인 IL 오브젝트, 명령어 AND인 IL 오브젝트를 포함한다.The IL block 3 is generated by the block instruction 'OR' and includes two IL objects, that is, an IL object that is an instruction OR and an IL object that is an instruction AND.

4번 IL 블록은 블록 명령어 'ORB'에 의해 생성되며, 2개의 IL 오브젝트, 즉 명령어 ORB인 IL 오브젝트, 명령어 AND인 IL 오브젝트를 포함한다.The IL block 4 is generated by the block instruction 'ORB' and includes two IL objects, that is, an IL object that is an instruction ORB and an IL object that is an instruction AND.

5번 IL 블록은 블록 명령어 'MPS'에 의해 생성되며, 2개의 IL 오브젝트, 즉 명령어 MPS인 IL 오브젝트, 명령어 OUT인 IL 오브젝트를 포함한다.The IL block 5 is generated by the block instruction 'MPS' and includes two IL objects, that is, the IL object which is the instruction MPS and the IL object which is the instruction OUT.

6번 IL 블록은 블록 명령어 'MPP'에 의해 생성되며, 3개의 IL 오브젝트, 즉 명령어 MPS인 IL 오브젝트, 명령어 ANI인 IL 오브젝트, 명령어 OUT인 IL 오브젝트를 포함한다.The IL block 6 is generated by the block instruction 'MPP' and includes three IL objects, that is, the IL object which is the instruction MPS, the IL object which is the instruction ANI, and the IL object which is the instruction OUT.

또한 도 7b는 공용블록 변환부(16)에 의해 IL 블록들이 공용 블록들로 변환된 결과를 보여준다.In addition, FIG. 7B illustrates a result of converting IL blocks into shared blocks by the common block converter 16.

먼저, 1번 IL 블록에 대해서, 공용블록 변환부(16)는 상기 공용명령어 라이브러리를 이용하여, 명령어 'LDI'인 IL 오브젝트를 공용명령어 'XIC'인 공용 오브젝트로 변환하고, 명령어 'AND'인 IL 오브젝트를 공용명령어 'XIC'인 공용 오브젝트로 변환함으로써, 1번 IL 블록을 1번 공용블록으로 변환한다. 따라서 1번 공용블록의 공용형식은 'XIC(X4)XIC(X5)'로 표현될 수 있다.First, for the IL block # 1, the common block converting unit 16 converts the IL object having the instruction 'LDI' into a common object having the common instruction 'XIC' using the common instruction library, and has the instruction 'AND' By converting the IL object into a public object with the common instruction 'XIC', the IL block 1 is converted into a public block 1. Therefore, the common type of common block 1 can be expressed as 'XIC (X4) XIC (X5)'.

2번 IL 블록에 대해서, 공용블록 변환부(16)는 상기 공용명령어 라이브러리를 이용하여, 명령어 'LDI'인 IL 오브젝트를 공용명령어 'XIC'인 공용 오브젝트로 변환함으로써, 2번 IL 블록을 2번 공용블록으로 변환한다. 따라서 2번 공용블록의 공용형식은 'XIC(X6)'로 표현될 수 있다.For the IL block # 2, the common block converting unit 16 converts the IL object having the instruction 'LDI' to a common object having the common instruction 'XIC' using the common instruction library, thereby converting the IL block # 2 twice. Convert to shared block. Therefore, the common type of common block 2 can be expressed as 'XIC (X6)'.

3번 IL 블록에 대해서, 공용블록 변환부(16)는 상기 공용명령어 라이브러리를 이용하여, 명령어 'OR'인 IL 오브젝트를 공용명령어 'XIC'인 공용 오브젝트로 변환하고, 명령어 'AND'인 IL 오브젝트를 공용명령어 'XIC'인 공용 오브젝트로 변환함으로써, 3번 IL 블록을 3번 공용블록으로 변환한다. 따라서 3번 공용블록의 공용형식은 'XIC(X8)XIC(X7)'으로 표현될 수 있다.For IL block 3, the common block converting unit 16 converts the IL object having the instruction 'OR' into the common object having the common instruction 'XIC' using the common instruction library, and the IL object having the instruction 'AND'. Converts IL block 3 to public block 3 by converting it to a public object with public command 'XIC'. Therefore, the common type of common block 3 can be expressed as 'XIC (X8) XIC (X7)'.

4번 IL 블록에 대해서, 공용블록 변환부(16)는 상기 공용명령어 라이브러리를 이용하여, 블록 결합 명령어 'ORB'인 IL 오브젝트를 공용명령어로 변환하지 않고, 명령어 'AND'인 IL 오브젝트를 공용명령어 'XIC'인 공용 오브젝트로 변환함으로써, 4번 IL 블록을 4번 공용블록으로 변환한다. 따라서 4번 공용블록의 공용형식은 'XIC(X9)'으로 표현될 수 있다.For the IL block # 4, the common block converting unit 16 does not convert the IL object that is the block combining instruction 'ORB' into the common instruction using the common instruction library, and converts the IL object that is the instruction 'AND' into the common instruction. By converting the shared object to 'XIC', IL block 4 is converted to 4 public blocks. Therefore, the common type of common block 4 can be expressed as 'XIC (X9)'.

5번 IL 블록에 대해서, 공용블록 변환부(16)는 상기 공용명령어 라이브러리를 이용하여, 블록 결합 명령어 'MPS'인 IL 오브젝트를 공용명령어로 변환하지 않고, 명령어 'OUT'인 IL 오브젝트를 공용명령어 'OUT'인 공용 오브젝트로 변환함으로써, 5번 IL 블록을 5번 공용블록으로 변환한다. 따라서 5번 공용블록의 공용형식은 'OUT(M0)'로 표현될 수 있다.For IL block # 5, the common block converting unit 16 does not convert the IL object that is the block combining instruction 'MPS' into the common instruction using the common instruction library, and converts the IL object that is the instruction 'OUT' into the common instruction. Converts IL block 5 to public block 5 by converting it to a public object that is 'OUT'. Therefore, the common type of common block 5 can be expressed as 'OUT (M0)'.

6번 IL 블록에 대해서, 공용블록 변환부(16)는 상기 공용명령어 라이브러리를 이용하여, 블록 결합 명령어 'MPP'인 IL 오브젝트를 공용명령어로 변환하지 않고, 명령어 'ANI'인 IL 오브젝트를 공용명령어 'XIO'인 공용 오브젝트로 변화하고, 명령어 'OUT'인 IL 오브젝트를 공용명령어 'OUT'인 IL 오브젝트로 변환함으로써, 6번 IL 블록을 6번 공용블록으로 변환한다. 따라서 6번 공용블록의 공용형식은 'XIO(X10)OUT(Y2)'로 표현될 수 있다.For IL block 6, the common block converting unit 16 does not convert the IL object that is the block combining instruction 'MPP' into the common instruction using the common instruction library, and converts the IL object that is the instruction 'ANI' into the common instruction. The IL block 6 is converted to the common block 6 by converting the IL object of the instruction 'OUT' into an IL object of the common instruction 'OUT'. Therefore, the common type of common block 6 can be expressed as 'XIO (X10) OUT (Y2)'.

이렇게 IL 블록들을 공용 블록들로 변환하는 과정이 완료되면, 공용 블록들 간의 결합관계를 표현함으로써, 최종적으로 텍스트 기반의 PLC 제어프로그램을 공용형식의 PLC 제어프로그램을 변환한다. When the process of converting the IL blocks into common blocks is completed, by expressing the coupling relationship between the common blocks, the text-based PLC control program is finally converted into a common PLC control program.

이때, 상기 공용 형식의 PLC 제어프로그램은, 상기 텍스트 기반의 PLC 제어프로그램의 제어 로직을 구성하는 적어도 하나의 렁(rung)마다 공용형식으로 표현될 수 있다.In this case, the PLC control program of the common format may be expressed in a common format for at least one rung constituting the control logic of the text-based PLC control program.

상기 공용형식의 렁(rung)에서는, 상기 텍스트 기반의 렁(rung) 내의 적어도 하나의 접점이 각각 공용명령어 및 태그(Tag)가 포함된 공용 오브젝트(object)로 표현되고 상기 적어도 하나의 공용 오브젝트가 블록화되어 생성된 적어도 하나의 공용 블록(block) 간의 결합관계가 기호 "[", "]" 및 "," 중 적어도 하나로 표현될 수 있다. 이때 기호 "[", "]"는 결합점을 나타내며, 기호 "," 는 분기점을 나타낸다.In the common rung, at least one point of contact in the text-based rung is represented as a common object including a common instruction and a tag, and the at least one common object is A coupling relationship between at least one common block generated by blocking may be represented by at least one of the symbols "[", "]" and ",". At this time, the symbols "[", "]" represent a coupling point, and the symbol "," represents a branch point.

이러한 공용블록들 간의 결합관계 표현은 결합관계 표현부(17)에 의해서 수행될 수 있다.The association relation representation between these common blocks may be performed by the association relation representation unit 17.

도 8a는 도 7a에 도시된 공용블록들에 대해서 결합 명령어 OR을 적용하여 공용블록들 간의 결합관계를 공용형식으로 표현하는 과정을 나타낸 도면이다.8A is a diagram illustrating a process of expressing a coupling relationship between common blocks by applying a joint instruction OR to the common blocks shown in FIG. 7A in a common format.

도 8a를 참조하면, 결합관계 표현부(17)는 도 7a에 도시된 공용블록들에 결합 명령어 OR를 포함한 공용 블록이 있는가를 확인하고, 결합 명령어 OR를 포함한 공용블록이 있으면 결합 명령어 OR이 포함된 공용블록과 바로 앞 공용블록의 2개 공용블록 간의 결합관계를 기호 "[", "]" 및 ","를 이용하여 표현한다. Referring to FIG. 8A, the coupling relationship expression unit 17 checks whether the common block shown in FIG. 7A includes a common block including a coupling instruction OR. The coupling relationship between the public block and the two public blocks of the previous public block is expressed using the symbols "[", "]" and ",".

도 8a에서는 결합명령어 OR를 포함한 2번 공용블록과, 1번 공용블록 간의 결합관계를 기호 "[", "]" 및 ","를 이용하여 표현한다. In FIG. 8A, a coupling relationship between a common block 2 including a joint instruction OR and a shared block 1 is expressed using the symbols "[", "]" and ",".

이에 대해서 좀 더 구체적으로 살펴보기로 한다. 먼저 결합명령어 OR를 포함한 2번 공용블록 앞의 1번 공용블록의 공용형식 표현의 가장 앞에 "["를 삽입한다(S1).This will be described in more detail. First, a "[" is inserted at the beginning of the common type expression of the common block 1 before the common block 2 including the joint instruction OR (S1).

다음으로, 결합명령어 OR를 포함한 2번 공용블록의 공용형식 표현의 가장 앞에 ","를 삽입한다(S2).Next, "," is inserted at the beginning of the common form representation of the common block 2 including the joint instruction OR (S2).

그리고 결합명령어 OR를 포함한 2번 공용블록의 다음 공용블록이 결합명령어 OR를 포함하지 않는다면 현재 2번 공용블록의 공용형식 중 OR 명령어를 포함한 IL 오브젝트의 공용형식 뒤에 "]"를 삽입한다(S3). 만일 OR를 포함한 현재 공용블록의 다음 공용블록이 결합명령어 OR를 포함한다면, 현재 공용블록의 공용형식 가장 뒤에 ","를 삽입한다.If the next public block of the common block 2 including the combined instruction OR does not include the combined instruction OR, inserts "]" after the common format of the IL object including the OR instruction among the common forms of the current public block 2 (S3). . If the next public block of the current public block containing an OR contains a combined instruction OR, insert "," at the end of the public format of the current public block.

이후 1번 공용블록과 2번 공용블록 중 번호가 더 늦은 공용블록 즉 2번 공용블록의 공용형식 표현에 1번 공용블록의 공용형식 표현을 병합(merge)한다(S4).Thereafter, the common type representation of the common block of the first common block and the common block of the second common block, that is, the common format of the first common block, is merged (S4).

따라서, 첫 번째 렁(rung)의 2번 공용블록의 공용형식은 '[XIC(X0),XIC(X1)]XIC(M0)XIO(X3)OUT(Y0)'가 된다.Therefore, the common type of the 2nd common block of the first rung becomes '[XIC (X0), XIC (X1)] XIC (M0) XIO (X3) OUT (Y0)'.

도 8b는 도 7b에 도시된 공용블록들에 대해서 결합 명령어 OR을 적용하여 공용블록들 간의 결합관계를 공용형식으로 표현하는 과정을 나타낸 도면이다.FIG. 8B is a diagram illustrating a process of expressing a coupling relationship between common blocks by applying a joint instruction OR to the common blocks shown in FIG. 7B in a common format.

도 8b를 참조하면, 결합관계 표현부(17)는 도 7b에 도시된 공용블록들에 결합 명령어 OR를 포함한 공용 블록이 있는가를 확인하고, 결합 명령어 OR를 포함한 공용블록이 있으면 결합 명령어 OR이 포함된 공용블록과 바로 앞 공용블록의 2개 공용블록 간의 결합관계를 기호 "[", "]" 및 ","를 이용하여 표현한다. Referring to FIG. 8B, the coupling relationship expression unit 17 checks whether the common block including the coupling instruction OR is present in the common blocks illustrated in FIG. 7B. The coupling relationship between the public block and the two public blocks of the previous public block is expressed using the symbols "[", "]" and ",".

도 8b에서는 결합명령어 OR를 포함한 3번 공용블록과, 2번 공용블록 간의 결합관계를 기호 "[", "]" 및 ","를 이용하여 표현한다. In FIG. 8B, the coupling relationship between the common block 3 and the common block 2 including the combining instruction OR is expressed using the symbols "[", "]" and ",".

이에 대해서 좀 더 구체적으로 살펴보기로 한다. 먼저 결합명령어 OR를 포함한 3번 공용블록 앞의 2번 공용블록의 공용형식 표현의 가장 앞에 "["를 삽입한다(S5).This will be described in more detail. First, a "[" is inserted at the beginning of the common type expression of the common block 2 before the common block 3 including the joint instruction OR (S5).

다음으로, 결합명령어 OR를 포함한 3번 공용블록의 공용형식 표현의 가장 앞에 ","를 삽입한다(S6).Next, "," is inserted at the beginning of the common format expression of the common block 3 including the combined instruction OR (S6).

그리고 결합명령어 OR를 포함한 3번 공용블록의 다음 공용블록이 결합명령어 OR를 포함하지 않는다면 현재 3번 공용블록의 공용형식 중 OR 명령어를 포함한 IL 오브젝트의 공용형식 뒤에 "]"를 삽입한다(S7). 만일 OR를 포함한 현재 공용블록의 다음 공용블록이 결합명령어 OR를 포함한다면, 현재 공용블록의 공용형식 가장 뒤에 ","를 삽입한다.If the next public block of the common block 3 including the combined instruction OR does not include the combined instruction OR, inserts "]" after the common format of the IL object including the OR instruction among the common forms of the current public block 3 (S7). . If the next public block of the current public block containing an OR contains a combined instruction OR, insert "," at the end of the public format of the current public block.

이후 2번 공용블록과 3번 공용블록 중 번호가 더 늦은 공용블록 즉 3번 공용블록의 공용형식 표현에 2번 공용블록의 공용형식 표현을 병합(merge)한다(S8).Thereafter, the common type representation of the common block of the common block 2 and the common block of the common block 2, that is, the common block of the common block 2, is merged (S8).

도 9는 도 8b를 통해 결합명령어 OR를 적용한 이후의 공용블록들에 대해서 결합 명령어 ORB를 적용하여 공용블록들 간의 결합관계를 공용형식으로 표현하는 과정을 나타낸 도면이다.FIG. 9 is a diagram illustrating a process of expressing a coupling relationship between common blocks by applying a joint command ORB to common blocks after applying the joint command OR through FIG. 8B.

도 9를 참조하면, 결합관계 표현부(17)는 결합명령어 OR를 적용한 이후의 공용블록들에 결합명령어 ORB를 포함한 공용블록이 있는가를 확인하고, 결합명령어 ORB를 포함한 공용블록이 있으면 결합명령어 ORB가 포함된 공용블록과 결합명령어 ORB를 포함한 공용블록 앞의 비어있지 않은 2개의 공용블록을 사용하여 공용블록들에 대한 결합관계를 표현한다.Referring to FIG. 9, the coupling relationship expression unit 17 checks whether the common block including the coupling instruction ORB is present in the common blocks after applying the coupling instruction OR. Two non-empty public blocks in front of the public block including the included public block and the joint instruction ORB are used to express the association relationship to the public blocks.

즉 결합관계 표현부(17)는 결합명령어 ORB를 포함한 4번 공용블록 앞의 비어있지 않은 2개의 공용블록 중 첫 번째 공용블록인 1번 공용블록의 공용형식 표현의 가장 앞에 "["를 삽입한다(S9).That is, the association relationship expression unit 17 inserts "[" at the beginning of the common format expression of the first public block of the first non-empty public blocks of the two non-empty public blocks in front of the common block ORB. (S9).

다음으로, 결합관계 표현부(17)는 결합명령어 ORB를 포함한 4번 공용블록 앞의 비어있지 않은 2개의 공용블록 중 두 번째 공용블록인 3번 공용블록의 공용형식 표현의 가장 앞에 ","를 삽입한다(S10).Next, the association relationship unit 17 adds "," to the beginning of the common type representation of the third common block, which is the second common block of the two non-empty common blocks before the fourth common block including the joint instruction ORB. Insert (S10).

그리고 결합관계 표현부(17)는 결합명령어 ORB를 포함한 4번 공용블록 뒤의 공용블록에 결합명령어 OR를 포함한 공용블록 및 결합명령어 ORB를 포함한 공용블록이 존재하는가를 확인하고, 존재하지 않을 때만 현재 결합명령어 ORB를 포함한 4번 공용블록의 공용형식의 표현의 가장 앞에 "]"를 삽입한다(S11).In addition, the association relationship expression unit 17 checks whether the public block including the association instruction OR and the common block including the association instruction ORB exist in the public block after the fourth common block including the association instruction ORB, and only when it does not exist. Insert "]" at the beginning of the common type representation of the common block 4, including the combined instruction ORB (S11).

이후 결합관계 표현부(17)는 1번 공용블록, 3번 공용블록 및 4번 공용블록 중 가장 번호가 늦은 4번 공용블록에 1번 공용블록과 3번 공용블록을 병합하고, 병합된 4번 공용블록에서 결합명령어 ORB를 포함한 공용 오브젝트를 삭제한다(S12).Thereafter, the joining relation expression unit 17 merges the first public block and the third public block into the fourth public block with the lowest number among the first public block, the third public block, and the fourth public block, and then merges the fourth public block. The public object including the combined instruction ORB is deleted from the public block (S12).

따라서, 두 번째 렁(rung)의 4번 공용블록의 공용형식은 '[XIC(X4)XIC(X5),[XIO(X6),XIC(X8)]XIC(X7)]XIC(X9)'가 된다.Therefore, the common type of shared block 4 of the second rung is '[XIC (X4) XIC (X5), [XIO (X6), XIC (X8)] XIC (X7)] XIC (X9)'. do.

도 10은 출력부에 사용되는 결합명령어 MPS를 적용한 결과를 나타낸 도면이다. 10 is a view showing a result of applying the combined command MPS used in the output unit.

도 10을 참조하면, 결합관계 표현부(17)는 결합명령어 MPS를 포함한 공용블록이 있는가를 확인하고, 결합명령어 MPS를 포함한 공용블록이 있으면 해당 공용블록의 공용형식 표현의 가장 앞에 "["를 삽입한다(S13).Referring to FIG. 10, the association relationship expression unit 17 checks whether there is a common block including the combined instruction MPS, and inserts "[" in front of the common form representation of the corresponding common block if there is a shared block including the combined instruction MPS. (S13).

즉, 결합관계 표현부(17)는 결합명령어 MPS를 포함한 5번 공용블록의 공용형식 표현의 가장 앞에 "["를 삽입한다.That is, the association relation expression unit 17 inserts "[" at the beginning of the common format representation of the common block 5 including the association instruction MPS.

따라서, 두 번째 렁(rung)의 5번 공용블록의 공용형식은 '[OUT(M0)'가 된다.Therefore, the common format of the 5th common block of the second rung is '[OUT (M0)'.

도 11은 출력부에 사용되는 결합명령어 MPP를 적용한 결과를 나타낸 도면이다. 11 is a view showing a result of applying the combined command MPP used in the output unit.

도 11을 참조하면, 결합관계 표현부(17)는 결합명령어 MPP를 포함한 공용블록이 있는가를 확인하고, 결합명령어 MPP를 포함한 공용블록이 있으면 해당 공용블록의 공용형식 표현의 가장 앞에 ","를 삽입하고 해당 공용블록의 공용형식 표현의 가장 뒤에 "]"를 삽입한다(S14).Referring to FIG. 11, the association relationship expression unit 17 checks whether there is a common block including the combined instruction MPP, and if there is a shared block including the combined instruction MPP, inserts "," at the beginning of the common form representation of the corresponding common block. And inserting "]" at the end of the common format expression of the corresponding common block (S14).

즉, 결합관계 표현부(17)는 결합명령어 MPP를 포함한 6번 공용블록의 공용형식 표현의 가장 앞에 ",", 가장 뒤에 "]"를 삽입한다.That is, the association relationship expression unit 17 inserts "," at the front and "]" at the front of the common format representation of the common block 6 including the association instruction MPP.

따라서, 두 번째 렁(rung)의 6번 공용블록의 공용형식은 ',XIO(X10)OUT(Y2)]'가 된다. Therefore, the common type of common block 6 of the second rung is ', XIO (X10) OUT (Y2)]'.

도 12는 두 번째 렁(rung)에 대하여 도 9 내지 11를 통해 표현된 공용블록들의 공용형식들을 나타낸다. 도 12를 참조하면, 4번, 5번 6번 공용블록의 공용형식을 차례대로 병합하면 두 번째 렁(rung)에 대한 최종 공용형식이 나오게 된다. FIG. 12 shows common formats of common blocks represented through FIGS. 9 through 11 for the second rung. Referring to FIG. 12, when the common formats of the 4th, 5th and 6th common blocks are merged in order, the final common format for the second rung is obtained.

따라서 두 번째 렁(rung)에 대한 최종 공용형식은, '[XIC(X4)XIC(X5),[XIO(X6),XIC(X8)]XIC(X7)]XIC(X9)[OUT(M0),XIO(X10)OUT(Y2)]'가 된다. So the final common format for the second rung is '[XIC (X4) XIC (X5), [XIO (X6), XIC (X8)] XIC (X7)] XIC (X9) [OUT (M0)' , XIO (X10) OUT (Y2)] '.

도 13은 위와 같은 과정을 거쳐 도 5b의 텍스트 기반의 PLC 제어 프로그램으로부터 변환된, 첫 번째 렁(rung)(N0)과 두 번째 렁(rung)(N5)에 대한 최종 공용형식을 나타낸다. FIG. 13 shows a final common format for the first rung N0 and the second rung N5 converted from the text-based PLC control program of FIG. 5B through the above process.

다시 도 1을 참조하면, 이하에서는 클래스 라이브러리 구축부(21)와 구조체 생성부(22)가 공용형식 변환부(13)로부터 출력되는 공용형식의 PLC 제어프로그램을 구조체 데이터로 변환하는 과정을 설명한다. Referring back to FIG. 1, the following describes a process of converting a PLC control program of a common format output from the common format conversion unit 13 into structure data by the class library construction unit 21 and the structure generation unit 22. .

클래스 라이브러리 구축부(21)는 PLC 제어프로그램의 렁(rung)들, 입력 접점들, 출력 접점들, 태그들에 대한 클래스들, 그리고 각 입력 접점 또는 출력 접점에 대한 해당 입력 접점 또는 출력 접점과 다른 입력 접점 또는 출력 접점과의 관계를 표현하는 클래스인 관계 클래스 등을 포함하는 클래스 라이브러리를 구축하여 저장한다. The class library construction unit 21 is different from the rungs, input contacts, output contacts, tags for the PLC control program, and the corresponding input contact or output contact for each input contact or output contact. Constructs and stores a class library including relation classes, which are classes representing relations with input contacts or output contacts.

도 14는 클래스 라이브러리 구축부(21)에 의해 구축되는 클래스 라이브러이의 구조를 나타낸다. 도 14를 참조하면, 클래스 라이브러리는, 최상위 클래스로서 모든 'Step'들의 집합을 나타내는 'StepS'와, 'StepS'의 하위 클래스로서 PLC 제어프로그램의 하나의 렁(rung)(PLC 제어프로그램의 로직을 구성하는 단위)을 나타내는 'Step'과, 'Step'의 하위 클래스로서 모든 'Coil'들의 집합을 나타내는 'CoilS'와, 'CoilS'의 하위 클래스로서 해당 렁(rung)에 속한 출력 접점을 나타내는 'Coil'과, 'Step'의 하위 클래스로서 모든 'Contact'들의 집합을 나타내는 'ContactS'와, 'ContactS'의 하위 클래스로서 해당 렁(rung)에 속한 입력 접점을 나타내는 'Contact'와, 'Coil' 또는 'Contact'의 하위 클래스로서 해당 입력 접점 또는 출력 접점과 다른 입력 접점 또는 출력 접점과의 관계를 표현하는 'Relation'과, 'Coil' 또는 'Contact'의 하위 클래스로서 해당 입력 접점 또는 출력 접점의 태그를 나타내는 'Tag'로 구성된다. 14 shows the structure of a class library constructed by the class library constructing unit 21. Referring to FIG. 14, the class library includes 'StepS' representing a set of all 'Steps' as a top-level class, and a rung of the PLC control program as a subclass of 'StepS' (the logic of the PLC control program). 'Step' which represents the constituent unit), 'CoilS' which represents the set of all 'Coil' as a subclass of 'Step', and 'C' which indicates the output contact which belongs to the rung as a subclass of 'CoilS'. Coil ',' ContactS 'representing the set of all' Contacts' as a subclass of 'Step', 'Contact' representing the input contacts belonging to the rung as a subclass of 'ContactS', and 'Coil' Or 'Relation' as a subclass of 'Contact' to express the relationship between the corresponding input or output contact and other input or output contacts, and as a subclass of 'Coil' or 'Contact' As a "Tag" that represents a tag It is sex.

도 15a 내지 15e는 각각 'Step' 클래스, 'Coil' 클래스, 'Contact' 클래스, 'Relation' 클래스, 'Tag' 클래스의 데이터 필드 구조를 나타낸다. 15A to 15E illustrate data field structures of a 'Step' class, a 'Coil' class, a 'Contact' class, a 'Relation' class, and a 'Tag' class, respectively.

도 15a를 참조하면, 'Step' 클래스는 데이터 필드로서 해당 'Step'의 고유 식별자인 Step key, 해당 PLC 제어프로그램의 이름인 Program, 그리고 해당 'Step'의 인덱스인 Step Index를 가지고, 하위 클래스로서 'CoilS'와 'ContactS'를 가진다. Step key는 해당 PLC 제어프로그램의 이름과 렁(rung) 번호로 이루어질 수 있다. 예를 들어 PLC 제어프로그램의 이름이 'Main'인 경우, 렁 번호 '0'에 대한 Step Index는 'Main.0', 렁 번호 '5'에 대한 Step Index는 'Main.5'가 될 수 있다. Step Index로는 렁 번호가 활용될 수 있다.Referring to FIG. 15A, a 'Step' class has a step key, a unique identifier of a corresponding 'Step', a Program, a name of a PLC control program, and a Step Index, an index of the 'Step', as a data field. It has 'CoilS' and 'ContactS'. Step key can consist of the name and rung number of the PLC control program. For example, if the name of the PLC control program is 'Main', the step index for the rung number '0' can be 'Main.0' and the step index for the rung number '5' can be 'Main.5'. . The rung number can be used as the step index.

도 15b를 참조하면, 'Coil' 클래스는 데이터 필드로서 해당 출력 접점에 대한 명령어인 command, 해당 Step 내의 고유 인덱스인 Index를 가지고, 하위 클래스로서 'Tag'와 'Relation'을 가진다.Referring to FIG. 15B, the 'Coil' class has a command which is a command for a corresponding output contact as a data field, an Index which is a unique index in a corresponding Step, and has a 'Tag' and a 'Relation' as a subclass.

도 15c를 참조하면, 'Contact' 클래스는 데이터 필드로서 해당 입력 접점에 대한 명령어인 command, 해당 Step 내에서의 고유 인덱스인 Index를 가지고, 하위 클래스로서 'Tag'와 'Relation'을 가진다.Referring to FIG. 15C, the 'Contact' class has a command which is a command for a corresponding input contact as a data field, an Index which is a unique index in a corresponding Step, and has a 'Tag' and a 'Relation' as subclasses.

도 15d를 참조하면, 'Relation' 클래스는 데이터 필드로서 해당 Contact 또는 Coil을 기준으로, 이전의 Contact의 인덱스인 Previous Contact, 이전의 Coil의 인덱스인 Previous Coil, 다음의 Contact의 인덱스인 Next Contact, 다음의 Coil의 인덱스인 Next Coil을 가진다.Referring to FIG. 15D, the 'Relation' class is a data field based on a corresponding contact or coil, and includes a previous contact, a previous contact index, a previous coil, a previous coil, a next contact index, and a next contact. It has Next Coil which is the index of Coil of.

도 15e를 참조하면, 'Tag' 클래스는 데이터 필드로서 해당 태그의 주소인 Address, 해당 태그의 설명인 Description을 가진다. Referring to FIG. 15E, the 'Tag' class has a data field as an address of a corresponding tag and a description as a description of the corresponding tag.

다시 도 1을 참조하면, 구조체 생성부(22)는 공용형식 변환부(13)로부터 공용형식의 PLC 제어프로그램을 입력받아, 클래스 라이브러리 구축부(21)에 의해 구축된 상기 클래스 라이브러리를 바탕으로, 상기 공용형식의 PLC 제어프로그램의 렁(rung)들, 입력 접점들, 출력 접점들, 태그들에 대한 오브젝트들, 그리고 각 입력 접점 또는 출력 접점에 대한 해당 입력 접점 또는 출력 접점과 다른 입력 접점 또는 출력 접점과의 관계를 표현하는 오브젝트인 관계 오브젝트 등을 포함하는 구조체 데이터를 형성하여, 구조체 형태의 PLC 제어프로그램을 출력한다. Referring back to FIG. 1, the structure generation unit 22 receives a PLC control program of a common format from the common format conversion unit 13, and based on the class library constructed by the class library construction unit 21, Rungs, input contacts, output contacts, objects for tags, and other input contacts or outputs different from the corresponding input contact or output contact for each input contact or output contact of the PLC control program of the common type. Structure data including a relationship object, which is an object representing a relationship with a contact point, is formed, and a PLC control program in the form of a structure is output.

이하에서는 도 13에 도시된 공용형식의 PLC 제어프로그램을 예로 들어 구조체 생성부(22)가 공용형식의 PLC 제어프로그램으로부터 구조체 데이터를 생성하는 과정을 설명한다. 도 13을 참조하면, 주어진 공용형식의 PLC 제어프로그램은 두 개의 렁(rung)으로 구성되므로, 2개의 Step이 존재한다. Hereinafter, a process in which the structure generation unit 22 generates structure data from the PLC control program of the common format will be described using the PLC control program of the common format shown in FIG. 13 as an example. Referring to FIG. 13, a PLC control program of a given common type is composed of two rungs, so there are two steps.

도 16은 본 발명의 일 실시예에 따른 구조체 생성부(22)의 구체적인 구성을 나타낸다. 구조체 생성부는 인덱스 생성부(23), 오브젝트 생성부(24), 관계 형성부(25)를 포함할 수 있다.16 shows a specific configuration of the structure generation unit 22 according to an embodiment of the present invention. The structure generator may include an index generator 23, an object generator 24, and a relationship generator 25.

인덱스 생성부(23)는 공용형식의 PLC 제어프로그램의 각 렁(rung)(다시 말하면, 하나의 문장 혹은 줄)마다, 해당 렁에 포함되는 각 접점에 내부적으로 인덱스를 부여한다. 인덱스는 예컨대 0 이상의 정수들로 접점들에 순차적으로 부여될 수 있다. 이러한 인덱스들은 후술할 관계 형성부(25)가 접점들 간의 관계를 표현하는데 사용된다. The index generator 23 internally assigns an index to each contact included in the corresponding rung for each rung (ie, one sentence or line) of the common PLC control program. The index may be sequentially assigned to the contacts, for example, with integers of zero or more. These indices are used by the relationship forming unit 25 to be described later to express the relationship between the contacts.

도 17은 도 13에 도시된 공용형식의 PLC 제어프로그램에 대하여 접점들에 부여된 인덱스들의 예를 나타낸다. 도 17을 참조하면, 첫 번째(0번) 렁의 다섯 개의 접점들 XIC(X0), XIC(X1), XIC(M0), XIO(X3), OUT(Y0)에 각각 0, 1, 2, 3, 4의 인덱스가 부여되고, 두 번째(5번) 렁의 9개의 접점들 XIC(X4), XIC(X5), XIO(X6), XIC(X8), XIC(X7), XIC(X9), OUT(M0), XIO(X10), OUT(Y2)에 각각 0, 1, 2, 3, 4, 5, 6, 7, 8의 인덱스가 부여된다.FIG. 17 shows an example of the indices given to the contacts for the PLC control program of the common type shown in FIG. Referring to FIG. 17, the five contacts XIC (X0), XIC (X1), XIC (M0), XIO (X3) and OUT (Y0) of the first (zero) rung are respectively 0, 1, 2, Index of 3, 4 is given, 9 contacts of the second (5th) rung XIC (X4), XIC (X5), XIO (X6), XIC (X8), XIC (X7), XIC (X9) , OUT (M0), XIO (X10), and OUT (Y2) are given indices of 0, 1, 2, 3, 4, 5, 6, 7, and 8, respectively.

오브젝트 생성부(24)는 주어진 공용형식의 PLC 제어프로그램의 'Command(Tag)' 형식의 접점들을 입력 접점(Contact)과 출력 접점(Coil)으로 구분하고 상기 인덱스 생성부(23)에 의해 부여된 인덱스를 반영하여, 상기 클래스 라이브러리를 바탕으로 Step 오브젝트, Contact 오브젝트, Coil 오브젝트, Tag 오브젝트, Relation 오브젝트 등을 생성한다. Step 오브젝트, Contact 오브젝트, Coil 오브젝트, Tag 오브젝트, Relation 오브젝트는 각각 클래스 라이브러리의 Step 클래스, Contact 클래스, Coil 클래스, Tag 클래스, Relation 클래스에 대응된다. The object generator 24 divides the contacts of the command (Tag) type of the PLC control program of the given common type into an input contact and an output contact, and is given by the index generator 23. Reflecting the index, a step object, a contact object, a coil object, a tag object, a relation object, and the like are generated based on the class library. Step object, Contact object, Coil object, Tag object, and Relation object correspond to Step class, Contact class, Coil class, Tag class, Relation class of class library, respectively.

접점들을 입력 접점(Contact)과 출력 접점(Coil)으로 구분하는 기준은 'Command(Tag)' 형식의 'Command'에 의해 이루어진다. 예를 들면, 입력 접점에 해당하는 'Command'는 입력에 해당하는 공용명령어인 XIC, XIO, AFI, INV, MEP, MEF, EGP, EGF, EQU, GEQ, GRT, LEQ, LES, MEQ, LIM, CMP 등을 포함하고, 출력 접점에 해당하는 'Command'는 출력에 해당하는 공용명령어인 OUT, SET, RST, MOV, TON, TOFF, RTO, TMR, CTU, CTD, UDCNT, MCR, FOR, NEXT, BREAK, LABEL, RET, CJ, SCJ, CALL, JMP, SBRT, FROM, TO 등을 포함한다. 여기서 입력 접점(Contact)과 출력 접점(Coil)의 구분을 위한 'Command'는 위와 같은 기본 공용명령어에 파라미터 한정자(예컨대 Double Word : D, Block : BK)나 동작 한정자(예컨대 Positive Pulse : P, Negative Pulse : N) 등이 결합된 공용명령어도 포함된다.The criteria for dividing the contacts into input contact and output contact is made by 'Command' in the form of 'Command (Tag)'. For example, 'Command' corresponding to the input contact point is a common command corresponding to the input such as XIC, XIO, AFI, INV, MEP, MEF, EGP, EGF, EQU, GEQ, GRT, LEQ, LES, MEQ, LIM, Including CMP, 'Command' corresponding to the output contact is the common command corresponding to the output, OUT, SET, RST, MOV, TON, TOFF, RTO, TMR, CTU, CTD, UDCNT, MCR, FOR, NEXT, Includes BREAK, LABEL, RET, CJ, SCJ, CALL, JMP, SBRT, FROM, TO, and more. Here, 'Command' for the distinction between input contact and output contact is a parameter qualifier (eg Double Word: D, Block: BK) or operation qualifier (eg Positive Pulse: P, Negative). Also included are common commands combined with Pulse: N).

도 17을 참조하면, 첫 번째(0번) 렁에서 XIC(X0), XIC(X1), XIC(M0), XIO(X3)는 입력 접점(Contact)에 해당하고, OUT(Y0)는 출력 접점에 해당한다. 두 번째(5번) 렁에서 XIC(X4), XIC(X5), XIO(X6), XIC(X8), XIC(X7), XIC(X9), XIO(X10)은 입력 접점에 해당하고 OUT(M0), OUT(Y2)는 출력 접점에 해당한다.Referring to FIG. 17, XIC (X0), XIC (X1), XIC (M0), and XIO (X3) correspond to an input contact and OUT (Y0) corresponds to an output contact in a first rung. Corresponds to In the second (5th) rung, XIC (X4), XIC (X5), XIO (X6), XIC (X8), XIC (X7), XIC (X9), and XIO (X10) correspond to the input contacts and OUT ( M0) and OUT (Y2) correspond to output contacts.

도 18은 도 14 및 15의 클래스 라이브러리를 바탕으로, 도 17과 같이 인덱스가 부여된 공용형식의 PLC 제어프로그램으로부터 생성된 오브젝트들의 예를 나타낸다. 도 18을 참조하면, 0번 Step은 Step key, Program, Step Index가 각각 Main.0, Main, 0이고, 4개의 Contact 오브젝트와 1개의 Coil 오브젝트를 가진다. 이들 중 예컨대 인덱스가 0인 Contact 오브젝트는 command가 'XIC'이고, 그에 속한 Tag 오브젝트는 Address가 X0이고 Description이 IN0이다. FIG. 18 illustrates examples of objects generated from a PLC-type control program of a common type indexed as shown in FIG. 17 based on the class libraries of FIGS. 14 and 15. Referring to FIG. 18, Step 0 has a Step key, a Program, and a Step Index of Main.0, Main, and 0, respectively, and have four Contact objects and one Coil object. For example, a Contact object with an index of 0 has a command of 'XIC', and a Tag object belonging to it has an Address of X0 and a Description of IN0.

또한 5번 Step은 Step key, Program, Step Index가 각각 Main.5, Main, 5이고, 7개의 Contact 오브젝트와 2개의 Coil 오브젝트를 가진다. 이들 중 예컨대 인덱스가 2인 Contact 오브젝트는 command가 'XIO'이고, 그에 속한 Tag 오브젝트는 Address가 X6이고 Description이 IN6이다. In Step 5, Step key, Program, and Step Index are Main.5, Main, and 5, respectively, and have 7 Contact objects and 2 Coil objects. For example, a Contact object with an index of 2 has a command of 'XIO', and a Tag object belonging to it has an Address of X6 and a Description of IN6.

도 18을 좀더 살펴보면, Relation 오브젝트를 제외하고 모든 데이터 필드가 정의되었음을 알 수 있다. 따라서 이제 각 Contact 오브젝트와 각 Coil 오브젝트에 속한 Relation 오브젝트의 데이터 필드(도 15d 참조), 즉 Previous Contact, Previous Coil, Next Contact, 또는 Next Coil을 정의하면 되는데, 이것이 바로 관계 형성부(25)가 각 입력 접점 또는 출력 접점에 대하여 해당 입력 접점 또는 출력 접점과 다른 입력 접점 또는 출력 접점과의 관계를 정의하는 것에 해당한다.Referring to FIG. 18, it can be seen that all data fields are defined except a Relation object. Therefore, the data fields of each Contact object and the Relation object belonging to each Coil object (see FIG. 15D), that is, Previous Contact, Previous Coil, Next Contact, or Next Coil, are defined. For an input contact or an output contact, this corresponds to defining a relationship between the corresponding contact or output contact and another input or output contact.

도 19는 도 17과 같이 인덱스가 부여된 공용형식의 PLC 제어프로그램을 편의상 오브젝트 형태로 표현한 PLC 제어프로그램을 나타낸다. 도 17 및 도 19를 참조하면, 입력 접점은 'I'로 표현하고, 출력 접점은 'O'로 표현하고, 인덱스는 아래 첨자로 표현하였다. FIG. 19 illustrates a PLC control program in which the common type PLC control program with an index is expressed in the form of an object as shown in FIG. 17. Referring to FIGS. 17 and 19, an input contact is represented by 'I', an output contact is represented by 'O', and an index is represented by a subscript.

도 20은 본 발명의 일 실시예에 따른 관계 형성부(25)의 구체적인 구성을 나타낸다. 관계 형성부(25)는 관계블록 생성부(26), 스텝내 관계 형성부(27), 관계블록내 관계 형성부(28)을 포함할 수 있다.20 shows a specific configuration of the relationship forming unit 25 according to an embodiment of the present invention. The relationship forming unit 25 may include a relationship block generating unit 26, an in-step relationship forming unit 27, and an relationship block forming unit 28.

본 발명의 실시예에 따른 공용형식의 PLC 제어프로그램은 결합관계를 나타내는 기호인 "[", "]" 및 ","를 포함하는데, "["로 시작하여 "]"로 끝나는 공용형식의 구조를 '관계블록(Relation Block)'이라 정의하기로 한다. 관계블록 생성부(26)는 이러한 관계블록을 생성한다. 관계블록의 내부 요소들은 OR 관계로 결합되어 있고, 내부 요소들을 구분하는 기준이 ","가 된다. 경우에 따라, 관계블록 내부에는 관계블록이 존재할 수 있다(예컨대, 도 19를 참조하면 N5 Step의 '[I0 I1, [I2, I3] I4]').The common type PLC control program according to an embodiment of the present invention includes symbols "[", "]" and "," representing a coupling relationship, and has a common type structure beginning with "[" and ending with "]". Is defined as a 'Relation Block'. The relationship block generator 26 generates such a relationship block. The inner elements of the relation block are combined in an OR relationship, and the criteria for distinguishing the inner elements is ",". In some cases, a relation block may exist inside the relation block (for example, referring to FIG. 19, '[I 0 I 1 , [I 2 , I 3 ] I 4 ]' of N5 Step).

관계블록 생성부(26)는 생성할 관계블록을 "RBK"로 표현하고, Step 내에서 관계블록마다 인덱스를 부여할 수 있다. 예컨대, N0 Step에서, 관계블록 [I0, I1]은 RBK0로 표현될 수 있다. 그러면 도 21과 같이 N0 Step은 'RBK0 I2 I3 O4'로 표현된다. The relation block generation unit 26 may express the relation block to be generated as "RBK" and assign an index to each relation block in Step. For example, in N0 Step, the relation block [I 0 , I 1 ] can be represented by RBK 0 . Then, N0 Step is expressed as 'RBK 0 I 2 I 3 O 4 ' as shown in FIG.

스텝내 관계 형성부(27)는 Step 내의 접점들(또는 관계블록)에 대하여 다른 접점(또는 관계블록)과의 관계를 정의한다. 구체적으로, 스텝내 관계 형성부(27)는 Step 내의 각 접점 또는 관계블록마다 그에 속한 Relation 오브젝트의 Previous Contact, Previous Coil, Next Contact, 또는 Next Coil을 정의한다. 이때 만일 Previous Contact, Previous Coil, Next Contact, 또는 Next Coil에 들어갈 인덱스가 관계블록의 것이라면, 인덱스의 앞에 'R'을 붙여 관계블록임을 나타낼 수 있다. 한 접점(또는 관계블록)의 Previous Contact, Previous Coil, Next Contact 또는 Next Coil을 정의할 때, Next Contact 또는 Next Coil이 정의되면 그 다음 접점(또는 관계블록)의 Previous Contact, Previous Coil이 그에 대응되도록 자동적으로 정의될 수 있다.In-step relationship forming unit 27 defines a relationship with other contacts (or relationship blocks) with respect to the contacts (or relationship blocks) in Step. Specifically, the intra-step relationship forming unit 27 defines a previous contact, previous coil, next contact, or next coil of a relation object belonging to each contact or relationship block in the step. In this case, if the index to be included in the previous contact, previous coil, next contact, or next coil belongs to the relation block, 'R' may be indicated before the index to indicate the relation block. When defining Previous Contact, Previous Coil, Next Contact, or Next Coil of one contact (or relation block), if Next Contact or Next Coil is defined, Previous Contact, Previous Coil of the next contact (or relation block) should correspond to it. Can be defined automatically.

도 22은 N0 Step에 대하여 접점들(또는 관계블록) 간의 관계가 정의된 결과를 보여준다. 22 shows the result of defining the relationship between the contacts (or the relationship block) for the NO step.

도 21 및 도 22를 참조하면, RBK0의 다음 접점이 I0, 즉 입력 접점이므로 RBK0의 Next Contact 필드가 '2'로 정의된다. 그에 대응되게 I2의 Previous Contact 필드는 R0로 정의된다. I2의 다음 접점이 I3, 즉 입력 접점이므로 I2의 Next Contact 필드가 '3'으로 정의되고, 그에 대응되게 I3의 Previous Contact 필드가 '2'로 정의된다. I3의 다음 접점이 O4, 즉 출력 접점이므로 I3의 Next Coil 필드가 4로 정의되고, 그에 대응되게 O4의 Previous Contact 필드가 '3'으로 정의된다.21 and 22, since the next contact of RBK 0 is I 0 , that is, an input contact, the Next Contact field of RBK 0 is defined as '2'. Correspondingly, the Previous Contact field of I 2 is defined as R 0. Since the next contact of I 2 is I 3 , that is, the input contact, the Next Contact field of I 2 is defined as '3', and the Previous Contact field of I 3 is defined as '2'. Since the next contact of I 3 is O 4 , that is, the output contact, the Next Coil field of I 3 is defined as 4, and correspondingly, the Previous Contact field of O 4 is defined as '3'.

관계블록내 관계 형성부(28)는 관계블록에 포함된 접점들(또는 관계블록)에 대하여 다른 접점(또는 관계블록)과의 관계를 정의한다. 구체적으로, 관계블록내 관계 형성부(28)는 관계블록 내의 각 접점 또는 관계블록마다 그에 속한 Relation 오브젝트의 Previous Contact, Previous Coil, Next Contact, 또는 Next Coil을 정의한다. 만일 관계블록 내에 관계블록이 존재한다면, 바깥의 관계블록의 접점들(또는 관계블록)에 대한 관계를 정의하는 것을 먼저 한다. 관계블록의 내부 요소들은 OR 관계로 결합되어 있는 바, 관계블록내 관계 형성부(28)는 ","를 기준으로 내부 요소들을 구분할 수 있다. 각 내부 요소는 편의상 OR1, OR2, ..., ORn으로 칭해질 수 있다. 도 23은 관계블록을 내부 요소들로 구분한 형식을 나타낸다.The relationship forming unit 28 in the relationship block defines a relationship with other contacts (or relationship blocks) with respect to the contacts (or relationship blocks) included in the relationship block. Specifically, the relationship forming unit 28 in the relationship block defines a previous contact, previous coil, next contact, or next coil of a relation object belonging to each contact or relationship block in the relationship block. If there is a relation block in the relation block, first define the relation to the contacts (or relation blocks) of the outer relation block. Since the internal elements of the relationship block are combined in an OR relationship, the relationship forming unit 28 in the relationship block may distinguish the internal elements based on ",". Each inner element may be referred to as OR 1 , OR 2 , ..., OR n for convenience. 23 shows a format in which the relationship block is divided into internal elements.

도 24a는 도 23의 형식에 도 22에 도시된 RBK0를 적용한 결과를 나타낸다. 도 21 및 도 22를 참조하면 RBK0 = [I0, I1]이므로 RBK0는 내부 요소로 I0와 I1을 가지고, Next Contact는 인덱스 '2'이다. 따라서 도 24a에 도시된 바와 같이, OR1에 I0의 Relation 오브젝트가, OR2에 I1의 Relation 오브젝트가 들어가고, Next Contact는 인덱스 '2'로 표현된다.FIG. 24A illustrates a result of applying RBK 0 illustrated in FIG. 22 to the format of FIG. 23. Referring to FIGS. 21 and 22, since RBK 0 = [I 0 , I 1 ], RBK 0 has I 0 and I 1 as internal elements, and Next Contact is an index '2'. Accordingly, as shown in FIG. 24A, a Relation object of I 0 is included in OR 1 , a Relation object of I 1 is included in OR 2 , and Next Contact is represented by an index '2'.

관계블록을 내부 요소들로 구분한 형식에서, 해당 관계블록의 Previous Contact 또는 Previous Coil은 모든 내부 요소들마다 맨 처음에 놓인(즉, 가장 왼쪽의) 접점의 Previous Contact 또는 Previous Coil이 된다. 또한 해당 관계블록의 Next Contact 또는 Next Coil은 모든 내부 요소들마다 맨 마지막에 놓인(즉, 가장 오른쪽의) 접점의 Next Contact 또는 Next Coil이 된다. 물론 내부 요소가 하나의 접점으로 이루어지는 경우 해당 접점이 맨 처음이자 마지막 접점이 된다(도 24의 경우임). In the form of dividing a relationship block into internal elements, the Previous Contact or Previous Coil of the relationship block becomes the Previous Contact or Previous Coil of the first (ie leftmost) contact that is placed for every internal element. Also, the next contact or next coil of the relation block becomes the next contact or next coil of the last (ie rightmost) contact point for all internal elements. Of course, if the internal element consists of one contact, the contact becomes the first and last contact (in the case of Fig. 24).

도 24a를 참조하면, RBK0는 Next Contact이 인덱스 '2'이므로, 도 24b에 도시된 바와 같이 OR1의 접점 I0와 OR2의 접점 I1 모두 Next Contact이 인덱스 '2'로 정의된다.Referring to FIG. 24A, since RBK 0 has the next contact as the index '2', as shown in FIG. 24B, both the contact I 0 of the OR1 and the contact I 1 of the OR2 are defined as the index '2'.

관계블록에 포함된 접점들에 대하여 다른 접점과의 관계가 정의되면, 관계블록내 관계 형성부(28)는 Step에 대하여 접점들(또는 관계블록) 간의 관계가 정의된 결과에서, 해당 관계블록을 그에 포함된 접점들로 대체한다. 이 과정에서 관계블록내 관계 형성부(28)는, 해당 관계블록의 이전 또는 다음의 접점의 해당 관계블록과의 관계(앞서, 스텝내 관계 형성부(27)에 의해 'R#'으로 정의되었음)를 해당 관계블록에 포함된 접점과의 관계로 재정의한다. 여기서, 관계블록을 Previous Contact 또는 Previous Coil로 가지고 있던 접점은, 해당 관계블록의 모든 내부 요소들마다 맨 마지막에 놓인 접점의 인덱스가 Previous Contact 또는 Previous Coil로 정의되고, 관계블록을 Next Contact 또는 Next Coil로 가지고 있던 접점은, 해당 관계블록의 모든 내부 요소들마다 맨 처음에 놓인 접점의 인덱스가 Next Contact 또는 Next Coil로 정의된다. When a relationship with another contact is defined for the contacts included in the relationship block, the relationship forming unit 28 in the relationship block selects the relationship block from the result of defining the relationship between the contacts (or relationship block) for the step. Replace with the contacts included therein. In this process, the relationship forming part 28 in the relationship block is defined as 'R #' by the relationship forming part 27 in the step. ) Is redefined as a relation with the contact point included in the relation block. Here, the contact point that has the relationship block as Previous Contact or Previous Coil, the index of the last contact point is defined as Previous Contact or Previous Coil for all internal elements of the relationship block, and the relationship block is called Next Contact or Next Coil. For each contact, the index of the first contact is defined as Next Contact or Next Coil for all internal elements of the relation block.

예컨대 도 22와 같이 N0 Step에 대하여 RBK0, I2, I3, O4 간의 관계가 정의된 결과에서, RBK0를 그에 포함된 접점들인 I0와 I1(도 24b 참조)으로 대체하면, 도 25와 같은 형태가 된다. 또한 도 22 및 도 24를 참조하면 I2는 RBK0를 Previous Contact로 가지고 있고 RBK0의 모든 내부 요소들의 마지막 접점은 I0와 I1이므로, 도 25에 도시된 바와 같이 I2의 Previous Contact는 '0, 1'로 재정의된다. For example, in the result of defining a relationship between RBK 0 , I 2 , I 3 , and O 4 with respect to N0 Step as shown in FIG. 22, when RBK 0 is replaced with the contacts I 0 and I 1 (see FIG. 24B) included therein, It becomes the form similar to FIG. 22 and 24, since I 2 has RBK 0 as a previous contact and the last contact point of all internal elements of RBK 0 is I 0 and I 1 , the previous contact of I 2 is shown in FIG. 25. Overridden to '0, 1'.

도 25는 N0 Step의 각 입력 접점 또는 출력 접점에 대하여 해당 입력 접점 또는 출력 접점과 다른 입력 접점 또는 출력 접점과의 관계가 모두 표현된 결과이다. FIG. 25 illustrates a result in which all of the relationships between the corresponding input contact or output contact and another input contact or output contact are expressed with respect to each input contact or output contact of the NO step.

이하에서는 상기된 관계 형성부(25)에 의해 N5 Step의 각 입력 접점 또는 출력 접점에 대하여 해당 입력 접점 또는 출력 접점과 다른 입력 접점 또는 출력 접점과의 관계가 표현되는 과정을 살펴보기로 한다. Hereinafter, a process of expressing a relationship between the corresponding input contact or output contact and another input contact or output contact for each input contact or output contact of N5 Step by the relationship forming unit 25 will be described.

N5 Step에서, 관계블록 [I0 I1, [I2, I3] I4]는 RBK0로 표현되고, RBK0 내의 관계블록 [I2, I3]는 RBK1로 표현되며, 관계블록 [O6, I7 O8]은 RBK2로 표현될 수 있다. 그러면 도 26과 같이 N5 Step은 'RBK0 I5 RBK2(여기서, RBK0 = [I0 I1, RBK1 I4], RBK1 = [I2, I3])'로 표현된다.In N5 Step, between blocks is represented by the RBK 0 [I 0 I 1, [I 2, I 3] I 4], the relationship block in the RBK 0 [I 2, I 3 ] is represented by RBK 1, between the block [O 6 , I 7 O 8 ] may be represented by RBK 2 . Then, as shown in FIG. 26, N5 Step is expressed as 'RBK 0 I 5 RBK 2 (where RBK 0 = [I 0 I 1 , RBK 1 I 4 ], RBK 1 = [I 2 , I 3 ])'.

도 27은 N5 Step에 대하여 접점들(또는 관계블록) 간의 관계가 정의된 결과를 보여준다. 27 shows a result of defining a relationship between contacts (or a relationship block) for N5 Step.

도 26 및 도 27을 참조하면, RBK0의 다음 접점이 I5, 즉 입력 접점이므로 RBK0의 Next Contact 필드가 '5'로 정의되고, 그에 대응되게 I5의 Previous Contact 필드는 R0로 정의된다. I5의 다음 접점이 RBK2이므로 I5의 Next Contact 필드가 'R2'로 정의되고, 그에 대응되게 RBK2의 Previous Contact 필드가 '5'로 정의된다.Referring to FIGS. 26 and 27, since the next contact of RBK 0 is I 5 , that is, an input contact, the Next Contact field of RBK 0 is defined as '5', and the Previous Contact field of I 5 is correspondingly defined as R0. . Since the next contact of I 5 is RBK 2 , the Next Contact field of I 5 is defined as 'R2', and the Previous Contact field of RBK 2 is defined as '5'.

도 28은 도 23의 형식에 도 27에 도시된 RBK0와 RBK1을 적용한 결과를 나타낸다. FIG. 28 shows the results of applying RBK 0 and RBK 1 shown in FIG. 27 to the format of FIG. 23.

도 26 및 도 27에서 RBK0 = [I0 I1, RBK1 I4]이므로 RBK0는 내부 요소로 I0 I1과 RBK1 I4를 가지고, Next Contact는 인덱스 '5'이다. 따라서 도 28에 도시된 바와 같이, OR1에 I0 I1의 Relation 오브젝트, OR2에 RBK1 I4의 Relation 오브젝트가 들어가고, Next Contact는 인덱스 '5'로 표현된다. 또한 RBK1 = [I2, I3]이므로 RBK1은 내부 요소로 I2와 I3를 가지고, Next Contact는 인덱스 '4'이다. 따라서 도 28에 도시된 바와 같이, OR1에 I2의 Relation 오브젝트, OR2에 I3의 Relation 오브젝트가 들어가고, Next Contact는 인덱스 '4'로 표현된다. In FIG. 26 and FIG. 27, since RBK 0 = [I 0 I 1 , RBK 1 I 4 ], RBK 0 has I 0 I 1 and RBK 1 I 4 as internal elements, and Next Contact is index '5'. Therefore, as shown in FIG. 28, a Relation object of I 0 I 1 is included in OR 1 , and a Relation object of RBK 1 I 4 is included in OR 2 , and Next Contact is represented by an index '5'. Also, because RBK 1 = [I 2 , I 3 ], RBK 1 has I 2 and I 3 as internal elements, and Next Contact is index '4'. Therefore, as shown in FIG. 28, a relation object of I 2 is included in OR 1 , a relation object of I 3 is included in OR 2 , and the next contact is represented by an index '4'.

또한, RBK0 내에서, I0의 다음 접점이 I1이므로 I0의 Next Contact 필드가 '1'로 정의되고, 그에 대응되게 I1의 Previous Contact 필드가 '0'으로 정의된다. RBK1의 다음 접점이 I4이므로 RBK1의 Next Contact 필드가 '4'로 정의되고 그에 대응되게 I4의 Previous Contact 필드는 'R1'로 정의된다. RBK0는 Next Contact이 인덱스 '5'이므로, OR1의 맨 마지막에 놓인 접점인 I1의 Next Contact이 '5'로 정의되고, OR2의 맨 마지막에 놓인 접점인 I4의 Next Contact도 '5'로 정의된다.Also within RBK 0, then the contact of the I 0 is defined as a "1" Next Contact field of the I 0 Since I 1, I correspond be defined as one of the Previous Contact field is '0' it. Since the next contact of RBK 1 is I 4 , the Next Contact field of RBK 1 is defined as '4' and the Previous Contact field of I 4 is defined as 'R1'. RBK 0 is Next Contact index "5" Because this Next Contact of I 1 contacts placed at the end of the OR1 is defined as a '5', the last Next Contact the junction of I 4 is placed in OR2 also '5' Is defined as

또한, RBK1은 Next Contact이 인덱스 '4'이므로, OR1의 접점 I2와 OR2의 접점 I3 모두 Next Contact이 인덱스 '4'로 정의된다.In addition, since RBK 1 has the next contact as the index '4', the next contact is defined as the index '4' for both the contact I 2 of OR1 and the contact I 3 of OR2.

도 29는 도 28에서 RBK0 내의 RBK1을 그에 포함된 접점들인 I2와 I3로 대체한 결과를 보여준다. 이 과정에서, I4는 RBK1을 Previous Contact로 가지고 있고 RBK1의 모든 내부 요소들의 마지막 접점은 I2와 I3이므로, 도 29에 도시된 바와 같이 I4의 Previous Contact는 '2, 3'으로 재정의된다.FIG. 29 shows a result of replacing RBK 1 in RBK 0 with I 2 and I 3 included in the contacts in FIG. 28. In this process, since I 4 has RBK 1 as a previous contact and the last contact point of all internal elements of RBK 1 is I 2 and I 3 , as shown in FIG. 29, the previous contact of I 4 is '2, 3'. To be redefined.

도 30은 도 27의 RBK0를 도 29의 RBK0, 즉 RBK0에 포함된, 관계가 정의된 접점들로 대체한 결과를 보여준다. 도 27 및 도 29를 참조하면, I5는 RBK0를 RBK0를 Previous Contact로 가지고 있고 RBK0의 모든 내부 요소들의 마지막 접점은 I1과 I4이므로, 도 30에 도시된 바와 같이 I5의 Previous Contact는 '1, 4'로 재정의된다.Figure 30 shows the results of replacing with a, the relationship between the contact point included in the definition RBK 0, i.e. 0 RBK of the RBK 29 0 of Fig. When 27 and FIG. 29, I 5 has a RBK 0 to RBK 0 to Previous Contact and the RBK Since the last contact point of all the internal elements of 0 I 1 and I 4, as shown in Fig. 30 I 5 Previous Contact is redefined as '1, 4.'

도 31은 도 23의 형식에 도 27에 도시된 RBK2를 적용한 결과를 보여준다. 도 26 및 도 27에서 RBK2 = [O6, I7 O8]이므로 RBK2는 내부 요소로 O6와 I7 O8을 가지고, Previous Contact는 '5'이다. 따라서 도 31에 도시된 바와 같이, OR1에 O6의 Relation 오브젝트, OR2에 I7 O8의 Relation 오브젝트가 들어가고, Previous Contact는 인덱스 '5'로 표현된다. FIG. 31 shows a result of applying RBK 2 shown in FIG. 27 to the format of FIG. 23. In FIG. 26 and FIG. 27, since RBK 2 = [O 6 , I 7 O 8 ], RBK 2 has O 6 and I 7 O 8 as internal elements, and Previous Contact is '5'. Therefore, as shown in FIG. 31, a Relation object of O 6 is inserted into OR 1 , and a Relation object of I 7 O 8 is contained in OR 2 , Previous Contact is represented by index '5'.

또한, RBK2 내에서, I7의 다음 접점이 O8이므로 I7의 Next Coil 필드가 '8'로 정의되고, 그에 대응되게 O8의 Previous Contact 필드가 '7'로 정의된다. RBK2는 Previous Contact가 인덱스 '5'이므로, OR1의 맨 처음에 놓인 접점 O6의 Previous Contact이 '5'로 정의되고, OR2의 맨 처음에 놓인 접점 I7의 Previous Contact도 '5'로 정의된다.Also, in RBK 2 , since the next contact of I 7 is O 8 , the Next Coil field of I 7 is defined as '8', and correspondingly, the Previous Contact field of O 8 is defined as '7'. RBK 2 is because the Previous Contact index "5", the contact O 6 placed at the beginning of the OR1 Previous Contact is defined as a '5', the contacts I 7 placed at the beginning of the OR2 Previous Contact is also defined as a '5' do.

도 32는 도 30의 RBK2를 도 31의 RBK2, 즉 RBK2에 포함된, 관계가 정의된 접점들로 대체한 결과를 보여준다. 도 30 및 도 31을 참조하면, I5는 RBK2를 Next Contact로 가지고 있고 RBK2의 모든 내부 요소들의 맨 처음 접점은 O6와 I7이므로, 도 32에 도시된 바와 같이 I5의 Next Contact는 '7'로, Next Coil은 '6'으로 재정의된다.Figure 32 shows the results of replacing with a, the relationship between the contact point included in the definition RBK 2, i.e. RBK 2 of the RBK 2 of Fig. 30 Fig. 31. 30 and 31, since I 5 has RBK 2 as a next contact and the first contact point of all internal elements of RBK 2 is O 6 and I 7 , the next contact of I 5 as shown in FIG. 32. Is redefined to '7' and Next Coil to '6'.

도 33은 위와 같은 과정을 거쳐 최종적으로 생성된 구조체 데이터로서, 도 18의 오브젝트들에, 도 25와 같이 N0 Step의 각 접점들에 대해 관계가 정의된 결과와 도 32와 같이 N5 Step의 각 접점들에 대해 관계가 정의된 결과를 반영한 구조체 데이터를 나타낸다.FIG. 33 is structure data finally generated through the above process, in which the relations are defined in the objects of FIG. 18 for each contact point of N0 Step as shown in FIG. 25 and each contact point of N5 Step as shown in FIG. Represents the structure data that reflects the result of defining relations.

도 34는 본 발명의 일 실시예에 따른, 공용형식의 PLC 제어프로그램을 구조체 데이터로 변환하는 방법의 흐름도를 나타낸다. 본 실시예에 따른 방법은 전술한 구조체 데이터 변환 장치에서 처리되는 단계들로 이루어진다. 따라서 이하 생략된 내용이라 하더라도 구조체 데이터 변환 장치에 관하여 이상에서 기술된 내용은 본 실시예에 따른 방법에도 적용된다.34 is a flowchart of a method of converting a common PLC control program into structure data according to an embodiment of the present invention. The method according to the present embodiment consists of the steps processed in the structure data converting apparatus described above. Therefore, even if omitted below, the above description of the structure data converting apparatus also applies to the method according to the present embodiment.

110단계에서, 공용명령어 라이브러리 구축부(11)는 서로 다른 형식을 가진 텍스트 기반의 PLC 제어프로그램들에 사용되는 명령어들에 대한 공용 명령어를 생성하여 공용 명령어 라이브러리를 구축한다.In step 110, the common instruction library building unit 11 constructs a common instruction library by generating common instructions for instructions used in text-based PLC control programs having different formats.

120단계에서, 클래스 라이브러리 구축부(21)는 PLC 제어프로그램의 렁, 입력 접점, 출력 접점에 대한 클래스 및 각 접점에 대한 해당 접점과 다른 접점과의 관계를 표현하기 위한 클래스를 포함하는 클래스 라이브러리를 구축한다.In step 120, the class library building unit 21 includes a class library including a rung of the PLC control program, a class for an input contact, an output contact, and a class for expressing a relationship between a corresponding contact and another contact for each contact. Build.

130단계에서, 공용형식 변환부(13)는 텍스트 기반의 PLC 제어프로그램을, 상기 공용명령어 라이브러리를 이용하여 공용형식의 PLC 제어프로그램으로 변환한다.In step 130, the common format converting unit 13 converts the text-based PLC control program into a common PLC control program using the common command library.

140단계에서, 구조체 생성부(22)는 상기 클래스 라이브러리를 바탕으로, 상기 공용형식의 PLC 제어프로그램의 렁, 입력 접점, 출력 접점에 대한 오브젝트 및 각 접점에 대한 해당 접점과 다른 접점과의 관계를 표현하는 오브젝트를 포함하는 구조체 데이터를 생성한다.In step 140, the structure generating unit 22 establishes a relationship between the rung, the input contact and the output contact of the PLC control program of the common type, the corresponding contact for each contact, and the other contact, based on the class library. Create structure data containing the objects to represent.

본 발명에 첨부된 블록도의 각 블록과 흐름도의 각 단계의 조합들은 컴퓨터 프로그램 인스트럭션들에 의해 수행될 수도 있다. 이들 컴퓨터 프로그램 인스트럭션들은 범용 컴퓨터, 특수용 컴퓨터 또는 기타 프로그램 가능한 데이터 프로세싱 장비의 프로세서에 탑재될 수 있으므로, 컴퓨터 또는 기타 프로그램 가능한 데이터 프로세싱 장비의 프로세서를 통해 수행되는 그 인스트럭션들이 블록도의 각 블록 또는 흐름도의 각 단계에서 설명된 기능들을 수행하는 수단을 생성하게 된다. 이들 컴퓨터 프로그램 인스트럭션들은 특정 방식으로 기능을 구현하기 위해 컴퓨터 또는 기타 프로그램 가능한 데이터 프로세싱 장비를 지향할 수 있는 컴퓨터 이용 가능 또는 컴퓨터 판독 가능 메모리에 저장되는 것도 가능하므로, 그 컴퓨터 이용가능 또는 컴퓨터 판독 가능 메모리에 저장된 인스트럭션들은 블록도의 각 블록 또는 흐름도 각 단계에서 설명된 기능을 수행하는 인스트럭션 수단을 내포하는 제조 품목을 생산하는 것도 가능하다. 컴퓨터 프로그램 인스트럭션들은 컴퓨터 또는 기타 프로그램 가능한 데이터 프로세싱 장비 상에 탑재되는 것도 가능하므로, 컴퓨터 또는 기타 프로그램 가능한 데이터 프로세싱 장비 상에서 일련의 동작 단계들이 수행되어 컴퓨터로 실행되는 프로세스를 생성해서 컴퓨터 또는 기타 프로그램 가능한 데이터 프로세싱 장비를 수행하는 인스트럭션들은 블록도의 각 블록 및 흐름도의 각 단계에서 설명된 기능들을 실행하기 위한 단계들을 제공하는 것도 가능하다. Combinations of each block of the block diagrams and respective steps of the flowcharts attached to the present invention may be performed by computer program instructions. These computer program instructions may be mounted on a processor of a general purpose computer, special purpose computer, or other programmable data processing equipment such that instructions executed through the processor of the computer or other programmable data processing equipment may not be included in each block or flowchart of the block diagram. It will create means for performing the functions described in each step. These computer program instructions may be stored in a computer usable or computer readable memory that can be directed to a computer or other programmable data processing equipment to implement functionality in a particular manner, and thus the computer usable or computer readable memory. It is also possible for the instructions stored in to produce an article of manufacture containing instruction means for performing the functions described in each block or flowchart of each step of the block diagram. Computer program instructions may also be mounted on a computer or other programmable data processing equipment, such that a series of operating steps may be performed on the computer or other programmable data processing equipment to create a computer-implemented process to create a computer or other programmable data. Instructions that perform processing equipment may also provide steps for performing the functions described in each block of the block diagram and in each step of the flowchart.

또한, 각 블록 또는 각 단계는 특정된 논리적 기능(들)을 실행하기 위한 하나 이상의 실행 가능한 인스트럭션들을 포함하는 모듈, 세그먼트 또는 코드의 일부를 나타낼 수 있다. 또, 몇 가지 대체 실시예들에서는 블록들 또는 단계들에서 언급된 기능들이 순서를 벗어나서 발생하는 것도 가능함을 주목해야 한다. 예컨대, 잇달아 도시되어 있는 두 개의 블록들 또는 단계들은 사실 실질적으로 동시에 수행되는 것도 가능하고 또는 그 블록들 또는 단계들이 때때로 해당하는 기능에 따라 역순으로 수행되는 것도 가능하다.In addition, each block or step may represent a portion of a module, segment or code that includes one or more executable instructions for executing a specified logical function (s). It should also be noted that in some alternative embodiments, the functions noted in the blocks or steps may occur out of order. For example, the two blocks or steps shown in succession may in fact be executed substantially concurrently or the blocks or steps may sometimes be performed in the reverse order, depending on the functionality involved.

이상의 설명은 본 발명의 기술 사상을 예시적으로 설명한 것에 불과한 것으로서, 본 발명이 속하는 기술 분야에서 통상의 지식을 가진 자라면 본 발명의 본질적인 특성에서 벗어나지 않는 범위에서 다양한 수정 및 변형이 가능할 것이다. 따라서, 본 발명에 개시된 실시예들은 본 발명의 기술 사상을 한정하기 위한 것이 아니라 설명하기 위한 것이고, 이러한 실시예에 의하여 본 발명의 기술 사상의 범위가 한정되는 것은 아니다. 본 발명의 보호 범위는 아래의 청구범위에 의하여 해석되어야 하며, 그와 동등한 범위 내에 있는 모든 기술사상은 본 발명의 권리범위에 포함되는 것으로 해석되어야 할 것이다.The above description is merely illustrative of the technical idea of the present invention, and those skilled in the art to which the present invention pertains may make various modifications and changes without departing from the essential characteristics of the present invention. Therefore, the embodiments disclosed in the present invention are not intended to limit the technical idea of the present invention but to describe the present invention, and the scope of the technical idea of the present invention is not limited by these embodiments. The scope of protection of the present invention should be interpreted by the following claims, and all technical ideas falling within the scope of the present invention should be construed as being included in the scope of the present invention.

Claims (16)

PLC 제어 프로그램의 렁(rung), 입력 접점 및 출력 접점 각각에 대한 클래스를 포함하는 클래스 라이브러리를 구축하는 클래스 라이브러리 구축부; 및A class library construction unit for constructing a class library including classes for each of a rung, an input contact, and an output contact of the PLC control program; And 텍스트 기반의 PLC 제어 프로그램으로부터 변환된 공용형식의 PLC 제어프로그램을 입력받아, 상기 클래스 라이브러리를 바탕으로, 상기 공용형식의 PLC 제어프로그램의 렁(rung), 입력 접점 및 출력 접점 각각에 대한 오브젝트를 포함하는 구조체 데이터를 생성하는 구조체 생성부를 포함하는 것을 특징으로 하는,Receives a common PLC control program converted from a text-based PLC control program, and includes objects for the rung, input contact, and output contact of the PLC control program of the common format based on the class library. Characterized in that it comprises a structure generating unit for generating structure data to PLC 제어 프로그램을 구조체 데이터로 변환하는 장치.Device for converting PLC control programs into structure data. 제1항에 있어서,The method of claim 1, 상기 클래스 라이브러리는 각 입력 접점 또는 출력 접점에 대한 해당 입력 접점 또는 출력 접점과 적어도 하나의 다른 입력 접점 또는 출력 접점과의 관계를 표현하기 위한 관계 클래스를 더 포함하고,The class library further includes a relationship class for representing a relationship between a corresponding input contact or output contact for each input contact or output contact and at least one other input contact or output contact, 상기 구조체 데이터는 상기 공용형식의 PLC 제어프로그램의 각 입력 접점 또는 출력 접점에 대한 해당 입력 접점 또는 출력 접점과 적어도 하나의 다른 입력 접점 또는 출력 접점과의 관계를 표현하는 관계 오브젝트를 더 포함하는 것을 특징으로 하는,The structure data may further include a relationship object representing a relationship between a corresponding input contact or output contact for each input contact or output contact of the PLC control program of the common format and at least one other input contact or output contact. Made, PLC 제어 프로그램을 구조체 데이터로 변환하는 장치.Device for converting PLC control programs into structure data. 제2항에 있어서,The method of claim 2, 상기 관계 클래스 및 상기 관계 오브젝트는 데이터 필드로, 해당 입력 접점 또는 출력 접점을 기준으로 이전 입력 접점, 이전 출력 접점, 다음 입력 접점, 또는 다음 출력 접점을 표현하기 위한 데이터 필드를 가지는 것을 특징으로 하는,The relationship class and the relationship object is a data field, and has a data field for representing a previous input contact, a previous output contact, a next input contact, or a next output contact based on the corresponding input contact or output contact. PLC 제어 프로그램을 구조체 데이터로 변환하는 장치.Device for converting PLC control programs into structure data. 제3항에 있어서,The method of claim 3, 상기 구조체 생성부는,The structure generation unit, 상기 공용형식의 PLC 제어프로그램의 각 렁마다, 해당 렁에 포함되는 각 접점에 인덱스를 부여하는 인덱스 생성부;An index generator for assigning an index to each contact included in the corresponding rung for each rung of the common type PLC control program; 상기 클래스 라이브러리를 바탕으로, 상기 부여된 인덱스를 반영하여, 상기 공용형식의 PLC 제어프로그램의 렁(rung), 입력 접점 및 출력 접점 각각에 대한 오브젝트 및 상기 관계 오브젝트를 생성하는 오브젝트 생성부; 및An object generation unit for generating an object and a relationship object for each of a rung, an input contact and an output contact of the PLC control program of the common type by reflecting the given index based on the class library; And 상기 관계 오브젝트의 상기 데이터 필드를 정의하는 관계 형성부를 포함하는 것을 특징으로 하는,And a relationship forming unit defining the data field of the relationship object. PLC 제어 프로그램을 구조체 데이터로 변환하는 장치.Device for converting PLC control programs into structure data. 제4항에 있어서,The method of claim 4, wherein 상기 관계 형성부는, 상기 데이터 필드로 이전 입력 접점, 이전 출력 접점, 다음 입력 접점, 또는 다음 출력 접점의 인덱스를 정의하는 것을 특징으로 하는,The relationship forming unit may define an index of a previous input contact, a previous output contact, a next input contact, or a next output contact as the data field. PLC 제어 프로그램을 구조체 데이터로 변환하는 장치.Device for converting PLC control programs into structure data. 제4항에 있어서,The method of claim 4, wherein 상기 공용형식의 PLC 제어프로그램은 OR 결합관계를 나타내는 기호를 포함하고,The common type PLC control program includes a symbol representing an OR coupling relationship, 상기 관계 형성부는,The relationship forming unit, 상기 OR 결합관계를 나타내는 기호를 이용하여, 상기 공용형식의 PLC 제어프로그램에서 OR 관계로 결합되어 있는 공용형식을 관계블록-상기 관계블록은 해당 관계블록을 기준으로 이전 입력 접점, 이전 출력 접점, 다음 입력 접점, 또는 다음 출력 접점을 표현하기 위한 데이터 필드를 가짐-으로 정의하는 관계블록 생성부;By using the symbol representing the OR coupling relationship, the common type combined in the OR relationship in the PLC control program of the common type is a relation block. The relation block is based on the corresponding relation block. A relation block generating unit for defining an input contact or a data field for representing the next output contact; 상기 관계블록으로 표현된 공용형식의 PLC 제어프로그램의 각 렁에 대하여, 해당 렁을 구성하는 관계블록, 입력 접점 및 출력 접점에 대한 상기 데이터 필드를 정의하는 스텝내 관계 형성부; 및An in-step relationship forming unit defining, for each rung of the PLC control program of the common type represented by the relationship block, the data field for the relationship block, the input contact point, and the output contact constituting the rung; And 상기 관계블록에 포함된 접점들에 대하여 상기 데이터 필드를 정의하는 관계블록내 관계 형성부를 포함하는 것을 특징으로 하는,And a relationship forming unit in a relationship block defining the data field with respect to the contacts included in the relationship block. PLC 제어 프로그램을 구조체 데이터로 변환하는 장치.Device for converting PLC control programs into structure data. 제6항에 있어서,The method of claim 6, 상기 관계블록내 관계 형성부는, 상기 관계블록 내의 OR 관계로 결합되어 있는 내부 요소들을 구분하고, 상기 관계블록에 대해 정의된 상기 데이터 필드를 바탕으로 상기 내부 요소들에 포함된 적어도 하나의 입력 접점 또는 출력 접점의 상기 데이터 필드를 정의하는 것을 특징으로 하는,The relationship forming unit in the relationship block may distinguish internal elements coupled in an OR relationship in the relationship block, and may include at least one input contact included in the internal elements based on the data field defined for the relationship block, or Defining the data field of the output contact, PLC 제어 프로그램을 구조체 데이터로 변환하는 장치.Device for converting PLC control programs into structure data. 제6항에 있어서,The method of claim 6, 상기 관계블록내 관계 형성부는, The relationship forming unit in the relationship block, 상기 관계블록에 포함된 접점들에 대하여 정의된 상기 데이터 필드를 바탕으로, 해당 관계블록의 이전 또는 다음의 입력 접점 또는 출력 접점의 상기 데이터 필드를 재정의하는 것을 특징으로 하는,On the basis of the data field defined for the contacts included in the relationship block, characterized in that to redefine the data field of the previous or next input contact or output contact of the relationship block, PLC 제어 프로그램을 구조체 데이터로 변환하는 장치.Device for converting PLC control programs into structure data. PLC 제어 프로그램의 렁(rung), 입력 접점 및 출력 접점 각각에 대한 클래스를 포함하는 클래스 라이브러리를 구축하는 단계; 및Building a class library including classes for each of a rung, an input contact, and an output contact of the PLC control program; And 텍스트 기반의 PLC 제어 프로그램으로부터 변환된 공용형식의 PLC 제어프로그램을 입력받아, 상기 클래스 라이브러리를 바탕으로, 상기 공용형식의 PLC 제어프로그램의 렁(rung), 입력 접점 및 출력 접점 각각에 대한 오브젝트를 포함하는 구조체 데이터를 생성하는 단계를 포함하는 것을 특징으로 하는,Receives a common PLC control program converted from a text-based PLC control program, and includes objects for the rung, input contact, and output contact of the PLC control program of the common format based on the class library. Characterized in that it comprises the step of generating the structure data, PLC 제어 프로그램을 구조체 데이터로 변환하는 방법.How to convert PLC control program into structure data. 제9항에 있어서,The method of claim 9, 상기 클래스 라이브러리는 각 입력 접점 또는 출력 접점에 대한 해당 입력 접점 또는 출력 접점과 적어도 하나의 다른 입력 접점 또는 출력 접점과의 관계를 표현하기 위한 관계 클래스를 더 포함하고,The class library further includes a relationship class for representing a relationship between a corresponding input contact or output contact for each input contact or output contact and at least one other input contact or output contact, 상기 구조체 데이터는 상기 공용형식의 PLC 제어프로그램의 각 입력 접점 또는 출력 접점에 대한 해당 입력 접점 또는 출력 접점과 적어도 하나의 다른 입력 접점 또는 출력 접점과의 관계를 표현하는 관계 오브젝트를 더 포함하는 것을 특징으로 하는,The structure data may further include a relationship object representing a relationship between a corresponding input contact or output contact for each input contact or output contact of the PLC control program of the common format and at least one other input contact or output contact. Made, PLC 제어 프로그램을 구조체 데이터로 변환하는 방법.How to convert PLC control program into structure data. 제10항에 있어서,The method of claim 10, 상기 관계 클래스 및 상기 관계 오브젝트는 데이터 필드로, 해당 입력 접점 또는 출력 접점을 기준으로 이전 입력 접점, 이전 출력 접점, 다음 입력 접점, 또는 다음 출력 접점을 표현하기 위한 데이터 필드를 가지는 것을 특징으로 하는,The relationship class and the relationship object is a data field, and has a data field for representing a previous input contact, a previous output contact, a next input contact, or a next output contact based on the corresponding input contact or output contact. PLC 제어 프로그램을 구조체 데이터로 변환하는 방법.How to convert PLC control program into structure data. 제11항에 있어서,The method of claim 11, 상기 구조체 데이터를 생성하는 단계는,Generating the structure data, 상기 공용형식의 PLC 제어프로그램의 각 렁마다, 해당 렁에 포함되는 각 접점에 인덱스를 부여하는 단계;Assigning an index to each contact included in the corresponding rung for each rung of the common type PLC control program; 상기 클래스 라이브러리를 바탕으로, 상기 부여된 인덱스를 반영하여, 상기 공용형식의 PLC 제어프로그램의 렁(rung), 입력 접점 및 출력 접점 각각에 대한 오브젝트 및 상기 관계 오브젝트를 생성하는 단계; 및Generating an object and a relationship object for each of a rung, an input contact and an output contact of the PLC control program of the common type by reflecting the given index based on the class library; And 상기 관계 오브젝트의 상기 데이터 필드를 정의하는 단계를 포함하는 것을 특징으로 하는,Defining the data field of the relationship object, PLC 제어 프로그램을 구조체 데이터로 변환하는 방법.How to convert PLC control program into structure data. 제12항에 있어서,The method of claim 12, 상기 데이터 필드를 정의하는 단계는, 상기 데이터 필드로 이전 입력 접점, 이전 출력 접점, 다음 입력 접점, 또는 다음 출력 접점의 인덱스를 정의하는 것을 특징으로 하는,The defining of the data field may include defining an index of a previous input contact, a previous output contact, a next input contact, or a next output contact as the data field. PLC 제어 프로그램을 구조체 데이터로 변환하는 방법.How to convert PLC control program into structure data. 제12항에 있어서,The method of claim 12, 상기 공용형식의 PLC 제어프로그램은 OR 결합관계를 나타내는 기호를 포함하고,The common type PLC control program includes a symbol representing an OR coupling relationship, 상기 데이터 필드를 정의하는 단계는,Defining the data field, (a) 상기 OR 결합관계를 나타내는 기호를 이용하여, 상기 공용형식의 PLC 제어프로그램에서 OR 관계로 결합되어 있는 공용형식을 관계블록-상기 관계블록은 해당 관계블록을 기준으로 이전 입력 접점, 이전 출력 접점, 다음 입력 접점, 또는 다음 출력 접점을 표현하기 위한 데이터 필드를 가짐-으로 정의하는 단계;(a) Using a symbol representing the OR coupling relationship, the common type coupled in an OR relationship in the PLC control program of the common type is a relation block. The relation block is a previous input contact or a previous output based on the relation block. Defining a data field for representing a contact, a next input contact, or a next output contact; (b) 상기 관계블록으로 표현된 공용형식의 PLC 제어프로그램의 각 렁에 대하여, 해당 렁을 구성하는 관계블록, 입력 접점 및 출력 접점에 대한 상기 데이터 필드를 정의하는 단계; 및(b) defining, for each rung of the PLC control program of the common format represented by the relationship block, the data field for the relationship block, the input contact point and the output contact point constituting the rung; And (c) 상기 관계블록에 포함된 접점들에 대하여 상기 데이터 필드를 정의하는 단계를 포함하는 것을 특징으로 하는,(c) defining the data field with respect to the contacts included in the relation block. PLC 제어 프로그램을 구조체 데이터로 변환하는 방법.How to convert PLC control program into structure data. 제14항에 있어서,The method of claim 14, 상기 (c) 단계는, 상기 관계블록 내의 OR 관계로 결합되어 있는 내부 요소들을 구분하고, 상기 관계블록에 대해 정의된 상기 데이터 필드를 바탕으로 상기 내부 요소들에 포함된 적어도 하나의 입력 접점 또는 출력 접점의 상기 데이터 필드를 정의하는 단계를 포함하는 것을 특징으로 하는,In step (c), the internal elements coupled in the OR relationship in the relationship block are distinguished, and at least one input contact or output included in the internal elements based on the data field defined for the relationship block. Defining the data field of a contact; PLC 제어 프로그램을 구조체 데이터로 변환하는 방법.How to convert PLC control program into structure data. 제14항에 있어서,The method of claim 14, 상기 (c) 단계는, 상기 관계블록에 포함된 접점들에 대하여 정의된 상기 데이터 필드를 바탕으로, 해당 관계블록의 이전 또는 다음의 입력 접점 또는 출력 접점의 상기 데이터 필드를 재정의하는 단계를 포함하는 것을 특징으로 하는,The step (c) includes the step of redefining the data field of the previous or next input contact or output contact of the relation block based on the data field defined for the contacts included in the relation block. Characterized in that, PLC 제어 프로그램을 구조체 데이터로 변환하는 방법.How to convert PLC control program into structure data.
PCT/KR2017/008728 2016-08-12 2017-08-11 Apparatus and method for converting plc control program into structured data Ceased WO2018030831A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201780049616.XA CN109643100B (en) 2016-08-12 2017-08-11 Apparatus and method for converting PLC control program into structured data

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
KR10-2016-0102809 2016-08-12
KR20160102809 2016-08-12
KR10-2017-0101465 2017-08-10
KR1020170101465A KR102004456B1 (en) 2016-08-12 2017-08-10 Apparatus and method for transforming PLC control program into structured data

Publications (1)

Publication Number Publication Date
WO2018030831A1 true WO2018030831A1 (en) 2018-02-15

Family

ID=61163218

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/KR2017/008728 Ceased WO2018030831A1 (en) 2016-08-12 2017-08-11 Apparatus and method for converting plc control program into structured data

Country Status (1)

Country Link
WO (1) WO2018030831A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110704396A (en) * 2019-09-26 2020-01-17 中国人民解放军军事科学院军事医学研究院 Method for establishing poison information base, information retrieval method and device and electronic equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100904557B1 (en) * 2008-11-20 2009-06-25 주식회사 이글루시큐리티 Heterogeneous firewall integrated management system and method
JP2010020635A (en) * 2008-07-11 2010-01-28 Nippon Reliance Kk Programming language conversion apparatus, conversion method and conversion program
KR20120095513A (en) * 2011-02-21 2012-08-29 성균관대학교산학협력단 Method and framework system for converting plc based control code to a general program code using xml interface
JP2013161106A (en) * 2012-02-01 2013-08-19 Omron Corp Support device and support program
KR101627769B1 (en) * 2015-12-17 2016-06-08 주식회사 유디엠텍 Apparatus and method of transforming text type of plc control program into common type of plc control program

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010020635A (en) * 2008-07-11 2010-01-28 Nippon Reliance Kk Programming language conversion apparatus, conversion method and conversion program
KR100904557B1 (en) * 2008-11-20 2009-06-25 주식회사 이글루시큐리티 Heterogeneous firewall integrated management system and method
KR20120095513A (en) * 2011-02-21 2012-08-29 성균관대학교산학협력단 Method and framework system for converting plc based control code to a general program code using xml interface
JP2013161106A (en) * 2012-02-01 2013-08-19 Omron Corp Support device and support program
KR101627769B1 (en) * 2015-12-17 2016-06-08 주식회사 유디엠텍 Apparatus and method of transforming text type of plc control program into common type of plc control program

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110704396A (en) * 2019-09-26 2020-01-17 中国人民解放军军事科学院军事医学研究院 Method for establishing poison information base, information retrieval method and device and electronic equipment

Similar Documents

Publication Publication Date Title
WO2017104934A1 (en) Device and method for common type conversion of plc control program
WO2021215730A1 (en) Computer program, method, and device for generating virtual defect image by using artificial intelligence model generated on basis of user input
WO2014025186A1 (en) Method for providing message function and electronic device thereof
WO2016186463A1 (en) Method for launching a second application using a first application icon in an electronic device
WO2023153821A1 (en) Method of compressing neural network model and electronic apparatus for performing the same
WO2020032655A1 (en) Method for executing function based on voice and electronic device supporting the same
WO2010087635A2 (en) Method and apparatus for processing user interface composed of component objects
WO2014189236A1 (en) Lossless image compression and restoration method and apparatus performing same
WO2017111197A1 (en) Big data visualisation system and method in learning analysis
WO2016056856A1 (en) Method and system for generating integrity verification data
WO2022131521A1 (en) Input device comprising touchscreen, and operation method of same
WO2018030831A1 (en) Apparatus and method for converting plc control program into structured data
WO2014010819A1 (en) Method of implementing structured and non-structured data in xml document
WO2022080659A1 (en) Electronic device and control method therefor
WO2019172613A1 (en) Method and electronic device for displaying web page
WO2023158133A1 (en) Method and computer program for providing editing interface for translated content
WO2020213885A1 (en) Server and control method thereof
WO2022203381A1 (en) Integrated user interface platform development system and method of single-page application type
WO2021002724A1 (en) Electronic apparatus and control method thereof
WO2021194089A1 (en) Method for changing graphical user interface of circuit block, and computer-readable storage medium having recorded thereon program including instructions for carrying out each step according to method for changing graphical user interface of circuit block
EP4649445A1 (en) Method performed by electronic apparatus, electronic apparatus and storage medium for inpainting
WO2024172305A1 (en) Product inspection system control method
WO2017094967A1 (en) Natural language processing schema and method and system for establishing knowledge database therefor
WO2023128424A1 (en) Electronic apparatus for analyzing application screen, and operating method therefor
WO2015102266A1 (en) Processor and method of controlling the same

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17839848

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 28.06.2019)

122 Ep: pct application non-entry in european phase

Ref document number: 17839848

Country of ref document: EP

Kind code of ref document: A1