JP2010020635A - Programming language conversion apparatus, conversion method and conversion program - Google Patents
Programming language conversion apparatus, conversion method and conversion program Download PDFInfo
- 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
Links
Images
Landscapes
- Programmable Controllers (AREA)
Abstract
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
一方、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.
従来、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
図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
通信インタフェース14は、図示しないインターネット等の通信ネットワークを介して他のコンピュータやサーバ等との間で通信を行う。表示インタフェース15は、画面表示用のデータを制御部30から入力し、例えば、XMLで表現したLDプログラム及びXMLで表現したFBDプログラム等を表示装置2に出力する。操作インタフェース16は、オペレータによるキーボード3及びマウス4の操作に従って、操作データを制御部30に出力する。
The
HD13は、OS(オペレーティングシステム)20、画面制御プログラム21、言語変換プログラム22、LDプログラムデータ(XML文書)23及びFBDプログラムデータ(XML文書)24等を記憶する記憶部である。ここで、LDプログラムデータ(XML文書)23は、XMLで表現したLDプログラムであり、FBDプログラムデータ(XML文書)24は、XMLで表現したFBDプログラムである。
The
OS20は、PLCプログラミング言語変換装置1をコンピュータとして動作させるための基本的な機能を提供するプログラムである。画面制御プログラム21は、XMLで表現したLDプログラム及びXMLで表現したFBDプログラムを表示装置2に表示したり、オペレータによるキーボード3及びマウス4の操作に従って、必要なデータを表示装置2に表示したり等、表示装置2の画面にデータを表示する表示インタフェース15を制御するプログラムである。
The
言語変換プログラム22は、HD13に記憶されたLDプログラムデータ(XML文書)23を読み出し、後述する言語変換処理を行い、FBDプログラムデータ(XML文書)24を生成してHD13に格納するプログラムである。
The
また、OS20は、CPU10によって読み出されて実行されることにより、コンピュータの基本的な機能として、RAM11、ROM12及びHD13のメモリ管理に関する機能、通信インタフェース14の通信制御に関する機能、表示インタフェース15の表示制御に関する機能、操作インタフェース16の操作入力制御に関する機能等を実現する。そして、このOS20がCPU10によって実行された状態で、言語変換プログラム22等が実行される。
The
尚、OS20、画面制御プログラム21、言語変換プログラム22等は、例えば、図示しない通信ネットワークに接続されたサーバ等からネットワークケーブルを介してHD13にダウンロードされるようにしてもよく、また、CD−ROM等の記憶媒体に記憶してから当該記憶媒体を介して、HD13に読み込まれるようにしてもよい。
The
制御部30は、前述したとおり、CPU10、RAM11及びROM12により構成され、CPU10がHD13に記憶された言語変換プログラム22をRAM11に読み出して実行することにより、図3に示すような機能構成となる。
As described above, the
すなわち、図2に示した制御部30が言語変換プログラム22を実行することにより、PLCプログラミング言語変換装置1は、図3に示すように、機能ブロック抽出部31、LD/FBD変換部32及びFBDプログラム生成部33を備えることになる。
That is, when the
〔PLCプログラミング言語変換装置の処理〕
次に、図2及び図3に示したPLCプログラミング言語変換装置1の処理について説明する。図4は、PLCプログラミング言語変換装置1による言語変換処理の全体の流れを示すフローチャートである。
[Processing of PLC programming language converter]
Next, processing of the PLC programming
まず、PLCプログラミング言語変換装置1の機能ブロック抽出部31は、HD13からLDプログラムデータ(XML文書)23を読み出し(ステップS401)、LDプログラムデータ(XML文書)23から機能ブロックを抽出し、機能ブロックによる階層構造データを生成する(ステップS402)。
First, the functional
LD/FBD変換部32は、機能ブロック抽出部31により生成された、機能ブロックによる階層構造データを入力し、機能ブロック毎にLDプログラムをFBDプログラムに変換し、機能ブロック毎のFBD部品を生成する(ステップS403)。
The LD /
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 /
〔機能ブロック化及び階層構造生成処理〕
次に、図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
図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
まず、機能ブロック抽出部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
機能ブロック抽出部31は、基準となるラダー160に基づいて、LDプログラムデータ(XML文書)23を構成するラダーから機能ブロック(1)を抽出する(ステップS503)。具体的には、機能ブロック抽出部31は、基準となるラダー160の変数を使用しているラダーを特定し、その特定したラダーをラダー番号の順番に整列させ、整列後のラダー群を機能ブロック(1)として抽出する。
The functional
図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
図5に戻って、機能ブロック抽出部31は、抽出した機能ブロック(1)の中で、基準となるラダーが1行のみ存在するか否かを判定する(ステップS504)。基準となるラダーが1行のみ存在すると判定した場合(ステップS504:Y)、ステップS501へ移行する。一方、基準となるラダーが2行以上存在すると判定した場合(ステップS504:N)、抽出した機能ブロック(1)の中で、新たに基準となるラダー(の行)を特定する(ステップS505)。そして、機能ブロック抽出部31は、新たに基準となるラダーに基づいて、機能ブロック(2)を抽出する(ステップS506)。
Returning to FIG. 5, the functional
図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
機能ブロック抽出部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
尚、図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
図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
ここで、機能ブロック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
尚、図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
〔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 /
まず、LD/FBD変換部32は、FBD部品が生成されていない未処理の機能ブロックが存在するか否かを判定する(ステップS1001)。最初は全ての機能ブロックが未処理であるから、未処理の機能ブロックが存在するものと判定される。LD/FBD変換部32は、後述するステップS1002からステップS1008までの処理を繰り返した後、未処理の機能ブロックが存在しないと判定した場合(ステップS1001:N)、FBD部品生成処理は終了する。
First, the LD /
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 /
LD/FBD変換部32は、ステップS1002にて選択した機能ブロックについて、その機能ブロックに含まれるLD機能要素をFB機能要素に置き替える(ステップS1003)。これにより、LDプログラムの機能ブロックは、FBDプログラムのFB図に置き替えられる。
The LD /
図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
LD/FBD変換部32は、ステップS1003において機能ブロックから置き替えたFB図について、入力変数を設定する(ステップS1004)。図12の例では、a114,a113,a112,a12,a13が入力変数として設定される。ここで設定された入力変数は、そのFB図全体の入力情報であり、FBD部品の入力情報になる。このようにして設定された入力変数は、後述するFBD配線処理において、FBD部品を配線するときに出力変数に接続するための参照情報として用いられる。
The LD /
LD/FBD変換部32は、ステップS1003において機能ブロックから置き替えたFB図について、出力変数を設定する(ステップS1005)。図12の例では、a11,a111,a1が出力変数として設定される。ここで設定された出力変数は、そのFB図全体の出力情報であり、FBD部品の出力情報になる。このようにして設定された出力変数は、後述するFBD配線処理において、FBD部品を配線するときに入力変数に接続するための参照情報として用いられる。
The LD /
LD/FBD変換部32は、ステップS1003において機能ブロックから置き替えたFB図について、一次遅れ変数を、オペレータの操作入力に従って設定する(ステップS1006)。一次遅れ変数とは、出力変数にて変数値が確定する前に参照される入力変数である。具体的には、LDプログラムにおいて、一次遅れ変数である入力変数を含む第1のラダー、及び、その一次遅れ変数である入力変数に反映する出力変数を含む第2のラダーがこの順番で存在する場合、前者のラダーの入力変数には、後者のラダーの出力変数の変数値が次のスキャンで反映される。したがって、前者のラダーの入力変数は、その変数値が1スキャン遅れて反映されるため、一次遅れ変数となる。
The LD /
オペレータは、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 /
LD/FBD変換部32は、ステップS1003において機能ブロックから置き替えたFB図について、オペレータの操作入力により、予め設定された入出力変数を隠蔽する(ステップS1007)。ここで、隠蔽とは、生成されるFBD部品が画面に表示されたときに、その変数を表示しないようにすることをいう。オペレータは、隠蔽する入出力変数として、一つの機能ブロック内に存在する変数のみを設定し、複数の機能ブロック間で相互に関連する変数は設定しない。尚、LD/FBD変換部32は、一つの機能ブロック内に存在する変数であるか、複数の機能ブロック間で相互に関連する変数であるかを判定し、隠蔽する入出力変数を自動的に設定して隠蔽するようにしてもよい。
The LD /
前述したステップ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 /
このように、LD/FBD変換部32は、機能ブロック抽出部31により生成された階層構造データに対して、下層の機能ブロック毎にLD機能要素をFB機能要素に変換し、入力変数、出力変数及び一次遅れ変数を設定し、さらに隠蔽する入出力変数を設定することにより、その機能ブロックに対応するFBD部品を生成する。これにより、全ての下層の機能ブロックに対応するFBD部品を完成することができる。また、入力変数、出力変数及び一次遅れ変数を設定するようにしたから、後述するFBD配線処理においてこれらの変数を参照することにより、FBD部品どうしを配線することができる。また、隠蔽する入出力変数を設定するようにしたから、画面上にFBDプログラムを表示したときに、隠蔽の設定がされた変数は表示されず、全体として見やすいプログラムとなる。
As described above, the LD /
〔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プログラム生成部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
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
また、本発明の実施形態による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
以上、実施形態を挙げて本発明を説明したが、本発明は前記実施形態に限定されるものではなく、その技術思想を逸脱しない範囲で種々変形可能である。例えば、図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.
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
11 RAM
12 ROM
13 HD
14 Communication interface 15 Display interface 16
21
24 FBD program data (XML document)
30
Claims (6)
マークアップ言語で表現した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プログラムから、互いに共通する前記変数を有するラダー群からなる機能ブロックを抽出する第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:
前記第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.
前記第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.
前記第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プログラムから、互いに共通する前記変数を有するラダー群からなる機能ブロックを抽出する処理と、
前記抽出した機能ブロックから、さらに互いに共通する前記変数を有するラダー群からなる下層の機能ブロックを階層的に順次抽出する処理と、
前記抽出する処理を繰り返すことにより、階層構造データを生成する処理と、
前記生成した階層構造データを用いて、前記機能ブロック毎に、その機能ブロックの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
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)
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 |
-
2008
- 2008-07-11 JP JP2008181929A patent/JP2010020635A/en not_active Withdrawn
Cited By (10)
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 |