JP2010020635A - Programming language conversion apparatus, conversion method and conversion program - Google Patents

Programming language conversion apparatus, conversion method and conversion program Download PDF

Info

Publication number
JP2010020635A
JP2010020635A JP2008181929A JP2008181929A JP2010020635A JP 2010020635 A JP2010020635 A JP 2010020635A JP 2008181929 A JP2008181929 A JP 2008181929A JP 2008181929 A JP2008181929 A JP 2008181929A JP 2010020635 A JP2010020635 A JP 2010020635A
Authority
JP
Japan
Prior art keywords
program
fbd
functional block
ladder
functional
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.)
Withdrawn
Application number
JP2008181929A
Other languages
Japanese (ja)
Inventor
Nobuyuki Kondo
信幸 近藤
Masazumi Yoshino
正純 吉野
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.)
Reliance Electric Ltd
Original Assignee
Reliance Electric Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Reliance Electric Ltd filed Critical Reliance Electric Ltd
Priority to JP2008181929A priority Critical patent/JP2010020635A/en
Publication of JP2010020635A publication Critical patent/JP2010020635A/en
Withdrawn legal-status Critical Current

Links

Images

Landscapes

  • Programmable Controllers (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To reduce the load of, increase the reliability of and generalize the conversion of an LD program for use in a PLC, or the like, into an FBD program. <P>SOLUTION: A function block extracting part 31 extracts function blocks from LD program data (XML document) 23, to generate hierarchical structure data of the function blocks (step S402). With the hierarchical structure data of the function blocks, an LD/FBD conversion part 32 converts an LD program into an FBD program in each function block, to generate FBD parts of each function block (step S403). An FBD program generating part 33 connects the FBD parts of each function block, to generate FBD program data (XML document) 24 (step S404). <P>COPYRIGHT: (C)2010,JPO&INPIT

Description

本発明は、PLC(Programmable Logic Controller:プログラマブルロジックコントローラ)等に用いるプログラミング言語の変換装置、変換方法及び変換プログラムに関し、特に、LD(Ladder Diagram)言語で記述されたLDプログラムをFBD(Function Block Diagram)言語で記述されたFBDプログラムに変換する技術に関する。   The present invention relates to a programming language conversion device, a conversion method, and a conversion program used in a PLC (Programmable Logic Controller: Programmable Logic Controller) and the like. ) It relates to a technique for converting to an FBD program written in a language.

従来、PLCやモーションコントローラ等の制御装置を動作させるためのプログラムとして、LD言語により記述されたLDプログラムが用いられている。このLDプログラムは、制御装置によって制御対象を制御するための手順が示されており、シーケンス制御専用のプログラマブル言語である、いわゆるラダーによって記述されたプログラムであり、パーソナルコンピュータや専用のプログラミング装置を用いて設計及び製作される。   Conventionally, an LD program written in an LD language is used as a program for operating a control device such as a PLC or a motion controller. This LD program shows a procedure for controlling a controlled object by a control device, and is a program described by a so-called ladder, which is a programmable language dedicated to sequence control, using a personal computer or a dedicated programming device. Designed and manufactured.

しかしながら、LDプログラムは、ラダーの仕様が制御装置メーカ間で統一されておらず、プログラミングを行うためには特殊な知識や経験が必要になることから、その扱いが特殊であり容易ではない。そこで、このようなLDプログラムの特殊性を緩和して扱いが容易になるように、例えば、WWWブラウザからLDプログラムを設計及び製作することができる仕組みや(特許文献1,2を参照)、ラダーだけでなくC言語等の汎用言語を用いてプログラミングを行う仕組み(特許文献3を参照)など、様々な技術が開発されている。   However, the LD program is not easy because the specifications of the ladder are not uniform among the control device manufacturers, and special knowledge and experience are required for programming. Therefore, in order to ease the handling by reducing the particularity of such LD programs, for example, a mechanism that can design and produce LD programs from a WWW browser (see Patent Documents 1 and 2), a ladder In addition, various techniques have been developed, such as a mechanism for performing programming using a general-purpose language such as C language (see Patent Document 3).

一方、IEC(International Electrotechnical Commission)により、PLC等の制御装置に用いるプログラミング言語として、FBDの標準規格が検討されてきている。このFBDにより記述されたFBDプログラムは、図形を用いたグラフィカルなプログラムである。また、FBDは、一般に、ラダーに比べて構造化及びモジュール化に有利であることから、ラダーに代わる言語として期待されている。   On the other hand, the FBD standard has been studied as a programming language used for a control device such as a PLC by IEC (International Electrotechnical Commission). The FBD program described by this FBD is a graphical program using graphics. In addition, FBD is generally expected to be an alternative language to ladders because it is more advantageous for structuring and modularization than ladders.

しかしながら、PLC等の制御装置の分野では、従来から使い慣れているラダーを用いてLDプログラムを設計及び製作するのが一般的である。このため、構造化及びモジュール化の利点を有効に活用するためには、設計及び製作したプログラム成果物であるLDプログラムを、FBDプログラムへ移行させる必要がある。   However, in the field of control devices such as PLCs, it is common to design and manufacture LD programs using ladders that have been used to date. For this reason, in order to effectively utilize the advantages of structuring and modularization, it is necessary to transfer the LD program, which is the designed and produced program product, to the FBD program.

特開2004−46618号公報JP 2004-46618 A 特開2002−189508号公報JP 2002-189508 A 特開2007−334469号公報JP 2007-334469 A

従来、LDプログラムからFBDプログラムへの移行は、設計者がLDプログラムを解析し、FBDプログラムへ変換するという手作業によって行われていた。このため、変換作業に多大な時間がかかり手間になっていた。また、手作業では変換過程の中でミスが生じる可能性があることから、LDプログラムからFBDプログラムへの変換が必ずしも正確に行われるとは限らず、信頼性の面で不安があった。   Conventionally, a transition from an LD program to an FBD program has been performed manually by a designer analyzing the LD program and converting it into an FBD program. For this reason, the conversion work takes a lot of time and effort. In addition, since manual operation may cause mistakes in the conversion process, conversion from the LD program to the FBD program is not always performed accurately, and there is anxiety in terms of reliability.

また、前述したように、ラダーの仕様は、制御装置メーカ間で統一されていないことから、LDプログラムからFBDプログラムへの変換作業は、統一して行うことができない。このため、可能な限り汎用的な変換作業ができることが望まれていた。   Further, as described above, since the specifications of the ladder are not unified among the control device manufacturers, the conversion work from the LD program to the FBD program cannot be performed uniformly. For this reason, it has been desired that general-purpose conversion work can be performed as much as possible.

そこで、本発明は上記課題を解決するためになされたものであり、その目的は、PLC等に用いるLDプログラムをFBDプログラムに変換する際に、変換作業の負荷を軽減すると共に信頼性を高め、かつ汎用性を実現可能なプログラミング言語変換装置、変換方法及び変換プログラムを提供することにある。   Therefore, the present invention has been made to solve the above problems, and its purpose is to reduce the load of conversion work and improve the reliability when converting an LD program used for a PLC or the like into an FBD program, Another object of the present invention is to provide a programming language conversion device, a conversion method, and a conversion program capable of realizing versatility.

上記目的を達成するために、本発明によるプログラミング言語変換装置は、複数の変数を組み合わせて所定のシーケンス処理を実現するLDプログラムをFBDプログラムに変換するプログラミング言語変換装置において、マークアップ言語で表現したLDプログラムから、互いに共通する前記変数を有するラダー群からなる機能ブロックを抽出し、前記抽出した機能ブロックから、さらに互いに共通する前記変数を有するラダー群からなる下層の機能ブロックを階層的に順次抽出し、階層構造データを生成する機能ブロック抽出部と、前記機能ブロック抽出部により生成された階層構造データを用いて、前記機能ブロック毎に、その機能ブロックのLDプログラムを構成するLD機能要素を、FBDプログラムを構成するFB機能要素に置き替え、前記機能ブロック毎のFBD部品を生成するLD/FBD変換部と、前記LD/FBD変換部により生成された機能ブロック毎のFBD部品間を配線し、マークアップ言語で表現したFBDプログラムを生成するFBDプログラム生成部と、を備えたことを特徴とする。   To achieve the above object, a programming language conversion apparatus according to the present invention is expressed in a markup language in a programming language conversion apparatus that converts an LD program that realizes a predetermined sequence process by combining a plurality of variables into an FBD program. From the LD program, a functional block consisting of a ladder group having the common variables is extracted, and a lower layer functional block consisting of a ladder group having the common variables is extracted sequentially from the extracted functional blocks. A functional block extraction unit that generates hierarchical structure data, and an LD functional element that constitutes an LD program of the functional block for each functional block using the hierarchical structure data generated by the functional block extraction unit, It is placed in the FB function element that constitutes the FBD program. In addition, an LD / FBD conversion unit that generates an FBD part for each functional block and an FBD part for each functional block generated by the LD / FBD conversion unit are wired to generate an FBD program expressed in a markup language. And an FBD program generation unit.

また、本発明によるプログラミング言語変換方法は、複数の変数を組み合わせて所定のシーケンス処理を実現するLDプログラムをFBDプログラムに変換するプログラミング言語変換方法において、マークアップ言語で表現したLDプログラムから、互いに共通する前記変数を有するラダー群からなる機能ブロックを抽出する第1のステップと、前記第1のステップにより抽出した機能ブロックから、さらに互いに共通する前記変数を有するラダー群からなる下層の機能ブロックを階層的に順次抽出する第2のステップと、前記第1のステップ及び第2のステップを繰り返すことにより、階層構造データを生成する第3のステップと、前記第3のステップにより生成した階層構造データを用いて、前記機能ブロック毎に、その機能ブロックのLDプログラムを構成するLD機能要素を、FBDプログラムを構成するFB機能要素に置き替え、前記機能ブロック毎のFBD部品を生成する第4のステップと、前記第4のステップにより生成した機能ブロック毎のFBD部品間を配線し、マークアップ言語で表現したFBDプログラムを生成する第5のステップと、を有することを特徴とする。   The programming language conversion method according to the present invention is a programming language conversion method for converting an LD program that realizes a predetermined sequence process by combining a plurality of variables into an FBD program. A first step of extracting a functional block consisting of a ladder group having the variable to be performed, and a lower-level functional block consisting of a ladder group having the variable common to each other from the functional block extracted by the first step. The second step of sequential extraction, the third step of generating hierarchical structure data by repeating the first step and the second step, and the hierarchical structure data generated by the third step. Use for each functional block, its functional block The LD function element constituting the LD program is replaced with the FB function element constituting the FBD program, and a fourth step for generating an FBD part for each functional block, and for each functional block generated by the fourth step And a fifth step of generating an FBD program expressed by a markup language by wiring between FBD parts.

また、本発明によるプログラミング言語変換方法は、前記第1のステップが、マークアップ言語で表現したLDプログラムのうちの基準となるラダーを選択し、前記基準となるラダーの変数を使用している他のラダーを特定し、前記他のラダーを機能ブロックとして抽出し、前記第2のステップが、前記第1のステップにより抽出した機能ブロックから、前記基準となるラダーの入力変数を出力変数として使用しているラダーを、新たに基準となるラダーとして選択し、前記新たに基準となるラダーの変数を使用している他のラダーを特定し、前記他のラダーを下層の機能ブロックとして抽出し、前記新たに基準となるラダーの選択及び下層の機能ブロックの抽出を階層的に行う、ことを特徴とする。   In the programming language conversion method according to the present invention, the first step selects a reference ladder among LD programs expressed in a markup language, and uses a variable of the reference ladder. The other ladder is extracted as a functional block, and the second step uses the input variable of the reference ladder as an output variable from the functional block extracted in the first step. Select the ladder as a new reference ladder, specify another ladder that uses the variable of the new reference ladder, extract the other ladder as a lower-level functional block, and It is characterized in that selection of a new ladder as a reference and extraction of functional blocks in a lower layer are performed hierarchically.

また、本発明によるプログラミング言語変換方法は、前記第4のステップが、前記第3のステップにより生成した階層構造データから、下層の機能ブロックを選択し、前記下層の機能ブロック毎に、その機能ブロックのLDプログラムを構成するLD機能要素を、FBDプログラムを構成するFB機能要素に置き替えてFB図を生成し、前記FB図から入力変数、出力変数及び一次遅れ変数を設定すると共に、画面表示を隠蔽する変数を設定し、前記機能ブロック毎のFBD部品を生成する、ことを特徴とする。   In the programming language conversion method according to the present invention, the fourth step selects a lower-level functional block from the hierarchical structure data generated by the third step, and the function block is selected for each lower-level functional block. The LD function elements constituting the LD program are replaced with the FB function elements constituting the FBD program to generate an FB diagram, and input variables, output variables, and first-order lag variables are set from the FB diagram, and screen display is performed. A variable to be concealed is set, and an FBD part for each functional block is generated.

また、本発明によるプログラミング言語変換方法は、前記第5のステップが、前記第4のステップにより生成した機能ブロック毎のFBD部品間を、前記設定した入力変数、出力変数及び一次遅れ変数に基づいて配線し、マークアップ言語で表現したFBDプログラムを生成する、ことを特徴とする。   Further, in the programming language conversion method according to the present invention, the fifth step is based on the set input variable, output variable, and first order lag variable between the FBD parts for each functional block generated by the fourth step. An FBD program that is wired and expressed in a markup language is generated.

また、本発明によるプログラミング言語変換プログラムは、複数の変数を組み合わせて所定のシーケンス処理を実現するLDプログラムをFBDプログラムに変換するプログラミング言語変換プログラムであって、コンピュータに、マークアップ言語で表現したLDプログラムから、互いに共通する前記変数を有するラダー群からなる機能ブロックを抽出する処理と、前記抽出した機能ブロックから、さらに互いに共通する前記変数を有するラダー群からなる下層の機能ブロックを階層的に順次抽出する処理と、前記抽出する処理を繰り返すことにより、階層構造データを生成する処理と、前記生成した階層構造データを用いて、前記機能ブロック毎に、その機能ブロックのLDプログラムを構成するLD機能要素を、FBDプログラムを構成するFB機能要素に置き替え、前記機能ブロック毎のFBD部品を生成する処理と、前記生成した機能ブロック毎のFBD部品間を配線し、マークアップ言語で表現したFBDプログラムを生成する処理と、を実行させることを特徴とする。   A programming language conversion program according to the present invention is a programming language conversion program that converts an LD program that realizes a predetermined sequence process by combining a plurality of variables into an FBD program, and is an LD expressed in a markup language on a computer. A process for extracting a functional block consisting of a ladder group having the same variable from the program, and a hierarchically lower functional block consisting of a ladder group having the common variable from the extracted functional block. An extraction function, a process of generating hierarchical structure data by repeating the extraction process, and an LD function that constitutes an LD program of the functional block for each functional block using the generated hierarchical structure data Elements, FBD programs Replacing the FB functional element to generate an FBD part for each functional block, and processing for generating an FBD program expressed in a markup language by wiring between the generated FBD parts for each functional block. It is made to perform.

以上説明したように、本発明によれば、PLC等に用いるLDプログラムをFBDプログラムに変換する際に、変換作業の負荷を軽減すると共に信頼性を高め、かつ汎用性を実現することが可能となる。   As described above, according to the present invention, when an LD program used for a PLC or the like is converted into an FBD program, it is possible to reduce the load of conversion work, improve reliability, and realize versatility. Become.

以下、本発明を実施するための最良の形態について、図面を参照して説明する。
まず、本発明の概要について説明する。本発明は、XML(eXtensible Markup Language)等のマークアップ言語で表現したLDプログラムを、XML等のマークアップ言語で表現したFBDプログラムに変換する仕組みに特徴がある。
The best mode for carrying out the present invention will be described below with reference to the drawings.
First, an outline of the present invention will be described. The present invention is characterized by a mechanism for converting an LD program expressed in a markup language such as XML (extensible Markup Language) into an FBD program expressed in a markup language such as XML.

図1は、変換元のLDプログラムから変換先のFBDプログラムへの変換処理について、一連の流れを説明する図である。図1において、変換元LDプログラムを変換先FBDプログラムに変換する一連の流れの中で、XML文書が介在している。すなわち、本発明の実施形態は、変換作業の一連の流れの中でXML文書を介在させる処理、すなわち、XMLで表現したLDプログラムを、XMLで表現したFBDプログラムに変換する処理(変換処理S2)に特徴がある。   FIG. 1 is a diagram for explaining a series of flows for conversion processing from a conversion source LD program to a conversion destination FBD program. In FIG. 1, an XML document is interposed in a series of flows for converting a conversion source LD program into a conversion destination FBD program. That is, according to the embodiment of the present invention, a process of interposing an XML document in a series of conversion operations, that is, a process of converting an LD program expressed in XML into an FBD program expressed in XML (conversion process S2). There is a feature.

変換元LDプログラムは、制御装置メーカが独自に提供するLD言語の仕様に従って生成されたプログラムである。この変換元LDプログラムは、画一的な仕様の下で生成されたものではないから、制御装置メーカによって異なるプログラムとなる。   The conversion source LD program is a program generated in accordance with the specification of the LD language provided uniquely by the control device manufacturer. Since this conversion source LD program is not generated under uniform specifications, the conversion source LD program differs depending on the control device manufacturer.

XMLで表現したLDプログラムは、変換元LDプログラムを、所定の変換処理S1によって変換したプログラムである。ここで、変換元LDプログラムが制御装置メーカによって異なるプログラムであるから、変換処理S1も、変換元LDプログラムの種類によって異なる処理となる。しかし、XMLで表現したLDプログラムは、変換元LDプログラム及び変換処理S1とは異なり、統一され画一的な表現形態のプログラムである。例えば、XMLで表現したLDプログラムαが、ある制御装置メーカの仕様による変換元LDプログラムから変換されたプログラムとし、XMLで表現したLDプログラムβが、他の制御装置メーカの仕様による変換元LDプログラムから変換されたプログラムであるとする。この場合、両者の変換元LDプログラムが同じ動作を実現するプログラムであって、表現形態のみが異なるときには、XMLで表現したLDプログラムαとXMLで表現したLDプログラムβとは同一の表現形態となり、同一のプログラムとなる。   The LD program expressed in XML is a program obtained by converting the conversion source LD program by a predetermined conversion process S1. Here, since the conversion source LD program is different depending on the manufacturer of the control device, the conversion process S1 is also different depending on the type of the conversion source LD program. However, unlike the conversion source LD program and the conversion process S1, the LD program expressed in XML is a unified and uniform expression form program. For example, an LD program α expressed in XML is a program converted from a conversion source LD program according to specifications of a certain control device manufacturer, and an LD program β expressed in XML is a conversion source LD program according to specifications of another control device manufacturer. Suppose the program is converted from. In this case, when both conversion source LD programs realize the same operation and only the expression form is different, the LD program α expressed in XML and the LD program β expressed in XML have the same expression form. The same program.

XMLで表現したFBDプログラムは、XMLで表現したLDプログラムを本発明の実施形態による変換処理S2によって変換したプログラムである。ここで、XMLで表現したLDプログラムは、統一され画一的な表現形態のプログラムであるから、XMLで表現したFBDプログラムも、統一され画一的な表現形態のプログラムである。   The FBD program expressed in XML is a program obtained by converting the LD program expressed in XML by the conversion process S2 according to the embodiment of the present invention. Here, since the LD program expressed in XML is a unified and uniform expression form program, the FBD program expressed in XML is also a unified and uniform expression form program.

変換先FBDプログラムは、XMLで表現したFBDプログラムを、所定の変換処理S3によって変換したプログラムである。ここで、変換先FBDプログラムは、制御装置メーカが独自に提供するFBD言語に従って生成されるFBDプログラムである。したがって、この変換先FBDプログラムは、画一的な仕様の下で生成されるものではないから、制御装置メーカによって異なるプログラムとなり、変換処理S3も、変換先FBDプログラムの種類によって異なる処理となる。   The conversion destination FBD program is a program obtained by converting an FBD program expressed in XML by a predetermined conversion process S3. Here, the conversion destination FBD program is an FBD program generated according to the FBD language uniquely provided by the control device manufacturer. Therefore, since this conversion destination FBD program is not generated under uniform specifications, it becomes a program that differs depending on the control device manufacturer, and the conversion process S3 also differs depending on the type of the conversion destination FBD program.

このように、本発明の実施形態では、制御装置メーカによって異なる変換元LDプログラムを、制御装置メータによって異なる変換先FBDプログラムに変換する一連の流れの中で、XML文書を介在させる。具体的には、変換元LDプログラムを、共通仕様による表現形態のLDプログラムに変換し(変換処理S1)、そして、共通仕様による表現形態のFBDプログラムに変換し(変換処理S2)、さらに、変換先FBDプログラムに変換するようにした(変換処理S3)。この変換処理S2は、制御装置メーカ間で異なることのない画一的な処理として規定することができるから、全体の流れの中で、汎用的に使用することができる。   As described above, in the embodiment of the present invention, an XML document is interposed in a series of flows for converting a conversion source LD program that differs depending on the control device manufacturer into a conversion destination FBD program that is different depending on the control device meter. Specifically, the conversion source LD program is converted into an LD program having an expression form according to a common specification (conversion process S1), and then converted into an FBD program having an expression form according to a common specification (conversion process S2). Conversion into the previous FBD program is performed (conversion processing S3). Since this conversion process S2 can be defined as a uniform process that does not differ between control device manufacturers, it can be used universally in the overall flow.

〔PLCプログラミング言語変換装置の構成〕
次に、本発明の実施形態によるPLCプログラミング言語変換装置の構成について説明する。図2は、本発明の実施形態によるPLCプログラミング言語変換装置のハードウェア構成を示すブロック図であり、図3は、図2に示すPLCプログラミング言語変換装置の機能構成を示すブロック図である。このPLCプログラミング言語変換装置1は、XMLで表現したLDプログラムを、XMLで表現したFBDプログラムに変換する装置である。尚、XMLで表現したLDプログラムは、図1に示した変換処理S1により、変換元LDプログラムから予め変換されているものとする。
[Configuration of PLC programming language converter]
Next, the configuration of the PLC programming language conversion device according to the embodiment of the present invention will be described. FIG. 2 is a block diagram showing a hardware configuration of a PLC programming language conversion device according to an embodiment of the present invention, and FIG. 3 is a block diagram showing a functional configuration of the PLC programming language conversion device shown in FIG. The PLC programming language conversion device 1 is a device that converts an LD program expressed in XML into an FBD program expressed in XML. Note that the LD program expressed in XML is preliminarily converted from the conversion source LD program by the conversion processing S1 shown in FIG.

図2を参照して、このPLCプログラミング言語変換装置1は、例えばパーソナルコンピュータであり、CPU10、RAM11、ROM12、HD(ハードディスク)13、通信インタフェース14、表示インタフェース15及び操作インタフェース16を備えている。CPU10は、RAM11及びROM12を含めて制御部30を構成し、制御部30によってPLCプログラミング言語変換装置1全体が統括制御される。RAM11は、各種プログラムやデータ等を一時的に記憶する書き換え可能な記憶部であり、ROM12には、CPU10による基本的な処理を実行するためのプログラム及びデータ等が予め記憶されている記憶部である。   Referring to FIG. 2, the PLC programming language conversion device 1 is a personal computer, for example, and includes a CPU 10, a RAM 11, a ROM 12, an HD (hard disk) 13, a communication interface 14, a display interface 15, and an operation interface 16. The CPU 10 includes a RAM 11 and a ROM 12 to form a control unit 30, and the entire PLC programming language conversion device 1 is controlled by the control unit 30. The RAM 11 is a rewritable storage unit that temporarily stores various programs, data, and the like. The ROM 12 is a storage unit that stores programs and data for executing basic processing by the CPU 10 in advance. is there.

通信インタフェース14は、図示しないインターネット等の通信ネットワークを介して他のコンピュータやサーバ等との間で通信を行う。表示インタフェース15は、画面表示用のデータを制御部30から入力し、例えば、XMLで表現したLDプログラム及びXMLで表現したFBDプログラム等を表示装置2に出力する。操作インタフェース16は、オペレータによるキーボード3及びマウス4の操作に従って、操作データを制御部30に出力する。   The communication interface 14 communicates with other computers or servers via a communication network such as the Internet (not shown). The display interface 15 receives screen display data from the control unit 30 and outputs, for example, an LD program expressed in XML, an FBD program expressed in XML, and the like to the display device 2. The operation interface 16 outputs operation data to the control unit 30 according to the operation of the keyboard 3 and the mouse 4 by the operator.

HD13は、OS(オペレーティングシステム)20、画面制御プログラム21、言語変換プログラム22、LDプログラムデータ(XML文書)23及びFBDプログラムデータ(XML文書)24等を記憶する記憶部である。ここで、LDプログラムデータ(XML文書)23は、XMLで表現したLDプログラムであり、FBDプログラムデータ(XML文書)24は、XMLで表現したFBDプログラムである。   The HD 13 is a storage unit that stores an OS (Operating System) 20, a screen control program 21, a language conversion program 22, an LD program data (XML document) 23, an FBD program data (XML document) 24, and the like. Here, the LD program data (XML document) 23 is an LD program expressed in XML, and the FBD program data (XML document) 24 is an FBD program expressed in XML.

OS20は、PLCプログラミング言語変換装置1をコンピュータとして動作させるための基本的な機能を提供するプログラムである。画面制御プログラム21は、XMLで表現したLDプログラム及びXMLで表現したFBDプログラムを表示装置2に表示したり、オペレータによるキーボード3及びマウス4の操作に従って、必要なデータを表示装置2に表示したり等、表示装置2の画面にデータを表示する表示インタフェース15を制御するプログラムである。   The OS 20 is a program that provides basic functions for causing the PLC programming language conversion device 1 to operate as a computer. The screen control program 21 displays the LD program expressed in XML and the FBD program expressed in XML on the display device 2, or displays necessary data on the display device 2 according to the operation of the keyboard 3 and the mouse 4 by the operator. For example, the program controls the display interface 15 that displays data on the screen of the display device 2.

言語変換プログラム22は、HD13に記憶されたLDプログラムデータ(XML文書)23を読み出し、後述する言語変換処理を行い、FBDプログラムデータ(XML文書)24を生成してHD13に格納するプログラムである。   The language conversion program 22 is a program that reads the LD program data (XML document) 23 stored in the HD 13, performs language conversion processing to be described later, generates FBD program data (XML document) 24, and stores it in the HD 13.

また、OS20は、CPU10によって読み出されて実行されることにより、コンピュータの基本的な機能として、RAM11、ROM12及びHD13のメモリ管理に関する機能、通信インタフェース14の通信制御に関する機能、表示インタフェース15の表示制御に関する機能、操作インタフェース16の操作入力制御に関する機能等を実現する。そして、このOS20がCPU10によって実行された状態で、言語変換プログラム22等が実行される。   The OS 20 is read and executed by the CPU 10, so that the basic functions of the computer are functions related to memory management of the RAM 11, ROM 12 and HD 13, functions related to communication control of the communication interface 14, and display of the display interface 15. Functions related to control, functions related to operation input control of the operation interface 16, and the like are realized. Then, the language conversion program 22 and the like are executed in a state where the OS 20 is executed by the CPU 10.

尚、OS20、画面制御プログラム21、言語変換プログラム22等は、例えば、図示しない通信ネットワークに接続されたサーバ等からネットワークケーブルを介してHD13にダウンロードされるようにしてもよく、また、CD−ROM等の記憶媒体に記憶してから当該記憶媒体を介して、HD13に読み込まれるようにしてもよい。   The OS 20, the screen control program 21, the language conversion program 22 and the like may be downloaded to the HD 13 via a network cable from a server or the like connected to a communication network (not shown), or a CD-ROM. Or the like, and then read into the HD 13 via the storage medium.

制御部30は、前述したとおり、CPU10、RAM11及びROM12により構成され、CPU10がHD13に記憶された言語変換プログラム22をRAM11に読み出して実行することにより、図3に示すような機能構成となる。   As described above, the control unit 30 includes the CPU 10, the RAM 11, and the ROM 12, and the CPU 10 reads out the language conversion program 22 stored in the HD 13 to the RAM 11 and executes the language conversion program 22, thereby having a functional configuration as shown in FIG.

すなわち、図2に示した制御部30が言語変換プログラム22を実行することにより、PLCプログラミング言語変換装置1は、図3に示すように、機能ブロック抽出部31、LD/FBD変換部32及びFBDプログラム生成部33を備えることになる。   That is, when the control unit 30 shown in FIG. 2 executes the language conversion program 22, the PLC programming language conversion device 1 has a function block extraction unit 31, an LD / FBD conversion unit 32, and an FBD as shown in FIG. The program generation unit 33 is provided.

〔PLCプログラミング言語変換装置の処理〕
次に、図2及び図3に示したPLCプログラミング言語変換装置1の処理について説明する。図4は、PLCプログラミング言語変換装置1による言語変換処理の全体の流れを示すフローチャートである。
[Processing of PLC programming language converter]
Next, processing of the PLC programming language conversion device 1 shown in FIGS. 2 and 3 will be described. FIG. 4 is a flowchart showing an overall flow of the language conversion processing by the PLC programming language conversion device 1.

まず、PLCプログラミング言語変換装置1の機能ブロック抽出部31は、HD13からLDプログラムデータ(XML文書)23を読み出し(ステップS401)、LDプログラムデータ(XML文書)23から機能ブロックを抽出し、機能ブロックによる階層構造データを生成する(ステップS402)。   First, the functional block extraction unit 31 of the PLC programming language conversion device 1 reads the LD program data (XML document) 23 from the HD 13 (step S401), extracts the functional block from the LD program data (XML document) 23, and outputs the functional block. Is generated (step S402).

LD/FBD変換部32は、機能ブロック抽出部31により生成された、機能ブロックによる階層構造データを入力し、機能ブロック毎にLDプログラムをFBDプログラムに変換し、機能ブロック毎のFBD部品を生成する(ステップS403)。   The LD / FBD conversion unit 32 inputs the hierarchical structure data by the functional block generated by the functional block extraction unit 31, converts the LD program into an FBD program for each functional block, and generates an FBD component for each functional block. (Step S403).

FBDプログラム生成部33は、LD/FBD変換部32により生成された、機能ブロック毎のFBD部品を入力し、機能ブロック毎のFBD部品どうしを配線し、FBDプログラムデータ(XML文書)24を生成する(ステップS404)。そして、FBDプログラム生成部33は、FBDプログラムデータ(XML文書)24をHD13に格納する(ステップS405)。これにより、言語変換処理が終了する。   The FBD program generation unit 33 inputs FBD parts for each functional block generated by the LD / FBD conversion unit 32, connects the FBD parts for each functional block, and generates FBD program data (XML document) 24. (Step S404). Then, the FBD program generation unit 33 stores the FBD program data (XML document) 24 in the HD 13 (step S405). Thereby, the language conversion process ends.

〔機能ブロック化及び階層構造生成処理〕
次に、図4に示したステップS402の機能ブロック化及び階層構造生成処理について詳細に説明する。図5は、機能ブロック化及び階層構造生成処理を示すフローチャートである。機能ブロック抽出部31は、図5に示す処理により、LDプログラムデータ(XML文書)23から機能ブロックを抽出し、階層構造データを生成する。
[Function block and hierarchical structure generation processing]
Next, the functional blockization and hierarchical structure generation processing in step S402 shown in FIG. 4 will be described in detail. FIG. 5 is a flowchart showing functional blockization and hierarchical structure generation processing. The functional block extraction unit 31 extracts functional blocks from the LD program data (XML document) 23 by the processing shown in FIG. 5, and generates hierarchical structure data.

図6は、HD13から読み出されたLDプログラムデータ(XML文書)23の一部を、ラダーの形態にて表現した図であり、オリジナルのLDプログラムを示している。尚、このLDプログラムは、以下の説明を簡単にするために、LDプログラムデータ(XML文書)23をラダーの形態にて便宜的に表現したものである。後述する図7、図8、図11及び図12につても同様である。図6において、左端の100〜160は、LDプログラムデータ(XML文書)23を構成する複数のラダーのうち、1行のラダーのラダー番号を示している。a4,b1,b2,b等は各要素の入出力アドレスを示しており、各記号は、要素の種類(a接点、b接点、コイル等)を示している。以下、説明を簡単にするため、a4,b1,b2,b等を、入出力状態が反映される変数として扱う。例えば、a4,b1,b2は入力変数であり、bは出力変数である。以下、図6に示すLDプログラムデータ(XML文書)23の例を参照して説明する。   FIG. 6 is a diagram representing a part of the LD program data (XML document) 23 read from the HD 13 in the form of a ladder, and shows the original LD program. This LD program expresses LD program data (XML document) 23 in a ladder form for the sake of simplicity. The same applies to FIG. 7, FIG. 8, FIG. 11 and FIG. In FIG. 6, reference numerals 100 to 160 on the left end indicate ladder numbers of ladders in one line among a plurality of ladders constituting the LD program data (XML document) 23. a4, b1, b2, b, etc. indicate the input / output addresses of each element, and each symbol indicates the type of element (a contact, b contact, coil, etc.). Hereinafter, in order to simplify the description, a4, b1, b2, b, etc. are treated as variables reflecting the input / output state. For example, a4, b1, and b2 are input variables, and b is an output variable. Hereinafter, description will be given with reference to an example of the LD program data (XML document) 23 shown in FIG.

まず、機能ブロック抽出部31は、HD13から読み出したLDプログラムデータ(XML文書)23について、基準となるラダーが1行のみ存在するか否かを判定する(ステップS501)。基準となるラダーが1行のみ存在すると判定した場合(ステップS501:Y)、ステップS507へ移行する。一方、基準となるラダーが2行以上存在すると判定した場合(ステップS501:N)、最も下に位置する(ラダー番号の大きい)ラダー(の行)を、基準となるラダーとして特定する(ステップS502)。図6の例では、機能ブロック抽出部31は、LDプログラムデータ(XML文書)23について、基準となるラダーが2行以上存在すると判定し(ステップS501:N)、最も下に位置するラダー番号160のラダーを、基準となるラダーとして特定する(ステップS502)。以下、ラダー番号nのラダーをラダーnという。   First, the functional block extraction unit 31 determines whether or not there is only one reference ladder for the LD program data (XML document) 23 read from the HD 13 (step S501). When it is determined that there is only one reference ladder (step S501: Y), the process proceeds to step S507. On the other hand, when it is determined that there are two or more reference ladders (step S501: N), the lowest ladder (the line with the highest ladder number) is identified as the reference ladder (step S502). ). In the example of FIG. 6, the functional block extraction unit 31 determines that there are two or more reference ladders for the LD program data (XML document) 23 (step S501: N), and the ladder number 160 located at the lowest position. Is specified as a reference ladder (step S502). Hereinafter, the ladder with ladder number n is referred to as ladder n.

機能ブロック抽出部31は、基準となるラダー160に基づいて、LDプログラムデータ(XML文書)23を構成するラダーから機能ブロック(1)を抽出する(ステップS503)。具体的には、機能ブロック抽出部31は、基準となるラダー160の変数を使用しているラダーを特定し、その特定したラダーをラダー番号の順番に整列させ、整列後のラダー群を機能ブロック(1)として抽出する。   The functional block extraction unit 31 extracts the functional block (1) from the ladder constituting the LD program data (XML document) 23 based on the reference ladder 160 (step S503). Specifically, the functional block extraction unit 31 identifies a ladder that uses the variables of the reference ladder 160, aligns the identified ladder in the order of the ladder numbers, and sets the sorted ladder group as a functional block. Extract as (1).

図7は、機能ブロック(1)の抽出処理を説明する図である。機能ブロック抽出部31は、基準となるラダー160の変数a4,a3,a2,a1,aを特定し、まず、変数aを注目する変数として変数aを使用しているラダーを、ラダー150からラダー100へ順番にラダー毎に判定して特定する。変数a1,a2,a3,a4についても同様の処理を行い、その変数を使用しているラダーを特定する。図6に示したLDプログラムデータ(XML文書)23の場合は、図7のように、ラダー100,110,120,130,140が特定され、これらのラダー郡は、機能ブロック(1)すなわち機能ブロックAとして抽出される。ラダー150は、基準となるラダー160の変数a4,a3,a2,a1,aが使用されていないから、機能ブロック(1)すなわち機能ブロックAのラダーには含まれず、機能ブロックAの上の位置に移動される。つまり、機能ブロック抽出部31は、ステップS503において、ラダー100,110,120,130,140,160からなる機能ブロックAを抽出する。尚、ラダー150は、次回のステップS503の処理により、機能ブロックBとなる。   FIG. 7 is a diagram for explaining the function block (1) extraction process. The functional block extraction unit 31 identifies the variables a4, a3, a2, a1, a of the reference ladder 160. First, a ladder that uses the variable a as a variable of interest for the variable a is changed from the ladder 150 to the ladder. In order to 100, it is determined and determined for each ladder. The same processing is performed for the variables a1, a2, a3, and a4, and the ladder that uses the variable is specified. In the case of the LD program data (XML document) 23 shown in FIG. 6, ladders 100, 110, 120, 130, and 140 are specified as shown in FIG. 7, and these ladder groups are function blocks (1), ie, function blocks. Extracted as block A. The ladder 150 is not included in the ladder of the functional block (1), that is, the functional block A because the variables a4, a3, a2, a1, and a of the reference ladder 160 are not used. Moved to. That is, the functional block extraction unit 31 extracts a functional block A including the ladders 100, 110, 120, 130, 140, and 160 in step S503. Note that the ladder 150 becomes a functional block B by the next processing in step S503.

図5に戻って、機能ブロック抽出部31は、抽出した機能ブロック(1)の中で、基準となるラダーが1行のみ存在するか否かを判定する(ステップS504)。基準となるラダーが1行のみ存在すると判定した場合(ステップS504:Y)、ステップS501へ移行する。一方、基準となるラダーが2行以上存在すると判定した場合(ステップS504:N)、抽出した機能ブロック(1)の中で、新たに基準となるラダー(の行)を特定する(ステップS505)。そして、機能ブロック抽出部31は、新たに基準となるラダーに基づいて、機能ブロック(2)を抽出する(ステップS506)。   Returning to FIG. 5, the functional block extraction unit 31 determines whether or not there is only one line of a reference ladder in the extracted functional block (1) (step S504). When it is determined that there is only one reference ladder (step S504: Y), the process proceeds to step S501. On the other hand, when it is determined that there are two or more reference ladders (step S504: N), a new reference ladder (row) is specified in the extracted functional block (1) (step S505). . Then, the functional block extraction unit 31 newly extracts the functional block (2) based on the reference ladder (step S506).

図8は、機能ブロック(2)の抽出処理を説明する図である。機能ブロック抽出部31は、ステップS502において基準となったラダー160の入力変数a1を注目する変数として、その変数a1を出力変数として使用しているラダーを特定する。すなわち、注目する変数aを演算するラダーを特定し、そのラダーを、新たに基準となるラダーとして特定する。そして、機能ブロック抽出部31は、ステップS503の処理と同様の処理を機能ブロックAの中で行い、機能ブロック(2)を抽出する。つまり、図8の例では、機能ブロック抽出部31は、ステップS506において、ラダー160が機能ブロックA1となり、ラダー120,130,140が機能ブロックA2となる。   FIG. 8 is a diagram for explaining the function block (2) extraction process. The function block extraction unit 31 specifies the ladder that uses the variable a1 as an output variable as the variable of interest, using the input variable a1 of the ladder 160 that is the reference in step S502. In other words, the ladder that calculates the variable a of interest is specified, and the ladder is newly specified as a reference ladder. Then, the functional block extraction unit 31 performs the same processing as the processing in step S503 in the functional block A, and extracts the functional block (2). That is, in the example of FIG. 8, in step S506, the functional block extraction unit 31 converts the ladder 160 into the functional block A1 and the ladders 120, 130, and 140 into the functional block A2.

機能ブロック抽出部31は、ステップS506において、機能ブロックA1,A2を抽出した後、ステップS504へ移行する。同様にして、機能ブロック(1)の中で、機能ブロック(2)の抽出を繰り返す。図8の例では、機能ブロック(2)として、機能ブロックA1,A2,A3,A4が抽出される。ここで、機能ブロック抽出部31は、ステップS504において、機能ブロック(1)の中で、基準となるラダーが1行のみ存在すると判定した場合(ステップS504:Y)、そのラダーを機能ブロック(2)として抽出し、ステップS501へ移行する。   In step S506, the functional block extraction unit 31 extracts the functional blocks A1 and A2, and then proceeds to step S504. Similarly, extraction of the function block (2) is repeated in the function block (1). In the example of FIG. 8, functional blocks A1, A2, A3, and A4 are extracted as the functional block (2). Here, when the functional block extraction unit 31 determines in step S504 that only one reference ladder exists in the functional block (1) (step S504: Y), the functional block extraction unit 31 converts the ladder into the functional block (2 ) And the process proceeds to step S501.

尚、図5に示したフローチャートには、機能ブロック(1)及び機能ブロック(2)を抽出する処理が示されているが、機能ブロック(2)の中から、さらに機能ブロック(3)が抽出される。すなわち、機能ブロックは階層的に抽出される。   In the flowchart shown in FIG. 5, the process of extracting the function block (1) and the function block (2) is shown, but the function block (3) is further extracted from the function block (2). Is done. That is, functional blocks are extracted hierarchically.

機能ブロック抽出部31は、ステップS501において、基準となるラダーが1行のみ存在すると判定した場合(ステップS501:Y)、そのラダーを機能ブロック(1)として抽出し、ステップS507へ移行する。機能ブロック抽出部31は、ステップS501〜ステップS506の処理により得られた機能ブロック(1)(2)等から、階層構造を生成する(ステップS507)。これにより、機能ブロック化及び階層構造生成処理は終了する。   If the functional block extraction unit 31 determines in step S501 that there is only one reference ladder (step S501: Y), the functional block extraction unit 31 extracts the ladder as a functional block (1), and proceeds to step S507. The functional block extraction unit 31 generates a hierarchical structure from the functional blocks (1), (2), and the like obtained by the processing in steps S501 to S506 (step S507). Thereby, the functional blockization and the hierarchical structure generation process are completed.

図9は、階層構造を説明する図であり、図9に示す階層構造が、ステップS507において機能ブロック抽出部31により生成される。図9に示す機能ブロックによる階層構造は、オリジナルのLDプログラムであるLDプログラムデータ(XML文書)23が、共通する変数が使用されているラダーからなる機能ブロックA,B等に区分されている。また、機能ブロックAが、共通する変数が使用されているラダーからなる機能ブロックA1,A2,A3,A4に区分されている。   FIG. 9 is a diagram for explaining the hierarchical structure. The hierarchical structure shown in FIG. 9 is generated by the functional block extraction unit 31 in step S507. In the hierarchical structure of the functional blocks shown in FIG. 9, LD program data (XML document) 23, which is an original LD program, is divided into functional blocks A, B, etc., which are ladders using common variables. The function block A is divided into function blocks A1, A2, A3, and A4 that are ladders using common variables.

ここで、機能ブロックA,B等は、機能ブロック(1)に相当するレベル1に位置しており、機能ブロックA1,A2,A3,A4は、機能ブロック(2)に相当するレベル2に位置している。同様にして、機能ブロック(3)が存在する場合は、点線で示しているように、機能ブロックA2が、共通する変数が使用されているラダーからなる機能ブロックA2−1,A2−2に区別されている。   Here, the functional blocks A, B, etc. are located at level 1 corresponding to the functional block (1), and the functional blocks A1, A2, A3, A4 are located at level 2 corresponding to the functional block (2). is doing. Similarly, when the functional block (3) exists, as shown by the dotted line, the functional block A2 is distinguished into functional blocks A2-1 and A2-2 composed of ladders using common variables. Has been.

尚、図9に示した階層構造において、最下層の機能ブロックを上から順番に並べたLDプログラムは、オリジナルのLDプログラムであるLDプログラムデータ(XML文書)23を構成するラダーを、機能ブロック毎に組み替えたLDプログラムである。すなわち、機能が密接に関係するラダーを機能ブロックとしてまとめて組み替えたLDプログラムである。但し、ラダー内の各変数は組み替えられていない。   In the hierarchical structure shown in FIG. 9, the LD program in which the lowermost functional blocks are arranged in order from the top, the ladder constituting the LD program data (XML document) 23, which is the original LD program, is displayed for each functional block. This is an LD program that has been rearranged. In other words, this is an LD program in which ladders whose functions are closely related are collectively recombined as function blocks. However, each variable in the ladder is not rearranged.

このように、機能ブロック抽出部31は、HD13から読み出したLDプログラムデータ(XML文書)23から、共通する変数が使用されている機能ブロックを抽出し、抽出した機能ブロックの中で、共通する変数が使用されている機能ブロックをさらに抽出し、この処理を繰り返すことにより、機能ブロックによる階層構造を生成する。   As described above, the functional block extraction unit 31 extracts a functional block in which a common variable is used from the LD program data (XML document) 23 read from the HD 13, and the common variable among the extracted functional blocks is extracted. By further extracting the functional blocks in which is used and repeating this process, a hierarchical structure of functional blocks is generated.

〔FBD部品生成処理〕
次に、図4に示したステップS403のFBD部品生成処理について詳細に説明する。図10は、FBD部品生成処理を示すフローチャートである。LD/FBD変換部32は、図10に示す処理により、機能ブロックによる階層構造データに対して、機能ブロック毎にLDプログラムをFBDプログラムに変換し、機能ブロック毎のFBD部品を生成する。
[FBD parts generation processing]
Next, the FBD component generation process in step S403 shown in FIG. 4 will be described in detail. FIG. 10 is a flowchart showing the FBD component generation process. The LD / FBD conversion unit 32 converts the LD program into the FBD program for each functional block with respect to the hierarchical structure data by the functional block by the processing shown in FIG.

まず、LD/FBD変換部32は、FBD部品が生成されていない未処理の機能ブロックが存在するか否かを判定する(ステップS1001)。最初は全ての機能ブロックが未処理であるから、未処理の機能ブロックが存在するものと判定される。LD/FBD変換部32は、後述するステップS1002からステップS1008までの処理を繰り返した後、未処理の機能ブロックが存在しないと判定した場合(ステップS1001:N)、FBD部品生成処理は終了する。   First, the LD / FBD conversion unit 32 determines whether or not there is an unprocessed functional block for which no FBD component has been generated (step S1001). Since all the functional blocks are unprocessed at first, it is determined that there are unprocessed functional blocks. If the LD / FBD conversion unit 32 determines that there is no unprocessed functional block after repeating the processing from step S1002 to step S1008 described later (step S1001: N), the FBD component generation processing ends.

LD/FBD変換部32は、未処理の機能ブロックが存在すると判定した場合(ステップS1001:Y)、LDプログラムの階層構造における下層の機能ブロックの中から、未処理の1つの機能ブロックを任意に選択する(ステップS1002)。例えば、LD/FBD変換部32は、図9に示すように、オリジナルのLDプログラムを基点として、その下層レベルにおける機能ブロックの中から、1つの機能ブロックを選択する。まず、LD/FBD変換部32は、オリジナルのLDプログラムの入れ子であるレベル1の機能ブロックA及び機能ブロックBを判定する。そして、機能ブロックAについて、機能ブロックAの入れ子であるレベル2の機能ブロックA1〜A4を判定し、さらに、機能ブロックA2については、その入れ子である機能ブロックA2−1,A2−2を判定する。そして、上から順番に枝毎に最下層の機能ブロックを判定する。つまり、レベル2の機能ブロックA1にはレベル3の入れ子が存在しないから、最下層の機能ブロックは機能ブロックA1となる。また、レベル2の機能ブロックA2にはレベル3の入れ子が存在し、そのレベル3の機能ブロックA2−1,A2−2にはレベル4の入れ子が存在しないから、最下層の機能ブロックは機能ブロックA2−1,A2−2となる。このように、最下層の機能ブロックとして機能ブロックA1,A2−1,A2−2,A3,A4,・・・が判定される。ここで、未処理の1つの機能ブロックがレベル2の機能ブロックの中からを選択される場合には、LD/FBD変換部32は、レベル2の機能ブロックが最下層でない機能ブロックA2について、その入れ子である機能ブロックA2−1,A2−2を機能ブロックA2に置き替える。そして、LD/FBD変換部32は、機能ブロックA1,A2,A3,A4等の中から、1つの機能ブロックを選択する。尚、ここではレベル2の機能ブロックの中から未処理の1つの機能ブロックを選択する例を示したが、本発明はレベル2に限定されるものではなく、階層化された機能ブロックの数や枝の数等に応じて、レベルを決定するようにしてもよい。また、同じレベルから未処理の1つの機能ブロックを選択する例を示したが、必ずしも同じレベルである必要はなく、異なるレベルの機能ブロックを選択するようにしてもよい。   When the LD / FBD conversion unit 32 determines that there is an unprocessed functional block (step S1001: Y), the LD / FBD conversion unit 32 arbitrarily selects one unprocessed functional block from the lower-level functional blocks in the hierarchical structure of the LD program. Select (step S1002). For example, as shown in FIG. 9, the LD / FBD conversion unit 32 selects one functional block from among the functional blocks at the lower level with the original LD program as a base point. First, the LD / FBD conversion unit 32 determines the level 1 functional block A and the functional block B that are nested in the original LD program. Then, for the functional block A, the level 2 functional blocks A1 to A4 that are nested in the functional block A are determined, and for the functional block A2, the nested functional blocks A2-1 and A2-2 are determined. . Then, the lowest functional block is determined for each branch in order from the top. That is, since there is no level 3 nesting in the level 2 functional block A1, the lowest level functional block is the functional block A1. Further, since the level 3 function block A2 has a level 3 nesting and the level 3 function blocks A2-1 and A2-2 have no level 4 nesting, the lowest level function block is a function block. A2-1 and A2-2. In this way, the functional blocks A1, A2-1, A2-2, A3, A4,... Are determined as the lowermost functional blocks. Here, when one unprocessed functional block is selected from the level 2 functional blocks, the LD / FBD conversion unit 32 determines the functional block A2 whose level 2 functional block is not the lowest layer. The nested functional blocks A2-1 and A2-2 are replaced with the functional block A2. Then, the LD / FBD converter 32 selects one functional block from the functional blocks A1, A2, A3, A4 and the like. Although an example in which one unprocessed functional block is selected from the functional blocks at level 2 is shown here, the present invention is not limited to level 2, and the number of hierarchical functional blocks and The level may be determined according to the number of branches or the like. Moreover, although the example which selects one unprocessed functional block from the same level was shown, it does not necessarily need to be the same level and you may make it select a functional block of a different level.

LD/FBD変換部32は、ステップS1002にて選択した機能ブロックについて、その機能ブロックに含まれるLD機能要素をFB機能要素に置き替える(ステップS1003)。これにより、LDプログラムの機能ブロックは、FBDプログラムのFB図に置き替えられる。   The LD / FBD conversion unit 32 replaces the LD functional element included in the functional block with the FB functional element for the functional block selected in step S1002 (step S1003). As a result, the functional block of the LD program is replaced with the FB diagram of the FBD program.

図11は、LD機能要素をFB機能要素に置き替える処理を説明する図であり、図12は、LDプログラムの機能ブロックA2をFBDプログラムのFB図A2に置き替える処理を説明する図である。尚、図12に示すFB図A2は、説明を簡単にするために、FBDプログラムデータ(XML文書)をFBDの形態にて便宜的に表現したものである。図11に示すように、例えばコイル、リレーのLD機能要素を、2入力1出力のFB機能要素に置き替える。図12において、機能ブロックA2に含まれるラダー120の入力変数a114のα接点と、入力変数a113のa接点との間でAND演算する場合、機能ブロックA2における入力変数a114,a113のLD機能要素を、FB図A2に示すようなFB機能要素(入力変数をa114,a113として2入力のAND演算を行い、演算結果を1出力の出力変数としている要素)に置き替える。このようにして、機能ブロックA2を構成するラダー120,130,140に含まれるLD機能要素の全てをFB機能要素に置き替えることにより、LDプログラムの機能ブロックA2がFBDプログラムのFB図A2に置き替えられる。   FIG. 11 is a diagram for explaining the process of replacing the LD function element with the FB function element. FIG. 12 is a diagram for explaining the process of replacing the functional block A2 of the LD program with the FB diagram A2 of the FBD program. The FB diagram A2 shown in FIG. 12 expresses the FBD program data (XML document) for convenience in the form of an FBD for the sake of simplicity. As shown in FIG. 11, for example, the LD function elements of coils and relays are replaced with FB function elements with two inputs and one output. In FIG. 12, when an AND operation is performed between the α contact of the input variable a114 of the ladder 120 included in the functional block A2 and the a contact of the input variable a113, the LD functional elements of the input variables a114 and a113 in the functional block A2 are , FB function elements as shown in FIG. A2 (elements in which 2-input AND operation is performed with input variables a114 and a113, and the operation result is an output variable of 1 output) are replaced. In this way, by replacing all of the LD functional elements included in the ladder 120, 130, 140 constituting the functional block A2 with the FB functional elements, the functional block A2 of the LD program is placed in the FB diagram A2 of the FBD program. Be replaced.

LD/FBD変換部32は、ステップS1003において機能ブロックから置き替えたFB図について、入力変数を設定する(ステップS1004)。図12の例では、a114,a113,a112,a12,a13が入力変数として設定される。ここで設定された入力変数は、そのFB図全体の入力情報であり、FBD部品の入力情報になる。このようにして設定された入力変数は、後述するFBD配線処理において、FBD部品を配線するときに出力変数に接続するための参照情報として用いられる。   The LD / FBD conversion unit 32 sets an input variable for the FB diagram replaced from the functional block in step S1003 (step S1004). In the example of FIG. 12, a114, a113, a112, a12, and a13 are set as input variables. The input variable set here is input information for the entire FB diagram, and is input information for the FBD component. The input variable set in this way is used as reference information for connecting to the output variable when wiring the FBD component in the FBD wiring process described later.

LD/FBD変換部32は、ステップS1003において機能ブロックから置き替えたFB図について、出力変数を設定する(ステップS1005)。図12の例では、a11,a111,a1が出力変数として設定される。ここで設定された出力変数は、そのFB図全体の出力情報であり、FBD部品の出力情報になる。このようにして設定された出力変数は、後述するFBD配線処理において、FBD部品を配線するときに入力変数に接続するための参照情報として用いられる。   The LD / FBD conversion unit 32 sets an output variable for the FB diagram replaced from the functional block in step S1003 (step S1005). In the example of FIG. 12, a11, a111, and a1 are set as output variables. The output variable set here is output information of the entire FB diagram, and is output information of the FBD component. The output variable set in this way is used as reference information for connecting to the input variable when wiring the FBD component in the FBD wiring process described later.

LD/FBD変換部32は、ステップS1003において機能ブロックから置き替えたFB図について、一次遅れ変数を、オペレータの操作入力に従って設定する(ステップS1006)。一次遅れ変数とは、出力変数にて変数値が確定する前に参照される入力変数である。具体的には、LDプログラムにおいて、一次遅れ変数である入力変数を含む第1のラダー、及び、その一次遅れ変数である入力変数に反映する出力変数を含む第2のラダーがこの順番で存在する場合、前者のラダーの入力変数には、後者のラダーの出力変数の変数値が次のスキャンで反映される。したがって、前者のラダーの入力変数は、その変数値が1スキャン遅れて反映されるため、一次遅れ変数となる。   The LD / FBD conversion unit 32 sets a first-order lag variable according to the operation input of the operator for the FB diagram replaced from the functional block in step S1003 (step S1006). The primary delay variable is an input variable that is referred to before the variable value is determined by the output variable. Specifically, in the LD program, a first ladder that includes an input variable that is a first-order lag variable and a second ladder that includes an output variable that reflects the input variable that is the first-order lag variable exist in this order. In this case, the input value of the former ladder reflects the variable value of the output variable of the latter ladder in the next scan. Therefore, the input variable of the former ladder is a primary delay variable because the variable value is reflected with a delay of one scan.

オペレータは、LDプログラムを参照しながら一次遅れ変数を判断し、その変数を操作入力することにより、LD/FBD変換部32が一次遅れ変数を設定する。尚、LD/FBD変換部32は、LDプログラムを用いて、入出力変数の順番を考慮し、一次遅れ変数を自動的に選択して設定するようにしてもよい。このようにして設定された一次遅れ変数は、後述するFBD配線処理において、FBD部品を配線するときに出力変数に接続するための参照情報として用いられる。   The operator determines the first-order lag variable while referring to the LD program, and the LD / FBD conversion unit 32 sets the first-order lag variable by operating the variable. Note that the LD / FBD converter 32 may automatically select and set the first-order lag variable using the LD program in consideration of the order of the input / output variables. The first-order delay variable set in this way is used as reference information for connecting to the output variable when wiring the FBD component in the FBD wiring process described later.

LD/FBD変換部32は、ステップS1003において機能ブロックから置き替えたFB図について、オペレータの操作入力により、予め設定された入出力変数を隠蔽する(ステップS1007)。ここで、隠蔽とは、生成されるFBD部品が画面に表示されたときに、その変数を表示しないようにすることをいう。オペレータは、隠蔽する入出力変数として、一つの機能ブロック内に存在する変数のみを設定し、複数の機能ブロック間で相互に関連する変数は設定しない。尚、LD/FBD変換部32は、一つの機能ブロック内に存在する変数であるか、複数の機能ブロック間で相互に関連する変数であるかを判定し、隠蔽する入出力変数を自動的に設定して隠蔽するようにしてもよい。   The LD / FBD conversion unit 32 conceals preset input / output variables by the operator's operation input for the FB diagram replaced from the functional block in step S1003 (step S1007). Here, concealment means that the variable is not displayed when the generated FBD component is displayed on the screen. The operator sets only variables existing in one function block as input / output variables to be hidden, and does not set variables related to each other among a plurality of function blocks. The LD / FBD conversion unit 32 determines whether the variable exists in one functional block or is a variable related to each other among a plurality of functional blocks, and automatically sets the input / output variable to be concealed. It may be set and hidden.

前述したステップS1001〜ステップS1007の処理を行うことにより、ステップS1001にて選択した機能ブロックに対応するFBD部品が完成する(ステップS1008)。そして、処理がステップS1001へ移行し、LD/FBD変換部32は、全ての下層の機能ブロックに対応するFBD部品を完成させると、FBD部品生成処理が終了する。   By performing the processing in steps S1001 to S1007 described above, an FBD part corresponding to the functional block selected in step S1001 is completed (step S1008). Then, the process proceeds to step S1001, and when the LD / FBD conversion unit 32 completes the FBD parts corresponding to all the lower-layer functional blocks, the FBD part generation process ends.

このように、LD/FBD変換部32は、機能ブロック抽出部31により生成された階層構造データに対して、下層の機能ブロック毎にLD機能要素をFB機能要素に変換し、入力変数、出力変数及び一次遅れ変数を設定し、さらに隠蔽する入出力変数を設定することにより、その機能ブロックに対応するFBD部品を生成する。これにより、全ての下層の機能ブロックに対応するFBD部品を完成することができる。また、入力変数、出力変数及び一次遅れ変数を設定するようにしたから、後述するFBD配線処理においてこれらの変数を参照することにより、FBD部品どうしを配線することができる。また、隠蔽する入出力変数を設定するようにしたから、画面上にFBDプログラムを表示したときに、隠蔽の設定がされた変数は表示されず、全体として見やすいプログラムとなる。   As described above, the LD / FBD conversion unit 32 converts the LD function element into the FB function element for each of the lower-level function blocks with respect to the hierarchical structure data generated by the function block extraction unit 31, and the input variable and the output variable. Then, by setting a first-order lag variable and further setting an input / output variable to be concealed, an FBD component corresponding to the functional block is generated. Thereby, FBD parts corresponding to all lower-layer functional blocks can be completed. Since the input variable, the output variable, and the first-order lag variable are set, the FBD parts can be wired by referring to these variables in the FBD wiring process described later. Since the input / output variables to be concealed are set, when the FBD program is displayed on the screen, the concealed variables are not displayed and the program is easy to see as a whole.

〔FBD配線処理〕
次に、図4に示したステップS404のFBD配線処理について詳細に説明する。図13は、FBD配線処理を示すフローチャートである。FBDプログラム生成部33は、図13に示す処理により、機能ブロック毎のFBD部品どうしを配線し、FBDプログラムデータ(XML文書)24を生成する。
[FBD wiring processing]
Next, the FBD wiring process in step S404 shown in FIG. 4 will be described in detail. FIG. 13 is a flowchart showing the FBD wiring process. The FBD program generation unit 33 generates FBD program data (XML document) 24 by wiring FBD parts for each functional block by the processing shown in FIG.

まず、FBDプログラム生成部33は、LD/FBD変換部32により生成された、機能ブロック毎のFBD部品を入力し、未配線のFBD部品が存在するか否かを判定する(ステップS1301)。最初は全てのFBD部品が未配線であるから、未配線のFBD部品が存在するものと判定される。FBDプログラム生成部33は、後述するステップS1302からステップS1310までの処理を繰り返した後、未配線のFBD部品が存在しないと判定した場合(ステップS1301:N)、FBD配線処理は終了する。   First, the FBD program generation unit 33 inputs the FBD part for each functional block generated by the LD / FBD conversion unit 32, and determines whether there is an unwired FBD part (step S1301). Since all the FBD parts are unwired at first, it is determined that there is an unwired FBD part. If the FBD program generation unit 33 repeats the processing from step S1302 to step S1310, which will be described later, and determines that there is no unwired FBD part (step S1301: N), the FBD wiring processing ends.

FBDプログラム生成部33は、未配線のFBD部品が存在すると判定した場合(ステップS1301:Y)、未配線のFBD部品の中から任意に1つのFBD部品を特定し、図5に示した処理にて得られた階層構造データに基づいて、そのFBD部品のグループを選択する(ステップS1302)。ここで、グループとは、機能ブロックによる階層構造において、上位に同じ機能ブロックを有する場合の下位のFBD部品の集合をいう。例えば、図9において、機能ブロックA1,A2,A3,A4に対応するFBD部品の集合は、機能ブロックAのグループに属することになる。つまり、FBDプログラム生成部33は、図9の例において、特定したFBD部品が機能ブロックA1に対応するFBD部品である場合、レベル1の機能ブロックAのグループを選択する。   When the FBD program generation unit 33 determines that there is an unwired FBD part (step S1301: Y), the FBD program generation unit 33 arbitrarily identifies one FBD part from the unwired FBD parts, and performs the processing illustrated in FIG. Based on the hierarchical structure data obtained in this way, the group of the FBD parts is selected (step S1302). Here, the group refers to a set of lower-level FBD parts in the case where the same functional block is provided at the upper level in the hierarchical structure of functional blocks. For example, in FIG. 9, the set of FBD parts corresponding to the functional blocks A1, A2, A3, and A4 belongs to the group of functional blocks A. That is, in the example of FIG. 9, the FBD program generation unit 33 selects a group of level 1 functional blocks A when the identified FBD component is an FBD component corresponding to the functional block A1.

FBDプログラム生成部33は、ステップS1302にて選択したグループに属するFBD部品群の中から、中心となるFBD部品(中心FBD部品)を選択する(ステップS1303)。具体的には、FBDプログラム生成部33は、FBD部品群のそれぞれのFBD部品について、入出力変数に基づいて関連付けを行い、入力変数と出力変数とを接続線で結んだときの接続線の数をカウントする。そして、FBD部品毎の接続線の数のうち、最も接続線の数が多いFBD部品を中心FBD部品として選択する。   The FBD program generation unit 33 selects a central FBD component (central FBD component) from the group of FBD components belonging to the group selected in step S1302 (step S1303). Specifically, the FBD program generation unit 33 associates each FBD part of the FBD part group based on the input / output variable, and the number of connection lines when the input variable and the output variable are connected by the connection line. Count. Then, the FBD component having the largest number of connection lines among the number of connection lines for each FBD component is selected as the central FBD component.

FBDプログラム生成部33は、ステップS1303にて選択した中心FBD部品を、そのグループのFBDプログラムが表示される画面を図面とした場合に、その図面の中央に配置する(ステップS1304)。例えば、中心FBD部品の図面内の配置位置データとして、図面の中央の座標データを設定する。   The FBD program generation unit 33 arranges the central FBD part selected in step S1303 in the center of the drawing when the screen on which the FBD program of the group is displayed is a drawing (step S1304). For example, the coordinate data of the center of the drawing is set as the arrangement position data in the drawing of the central FBD part.

FBDプログラム生成部33は、グループに属するFBD部品について、未選択のFBD部品が存在するか否かを判定する(ステップS1305)。最初は、全てのFBD部品が未選択であるから、未選択のFBD部品が存在するものと判定される。FBDプログラム生成部33は、後述するステップS1307からステップS1310までの処理を繰り返した後、未選択のFBD部品が存在しないと判定した場合(ステップS1305:N)、グループ内の配線は完了したものとして(ステップS1306)、ステップS1301へ移行する。   The FBD program generation unit 33 determines whether or not there is an unselected FBD part for the FBD parts belonging to the group (step S1305). Initially, since all FBD parts are not selected, it is determined that there is an unselected FBD part. If the FBD program generation unit 33 determines that there is no unselected FBD part after repeating the processing from step S1307 to step S1310 described later (step S1305: N), it is assumed that the wiring in the group has been completed. (Step S1306), the process proceeds to Step S1301.

FBDプログラム生成部33は、未選択のFBD部品が存在すると判定した場合(ステップS1305:Y)、未選択のFBD部品の中から任意に1つのFBD部品を選択する(ステップS1307)。   If it is determined that there is an unselected FBD part (step S1305: Y), the FBD program generation unit 33 arbitrarily selects one FBD part from the unselected FBD parts (step S1307).

FBDプログラム生成部33は、ステップS1307にて選択したFBD部品が一次遅れ変数を有する場合、その一次遅れ変数を確定するFBD部品を特定し、特定したFBD部品を、選択したFBD部品の右側に配置し、一次遅れ変数と特定したFBD部品の出力変数とを配線する(ステップS1308)。   If the FBD part selected in step S1307 has a first-order lag variable, the FBD program generation unit 33 specifies the FBD part that determines the first-order lag variable, and places the specified FBD part on the right side of the selected FBD part. Then, the first-order lag variable and the output variable of the identified FBD part are wired (step S1308).

FBDプログラム生成部33は、ステップS1307にて選択したFBD部品の入力変数について、その入力変数を確定するFBD部品を特定し、特定したFBD部品を、選択したFBD部品の左側に配置し、入力変数と特定したFBD部品の出力変数とを配線する(ステップS1309)。   The FBD program generation unit 33 identifies the FBD component that determines the input variable for the input variable of the FBD component selected in step S1307, places the identified FBD component on the left side of the selected FBD component, and sets the input variable. And the output variable of the identified FBD part are wired (step S1309).

FBDプログラム生成部33は、ステップS1307にて選択したFBD部品の出力変数について、その出力変数を参照するFBD部品を特定し、特定したFBD部品を、選択したFBD部品の右側に配置し、出力変数と特定したFBD部品の入力変数とを配線する(ステップS1310)。そして、ステップS1305へ移行する。   The FBD program generation unit 33 identifies the FBD part that refers to the output variable for the output variable of the FBD part selected in step S1307, places the identified FBD part on the right side of the selected FBD part, and outputs the output variable. And the input variable of the specified FBD part are wired (step S1310). Then, control goes to a step S1305.

このように、ステップS1307からステップS1310までの処理を繰り返すことにより、グループに属する全てのFBD部品の配線が行われ、図面の中央に配置された中心FBD部品を中心として、グループのFBDプログラムが生成される。そして、ステップS1301へ移行し、他のグループについても同様の処理を行い、FBD配線処理が終了する。   In this way, by repeating the processing from step S1307 to step S1310, wiring of all the FBD parts belonging to the group is performed, and the group FBD program is generated around the center FBD part arranged at the center of the drawing. Is done. Then, the process proceeds to step S1301, the same process is performed for the other groups, and the FBD wiring process ends.

以上のように、本発明の実施形態によるPLCプログラミング言語変換装置1によれば、機能ブロック抽出部31が、LDプログラムデータ(XML文書)23から機能ブロックを抽出して階層構造データを生成し、LD/FBD変換部32が、階層構造データにおける機能ブロック毎にLDプログラムをFBDプログラムに変換し、機能ブロック毎のFBD部品を生成し、FBDプログラム生成部33が、機能ブロック毎のFBD部品どうしを配線し、FBDプログラムデータ(XML文書)24を生成するようにした。これにより、従来の手作業による時間及び手間の問題を解消することができ、変換作業に伴うミスも無くすことができる。したがって、LDプログラムからFBDプログラムへの変換作業の負荷を低減することができ、変換作業の信頼性を高めることができる。   As described above, according to the PLC programming language conversion device 1 according to the embodiment of the present invention, the functional block extraction unit 31 extracts a functional block from the LD program data (XML document) 23 to generate hierarchical structure data, The LD / FBD conversion unit 32 converts the LD program into an FBD program for each functional block in the hierarchical structure data, generates an FBD component for each functional block, and the FBD program generation unit 33 performs an FBD component for each functional block. The FBD program data (XML document) 24 is generated by wiring. As a result, it is possible to eliminate the time and labor problems caused by the conventional manual work, and it is possible to eliminate errors associated with the conversion work. Therefore, it is possible to reduce the load of conversion work from the LD program to the FBD program, and to improve the reliability of the conversion work.

また、本発明の実施形態によるPLCプログラミング言語変換装置1によれば、制御装置メーカ間で統一されていない変換元LDプログラムから変換先FBDプログラムへ変換するために、変換元LDプログラムを、統一したLDプログラムデータ(XML文書)23に前もって変換させ、このLDプログラムデータ(XML文書)23をLDプログラムデータ(XML文書)23に変換するようにした。そして、LDプログラムデータ(XML文書)23は、変換先FBDプログラムに変換される。したがって、制御装置メーカ間で統一されていない変換元LDプログラムであっても、制御装置メーカ間で統一された仕様によるLDプログラムデータ(XML文書)23に変換すれば、LDプログラムデータ(XML文書)23からFBDプログラムデータ(XML文書)24に画一的に変換することができる。つまり、変換元LDプログラムから変換先FBDプログラムへの変換過程の中に、制御装置メーカ間で統一され汎用的に使用できる変換手法を組み込むことができる。これにより、LDプログラムからFBDプログラムへの変換を、汎用的に実現することができる。   Also, according to the PLC programming language conversion device 1 according to the embodiment of the present invention, the conversion source LD program is unified in order to convert from the conversion source LD program that is not unified among the control device manufacturers to the conversion destination FBD program. The LD program data (XML document) 23 is converted in advance, and the LD program data (XML document) 23 is converted into LD program data (XML document) 23. Then, the LD program data (XML document) 23 is converted into a conversion destination FBD program. Therefore, even if a conversion source LD program that is not unified among control device manufacturers is converted into LD program data (XML document) 23 according to specifications unified among control device manufacturers, LD program data (XML document) 23 to FBD program data (XML document) 24 can be uniformly converted. That is, a conversion method that can be used universally and can be incorporated among the control device manufacturers can be incorporated into the conversion process from the conversion source LD program to the conversion destination FBD program. Thereby, the conversion from the LD program to the FBD program can be realized for general purposes.

以上、実施形態を挙げて本発明を説明したが、本発明は前記実施形態に限定されるものではなく、その技術思想を逸脱しない範囲で種々変形可能である。例えば、図6、図7、図8、図12に示したLDプログラム等、及び図9に示した階層構造は、本発明の実施形態を説明するための例示に過ぎず、本発明はこれらに限定されることはない。   The present invention has been described with reference to the embodiment. However, the present invention is not limited to the above-described embodiment, and various modifications can be made without departing from the technical idea thereof. For example, the LD program and the like shown in FIGS. 6, 7, 8, and 12 and the hierarchical structure shown in FIG. 9 are merely examples for explaining the embodiment of the present invention, and the present invention is not limited thereto. There is no limit.

また、前記実施の形態ではXML文書を例にして説明したが、本発明はこれに限定されるものではなく、HTML(HyperText Markup Language)、SGML(Standard Generalized Markup Language)、RTF(Rich Text Format)、TeX等のマークアップ言語による文書であればよい。   In the above embodiment, the XML document has been described as an example. However, the present invention is not limited to this, and HTML (Hyper Text Markup Language), SGML (Standard Generalized Markup Language), and RTF (Rich Text Format). Any document in a markup language such as TeX may be used.

変換元のLDプログラムから変換先のFBDプログラムへの変換処理について、一連の流れを説明する図である。It is a figure explaining a series of flows about the conversion process from the LD program of a conversion source to the FBD program of a conversion destination. 本発明の実施形態によるPLCプログラミング言語変換装置のハードウェア構成を示すブロック図である。It is a block diagram which shows the hardware constitutions of the PLC programming language converter by embodiment of this invention. 本発明の実施形態によるPLCプログラミング言語変換装置の機能構成を示すブロック図である。It is a block diagram which shows the function structure of the PLC programming language converter by embodiment of this invention. 言語変換処理の全体の流れを示すフローチャートである。It is a flowchart which shows the whole flow of a language conversion process. 機能ブロック化及び階層構造生成処理を示すフローチャートである。It is a flowchart which shows a function block formation and hierarchical structure production | generation process. LDプログラム(オリジナル)を表現した図である。It is a figure expressing LD program (original). 機能ブロック(1)の抽出処理を説明する図である。It is a figure explaining the extraction process of a functional block (1). 機能ブロック(2)の抽出処理を説明する図である。It is a figure explaining the extraction process of a functional block (2). 機能ブロックによる階層構造を説明する図である。It is a figure explaining the hierarchical structure by a functional block. FBD部品生成処理を示すフローチャートである。It is a flowchart which shows a FBD component production | generation process. LD機能要素をFB機能要素に置き替える処理を説明する図である。It is a figure explaining the process which replaces LD function element with FB function element. LDプログラムの機能ブロックをFBDプログラムのFB図に置き替える処理を説明する図である。It is a figure explaining the process which replaces the functional block of LD program with the FB figure of an FBD program. FBD配線処理を示すフローチャート図である。It is a flowchart figure which shows FBD wiring processing.

符号の説明Explanation of symbols

1 PLCプログラミング言語変換装置
2 表示装置
3 キーボード
4 マウス
10 CPU
11 RAM
12 ROM
13 HD
14 通信インタフェース
15 表示インタフェース
16 操作インタフェース
20 OS
21 画面制御プログラム
22 言語変換プログラム
23 LDプログラムデータ(XML文書)
24 FBDプログラムデータ(XML文書)
30 制御部
31 機能ブロック抽出部
32 LD/FBD変換部
33 FBDプログラム生成部
1 PLC programming language conversion device 2 Display device 3 Keyboard 4 Mouse 10 CPU
11 RAM
12 ROM
13 HD
14 Communication interface 15 Display interface 16 Operation interface 20 OS
21 Screen control program 22 Language conversion program 23 LD program data (XML document)
24 FBD program data (XML document)
30 Control Unit 31 Functional Block Extraction Unit 32 LD / FBD Conversion Unit 33 FBD Program Generation Unit

Claims (6)

複数の変数を組み合わせて所定のシーケンス処理を実現するLD(Ladder Diagram)プログラムをFBD(Function Block Diagram)プログラムに変換するプログラミング言語変換装置において、
マークアップ言語で表現したLDプログラムから、互いに共通する前記変数を有するラダー群からなる機能ブロックを抽出し、前記抽出した機能ブロックから、さらに互いに共通する前記変数を有するラダー群からなる下層の機能ブロックを階層的に順次抽出し、階層構造データを生成する機能ブロック抽出部と、
前記機能ブロック抽出部により生成された階層構造データを用いて、前記機能ブロック毎に、その機能ブロックのLDプログラムを構成するLD機能要素を、FBDプログラムを構成するFB機能要素に置き替え、前記機能ブロック毎のFBD部品を生成するLD/FBD変換部と、
前記LD/FBD変換部により生成された機能ブロック毎のFBD部品間を配線し、マークアップ言語で表現したFBDプログラムを生成するFBDプログラム生成部と、
を備えたことを特徴とするプログラミング言語変換装置。
In a programming language conversion device that converts an LD (Ladder Diagram) program that realizes a predetermined sequence process by combining a plurality of variables into an FBD (Function Block Diagram) program,
A functional block consisting of a ladder group having the common variable is extracted from the LD program expressed in a markup language, and a lower functional block consisting of a ladder group having the common variable is extracted from the extracted functional block. Functional block extraction unit that sequentially extracts the hierarchically and generates hierarchical structure data,
Using the hierarchical structure data generated by the functional block extraction unit, for each functional block, the LD functional element constituting the LD program of the functional block is replaced with the FB functional element constituting the FBD program, and the function An LD / FBD converter that generates FBD parts for each block;
An FBD program generation unit for wiring FBD parts for each functional block generated by the LD / FBD conversion unit and generating an FBD program expressed in a markup language;
A programming language conversion device characterized by comprising:
複数の変数を組み合わせて所定のシーケンス処理を実現するLDプログラムをFBDプログラムに変換するプログラミング言語変換方法において、
マークアップ言語で表現したLDプログラムから、互いに共通する前記変数を有するラダー群からなる機能ブロックを抽出する第1のステップと、
前記第1のステップにより抽出した機能ブロックから、さらに互いに共通する前記変数を有するラダー群からなる下層の機能ブロックを階層的に順次抽出する第2のステップと、
前記第1のステップ及び第2のステップを繰り返すことにより、階層構造データを生成する第3のステップと、
前記第3のステップにより生成した階層構造データを用いて、前記機能ブロック毎に、その機能ブロックのLDプログラムを構成するLD機能要素を、FBDプログラムを構成するFB機能要素に置き替え、前記機能ブロック毎のFBD部品を生成する第4のステップと、
前記第4のステップにより生成した機能ブロック毎のFBD部品間を配線し、マークアップ言語で表現したFBDプログラムを生成する第5のステップと、
を有することを特徴とするプログラミング言語変換方法。
In a programming language conversion method for converting an LD program that realizes a predetermined sequence process by combining a plurality of variables into an FBD program,
A first step of extracting a functional block consisting of a ladder group having the variables in common from an LD program expressed in a markup language;
A second step of hierarchically extracting the lower-layer functional blocks consisting of ladder groups having the variables that are common to each other from the functional blocks extracted in the first step;
A third step of generating hierarchical structure data by repeating the first step and the second step;
Using the hierarchical structure data generated in the third step, for each functional block, the LD functional element constituting the LD program of the functional block is replaced with the FB functional element constituting the FBD program, and the functional block A fourth step of generating each FBD part;
A fifth step of wiring between FBD parts for each functional block generated in the fourth step and generating an FBD program expressed in a markup language;
A programming language conversion method characterized by comprising:
請求項2に記載のプログラミング言語変換方法において、
前記第1のステップは、マークアップ言語で表現したLDプログラムのうちの基準となるラダーを選択し、前記基準となるラダーの変数を使用している他のラダーを特定し、前記他のラダーを機能ブロックとして抽出し、
前記第2のステップは、前記第1のステップにより抽出した機能ブロックから、前記基準となるラダーの入力変数を出力変数として使用しているラダーを、新たに基準となるラダーとして選択し、前記新たに基準となるラダーの変数を使用している他のラダーを特定し、前記他のラダーを下層の機能ブロックとして抽出し、前記新たに基準となるラダーの選択及び下層の機能ブロックの抽出を階層的に行う、
ことを特徴とするプログラミング言語変換方法。
The programming language conversion method according to claim 2, wherein
The first step selects a reference ladder among LD programs expressed in a markup language, specifies another ladder that uses a variable of the reference ladder, and selects the other ladder. Extract as a functional block,
In the second step, a ladder that uses an input variable of the reference ladder as an output variable is newly selected as a reference ladder from the functional blocks extracted in the first step, and the new ladder is selected. The other ladders that use the variables of the reference ladder are identified, the other ladders are extracted as lower-level functional blocks, and the selection of the new reference ladder and the extraction of the lower-level functional blocks are hierarchical. To do,
A programming language conversion method characterized by the above.
請求項2または3に記載のプログラミング言語変換方法において、
前記第4のステップは、前記第3のステップにより生成した階層構造データから、下層の機能ブロックを選択し、前記下層の機能ブロック毎に、その機能ブロックのLDプログラムを構成するLD機能要素を、FBDプログラムを構成するFB機能要素に置き替えてFB図を生成し、前記FB図から入力変数、出力変数及び一次遅れ変数を設定すると共に、画面表示を隠蔽する変数を設定し、前記機能ブロック毎のFBD部品を生成する、
ことを特徴とするプログラミング言語変換方法。
In the programming language conversion method according to claim 2 or 3,
In the fourth step, a lower-layer functional block is selected from the hierarchical structure data generated in the third step, and an LD functional element constituting an LD program of the functional block is selected for each lower-layer functional block. An FB diagram is generated by replacing the FB function elements constituting the FBD program, and input variables, output variables, and first-order lag variables are set from the FB diagram, and variables for hiding the screen display are set. Generate FBD parts,
A programming language conversion method characterized by the above.
請求項4に記載のプログラミング言語変換方法において、
前記第5のステップは、前記第4のステップにより生成した機能ブロック毎のFBD部品間を、前記設定した入力変数、出力変数及び一次遅れ変数に基づいて配線し、マークアップ言語で表現したFBDプログラムを生成する、
ことを特徴とするプログラミング言語変換方法。
The programming language conversion method according to claim 4,
In the fifth step, the FBD program is configured such that the FBD parts for each functional block generated in the fourth step are wired based on the set input variable, output variable, and first-order lag variable, and expressed in a markup language. Generate
A programming language conversion method characterized by the above.
複数の変数を組み合わせて所定のシーケンス処理を実現するLDプログラムをFBDプログラムに変換するプログラミング言語変換プログラムであって、コンピュータに、
マークアップ言語で表現したLDプログラムから、互いに共通する前記変数を有するラダー群からなる機能ブロックを抽出する処理と、
前記抽出した機能ブロックから、さらに互いに共通する前記変数を有するラダー群からなる下層の機能ブロックを階層的に順次抽出する処理と、
前記抽出する処理を繰り返すことにより、階層構造データを生成する処理と、
前記生成した階層構造データを用いて、前記機能ブロック毎に、その機能ブロックのLDプログラムを構成するLD機能要素を、FBDプログラムを構成するFB機能要素に置き替え、前記機能ブロック毎のFBD部品を生成する処理と、
前記生成した機能ブロック毎のFBD部品間を配線し、マークアップ言語で表現したFBDプログラムを生成する処理と、
を実行させるプログラミング言語変換プログラム。
A programming language conversion program for converting an LD program that realizes a predetermined sequence process by combining a plurality of variables into an FBD program,
A process of extracting a functional block consisting of a ladder group having the variables in common from an LD program expressed in a markup language;
A process of sequentially extracting hierarchically functional blocks consisting of ladder groups having the variables that are common to each other from the extracted functional blocks;
Processing for generating hierarchical structure data by repeating the extracting process;
Using the generated hierarchical structure data, for each functional block, the LD functional element constituting the LD program of the functional block is replaced with the FB functional element constituting the FBD program, and the FBD part for each functional block is Process to generate,
Wiring between the generated FBD parts for each functional block and generating an FBD program expressed in a markup language;
Programming language conversion program that runs
JP2008181929A 2008-07-11 2008-07-11 Programming language conversion apparatus, conversion method and conversion program Withdrawn JP2010020635A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008181929A JP2010020635A (en) 2008-07-11 2008-07-11 Programming language conversion apparatus, conversion method and conversion program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008181929A JP2010020635A (en) 2008-07-11 2008-07-11 Programming language conversion apparatus, conversion method and conversion program

Publications (1)

Publication Number Publication Date
JP2010020635A true JP2010020635A (en) 2010-01-28

Family

ID=41705446

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008181929A Withdrawn JP2010020635A (en) 2008-07-11 2008-07-11 Programming language conversion apparatus, conversion method and conversion program

Country Status (1)

Country Link
JP (1) JP2010020635A (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2016062126A (en) * 2014-09-12 2016-04-25 富士電機株式会社 Program convert device
CN106200541A (en) * 2015-05-08 2016-12-07 杭州电子科技大学 A kind of method that FBD is converted to AOV structure
WO2017104934A1 (en) * 2015-12-17 2017-06-22 주식회사 유디엠텍 Device and method for common type conversion of plc control program
WO2018030831A1 (en) * 2016-08-12 2018-02-15 주식회사 유디엠텍 Apparatus and method for converting plc control program into structured data
CN109643100A (en) * 2016-08-12 2019-04-16 乌德姆泰克公司 For PLC control program to be converted to the device and method of structural data
CN112506129A (en) * 2020-12-15 2021-03-16 北京东土科技股份有限公司 Method, device and equipment for converting ladder diagram and storage medium
KR20220145096A (en) * 2021-04-21 2022-10-28 주식회사 유디엠텍 Apparatus and method for extracting common command information from PLC ladder information
WO2023195282A1 (en) * 2022-04-06 2023-10-12 オムロン株式会社 Program conversion device, program inspection device, method, and program

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2016062126A (en) * 2014-09-12 2016-04-25 富士電機株式会社 Program convert device
CN106200541A (en) * 2015-05-08 2016-12-07 杭州电子科技大学 A kind of method that FBD is converted to AOV structure
WO2017104934A1 (en) * 2015-12-17 2017-06-22 주식회사 유디엠텍 Device and method for common type conversion of plc control program
WO2018030831A1 (en) * 2016-08-12 2018-02-15 주식회사 유디엠텍 Apparatus and method for converting plc control program into structured data
CN109643100A (en) * 2016-08-12 2019-04-16 乌德姆泰克公司 For PLC control program to be converted to the device and method of structural data
CN109643100B (en) * 2016-08-12 2021-07-20 乌德姆泰克公司 Apparatus and method for converting PLC control program into structured data
CN112506129A (en) * 2020-12-15 2021-03-16 北京东土科技股份有限公司 Method, device and equipment for converting ladder diagram and storage medium
KR20220145096A (en) * 2021-04-21 2022-10-28 주식회사 유디엠텍 Apparatus and method for extracting common command information from PLC ladder information
KR102509859B1 (en) * 2021-04-21 2023-03-24 주식회사 유디엠텍 Apparatus and method for extracting common command information from PLC ladder information
WO2023195282A1 (en) * 2022-04-06 2023-10-12 オムロン株式会社 Program conversion device, program inspection device, method, and program

Similar Documents

Publication Publication Date Title
JP2010020635A (en) Programming language conversion apparatus, conversion method and conversion program
CN103279088B (en) Graphical programming language object editing and reporting tool
JP4302146B2 (en) Program creation support device
CN102880462A (en) Method and device for generating configuration monitoring object based on graph mode integration
JP5921765B2 (en) Program graph display device, program graph display method, and program graph display program
CN109716294B (en) User interface with removable mini-tab
CN104267962A (en) Description-based interface UI control configuration method
CN115495069B (en) Model-driven coal industry software process implementation method, device and equipment
JP5762601B1 (en) Program editing apparatus, method, and program
JP5498446B2 (en) Ladder program creation device and ladder program creation method
KR101350798B1 (en) Robot system controlled on the basis of opros platform and control method thereof
US20200174755A1 (en) Interactive application tool and methods
CN110457028A (en) A kind of page visual programming method, apparatus, server and storage medium
JP4843583B2 (en) Information processing apparatus, power system tree creation method and program
CN117744398A (en) Simulation method, simulation system, simulation device and storage medium for modeling software
KR20180135654A (en) Intuitive method of making a program
US20200174757A1 (en) Application development preview tool and methods
KR20140045101A (en) Three-dimensional modeling method using parametric data
JP6854982B1 (en) Programming support program, programming support device and programming support method
JP2009238215A (en) Data processing device and data processing method
Bocevska et al. An example of application design using solidworks application programming interface
JP6795996B2 (en) Sign language CG editing equipment and programs
JP2008123242A (en) Cad system and program packaged in this system
JP7423895B2 (en) Ladder diagram program creation support device, ladder diagram program creation support method, and ladder diagram program creation support program
JP2018156214A (en) SFC program creation support apparatus, SFC program creation support program, and SFC program creation method

Legal Events

Date Code Title Description
A300 Withdrawal of application because of no request for examination

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20111004