JP5785130B2 - Program generator - Google Patents

Program generator Download PDF

Info

Publication number
JP5785130B2
JP5785130B2 JP2012095647A JP2012095647A JP5785130B2 JP 5785130 B2 JP5785130 B2 JP 5785130B2 JP 2012095647 A JP2012095647 A JP 2012095647A JP 2012095647 A JP2012095647 A JP 2012095647A JP 5785130 B2 JP5785130 B2 JP 5785130B2
Authority
JP
Japan
Prior art keywords
template
program
list
parts list
hierarchical structure
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.)
Active
Application number
JP2012095647A
Other languages
Japanese (ja)
Other versions
JP2013222439A (en
Inventor
安井 照昌
照昌 安井
勘 仲井
勘 仲井
啓文 甲斐
啓文 甲斐
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric Corp
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 Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP2012095647A priority Critical patent/JP5785130B2/en
Publication of JP2013222439A publication Critical patent/JP2013222439A/en
Application granted granted Critical
Publication of JP5785130B2 publication Critical patent/JP5785130B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/02Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]

Description

本発明は、プログラム生成装置に関し、特に、産業用コントローラやマイコンで実行される計測監視制御プログラムの作成支援を行うプログラム生成装置に関する。   The present invention relates to a program generation device, and more particularly to a program generation device that supports creation of a measurement monitoring control program executed by an industrial controller or a microcomputer.

従来より、各種設備の計測監視制御の目的で、プログラマブルコントローラ(Programmable Controller;PC)、モーションコントローラ(Motion Controller;MC)、数値制御装置コントローラ(Numerical Controller;NC)、検査装置コントローラ、表示器(Graphic Operation Terminal;GOT)などの産業用コントローラが用いられている。産業用コントローラで実行される計測監視制御プログラムに用いられる言語としては、ラダーを代表例とするIEC61131−3規格に準拠した言語や、コントローラ専用の言語などがあげられる。   Conventionally, for the purpose of measurement monitoring control of various facilities, a programmable controller (PC), a motion controller (MC), a numerical controller (NC), an inspection controller, a display (Graphic) Industrial controllers such as Operation Terminal (GOT) are used. Languages used in the measurement monitoring control program executed by the industrial controller include a language conforming to the IEC61131-3 standard with a ladder as a representative example, a language dedicated to the controller, and the like.

以下、産業用コントローラの代表として、プログラマブルコントローラ(以下、PCという)を例にあげて説明する。PCは計測監視制御プログラム(以下、プログラムという)を実行して、計測監視制御対象の状態を把握したり、動作を指示したりする。プログラムは、所定のプログラム作成支援装置(例えば、ラダー作成支援装置)を用いて作成され、主に変数、デバイス、数値を用いて記述される。   Hereinafter, a programmable controller (hereinafter referred to as PC) will be described as an example of a representative industrial controller. The PC executes a measurement monitoring control program (hereinafter referred to as a program), grasps the state of the measurement monitoring control target, and instructs the operation. The program is created using a predetermined program creation support device (for example, a ladder creation support device), and is mainly described using variables, devices, and numerical values.

ここでいうデバイスとは、PCとそれが接続する計測監視制御対象との間の入出力をPCのメモリアドレスに割りつけたもの、および、PCが内部的に使用するメモリアドレスを指している。例えば、非特許文献1に示されたようなプログラム作成支援装置(ラダー作成支援装置)に対応するPCでは、入力を割りつけたものをXデバイス、出力を割りつけたものをYデバイス、内部的に使用するビットデータ(内部リレー)をMデバイス、内部的に使用するワードデータ(レジスタ)をDデバイスやRデバイス、というようにデータ種別によってデバイス文字が予め決められている。デバイスはデバイス文字とアドレスにより表記され、例えば入力デバイスのアドレス0のものは「X0」と表記される。   The device here refers to a device in which input / output between a PC and a measurement monitoring control target connected to the PC is assigned to a memory address of the PC, and a memory address used internally by the PC. For example, in a PC corresponding to a program creation support apparatus (ladder creation support apparatus) as shown in Non-Patent Document 1, an input device is assigned an X device, an output assignment is a Y device, and an internal The device character is determined in advance according to the data type, such as bit data (internal relay) used for the M device and word data (register) used internally for the D device and R device. A device is represented by a device character and an address. For example, an input device having an address of 0 is represented by “X0”.

プログラム作成支援装置は、一般的にはパーソナルコンピュータ(以下、パソコンという)上で動作するソフトウェアツールとして提供され、PCが設備の計測・監視・制御を行うためのプログラムの編集を支援する他、PCをパソコンに接続して、パソコンで編集したプログラム(あるいはそれをコンパイルして得られた実行コード)をPCへ転送する機能などを有している。非特許文献1はこうしたプログラム作成支援装置の例である。なお、プログラム作成支援装置が提供するプログラム編集機能などを搭載する表示器(GOT)もある。これにより、PCと常時接続状態にあるGOT上から、プログラムの編集などを行うことができる。   The program creation support device is generally provided as a software tool that operates on a personal computer (hereinafter referred to as a personal computer), and supports the editing of a program for the PC to measure, monitor, and control the facility. Is connected to a personal computer, and a program edited by the personal computer (or an executable code obtained by compiling it) is transferred to the PC. Non-Patent Document 1 is an example of such a program creation support apparatus. There is also a display (GOT) equipped with a program editing function provided by the program creation support device. As a result, the program can be edited from the GOT that is always connected to the PC.

計測監視制御対象である設備の仕様およびプログラムは、パソコン上で動作するソフトウェアツールを用いて記述されることにより、電子的にデータ化されているが、仕様とプログラムの間には電子データ的な相互関係がないことから、計測監視制御プログラムは、仕様に基づいて、プログラム作成支援装置を用いて人手により作成されている。そのため、仕様に記述された機能を過不足なく、不具合無く動作させるプログラムの作成には多大な労力が必要であった。   The specifications and programs of the equipment that is the object of measurement, monitoring, and control are converted into electronic data by being described using a software tool that runs on a personal computer. Since there is no correlation, the measurement monitoring control program is manually created using a program creation support device based on the specifications. For this reason, a great deal of effort was required to create a program that can operate without any deficiencies in the functions described in the specifications.

近年では、よく使用するプログラムをプログラムモジュール(Program Organization Unit;POU)として部品化し、設備の仕様に合致するPOUを再利用しつつ、複数のPOUからプログラムを構成することが可能なプログラム作成支援装置もある。プログラム言語がラダーであれば、POUはサブルーチンや機能ブロック(Function Block;FB)に相当し、ストラクチャードテキスト(Structured Text;ST)などであれば、POUはサブルーチンや関数に相当する。   In recent years, frequently used programs are converted into program modules (Program Organization Units; POUs) as parts, and a program creation support apparatus that can construct a program from a plurality of POUs while reusing POUs that match equipment specifications. There is also. If the programming language is a ladder, the POU corresponds to a subroutine or function block (FB), and if it is structured text (ST), the POU corresponds to a subroutine or function.

さらに、複数のプログラム部品からなる任意のプログラムパタンに名前(マクロ名)をつけて登録しておき、プログラムの作成時にそれを呼び出して再利用(マクロ流用)できるマクロ機能を有するプログラム作成支援装置もある。このようにプログラム部品を再利用できるプログラム作成支援装置を用いることにより、プログラム作成の労力は軽減される。   Furthermore, there is also a program creation support apparatus having a macro function that allows an arbitrary program pattern made up of a plurality of program parts to be registered with a name (macro name) registered and called up and reused (macro diversion) when creating the program. is there. By using the program creation support apparatus that can reuse program parts in this way, the effort for program creation is reduced.

例えば、特許文献1ではこのようなプログラム再利用に関してプログラム部品中のデバイスなどを示す場所をユーザが抽象的な名前で記述したものを再利用し、抽象名を部品実体化情報により実体化して具体的なプログラムを生成する方法について述べているが、抽象名で記述された部品挿入箇所と挿入する実体との間には単純な関係しかなく、ある部品実体が複数箇所に展開されることにより論理回路を構成する具体的な方法については述べられていない。   For example, in Japanese Patent Laid-Open No. 2004-260688, a user describes a place indicating a device in a program part with an abstract name for reuse, and the abstract name is instantiated by part instantiation information. However, there is only a simple relationship between the part insertion part described by the abstract name and the entity to be inserted. No specific method for constructing the circuit is described.

特開平7−49651号公報Japanese Patent Laid-Open No. 7-49651

「GX Developer Version 8 オペレーティングマニュアル」 三菱電機株式会社、マニュアル番号SH-080356"GX Developer Version 8 Operating Manual" Mitsubishi Electric Corporation, manual number SH-080356

上記のように、プログラムの作成は、作成者即ち人間が計測監視制御対象の仕様記述を理解した上で手作業により行われる。近年のプログラム作成支援装置では、プログラム部品を再利用することにより、プログラムの作成労力はある程度軽減されるが、仕様に合致するようにプログラムを作成するためには、どのプログラム部品を選定し、それらをどのように組み合わせるかといった判断が難しく、更にその労力を軽減することが望まれていた。   As described above, the program is manually created after the creator, that is, a person understands the specification description of the measurement monitoring control target. In recent program creation support devices, the program creation effort can be reduced to some extent by reusing program parts. However, in order to create a program that conforms to the specifications, which program parts are selected, It was difficult to determine how to combine the two, and further reduction of the labor was desired.

この発明は上記のような課題を解決するためになされたもので、プログラム作成効率の向上を図ることのできるプログラム生成装置を得ることを目的とする。   The present invention has been made to solve the above-described problems, and an object of the present invention is to provide a program generation apparatus that can improve the efficiency of program creation.

この発明に係るプログラム生成装置は、プログラムを構成する部品の階層構造を示す部品リストと、プログラムの部分記述と、階層構造における子テンプレートの挿入位置を示す記述とからなり、プログラムの部分記述として、階層構造中の相対位置で対象を指定するためのパラメタを含むテンプレートとを設けると共に、部品リストとテンプレートとを入力とし、テンプレートのパラメタの対象指定を、パラメタが記述されたテンプレートの階層構造中の位置と、部品リストの階層構造中で同じ位置にある要素を起点とした相対位置で解釈した対象の部品で置換することによりプログラムを生成するプログラム生成部を備えたものである。   The program generation apparatus according to the present invention includes a parts list indicating a hierarchical structure of parts constituting a program, a partial description of the program, and a description indicating an insertion position of the child template in the hierarchical structure. A template including a parameter for specifying a target at a relative position in the hierarchical structure is provided, and a part list and a template are input, and the target specification of the template parameter is specified in the hierarchical structure of the template in which the parameter is described. A program generation unit is provided that generates a program by replacing a position and a target part interpreted at a relative position starting from an element at the same position in the hierarchical structure of the parts list.

この発明のプログラム生成装置は、テンプレートのパラメタの対象指定を、パラメタが記述されたテンプレートの階層構造中の位置と、部品リストの階層構造中で同じ位置にある要素を起点とした相対位置で解釈した対象の部品で置換することによりプログラムを生成するようにしたので、プログラム作成効率の向上を図ることができる。   The program generation apparatus according to the present invention interprets the target specification of a template parameter based on a position in the template hierarchical structure in which the parameter is described and a relative position starting from an element at the same position in the hierarchical structure of the parts list. Since the program is generated by substituting with the target part, the efficiency of program creation can be improved.

実施の形態1に係るプログラム生成装置の最小構成を示す構成図である。1 is a configuration diagram illustrating a minimum configuration of a program generation device according to Embodiment 1. FIG. 実施の形態1に係るプログラム生成装置の拡張構成を示す構成図である。1 is a configuration diagram illustrating an extended configuration of a program generation device according to Embodiment 1. FIG. 自己保持回路を表すラダープログラムの説明図である。It is explanatory drawing of the ladder program showing a self-holding circuit. 図3のラダープログラムを論理式で表現した説明図である。FIG. 4 is an explanatory diagram expressing the ladder program of FIG. 3 by a logical expression. 図3のラダープログラムを木構造で表現した説明図である。FIG. 4 is an explanatory diagram expressing the ladder program of FIG. 3 in a tree structure. 実施の形態1に係る1階層と2階層の部品リストの例を示す説明図である。FIG. 6 is an explanatory diagram illustrating an example of a component list of a first hierarchy and a second hierarchy according to the first embodiment. 実施の形態1に係る2階層と1階層のテンプレートの例を示す説明図である。6 is an explanatory diagram illustrating an example of a template of two layers and one layer according to Embodiment 1. FIG. 実施の形態1に係るパラメタを示す説明図である。6 is an explanatory diagram showing parameters according to Embodiment 1. FIG. 実施の形態1に係る参照指定・複製指定および複製制約を示す説明図である。FIG. 6 is an explanatory diagram showing reference designation / duplication designation and duplication restrictions according to the first embodiment. 実施の形態1に係るテンプレートと部品リストとの階層構造の対応と生成されるプログラムを示す説明図である。It is explanatory drawing which shows the correspondence of the hierarchical structure of the template and component list which concern on Embodiment 1, and the produced | generated program. 実施の形態1に係るテンプレート階層の順次処理を示すフローチャートである。4 is a flowchart showing sequential processing of template hierarchies according to the first embodiment. 実施の形態1に係るテンプレートのパラメタを部品リスト中の要素で置き換える処理を示すフローチャートである。It is a flowchart which shows the process which replaces the parameter of the template which concerns on Embodiment 1 with the element in a parts list. 図10のラダープログラムをラダー図で表現した説明図である。It is explanatory drawing which expressed the ladder program of FIG. 10 with the ladder diagram. 実施の形態1に係るプログラムを内部に含むテンプレートと、それを用いたプログラム生成例を示す説明図である。It is explanatory drawing which shows the template which contains the program which concerns on Embodiment 1 inside, and the example of a program production | generation using the same. 実施の形態1に係る親を参照するパラメタを含むテンプレートと、それを用いたプログラム生成例を示す説明図である。It is explanatory drawing which shows the template containing the parameter which refers the parent which concerns on Embodiment 1, and the example of a program production | generation using the template. 図15のラダープログラムをラダー図で表現した説明図である。FIG. 16 is an explanatory diagram representing the ladder program of FIG. 15 in a ladder diagram. 実施の形態1に係る複製指定を含むテンプレートと、それを用いたプログラム生成例を示す説明図である。It is explanatory drawing which shows the template containing the replication designation | designated which concerns on Embodiment 1, and the example of a program production | generation using the same. 実施の形態1に係る複数の複製指定を含むテンプレートと、それを用いたプログラム生成例を示す説明図である。It is explanatory drawing which shows the template containing the some replication designation | designated which concerns on Embodiment 1, and the example of a program production | generation using the same. 図18のラダープログラムをラダー図で表現した説明図である。FIG. 19 is an explanatory diagram representing the ladder program of FIG. 18 in a ladder diagram. 実施の形態1に係る複製指定を持ったテンプレートと複製インデクスを示す説明図である。It is explanatory drawing which shows the template with a replication designation | designated and replication index which concern on Embodiment 1. FIG. 実施の形態1に係る複製制約を含むテンプレートと、それを用いたプログラム生成例を示す説明図である。It is explanatory drawing which shows the template containing the replication restrictions which concern on Embodiment 1, and the example of a program production | generation using the same. 図21のラダープログラムをラダー図で表現した説明図である。FIG. 22 is an explanatory diagram expressing the ladder program of FIG. 21 in a ladder diagram. 実施の形態1に係る複製指定・複製制約を含んだテンプレート処理のフローチャートである。6 is a flowchart of template processing including duplication designation / duplication constraints according to the first embodiment. 実施の形態1に係るインターロック回路を表現したテンプレートと部品リストを示す説明図である。FIG. 4 is an explanatory diagram showing a template and a parts list expressing the interlock circuit according to the first embodiment. 図24の1つ目の複製指定によりテンプレートを複製した状態を示す説明図である。It is explanatory drawing which shows the state which duplicated the template by the 1st replication designation | designated of FIG. 図24の左端の部分木に対し、2つ目の複製指定によりテンプレートを複製した状態に複製インデクスを付記した状態を示す説明図である。FIG. 25 is an explanatory diagram showing a state in which a replication index is added to a state where a template is replicated by a second replication designation for the leftmost subtree in FIG. 24. 図24の左端の部分木に対し、2つ目の複製指定と複製制約によりテンプレートを複製した状態を示す説明図である。It is explanatory drawing which shows the state which duplicated the template by the 2nd replication specification and replication restrictions with respect to the partial tree of the left end of FIG. 図24の構成から生成したプログラムを示す説明図である。It is explanatory drawing which shows the program produced | generated from the structure of FIG. 図24〜図28で生成されるインターロック回路をラダー図で表現した説明図である。FIG. 29 is an explanatory diagram expressing the interlock circuit generated in FIGS. 24 to 28 in a ladder diagram. 図24〜図28のテンプレートに対応した5要素のインターロック回路の部品リストを示す説明図である。It is explanatory drawing which shows the components list | wrist of a 5-element interlock circuit corresponding to the template of FIGS. 図30の部品リストを用いて生成されるインターロック回路をラダー図で表現した説明図である。FIG. 31 is an explanatory diagram in which an interlock circuit generated using the parts list in FIG. 30 is represented by a ladder diagram. オン優先インターロック回路を表現したテンプレートの説明図である。It is explanatory drawing of the template expressing an on-priority interlock circuit. 図32のテンプレートから生成されるオン優先インターロック回路をラダー図で表現した説明図である。FIG. 33 is an explanatory diagram expressing an on-priority interlock circuit generated from the template of FIG. 32 in a ladder diagram. 実施の形態1に係るテンプレート編集画面の実現例を示す説明図である。6 is an explanatory diagram illustrating an implementation example of a template editing screen according to Embodiment 1. FIG. 実施の形態1に係るプログラム編集画面の実現例を示す説明図である。6 is an explanatory diagram illustrating an implementation example of a program editing screen according to Embodiment 1. FIG. XMLで記述した図6の部品リストを示す説明図である。It is explanatory drawing which shows the components list | wrist of FIG. 6 described by XML. S式で記述した図6の部品リストを示す説明図である。It is explanatory drawing which shows the components list of FIG. 6 described by S type | formula. 実施の形態1に係るテンプレート表示領域とプログラム表示領域を持つプログラム編集画面の実現例を示す説明図である。FIG. 6 is an explanatory diagram showing an implementation example of a program editing screen having a template display area and a program display area according to the first embodiment. 実施の形態2に係る表計算ソフト特有の操作を用いてプログラムを生成するシステムの画面と操作を示す説明図である。It is explanatory drawing which shows the screen and operation of a system which produce | generate a program using operation specific to the spreadsheet software which concerns on Embodiment 2. FIG.

実施の形態1.
図1は、この発明の実施の形態1によるプログラム生成装置の構成図である。
図1に示すプログラム生成装置は、テンプレート1、部品リスト2、プログラム生成部3を備えている。テンプレート1は、プログラムの部分記述と、階層構造における子テンプレートの挿入位置を示す記述とからなり、また、プログラムの部分記述として、階層構造中の相対位置で対象を指定するためのパラメタを含むものである。部品リスト2は、プログラムを構成する部品の階層構造を示すものである。プログラム生成部3は、部品リスト2とテンプレート1とを入力とし、テンプレート1のパラメタの対象指定を、そのパラメタが記述されたテンプレート1の階層構造中の位置と、部品リスト2の階層構造中で同じ位置にある部品リスト2を起点とした相対位置で解釈した対象の部品で置換することによりプログラム4を生成するものである。また、この構成は本発明の最小構成であるが、さらに、各種の機能部を備えてもよい。
Embodiment 1 FIG.
FIG. 1 is a configuration diagram of a program generation apparatus according to Embodiment 1 of the present invention.
The program generation apparatus shown in FIG. 1 includes a template 1, a parts list 2, and a program generation unit 3. The template 1 is composed of a partial description of the program and a description indicating the insertion position of the child template in the hierarchical structure, and includes a parameter for designating a target at a relative position in the hierarchical structure as the partial description of the program. . The parts list 2 shows a hierarchical structure of parts constituting the program. The program generation unit 3 receives the parts list 2 and the template 1 as input, and designates the target of the parameter of the template 1 in the hierarchical structure of the template 1 where the parameter is described and in the hierarchical structure of the part list 2. The program 4 is generated by replacing the parts list 2 at the same position with the target parts interpreted at the relative positions starting from the parts list 2. This configuration is the minimum configuration of the present invention, but various functional units may be further provided.

なお、プログラム生成装置はコンピュータを用いて実現され、プログラム生成部3は、その機能に対応したソフトウェアと、このソフトウェアを実行するCPUやメモリといったハードウェアから構成されている。また、プログラム生成装置は、ユーザが各種の入力を行うための入力部や、テンプレート1や部品リスト2、プログラム4等を表示するための表示部を備えている。   Note that the program generation device is realized by using a computer, and the program generation unit 3 includes software corresponding to the function, and hardware such as a CPU and a memory that execute the software. Further, the program generation device includes an input unit for the user to perform various inputs, and a display unit for displaying the template 1, the component list 2, the program 4, and the like.

図2は、プログラム生成装置の拡張構成を示す構成図である。
図示のプログラム生成装置は、テンプレート1を保持するテンプレート保持部5と、部品リスト2を保持する部品リスト保持部6を備えると共に、図1と同様のプログラム生成部3と、テンプレート編集部7、テンプレート表示部8、部品リスト編集部9、部品リスト表示部10、自動生成部11、プログラム編集部12、プログラム表示部13を備えている。
FIG. 2 is a configuration diagram illustrating an extended configuration of the program generation device.
The illustrated program generation apparatus includes a template holding unit 5 that holds a template 1 and a parts list holding unit 6 that holds a parts list 2, and a program generation unit 3, a template editing unit 7, and a template similar to those in FIG. A display unit 8, a component list editing unit 9, a component list display unit 10, an automatic generation unit 11, a program editing unit 12, and a program display unit 13 are provided.

テンプレート編集部7は、テンプレート1の編集を行う処理部であり、テンプレート表示部8は、テンプレート編集部7で編集するテンプレート1やテンプレート保持部5で保持されているテンプレート1の情報を表示する表示部である。部品リスト編集部9は、プログラム編集部12からの指示に従い、部品リスト2の編集を行う処理部である。また、部品リスト表示部10は部品リスト2に関する情報を表示する表示部である。自動生成部11は、テンプレート1から部品リスト2の自動生成を行う処理部である。プログラム編集部12は、部品リスト編集部9やプログラム生成部3を呼び出し、プログラム編集を行う処理部である。また、プログラム表示部13は、プログラム編集部12の編集するプログラム4やプログラム生成部3によって生成されたプログラム4を表示するための表示部である。なお、テンプレート表示部8、部品リスト表示部10およびプログラム表示部13は、それぞれ独立した表示部であっても、画面中の部分的な領域であってもよい。
以上、実施の形態1では、図2に示した各機能部を任意の組み合わせで構成することができる。
The template editing unit 7 is a processing unit that edits the template 1, and the template display unit 8 is a display that displays the information of the template 1 that is edited by the template editing unit 7 and the template 1 that is held by the template holding unit 5. Part. The parts list editing unit 9 is a processing unit that edits the parts list 2 in accordance with an instruction from the program editing unit 12. The parts list display unit 10 is a display unit that displays information about the parts list 2. The automatic generation unit 11 is a processing unit that automatically generates the component list 2 from the template 1. The program editing unit 12 is a processing unit that calls the parts list editing unit 9 and the program generation unit 3 to perform program editing. The program display unit 13 is a display unit for displaying the program 4 edited by the program editing unit 12 and the program 4 generated by the program generation unit 3. The template display unit 8, the parts list display unit 10 and the program display unit 13 may be independent display units or partial areas on the screen.
As described above, in the first embodiment, the functional units illustrated in FIG. 2 can be configured in any combination.

ラダー言語はPLCプログラムの記述に用いられるプログラミング言語であり、一般に図3のようなラダー図で表現される。ラダープログラムはリレー回路を表現しており、スイッチおよびコイルの直列・並列結合が入れ子になった回路と等価である。301の記号はA接点であり、デバイスX0がオンになると通電するスイッチを表す。302の記号はB接点であり、デバイスX1がオフになると通電するスイッチを表す。303の記号はコイルであり、入力がオンになった場合に出力がオンとなる電磁スイッチである。X0,X1,Y10などはデバイスであり、ある特定のスイッチ・センサなどを表す。以下、デバイスX0につながった接点を接点X0などと呼称する。接点X0とY10は並列結合されており、いずれかのスイッチがオンの場合通電し、出力がオンとなる。X1はその出力に直列結合されており、B接点なのでX1がオフの時通電する。よって、X0またはY10のいずれかがオンで、X1がオフの場合のみY10の入力はオンになる。   The ladder language is a programming language used for describing a PLC program, and is generally expressed by a ladder diagram as shown in FIG. The ladder program represents a relay circuit, and is equivalent to a circuit in which a series / parallel combination of switches and coils is nested. Reference numeral 301 denotes an A contact, which represents a switch that is energized when the device X0 is turned on. Reference numeral 302 denotes a B contact, which represents a switch that is energized when the device X1 is turned off. Reference numeral 303 denotes a coil, which is an electromagnetic switch whose output is turned on when the input is turned on. X0, X1, Y10, etc. are devices, which represent a specific switch / sensor. Hereinafter, the contact connected to the device X0 is referred to as a contact X0 or the like. The contacts X0 and Y10 are connected in parallel. When any of the switches is on, power is supplied and the output is turned on. X1 is connected in series to its output and is energized when X1 is off because it is a B contact. Therefore, the input of Y10 is turned on only when either X0 or Y10 is on and X1 is off.

即ち、ラダーはブール式を表現しており、図3のラダーは図4に示す論理式と等価である。ブール式はAND,ORの入れ子として表現できる。同様にラダープログラムは直列・並列結合回路の入れ子として表現できる。図5に図3のラダーを階層表現したものを示す。図5において、接点X1とコイルY10の関係は論理式のANDとは異なるが、回路上は直列回路であるので接続関係については同様の表現が可能である。   That is, the ladder expresses a Boolean expression, and the ladder in FIG. 3 is equivalent to the logical expression shown in FIG. Boolean expressions can be expressed as AND and OR nesting. Similarly, a ladder program can be expressed as a nested series / parallel connection circuit. FIG. 5 shows a hierarchical representation of the ladder of FIG. In FIG. 5, although the relationship between the contact X1 and the coil Y10 is different from the logical AND, the connection relationship can be expressed in the same way because the circuit is a series circuit.

図3の回路は自己保持回路とよばれ、ラダープログラムでは重要な回路である。もし、304がないとすると、スイッチX1は押されていない状態では通電しているため、スイッチX0を押すとコイルY10はオンとなり、離すとオフとなる。304が存在すると、X0を押した時にY10がオンとなり、304もオンとなるため、X0を離しても304がオンとなり、301と304の並列結合の出力はオンとなり、303の入力はオンのままとなる。つまり、X0を一度押すと、離してもY10がオンの状態を維持する回路である。直列接続となっている302を押すとY10はオフとなる。   The circuit in FIG. 3 is called a self-holding circuit and is an important circuit in a ladder program. If there is no 304, the switch X1 is energized when not pressed, so the coil Y10 is turned on when the switch X0 is pressed and turned off when the switch X1 is released. If 304 exists, Y10 is turned on when X0 is pressed, and 304 is also turned on. Therefore, even if X0 is released, 304 is turned on, the output of the parallel combination of 301 and 304 is turned on, and the input of 303 is turned on. Will remain. That is, when X0 is pressed once, Y10 remains on even if released. Pressing 302 in series connection turns off Y10.

以下では、上記の階層構造を利用し、部分プログラムの構造を表し再利用可能なテンプレート1と、部品リスト2から具体値を取得してテンプレート1に適用してラダープログラムを生成する装置について述べる。
部品リスト2は部品具体値または部品リストを要素とするリストである。図6に部品リスト2の例を示す。部品リスト2は階層構造を取る。図6の(a)が1階層の例であり、(b)が2階層の例である。部品リストBが部品リストAの要素である時、BはAの子部品リストであり、AはBの親部品リストである。図6の(b)では、601は602の親部品リストであり、602は601の子部品リストである。ユーザがテンプレート1に対し、テンプレート1が必要とする構造の部品リスト2を定義することによりプログラム生成部3はプログラム4を生成する。
In the following, a template 1 that represents the structure of a partial program and that can be reused using the above-described hierarchical structure, and a device that generates a concrete value from the parts list 2 and applies it to the template 1 will be described.
The component list 2 is a list having a component specific value or a component list as an element. FIG. 6 shows an example of the parts list 2. The parts list 2 has a hierarchical structure. FIG. 6A shows an example of one layer, and FIG. 6B shows an example of two layers. When the parts list B is an element of the parts list A, B is a child parts list of A and A is a parent parts list of B. In FIG. 6B, 601 is a parent part list of 602, and 602 is a child parts list of 601. When the user defines a part list 2 having a structure required by the template 1 for the template 1, the program generation unit 3 generates the program 4.

テンプレート1はプログラム4の構造を定義するプログラム部品である。同一の構造を持つプログラム4に対しては同じテンプレート1を利用して異なった部品リスト2を定義することによりプログラム4を生成することができる。
テンプレート1はプログラム内容の記述を含む。ラダー言語のテンプレート1の最も単純なものはラダー言語そのものであり、例えば、図5に示した階層構造がテンプレート1の例となる。
プログラム内容の記述にはテンプレート1を含むことができる。含まれるテンプレート1を子テンプレートと呼ぶ。子テンプレートにとって自分を含むテンプレート1は親テンプレートである。図5では、502は501の子テンプレートであり、501は502の親テンプレートである。図7は、テンプレートの例であり、図7(a)が2階層のテンプレート、図7(b)が1階層のテンプレートを示している。
Template 1 is a program part that defines the structure of program 4. For the program 4 having the same structure, the program 4 can be generated by defining different parts lists 2 using the same template 1.
Template 1 includes a description of the program content. The simplest one of the ladder language template 1 is the ladder language itself. For example, the hierarchical structure shown in FIG.
The description of the program content can include the template 1. The included template 1 is called a child template. For child templates, template 1 including itself is a parent template. In FIG. 5, 502 is a child template 501, and 501 is a parent template 502. 7A and 7B show examples of templates, in which FIG. 7A shows a two-level template and FIG. 7B shows a one-level template.

プログラム内容の記述にはパラメタを含むことができる。図8にパラメタを含むテンプレートを示す。接点・コイルなどの示すデバイスがパラメタとなっているため、異なったデバイスに対する同じ構造の回路(図示例では自己保持回路)を同一のテンプレート1から生成できる。パラメタは参照指定を持っており、プログラム生成部3はパラメタの位置に展開する部品を指定に沿って選択する。指定の詳細は後述する。   The description of the program content can include parameters. FIG. 8 shows a template including parameters. Since devices indicated by contacts and coils are parameters, circuits having the same structure (self-holding circuits in the illustrated example) for different devices can be generated from the same template 1. The parameter has a reference designation, and the program generation unit 3 selects a part to be developed at the parameter position according to the designation. Details of the designation will be described later.

プログラム生成部3は上記のテンプレート1と部品リスト2を入力とし、プログラム4を生成する。プログラム生成部3はテンプレート1中のパラメタを、そのパラメタが参照指定する部品リスト2中の要素と置き換えることによりプログラム4を生成する。図9は、この参照指定及び複製指定、複数制約を表現したものである。以下、参照指定について説明する。   The program generation unit 3 receives the template 1 and the parts list 2 as input and generates a program 4. The program generation unit 3 generates the program 4 by replacing the parameter in the template 1 with the element in the parts list 2 that is referred to by the parameter. FIG. 9 represents the reference designation, duplication designation, and plural constraints. The reference designation will be described below.

テンプレート1と部品リスト2は共に階層構造を持つ。テンプレート1中のパラメタは参照指定を持つが、参照指定は、テンプレート階層構造の中で自分が持つ位置と同じ部品リスト階層構造中の位置を起点として参照先を指定する。図10(a)において、テンプレート1と部品リスト2は同じ階層構造を持っており、接点1001は部品1002と同じ位置にある。参照指定により部品リスト2中の同じ位置にある部品を参照することができる。図10では1001のパラメタは参照指定「$.」がこれを表している。これにより、プログラム生成部3はテンプレート1中の1001部品のデバイスを部品リスト2中の1002の部品X0と置き換える。他のパラメタについても同様の置き換えを行い、図10(b)に示すラダープログラムを得る。   Both the template 1 and the parts list 2 have a hierarchical structure. The parameter in the template 1 has a reference designation. In the reference designation, a reference destination is designated starting from the same position in the parts list hierarchical structure as that of the template hierarchical structure. In FIG. 10A, the template 1 and the component list 2 have the same hierarchical structure, and the contact 1001 is at the same position as the component 1002. The parts at the same position in the parts list 2 can be referred to by reference designation. In FIG. 10, the reference designation “$.” Represents the parameter 1001. As a result, the program generation unit 3 replaces the 1001 component device in the template 1 with the 1002 component X0 in the component list 2. Similar replacement is performed for the other parameters to obtain a ladder program shown in FIG.

図11にテンプレート階層をたどる処理を表すフローチャートを示す。
即ち、先ず、現在位置をテンプレート1のトップに設定し(ステップST1)、その後、パラメタ展開など現在位置のテンプレート1の処理を行う(ステップST2)。次に、現在位置のテンプレート1に子があるかを判定し(ステップST3)、子があった場合は最初の子テンプレートに現在位置を移動して(ステップST4)、ステップST2に戻る。一方、ステップST3において、子がなかった場合は、現在位置のテンプレートに次の兄弟があるかを判定し(ステップST5)、兄弟があった場合は、次の兄弟テンプレートに現在位置を移動して(ステップST6)、ステップST2に戻り、なかった場合は親テンプレートがあるかを判定する(ステップST7)。ステップST7において親テンプレートがあった場合は、親テンプレートに現在位置を移動して(ステップST8)、ステップST2に戻り、親テンプレートが無かった場合は終了となる。
FIG. 11 is a flowchart showing the process of tracing the template hierarchy.
That is, first, the current position is set to the top of the template 1 (step ST1), and then processing of the template 1 at the current position such as parameter expansion is performed (step ST2). Next, it is determined whether the template 1 at the current position has a child (step ST3). If there is a child, the current position is moved to the first child template (step ST4), and the process returns to step ST2. On the other hand, if there is no child in step ST3, it is determined whether there is a next sibling in the template at the current position (step ST5). If there is a sibling, the current position is moved to the next sibling template. (Step ST6), returning to step ST2, if not, it is determined whether there is a parent template (step ST7). If there is a parent template in step ST7, the current position is moved to the parent template (step ST8), the process returns to step ST2, and if there is no parent template, the process ends.

図11のフローチャートにおけるステップST2の詳細を図12に示す。即ち、テンプレート中、置き換えられていないパラメタがあるか否かを判定し(ステップST21)、あった場合は、現在位置のテンプレート1と同じ位置の部品リスト2中の要素を起点として、パラメタが示す位置にある要素を取得し、パラメタと置き換える(ステップST22)。   Details of step ST2 in the flowchart of FIG. 11 are shown in FIG. That is, it is determined whether or not there is a parameter that has not been replaced in the template (step ST21). If there is, the parameter indicates the element in the parts list 2 at the same position as the template 1 at the current position. The element at the position is acquired and replaced with a parameter (step ST22).

図13は、図10(b)のプログラム4をラダー図で表現したものである。上下2つならんだ回路は同じテンプレートから生成されたので同じ構造を持ち、部品リスト2の異なった部分からの部品を用いているため、異なったデバイスを使っている。従来のラダーエディタの持つマクロ機能も同じ構造にパラメタを適用するものであり、繰り返し適用すれば同様の結果を得られるが、本実施の形態では複数の回路のパラメタを一斉に与えることができるためより効率的である。   FIG. 13 is a ladder diagram representing the program 4 in FIG. Since the two upper and lower circuits are generated from the same template, they have the same structure and use parts from different parts of the parts list 2, so different devices are used. The macro function of the conventional ladder editor also applies parameters to the same structure, and if applied repeatedly, the same result can be obtained, but in this embodiment, parameters of multiple circuits can be given simultaneously. More efficient.

参照指定により部品リスト2中の同じ位置にある部品の指定した順番の子要素を参照することができる。図14(a)に示したテンプレートは図10(a)のものと異なり、階層が少ない。1401に対応する部品リスト中の要素は1402である。1401は内部にプログラムを持っており、パラメタの参照指定は「$0」となっているがこれは0番目の子要素を表す。1402の0番の子要素は1403であるため、プログラム生成部3はX0をこのパラメタの位置に展開する。同様に1401の$1などを展開すると14(b)のプログラムを得る。これは図10と同じプログラムである。   By specifying the reference, the child elements in the specified order of the components at the same position in the component list 2 can be referred to. Unlike the template shown in FIG. 10A, the template shown in FIG. The element in the parts list corresponding to 1401 is 1402. 1401 has a program inside, and the parameter reference designation is “$ 0”, which represents the 0th child element. Since the 0th child element of 1402 is 1403, the program generation unit 3 expands X0 to the position of this parameter. Similarly, if $ 1 of 1401 is expanded, a program 14 (b) is obtained. This is the same program as FIG.

参照指定により部品リスト2中の同じ位置にある部品の親、あるいはさらにその親を再帰的に参照することができる。図15の(a)において、テンプレート1501と同じ位置にある部品リスト中の要素は1503である。1501は内部にプログラム定義を持っており、パラメタの参照指定は「$$0」となっているが、$の数がいくつ親をさかのぼるかを表す。1つの場合が自身を表し、ここでは2つなので1503の親、即ち、1502を表す。$$0は1502の0番目の子を表すため1503である。即ち、$$0はX0に置き換えられる。同様に$$1は1504であり、Y10に置き換えられる。ここで、1505と同じ位置にある部品リスト中の要素は1502であるが、1505中の$1は1502の1番目の子、即ち1504を表す。つまり、1501の$$1と1505の$1は同じ要素を指しており、このようなテンプレート表現により部品リスト中の単一の要素が複数箇所に展開される。図15の(b)ではY10が2ヶ所に現れており、ラダー図で表現すると図16となる。これはオフ用の接点を持たない自己保持回路である。3つの要素からなるが使用するデバイスは2つであるため、部品リストには2要素の記述でプログラムを生成することができた。これにより、全てを入力する場合に比べて効率的に作成でき、またY10は自動的に2ヶ所に展開されるため、意図せず異なったものを入れてしまう入力ミスも軽減される。   By reference designation, it is possible to recursively refer to the parent of a part at the same position in the parts list 2 or the parent. In FIG. 15A, the element in the parts list at the same position as the template 1501 is 1503. Reference numeral 1501 has an internal program definition, and the parameter reference designation is “$$ 0”, but the number of $ represents how many parents go back. One case represents itself, and here it is two, so it represents the parent of 1503, ie 1502. $ 0 is 1503 because it represents the 0th child of 1502. That is, $$ 0 is replaced with X0. Similarly, $ 1 is 1504 and is replaced with Y10. Here, the element in the parts list at the same position as 1505 is 1502, but $ 1 in 1505 represents the first child of 1502, namely 1504. That is, $ 1 of 1501 and $ 1 of 1505 indicate the same element, and a single element in the parts list is expanded at a plurality of locations by such a template expression. In FIG. 15 (b), Y10 appears in two places, which is expressed in a ladder diagram as shown in FIG. This is a self-holding circuit that does not have an off contact. Since it consists of three elements but uses two devices, it was possible to generate a program with a two-element description in the parts list. As a result, it can be created more efficiently than when all the inputs are made, and Y10 is automatically expanded in two places, so that an input mistake that unintentionally puts a different one is reduced.

次に、テンプレート1が複製指定を持つ場合を説明する。
テンプレート1が複製指定を持つ場合、プログラム生成部3はテンプレート1を複製する。複製指定は部品リスト2中の要素を複製対象親として指定する。図17の(a)において、テンプレート1701は複製指定1702を持つため、プログラム生成部3は、1701を複製する。複製対象親の指定はパラメタの参照指定と同様に、部品リスト2中の同じ位置を起点として親やある順番の子を指定できる。1702では「$$*」となっており、すぐ上の親、即ち、1703を親として指定している。1703は2つの子を持っているため、1701は2つ複製される。この時、複製された2つのテンプレートでは対応する1703の子が参照指定の起点となる。図17の(b)にこの様子を示す。1701から複製された0番目の子である1705には1703の0番目の子である1704が起点となり、その0番目の子1706の参照の起点は1707である。1706の参照は「$.」つまり同じ位置なので、1706のパラメタはX0で置き換えられる。
Next, a case where template 1 has a copy designation will be described.
When the template 1 has a copy designation, the program generation unit 3 copies the template 1. Duplication designation designates an element in the parts list 2 as a duplication target parent. In FIG. 17A, since the template 1701 has a copy designation 1702, the program generation unit 3 copies 1701. In the specification of the parent to be replicated, a parent and a child in a certain order can be designated starting from the same position in the parts list 2 as in the case of parameter designation. In 1702, “$$ * ” is specified, and the parent immediately above, that is, 1703 is designated as the parent. Since 1703 has two children, two 1701 are duplicated. At this time, in the two duplicated templates, the corresponding 1703 child is the reference designation starting point. FIG. 17B shows this state. The first child 1705 copied from 1701 is the first child 1704 of the first child 1703, and the reference origin of the zeroth child 1706 is 1707. Since the reference of 1706 is “$.”, That is, the same position, the parameter of 1706 is replaced with X0.

この結果、生成されるラダープログラムは図13のものであり、図10の(b)で示したものと同じである。図10の(a)ではテンプレート1も部品リスト2と同じ数の子テンプレートを持っていたが、子テンプレートの構造は同じであるため、ここでの複製による方法で十分であり、より効率的である。また、複製数が3以上になった場合、図10の(a)の定義ではテンプレート1の変更が必要だが、複製を用いたものは任意の数に対応できる。   As a result, the generated ladder program is the one shown in FIG. 13, which is the same as that shown in FIG. In FIG. 10A, the template 1 also has the same number of child templates as the parts list 2. However, since the structure of the child templates is the same, the method by duplication here is sufficient and more efficient. Further, when the number of replicas is 3 or more, the template 1 needs to be changed in the definition of FIG. 10A, but those using replicas can correspond to an arbitrary number.

複製を用いることにより同じ構造の回路が並ぶような回路の記述がより容易になる。
テンプレート1は複数の複製指定を持つことができる。プログラム生成部3は、複製指定ごとにテンプレート1を複製する。図18の(a)のテンプレート1は1801と1802の2ヶ所に複製指定を持つ。1801の複製指定は1つ上の親を複製対象親に指定しており、1802の複製指定は2つ上の親を複製対象親に指定しているので、どちらも同じ親1803を指定している。1803は2つの子を持っているので複製の都度2つの子ができ、合計4つに展開され、その都度、1803の対応する子が参照の起点となる(図18の(b)→(c))。結果として図18の(d)に示すプログラム4が生成される。このプログラム4をラダー図で表すと図19に示す回路となる。
By using replication, it becomes easier to describe a circuit in which circuits having the same structure are arranged.
Template 1 can have multiple copy designations. The program generation unit 3 duplicates the template 1 for each copy designation. The template 1 in FIG. 18A has duplicate designations at two locations 1801 and 1802. Since the replication designation of 1801 designates the parent one above as the replication target parent, and the replication designation of 1802 designates the parent above two as the replication target parent, both specify the same parent 1803. Yes. Since 1803 has two children, there are two children each time it is replicated, and it is expanded into a total of four. Each time, the corresponding child of 1803 becomes the reference origin ((b) → (c in FIG. 18). )). As a result, the program 4 shown in (d) of FIG. 18 is generated. When this program 4 is represented by a ladder diagram, the circuit shown in FIG. 19 is obtained.

プログラム生成部3が複製を行うときに、複製インデクスを生成する。複製インデクスは複製内から参照でき、その複製が何番目の複製であるかを返す。図20の(a)において2001は複製指定を持ち、複製指定親は2002である。2002は3つの子を持つためテンプレートは2003,2004,2005の3つが複製され、それぞれが2002の3つの子を参照の起点とする。この時、2003の2001での複製における複製インデクスは0であり、2004は1、2005は2である。複製が入れ子になっている場合、全ての段階での複製インデクスが参照できる。図21の(a)では、2101と2102の2回の複製が行われているので2組の複製インデクスが生成される。2101の複製における2103の複製インデクスは0である。また、2105は2103の下にあるため、2101の複製における2105の複製インデクスも0である。2104は2102によっても複製されるため、ここでも別の複製インデクスを持つ。2102の複製における2104の複製インデクスは1である。   When the program generation unit 3 performs replication, a replication index is generated. The duplicate index can be referenced from within the duplicate and returns the number of the duplicate. In FIG. 20A, 2001 has a copy designation, and the copy designation parent is 2002. Since 2002 has three children, three templates 2003, 2004, and 2005 are duplicated, and each of the three children 2002 has a reference origin. At this time, the replication index in the replication in 2001 of 2001 is 0, 2004 is 1, and 2005 is 2. When duplicates are nested, you can see the duplicate indexes at all stages. In FIG. 21A, since two copies 2101 and 2102 are performed, two sets of duplicate indexes are generated. The replication index 2103 in the replication 2101 is 0. Since 2105 is under 2103, the replication index of 2105 in the replication of 2101 is also 0. Since 2104 is also duplicated by 2102, it again has another duplicate index. The replication index of 2104 in the replication of 2102 is 1.

複製指定は複製制約を持つことができる。複製制約がある場合、複製制約を満たす子テンプレートのみが複製される。複製制約指定に複製インデクスを用いることができる。図21の(a)において、2101,2102の2回の複製が行われるが、2102は複製制約2106を持つ。2102から複製された2105,2104は2つの複製インデクスを持つが、複製制約2106においてこれらのインデクス間の制約が記述されている。「$.」はこの位置、つまり2102での複製インデクスを表し、「$..」は1つ上の位置、つまり2101での複製インデクスを表しており、複製制約「$.!=$..」はこの2つが等しくないことを要求している。2105においては「$.」「$..」ともに0であるため制約を満たさない。このため、プログラム生成部3は2105を生成しない。2104においては「$.」は1、「$..」は0であるため制約を満たす。結果として図21の(d)が生成される。これはラダー図で表現すると図22に示す回路となる。   A replication specification can have replication constraints. If there is a replication constraint, only the child template that satisfies the replication constraint is replicated. A replication index can be used to specify replication constraints. In FIG. 21A, two copies 2101 and 2102 are performed, but 2102 has a replication constraint 2106. 2105 and 2104 duplicated from 2102 have two duplicate indexes, and a restriction between these indexes is described in a duplicate restriction 2106. “$.” Represents the replication index at this position, that is, 2102, and “$ ..” represents the replication index one position higher, that is, 2101, and the replication constraint “$.! = $. Requires that the two are not equal. In 2105, since “$.” And “$ ..” are both 0, the constraint is not satisfied. For this reason, the program generation unit 3 does not generate 2105. In 2104, “$.” Is 1 and “$ ..” is 0, so the constraint is satisfied. As a result, (d) of FIG. 21 is generated. This can be expressed as a ladder diagram, resulting in the circuit shown in FIG.

複製指定・複製制約を含んだ処理では、図11に示した階層処理の中で、ステップST2の処理部分が図23のフローチャートに示す処理になる。即ち、プログラム生成部3は、テンプレート1に複製指定があるかを判定し(ステップST201)、あった場合は、複製指定の指定する複製対象親の先頭の子を起点に選ぶ(ステップST202)。次に、テンプレート1に複製制約があるかを調べ(ステップST203)、あった場合は複製制約が満たされているかを判定する(ステップST204)。ステップST204において、満たされていた場合はテンプレート1を複製し(ステップST205)、満たされていない場合は次の子を起点に選び(ステップST206)、ステップST203に戻る。   In processing including replication designation / duplication constraints, the processing portion of step ST2 in the hierarchical processing shown in FIG. 11 is the processing shown in the flowchart of FIG. That is, the program generation unit 3 determines whether or not the template 1 has a copy designation (step ST201). If there is, the program generation unit 3 selects the first child of the copy target parent designated by the copy designation as a starting point (step ST202). Next, it is checked whether or not the template 1 has a replication constraint (step ST203), and if there is, it is determined whether or not the replication constraint is satisfied (step ST204). In step ST204, if satisfied, the template 1 is duplicated (step ST205). If not satisfied, the next child is selected as a starting point (step ST206), and the process returns to step ST203.

ステップST205において、テンプレート1を複製した後は、複製したテンプレート1に置き換えされていないパラメタがあるかを調べ(ステップST207)、あった場合は、起点として選択した要素を起点として、パラメタが示す位置にある要素を取得し、パラメタと置き換え(ステップST208)、ステップST207に戻る。ステップST207において、置き換えられていないパラメタがなかった場合は、子がまだ残っているかを判定し(ステップST209)、残っていた場合はステップST206に移行し、残っていない場合は終了する。   In step ST205, after the template 1 is copied, it is checked whether there is a parameter that has not been replaced with the copied template 1 (step ST207). Is acquired and replaced with a parameter (step ST208), and the process returns to step ST207. If there is no parameter that has not been replaced in step ST207, it is determined whether or not there are any remaining children (step ST209). If there are any, the process proceeds to step ST206, and if not, the process ends.

一方、ステップST201において、複製指定がなかった場合は、図12に示す動作と同様である。即ち、テンプレート1中、置き換えられていないパラメタがあるか否かを判定し(ステップST210)、あった場合は、現在位置のテンプレート1と同じ位置の部品リスト2中の要素を起点として、パラメタが示す位置にある要素を取得し、パラメタと置き換えて(ステップST211)、ステップST210に戻る。ステップST210において置き換えられていないパラメタがなかった場合は終了する。   On the other hand, if there is no copy designation in step ST201, the operation is the same as that shown in FIG. That is, it is determined whether or not there is a parameter that has not been replaced in the template 1 (step ST210). If there is, the parameter is set starting from the element in the parts list 2 at the same position as the template 1 at the current position. The element at the indicated position is acquired, replaced with a parameter (step ST211), and the process returns to step ST210. If there is no parameter not replaced in step ST210, the process ends.

図24に示すテンプレートは2401と2402の2ヶ所に複製指定を持つ。2401の複写指定は2403の3つの子に沿ってテンプレートを3つ複製する。2402の部分は2つ上の要素、つまり2403を複写対象親としており、同様に3つの子を複製する。冗長であるため、図26及び図27に、図25における2404以下の部分のみ記す。2402からは3つのテンプレートが複製されるが、複製制約があるため複製インデクスが0である2405は複製されない。結果として、全体としては図28の回路が生成される。これはラダー図で表すと図29の回路であり、インターロック回路と呼ばれる。X0,X1,X2の3つのスイッチがお互いをオフにしあうため、Y10,Y11,Y12のうちいずれかひとつのみしかオンにならない。   The template shown in FIG. 24 has duplicate designations at two locations 2401 and 2402. The copy designation of 2401 duplicates three templates along the three children of 2403. The portion 2402 has two upper elements, that is, 2403 as a copy target parent, and similarly duplicates three children. Since it is redundant, only the part below 2404 in FIG. 25 is shown in FIG. 26 and FIG. Three templates are duplicated from 2402, but 2405 whose duplication index is 0 is not duplicated due to duplication restrictions. As a result, the circuit of FIG. 28 is generated as a whole. This is a circuit shown in FIG. 29 in a ladder diagram, and is called an interlock circuit. Since the three switches X0, X1, and X2 turn off each other, only one of Y10, Y11, and Y12 is turned on.

インターロック回路は汎用性の高い回路であるが通常の単純なマクロでは表現できないが、本実施の形態のプログラム生成装置では、単一のテンプレート1として表現でき、3つのスイッチと3つのコイル以外の冗長な入力も必要としない。図24の部品リスト2が3組の部品からなるのに対し、図30は5組の部品からなる。全く同じテンプレート1に対して図30の部品リスト2を用いることにより、図31のインターロック回路が生成できる。部品リスト2の要素数を変化させるだけで、任意の要素数のインターロック回路を同一のテンプレート1から生成できることを示している。   Although the interlock circuit is a highly versatile circuit, it cannot be expressed by a normal simple macro, but can be expressed as a single template 1 in the program generation device of the present embodiment, except for three switches and three coils. Redundant input is not required. 24 includes three sets of parts, whereas FIG. 30 includes five sets of parts. By using the parts list 2 of FIG. 30 for the same template 1, the interlock circuit of FIG. 31 can be generated. It is shown that an interlock circuit with an arbitrary number of elements can be generated from the same template 1 simply by changing the number of elements in the parts list 2.

ここまで示したインターロック回路はオフ優先インターロック回路と呼ばれるもので、2つ以上のスイッチを同時に押した場合、全ての出力がオフになる特性を持っている。図32に示したテンプレート1はオン優先インターロック回路のものであり、2つ以上のスイッチを同時に押した場合、押されたスイッチに対応するコイルの出力が同時にオンになる特性を持っている。このオン優先インターロック回路テンプレートに対応する部品リスト2はオフ優先インターロック回路のものと構造が同じであるため、図24〜図28で示したものと同じ部品リストを再利用することができる。図33に図24〜図28で用いた部品リスト2から生成されたオン優先インターロック回路のラダー図を示す。
実施の形態1におけるこのような構成により、テンプレート1のみならず、同じ構造を要求するテンプレート1に対して部品リスト2も再利用可能であることが示される。
The interlock circuit described so far is called an off-priority interlock circuit, and has a characteristic that all outputs are turned off when two or more switches are pressed simultaneously. The template 1 shown in FIG. 32 is an on-priority interlock circuit, and has a characteristic that when two or more switches are pressed at the same time, the outputs of the coils corresponding to the pressed switches are simultaneously turned on. Since the parts list 2 corresponding to the on-priority interlock circuit template has the same structure as that of the off-priority interlock circuit, the same parts list as that shown in FIGS. 24 to 28 can be reused. FIG. 33 shows a ladder diagram of the on-priority interlock circuit generated from the parts list 2 used in FIGS.
With such a configuration in the first embodiment, it is shown that the component list 2 can be reused not only for the template 1 but also for the template 1 that requires the same structure.

次に、上述したテンプレート1や部品リスト2の編集について説明する。
テンプレート編集画面は、テンプレート名入力領域、プログラム編集領域、プログラム要素アイコン表示領域からなる。図34にその一例を示す。
テンプレート名入力領域では作成したテンプレートに名前をつけることができ、プログラム編集部12などでテンプレート保持部5に保存したテンプレート1をテンプレート名を用いて呼び出すことができる。
テンプレート編集領域ではテンプレート1の階層構造を表示している。ノードはテンプレートを表しており、選択することができる。選択したノードに対して、ノードごとに規定された編集が可能である。例えば、接点なら対象指定の編集が可能である。図34では「$$$0」「$$1」などの部分である。
Next, editing of the template 1 and the parts list 2 described above will be described.
The template editing screen includes a template name input area, a program editing area, and a program element icon display area. An example is shown in FIG.
In the template name input area, a name can be given to the created template, and the template 1 stored in the template holding unit 5 by the program editing unit 12 or the like can be called using the template name.
In the template editing area, the hierarchical structure of template 1 is displayed. A node represents a template and can be selected. For the selected node, editing defined for each node is possible. For example, if it is a contact, it is possible to edit the target. In FIG. 34, “$$$ 0”, “$$ 1”, and the like.

また、テンプレート編集画面は、選択されたノードの削除や左右への移動を行うボタンがあり、階層構造を編集できる。さらに、複製指定追加・複製制約追加ボタンにより、選択したノードに複製指定・複製制約を追加できる。複製指定ノード・複製制約ノードを選択すると内容を編集できる。複製指定ノードでは複製対象親の指定を編集できる。図34では「$$$*」の値を取るノードが示されている。複製制約ノードでは複製制約を編集できる。図34では「$.!=$..」即ち、この複製での複製インデクスが、1つ上の階層での複製インデクスと等しくない、という複製制約を示している。 In addition, the template editing screen has buttons for deleting the selected node and moving to the left and right to edit the hierarchical structure. Further, a replication designation / duplication constraint can be added to the selected node by a replication designation addition / duplication constraint addition button. The contents can be edited by selecting the replication specification node and replication constraint node. In the replication specification node, the specification of the parent to be replicated can be edited. FIG. 34 shows nodes that take the value of “$$$ * ”. You can edit the replication constraint at the replication constraint node. 34 shows “$.! = $ ..”, that is, the replication constraint that the replication index in this replication is not equal to the replication index in the next higher hierarchy.

さらに、テンプレート編集画面には、ラダープログラムで用いることのできる要素がアイコンとして表示されている。あるノードをテンプレート編集領域で選択し、アイコンをクリックすることでアイコンを選択したノードの子として追加できる。また、ユーザはこれらのアイコンをテンプレート編集領域のノードにドラッグアンドドロップ等の操作を行うことで、対象要素内に追加することもできる。図34では、AND・OR・A接点・B接点・コイルの5種類が表示されているが、これ以外にもラダープログラムで利用できる要素を含むことが可能である。   Furthermore, elements that can be used in the ladder program are displayed as icons on the template editing screen. An icon can be added as a child of the selected node by selecting a node in the template editing area and clicking the icon. The user can also add these icons to the target element by performing an operation such as drag and drop on a node in the template editing area. In FIG. 34, five types of AND, OR, A contact, B contact, and coil are displayed, but other elements that can be used in the ladder program can be included.

プログラム編集部12では、ユーザが部品リスト編集部9を呼び出して部品リスト2を編集することができる。また、プログラム編集部12では、テンプレート保持部5からテンプレート1を選択し、テンプレート1に対応する部品リスト2を部品リスト編集部9で編集してプログラム生成部3を呼び出し、プログラム4を自動生成することができる。   In the program editing unit 12, the user can call up the component list editing unit 9 to edit the component list 2. The program editing unit 12 selects the template 1 from the template holding unit 5, edits the component list 2 corresponding to the template 1 by the component list editing unit 9, calls the program generation unit 3, and automatically generates the program 4. be able to.

プログラム編集部12の編集画面は、テンプレート名表示領域、部品リスト編集領域からなり、この例を図35に示す。図35において、テンプレート名表示領域は生成に使用しているテンプレート1の名称を表示している。図35では、上部にテンプレート名表示領域があり、「インターロック回路」のテンプレート1を利用していることを表している。テンプレート名表示領域にテンプレート名を入力することで使用するテンプレート1を選択するようにしても良い。また、テンプレート名表示領域がメニューとなっており、利用可能なテンプレート一覧を提供し、メニューの選択によりテンプレート1を選択するようにしても良い。   The editing screen of the program editing unit 12 includes a template name display area and a parts list editing area. An example of this is shown in FIG. In FIG. 35, the template name display area displays the name of the template 1 used for generation. In FIG. 35, there is a template name display area at the top, indicating that the template 1 of the “interlock circuit” is used. The template 1 to be used may be selected by inputting the template name in the template name display area. Further, the template name display area is a menu, a list of available templates may be provided, and the template 1 may be selected by selecting a menu.

部品リスト編集部9は、部品リスト2のツリー構造を編集可能なインタフェースとなっており、テンプレート1のトップ要素に対応する部品リスト2のトップ要素以下にリストの要素としてリストを追加する機能と、リストの要素として具体値を追加する機能を有する。要素の追加は対応するアイコンで指定したり、テキストで入力することもできる。図35の例では、下部に部品リスト編集領域があり、部品リストの階層構造が表示されている。リストの各ノードは選択でき、X0,Y10などの具体値を表すノードは内容を編集できる。また、部品リスト編集部9は選択したノードの子として部品リストノード・具体値ノードを追加、削除するボタンと、選択したノードを左右に移動させるボタンを持ち、リスト構造を自由に編集できる。
テンプレート1から部品リスト構造を自動生成部11で自動生成した場合は、ノード構造を編集する上記ボタン群を使用できないようにし、ノードへの具体値入力のみ可能にしてもよい。
The parts list editing unit 9 is an interface capable of editing the tree structure of the parts list 2, and has a function of adding a list as a list element below the top element of the parts list 2 corresponding to the top element of the template 1. It has a function of adding a concrete value as a list element. Elements can be added with the corresponding icon or entered as text. In the example of FIG. 35, there is a parts list editing area at the bottom, and the hierarchical structure of the parts list is displayed. Each node in the list can be selected, and the contents of nodes representing specific values such as X0 and Y10 can be edited. The parts list editor 9 has buttons for adding and deleting parts list nodes and specific value nodes as children of the selected node, and a button for moving the selected node to the left and right, and can freely edit the list structure.
When the parts list structure is automatically generated from the template 1 by the automatic generation unit 11, the above button group for editing the node structure may not be used, and only a specific value input to the node may be allowed.

部品リスト編集部9は、編集された部品リスト2を再利用のために保持する部品リスト保持部6を用いるようにしてもよい。部品リスト保持部6から取り出した部品リスト2を更に編集したり、部品の一部を流用したりして編集に利用する機能を持つことも考えられる。
部品リスト編集部9は、編集中の、あるいは部品リスト保持部6の保持する部品リスト2を表示する部品リスト表示部10を合わせ持っても良い。図35の例では部品リスト編集領域が部品リスト表示部10となっており、編集中の部品リスト2を表示している。
The parts list editing unit 9 may use a parts list holding unit 6 that holds the edited parts list 2 for reuse. It is conceivable that the parts list 2 taken out from the parts list holding unit 6 may be further edited, or a part of the parts may be used for editing.
The parts list editing section 9 may have a parts list display section 10 for displaying the parts list 2 being edited or held by the parts list holding section 6. In the example of FIG. 35, the parts list editing area is the parts list display unit 10, and the part list 2 being edited is displayed.

本実施の形態では、階層構造を表現できるなんらかのスクリプトで書いても良い。例えば、XMLやLispのS式などで表現することが考えられる。
図36にXMLで記述した図6の(b)の部品リスト2を示す。また、図37にS式で記述した図6の(b)の部品リスト2を示す。
In this embodiment, the script may be written in some script that can express the hierarchical structure. For example, it can be expressed by the XML or Lisp S-expression.
FIG. 36 shows the parts list 2 of FIG. 6B described in XML. FIG. 37 shows the parts list 2 shown in FIG.

プログラム編集部12の編集画面は、選択されたテンプレート1を表示する表示領域を持っても良い。図38ではテンプレート表示領域にテンプレート1が表示されている。
テンプレート1中の各パラメタを具体化するためには部品リスト2がその全ての参照先に部品を配置することが必要であるが、自動生成部11がテンプレート1中の参照指定を解析することにより、これに十分な構造の部品リスト2を生成することが可能である。
The editing screen of the program editing unit 12 may have a display area for displaying the selected template 1. In FIG. 38, template 1 is displayed in the template display area.
In order to embody each parameter in the template 1, it is necessary for the parts list 2 to place parts at all of the reference destinations, but the automatic generation unit 11 analyzes the reference designation in the template 1. It is possible to generate the parts list 2 having a structure sufficient for this.

例えば図15において、テンプレート1505はパラメタ「$1」を含むが、これは部品リスト2中で同じ位置にあるリスト1502のインデクス1の子を指すので、1502は子1504を必要とする。また、1501は「$$0」と「$$1」を含むので、部品リスト2中で1501の親1505と同じ位置にある1502はインデクス0の子1503およびインデクス1の子1504を必要とする。合わせると、このテンプレート1に対しては、1502,1503,1504からなる構造の部品リスト2が必要なことがわかる。1503,1504にどのような具体値が入るかはテンプレート1からは決定できないため、生成された部品リスト2には未定値や仮のデフォルト値を入れる。   For example, in FIG. 15, the template 1505 includes a parameter “$ 1”, which points to a child of the index 1 of the list 1502 at the same position in the parts list 2, so 1502 requires a child 1504. Since 1501 includes “$$ 0” and “$$ 1”, 1502 in the same position as the parent 1505 of 1501 in the parts list 2 requires a child 1503 of index 0 and a child 1504 of index 1 . Together, it can be seen that for this template 1, a parts list 2 having a structure of 1502, 1503 and 1504 is necessary. Since it is not possible to determine from the template 1 what specific values are entered in 1503 and 1504, an undetermined value or a temporary default value is entered in the generated component list 2.

プログラム編集において、部品リスト2の形状は自動生成部11によって自動的に決定されるため、ユーザはリスト構造を編集する必要はなく、具体値のみ記述すれば良い。図で言うと1503にX0、1504にY10を挿入するのみでプログラム生成に十分な部品リスト2の定義を行うことができる。   In the program editing, since the shape of the parts list 2 is automatically determined by the automatic generation unit 11, the user does not need to edit the list structure, and only a specific value needs to be described. In the figure, the component list 2 sufficient for program generation can be defined simply by inserting X0 into 1503 and Y10 into 1504.

プログラム編集部12は、選択されたテンプレート1と、編集された部品リスト2を与えてプログラム生成部3を呼び出し、プログラムを生成することができる。   The program editing unit 12 can generate the program by giving the selected template 1 and the edited component list 2 and calling the program generation unit 3.

また、実際には、既に完成したラダープログラムを元にしてテンプレート1を作成する場合が多いが、このような場合でもラダープログラム中のパラメタ化したい要素を指定し、そこの位置指定を$.とすることによってテンプレート1が作成でき、また、上述した自動生成部11の機能により対応した部品リスト2の構造も自動生成することができる。例えば、図10に示すようなテンプレート1と部品リスト2(図13に示すラダープログラム)のような場合は自動生成することができる。   In practice, the template 1 is often created based on the already completed ladder program. Even in such a case, the element to be parameterized in the ladder program is designated, and the position designation is designated as $. Thus, the template 1 can be created, and the corresponding structure of the parts list 2 can be automatically generated by the function of the automatic generation unit 11 described above. For example, a template 1 and a parts list 2 (ladder program shown in FIG. 13) as shown in FIG. 10 can be automatically generated.

プログラム編集部12の編集画面には、生成したプログラムを表示するプログラム表示領域があってもよい。編集した部品リスト2の現在の状態に応じてどのようなプログラムが生成されるかをユーザの要求に応じて、あるいは部品リスト2の変更が行われる都度表示することも考えられる。図38ではプログラム表示領域に生成したプログラム4が表示されている。   The editing screen of the program editing unit 12 may have a program display area for displaying the generated program. It may be possible to display what program is generated according to the current state of the edited parts list 2 in response to a user request or whenever the parts list 2 is changed. In FIG. 38, the generated program 4 is displayed in the program display area.

従来のプログラム作成支援装置では、異なる形態のプログラム、例えば図29と図31のインターロック回路を、同一のプログラム部品を用いて生成することができなかったが、本実施の形態ではそれが可能となる。これにより、プログラム部品を応用可能な範囲が広くなり、計測監視制御対象である設備の使用記述に、より直接的に合致するようにプログラム部品を定義することができるようになる。
よって、仕様記述に合致するプログラムを作成するための、プログラム部品の選定およびそれらの組み合わせに関する設計の労力を軽減し、仕様に記述された機能を過不足なく備えるプログラムの作成の量力を大幅に軽減できる。
In the conventional program creation support apparatus, different types of programs, for example, the interlock circuits of FIGS. 29 and 31 could not be generated using the same program parts, but this embodiment can do so. Become. As a result, the range in which the program component can be applied is widened, and the program component can be defined so as to more directly match the usage description of the equipment that is the object of measurement monitoring control.
Therefore, the design effort for selecting and combining program parts to create a program that matches the specification description is reduced, and the amount of program creation that includes the functions described in the specification is greatly reduced. it can.

以上説明したように、実施の形態1のプログラム生成装置によれば、プログラムを構成する部品の階層構造を示す部品リストと、プログラムの部分記述と、階層構造における子テンプレートの挿入位置を示す記述とからなり、プログラムの部分記述として、階層構造中の相対位置で対象を指定するためのパラメタを含むテンプレートとを設けると共に、部品リストとテンプレートとを入力とし、テンプレートのパラメタの対象指定を、パラメタが記述されたテンプレートの階層構造中の位置と、部品リストの階層構造中で同じ位置にある要素を起点とした相対位置で解釈した対象の部品で置換することによりプログラムを生成するプログラム生成部を備えたので、プログラム作成効率の向上を図ることができる。   As described above, according to the program generating apparatus of the first embodiment, the parts list indicating the hierarchical structure of the parts constituting the program, the partial description of the program, the description indicating the insertion position of the child template in the hierarchical structure, As a partial description of the program, a template including a parameter for specifying a target at a relative position in the hierarchical structure is provided, and a part list and a template are input, and the target specification of the template parameter is specified by the parameter Provided with a program generator that generates a program by replacing the position in the hierarchical structure of the described template with the target part interpreted at the relative position starting from the element at the same position in the hierarchical structure of the parts list Therefore, it is possible to improve the program creation efficiency.

また、実施の形態1のプログラム生成装置によれば、テンプレートは、階層構造中の相対位置で複製対象親を指定するための複製指定を有し、プログラム生成部は、複製指定に基づき、部品リストの階層構造中で同じ位置にある要素を起点とした相対位置で解釈した複製対象親の子それぞれに対するテンプレートを複製し、複製したテンプレート中のパラメタの対象指定を、複製に用いた複製対象親の子を起点とした相対位置で解釈した対象部品で置換することによりプログラムを生成するようにしたので、複数箇所に同じ部品を持つプログラム構造を部品化することができ、また、部品の複製により、単一の記述から複数部品を生成でき、プログラム作成効率を向上させることができる。   Further, according to the program generation device of the first embodiment, the template has a copy designation for designating a parent to be duplicated at a relative position in the hierarchical structure, and the program creation unit is configured to use a parts list based on the copy designation. The template for each child of the parent to be replicated interpreted at the relative position starting from the element at the same position in the hierarchical structure of, and the target specification of the parameter in the duplicated template is set to the replication target parent used for the replication. Since the program is generated by replacing with the target part interpreted at the relative position starting from the child, the program structure with the same part in multiple places can be made into parts, and by duplicating the part, Multiple parts can be generated from a single description, and program creation efficiency can be improved.

また、実施の形態1のプログラム生成装置によれば、複製指定は、複製毎に複製を行うか否かの複製制約を有し、プログラム生成部は、複製制約を満たす場合のみテンプレートの複製を行うようにしたので、部品の複製を行うかどうかを指定でき、より複雑なプログラムを部品化することができる。   Further, according to the program generation apparatus of the first embodiment, the copy designation has a copy restriction on whether or not to make a copy for each copy, and the program generation unit copies the template only when the copy restriction is satisfied. Because of this, it is possible to specify whether or not to duplicate a part, and a more complicated program can be made into a part.

また、実施の形態1のプログラム生成装置によれば、複製制約は、異なる階層間の複製指定に基づいて複製された各々のテンプレートが何番目の子に対するものであるかの関係を規定するようにしたので、より複雑なプログラムを部品化することができる。   In addition, according to the program generation device of the first embodiment, the replication constraint defines the relationship of which template each copied template is based on the replication designation between different hierarchies. As a result, a more complicated program can be made into parts.

また、実施の形態1のプログラム生成装置によれば、全てのパラメタの対象指定となる位置全てを含む部品リストの階層構造を生成する自動生成部を備えたので、テンプレートに対して必要となる部品リストの構造を自動生成でき、プログラム作成効率を向上させることができる。   In addition, according to the program generation apparatus of the first embodiment, since the automatic generation unit that generates the hierarchical structure of the parts list including all the positions to be specified by all the parameters is provided, the necessary parts for the template The list structure can be automatically generated, and the program creation efficiency can be improved.

実施の形態2.
トップレベルのテンプレートの直下の要素が複製指定を持つ場合、この要素以下から参照される部品リストを1次元にまとめて横方向に並べ、縦方向にこの1次元部品リストを並べると、部品リストが表形式になる。これにより、高度な編集機能を持った表計算ソフトで部品リスト2を作成し、コピーと貼り付けによりプログラム4を生成することができる。また、表形式インタフェースは部品リスト2を縦方向を伸縮させる要素を持ち、これにより複製数を変化させることができる。この際、数字の連続値補完などにより、定型的な入力を簡易化することが考えられる。例えばインターロック回路の場合、スイッチがX0から連続アドレスであり、コイルがY0から連続アドレスであれば、インターロック回路の数が増えた場合にも表形式部品リストを縦に伸縮させるだけで必要な数のインターロック回路が生成できる。スイッチ・コイルの名称に数字の入ったラベル名を用いれば、より一般的にこの手法が利用可能である。実施の形態2では、以上のような機能を部品リスト編集部9で実現している。なお、図面上の構成は実施の形態1における図2の構成と同様であるため、図2を用いて説明する。
Embodiment 2. FIG.
If the element directly under the top-level template has a copy designation, the parts list referenced from this element and below is grouped in one dimension and arranged in the horizontal direction. If this one-dimensional parts list is arranged in the vertical direction, the parts list is Tabular format. Thereby, the parts list 2 can be created with spreadsheet software having an advanced editing function, and the program 4 can be generated by copying and pasting. Further, the tabular interface has an element for expanding and contracting the parts list 2 in the vertical direction, and the number of copies can be changed. At this time, it is conceivable to simplify typical input by, for example, complementing consecutive numbers. For example, in the case of an interlock circuit, if the switch is a continuous address from X0 and the coil is a continuous address from Y0, even if the number of interlock circuits increases, it is only necessary to expand and contract the tabular part list vertically. A number of interlock circuits can be generated. If a label name including a number is used for the name of the switch coil, this method can be used more generally. In the second embodiment, the above functions are realized by the parts list editing unit 9. The configuration on the drawing is the same as the configuration of FIG. 2 in the first embodiment, and will be described with reference to FIG.

図39に画面と操作の例を示す。ユーザがテンプレート表示部8でオフ優先インターロック回路を選択すると、プログラム生成装置は、図39に示すようなテンプレート兼プログラム表示画面にテンプレート1を表示する。ユーザが部品リスト編集部9にX0,Y0を入力すると、テンプレート兼プログラム表示画面に、生成されたプログラム4が表示される(画面3901)。   FIG. 39 shows an example of the screen and operation. When the user selects the off-priority interlock circuit on the template display unit 8, the program generation device displays the template 1 on the template / program display screen as shown in FIG. When the user inputs X0 and Y0 to the parts list editing unit 9, the generated program 4 is displayed on the template / program display screen (screen 3901).

ユーザが部品リスト編集部9のY0を表示するセルの隅を下方にドラッグすることにより、部品リスト編集部9は表を拡張する。まず、表の行数をドラッグ幅にあわせて増やす。図39では4行に増やしている。X0は数値0を持っているため、これを元に1,2,3という数値が生成され、それぞれの行はX1,X2,X3で埋められる。同様にY0からはY1,Y2,Y3が生成される。これにより部品リストが4つの子を持ったため、プログラム生成部3は4つの自己保持回路からなるプログラムをその場で生成し、テンプレート兼プログラム表示画面に表示される(画面3902)。   When the user drags the corner of the cell displaying Y0 of the parts list editing unit 9 downward, the parts list editing unit 9 expands the table. First, increase the number of rows in the table according to the drag width. In FIG. 39, the number is increased to four lines. Since X0 has a numerical value 0, numerical values 1, 2, and 3 are generated based on this, and each row is filled with X1, X2, and X3. Similarly, Y1, Y2, and Y3 are generated from Y0. Thus, since the parts list has four children, the program generation unit 3 generates a program composed of four self-holding circuits on the spot and displays it on the template / program display screen (screen 3902).

次にユーザがテンプレート表示部8でオン優先インターロック回路を選択すると、プログラム生成部3に与えられるテンプレート1が切り替えられる。両テンプレートの要求する部品リスト2の構成は同じなので、現在の部品リスト2がそのまま使用され、4つの自己保持回路からなるオン優先インターロック回路を生成し、テンプレート兼プログラム表示画面に表示される(画面3903)。この時、テンプレート表示部8で選択可能なテンプレートを、現在の部品リスト2を適用可能なものに制限してもよい。または、適用可能かどうかを色などの情報でユーザに提示しても良い。   Next, when the user selects the on-priority interlock circuit on the template display unit 8, the template 1 given to the program generation unit 3 is switched. Since the parts list 2 required by both templates has the same configuration, the current parts list 2 is used as it is, and an on-priority interlock circuit composed of four self-holding circuits is generated and displayed on the template / program display screen ( Screen 3903). At this time, templates that can be selected in the template display unit 8 may be limited to those that can be applied to the current component list 2. Or you may show to a user by information, such as a color, whether it is applicable.

以上説明したように、実施の形態2のプログラム生成装置によれば、特定の要素が複製指定を持つテンプレートに対して、特定の要素以下から参照される部品リストを1次元に横方向に並べ、かつ、1次元部品リストを縦方向に並べて表形式の部品リストを設けると共に、縦方向への伸縮指示を受けた場合、伸縮に応じて所定の数値の補完を行い部品リストを増減させる部品リスト編集部を備えたので、テンプレートに対して必要となる部品リストの構造を自動生成でき、プログラム作成効率を向上させることができる。   As described above, according to the program generation device of the second embodiment, a part list referenced from a specific element or lower is arranged in a one-dimensional horizontal direction with respect to a template in which a specific element has a copy designation. In addition, a one-dimensional parts list is arranged in the vertical direction to provide a tabular parts list, and when receiving an instruction to expand or contract in the vertical direction, the parts list is edited to increase or decrease the parts list by complementing a predetermined numerical value according to the expansion or contraction. Therefore, the parts list structure required for the template can be automatically generated, and the program creation efficiency can be improved.

なお、本願発明はその発明の範囲内において、各実施の形態の自由な組み合わせ、あるいは各実施の形態の任意の構成要素の変形、もしくは各実施の形態において任意の構成要素の省略が可能である。   In the present invention, within the scope of the invention, any combination of the embodiments, or any modification of any component in each embodiment, or omission of any component in each embodiment is possible. .

1 テンプレート、2 部品リスト、3 プログラム生成部、4 プログラム、5 テンプレート保持部、6 部品リスト保持部、7 テンプレート編集部、8 テンプレート表示部、9 部品リスト編集部、10 部品リスト表示部、11 自動生成部、12 プログラム編集部、13 プログラム表示部。   1 template, 2 parts list, 3 program generation part, 4 program, 5 template holding part, 6 part list holding part, 7 template editing part, 8 template display part, 9 part list editing part, 10 part list display part, 11 automatic Generation unit, 12 program editing unit, 13 program display unit.

Claims (6)

プログラムを構成する部品の階層構造を示す部品リストと、
前記プログラムの部分記述と、階層構造における子テンプレートの挿入位置を示す記述とからなり、前記プログラムの部分記述として、階層構造中の相対位置で対象を指定するためのパラメタを含むテンプレートとを設けると共に、
前記部品リストと前記テンプレートとを入力とし、前記テンプレートのパラメタの対象指定を、当該パラメタが記述されたテンプレートの階層構造中の位置と、前記部品リストの階層構造中で同じ位置にある要素を起点とした相対位置で解釈した対象の部品で置換することによりプログラムを生成するプログラム生成部を備えたことを特徴とするプログラム生成装置。
A parts list showing the hierarchical structure of the parts that make up the program;
The program includes a partial description of the program and a description indicating the insertion position of the child template in the hierarchical structure. The partial description of the program includes a template including a parameter for designating a target at a relative position in the hierarchical structure. ,
Using the parts list and the template as input, the target specification of the template parameter is based on the element at the same position in the hierarchical structure of the part list and the position in the hierarchical structure of the template in which the parameter is described. A program generation apparatus comprising a program generation unit that generates a program by replacing with a target component interpreted at a relative position.
テンプレートは、階層構造中の相対位置で複製対象親を指定するための複製指定を有し、
プログラム生成部は、前記複製指定に基づき、部品リストの階層構造中で同じ位置にある要素を起点とした相対位置で解釈した前記複製対象親の子それぞれに対するテンプレートを複製し、当該複製したテンプレート中のパラメタの対象指定を、前記複製に用いた前記複製対象親の子を起点とした相対位置で解釈した対象部品で置換することによりプログラムを生成することを特徴とする請求項1記載のプログラム生成装置。
The template has a copy specification for specifying a copy target parent at a relative position in the hierarchical structure,
The program generation unit duplicates a template for each child of the parent to be duplicated interpreted at a relative position starting from an element at the same position in the hierarchical structure of the parts list based on the duplicate designation, and in the duplicated template 2. The program generation according to claim 1, wherein the program generation is performed by replacing the target designation of the parameter with a target part interpreted at a relative position starting from a child of the replication target parent used for the replication. apparatus.
複製指定は、複製毎に複製を行うか否かの複製制約を有し、プログラム生成部は、当該複製制約を満たす場合のみテンプレートの複製を行うことを特徴とする請求項2記載のプログラム生成装置。   3. The program generation apparatus according to claim 2, wherein the copy designation has a copy restriction for determining whether or not to make a copy for each copy, and the program generation unit copies the template only when the copy restriction is satisfied. . 複製制約は、異なる階層間の複製指定に基づいて複製された各々のテンプレートが何番目の子に対するものであるかの関係を規定することを特徴とする請求項3記載のプログラム生成装置。   4. The program generation apparatus according to claim 3, wherein the duplication restriction defines a relationship regarding to which child each of the duplicated templates is based on designation of duplication between different hierarchies. 全てのパラメタの対象指定となる位置全てを含む部品リストの階層構造を生成する自動生成部を備えたことを特徴とする請求項1から請求項4のうちのいずれか1項記載のプログラム生成装置。   5. The program generation device according to claim 1, further comprising an automatic generation unit that generates a hierarchical structure of a parts list including all positions to be specified by all parameters. . 特定の要素が複製指定を持つテンプレートに対して、前記特定の要素以下から参照される部品リストを1次元に横方向に並べ、かつ、当該1次元部品リストを縦方向に並べて表形式の部品リストを設けると共に、
前記縦方向への伸縮指示を受けた場合、当該伸縮に応じて所定の数値の補完を行い前記部品リストを増減させる部品リスト編集部を備えたことを特徴とする請求項1から請求項5のうちのいずれか1項記載のプログラム生成装置。
For a template in which a specific element has a copy designation, a parts list referenced from the specified element and below is arranged one-dimensionally in the horizontal direction, and the one-dimensional parts list is arranged in the vertical direction to display a tabular part list. And providing
6. A component list editing unit for increasing or decreasing the component list by complementing a predetermined numerical value in response to the expansion / contraction instruction in the vertical direction. The program generation apparatus of any one of them.
JP2012095647A 2012-04-19 2012-04-19 Program generator Active JP5785130B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2012095647A JP5785130B2 (en) 2012-04-19 2012-04-19 Program generator

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2012095647A JP5785130B2 (en) 2012-04-19 2012-04-19 Program generator

Publications (2)

Publication Number Publication Date
JP2013222439A JP2013222439A (en) 2013-10-28
JP5785130B2 true JP5785130B2 (en) 2015-09-24

Family

ID=49593323

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2012095647A Active JP5785130B2 (en) 2012-04-19 2012-04-19 Program generator

Country Status (1)

Country Link
JP (1) JP5785130B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11726453B2 (en) 2020-12-25 2023-08-15 Kabushiki Kaisha Yaskawa Denki Program creation device, program creation method, and program

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3296827A4 (en) * 2015-05-13 2019-01-09 Mitsubishi Electric Corporation Control logic diagram analysis device and control logic diagram analysis method
EP3432095B1 (en) * 2016-03-18 2021-07-21 Mitsubishi Electric Corporation Control logic diagram creation support device
JP6632692B1 (en) * 2018-11-19 2020-01-22 日鉄テックスエンジ株式会社 Control program creation support tool and control program creation method
JP7285283B2 (en) 2021-06-11 2023-06-01 株式会社日立製作所 Distributed transaction management method and system

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05189012A (en) * 1992-01-10 1993-07-30 Yaskawa Electric Corp Programming device for programmable controller
WO2011080945A1 (en) * 2009-12-28 2011-07-07 三菱電機株式会社 Program creation support device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11726453B2 (en) 2020-12-25 2023-08-15 Kabushiki Kaisha Yaskawa Denki Program creation device, program creation method, and program

Also Published As

Publication number Publication date
JP2013222439A (en) 2013-10-28

Similar Documents

Publication Publication Date Title
EP3798817B1 (en) User interface logical and execution view navigation and shifting
TWI464558B (en) Program generation support device
JP5785130B2 (en) Program generator
EP3798757B1 (en) System and method for developing industrial applications
WO2014064819A1 (en) System building assistance tool and system
JP5498446B2 (en) Ladder program creation device and ladder program creation method
JP5921765B2 (en) Program graph display device, program graph display method, and program graph display program
Falkman et al. Automatic generation: A way of ensuring PLC and HMI standards
Frey et al. Editing, visualizing, and implementing signal interpreted petri nets
JP3625084B2 (en) Reuse system for software parts
JP5425317B2 (en) Motion SFC program parts creation device
WO2020195195A1 (en) Development support device, method for controlling development support device, information processing program, and recording medium
JP5483011B2 (en) PLC program development support apparatus and computer program for causing a computer to function as the apparatus
JP4848772B2 (en) Program generating apparatus and program generating program
JP6566151B2 (en) System design support apparatus and system design support method
KR102509859B1 (en) Apparatus and method for extracting common command information from PLC ladder information
JP2021157382A (en) Information processing device and program for displaying ladder program
EP4343468A1 (en) Development assistance device, control method for development assistance device, information processing program, and recording medium
Gupta Toward a Smart Object-based Application and thus Reusability
Gauthier Generic Navigation of Concerns and Perspectives in TouchCORE
CN113568365A (en) Method of controlling industrial controller, computing device and computer storage medium
JP2004318286A (en) Device for generating program specification and for developing program, method thereof, and control system
JPH02268332A (en) Membership function setting device
Mészáros et al. A General Purpose Model Visualization Environment
JP2018018410A (en) Design support method, design support program, and design support device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20141010

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20150619

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20150623

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20150723

R150 Certificate of patent or registration of utility model

Ref document number: 5785130

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250