JP2008293058A - Programming device - Google Patents

Programming device Download PDF

Info

Publication number
JP2008293058A
JP2008293058A JP2007134963A JP2007134963A JP2008293058A JP 2008293058 A JP2008293058 A JP 2008293058A JP 2007134963 A JP2007134963 A JP 2007134963A JP 2007134963 A JP2007134963 A JP 2007134963A JP 2008293058 A JP2008293058 A JP 2008293058A
Authority
JP
Japan
Prior art keywords
program
action
insertion point
unit
sequence control
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.)
Pending
Application number
JP2007134963A
Other languages
Japanese (ja)
Inventor
Koichi Nakagawa
晃一 中川
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 JP2007134963A priority Critical patent/JP2008293058A/en
Publication of JP2008293058A publication Critical patent/JP2008293058A/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To provide a programming device which can create a sequence control program for increasing the reusability of an auxiliary program which can be used in common by a plurality of sequence control programs without requiring high level skill to a user. <P>SOLUTION: The programming device is equipped with an engineering tool part 11, an engineering database 12 and a programming part 13. The engineering tool part 11 is equipped with: a program editing part 111; an action insertion point detection part 112 for detecting a point into which an action can be inserted from a sequence control program; an aspect definition part 113 for modularizing the set of information where the action and the point into which the action can be inserted form a pair; and an action editing part 114 to be operated by a user when inserting the action. The engineering database 12 is equipped with a program table 121; an action insertion point table 122; and an aspect table 123. The programming part 13 is equipped with a program synthesis part 131 and a source buffer 132. <P>COPYRIGHT: (C)2009,JPO&INPIT

Description

本発明はプログラム作成装置に関し、特に、PLC(Programable Logic Controller)を用いて機器を制御するシーケンス制御プログラムの作成装置に関する。   The present invention relates to a program creation device, and more particularly to a sequence control program creation device that controls a device using a PLC (Programmable Logic Controller).

従来より、シーケンス制御プログラムの作成方法としては、ラダー言語を使ったプログラミングがある。ラダー言語は、リレーによる論理回路を記述するために考案され、ラダー言語で書かれたプログラムは、リレーを使った回路と等価であるため、比較的簡単に理解できるが、例えば機器が故障した場合に処理を中断させるという、本質的には単純な回路であっても、故障を検出するためのタイムアウト処理を施す機能などの補助的な機能が加わることで、入力作業が複雑化することになる。   Conventionally, as a method for creating a sequence control program, there is programming using a ladder language. Ladder language was devised to describe logic circuits with relays, and programs written in ladder language are equivalent to circuits using relays, so it is relatively easy to understand. For example, when a device fails Even if it is essentially a simple circuit that interrupts the process, the addition of an auxiliary function such as a time-out process for detecting a failure complicates the input work. .

このような、シーケンス制御プログラムの入力作業を改善するために、例えば、特許文献1には、特別な表を使って複雑なラダープログラムを簡易に作成する技術が開示されている。   In order to improve the input operation of such a sequence control program, for example, Patent Document 1 discloses a technique for easily creating a complicated ladder program using a special table.

特開平6−4111号公報(図2)Japanese Patent Laid-Open No. 6-4111 (FIG. 2)

シーケンス制御プログラムが複雑化すると、入力作業が煩雑になるというだけでなく、プログラムの再利用性が低下するという問題がある。例えば、1のシーケンス制御プログラムで使用されている補助的なプログラムを適用元とし、他のシーケンス制御プログラムを適用先とし、適用元の補助的なプログラムを適用先のプログラムにも適用する場合、適用元および適用先の2つのプログラム仕様を熟知していないと適用ができず、ユーザに高度なスキルが要求されることになる。   When the sequence control program becomes complicated, there is a problem that not only the input operation becomes complicated, but also the reusability of the program is lowered. For example, if the auxiliary program used in one sequence control program is the application source, the other sequence control program is the application destination, and the auxiliary program of the application source is also applied to the application program If the user does not know the two program specifications of the original and application destinations, the application cannot be applied and a high level of skill is required of the user.

本発明は、上記のような問題点を解決するためになされたものであり、ユーザに高度なスキルを要求することなく、複数のシーケンス制御プログラム間で共通に使用可能な補助的なプログラムの再利用性を高めたシーケンス制御プログラムを作成できるプログラム作成装置を提供することを目的とする。   The present invention has been made to solve the above-described problems, and it is possible to reproduce an auxiliary program that can be commonly used among a plurality of sequence control programs without requiring a high level of skill from the user. An object of the present invention is to provide a program creation device capable of creating a sequence control program with improved usability.

本発明に係る請求項1記載のプログラム作成装置は、ラダー言語で記述されたシーケンス制御プログラムを入力して所定のプログラミング言語に変換し、変換後の前記シーケンス制御プログラムを、メインフローであるメインプログラムと、接点のロード、接点の参照およびコイルへの出力で定義される単位命令とに分割するプログラム編集部と、変換後の前記シーケンス制御プログラムを解析して、前記メインプログラムに対して、該メインプログラム以外のプログラムとして規定されるアクションの挿入点を検出するアクション挿入点検出部と、検出した前記挿入点と、そこに挿入すべき前記アクションとが対になった情報をまとめてモジュール化してアスペクトとして定義するアスペクト定義部と、前記プログラム編集部において、前記メインプログラムと前記単位命令とに分割された分割済みプログラムを保持するプログラム保持部と、前記アクション挿入点検出部で検出された前記挿入点を保持するアクション挿入点保持部と、前記アスペクト定義部で定義された、前記アスペクトを保持するアスペクト保持部と、前記プログラム保持部に保持された前記メインプログラムと、前記アスペクト保持部に保持された前記アスペクトとを読み出し、前記アクション挿入点保持部に保持された前記挿入点に基づいて、前記メインプログラムと前記アクションとを合成するプログラム合成部とを備えている。   According to a first aspect of the present invention, there is provided a program creation device that receives a sequence control program written in a ladder language and converts it into a predetermined programming language, and the converted sequence control program is a main program as a main flow. And a program editing unit that divides into unit instructions defined by contact load, contact reference and coil output, and the sequence control program after conversion is analyzed, and the main program is analyzed with respect to the main program. An action insertion point detection unit that detects an insertion point of an action defined as a program other than a program, and information obtained by pairing information of the detected insertion point and the action to be inserted therein into a module. In the aspect definition section defined as A program holding unit that holds a divided program divided into a main program and the unit instruction, an action insertion point holding unit that holds the insertion point detected by the action insertion point detection unit, and an aspect definition unit The defined aspect holding unit that holds the aspect, the main program held in the program holding unit, and the aspect held in the aspect holding unit are read and held in the action insertion point holding unit And a program synthesis unit that synthesizes the main program and the action based on the insertion point.

本発明に係る請求項1記載のプログラム作成装置によれば、メインプログラムとは別に、メインプログラム以外のプログラムとして規定されるアクションをモジュール化して適用元のプログラムとし、それを適用先のメインプログラムと合成するので、メインプログラムが理解しやすくなり保守性、再利用性を向上させることができる。また適用元のアスペクトについてもモジュール化されているので再利用性が向上するという効果が得られる。   According to the program creation device of the first aspect of the present invention, separately from the main program, an action defined as a program other than the main program is modularized as an application source program, which is applied to the application main program Since it is synthesized, the main program can be easily understood, and maintainability and reusability can be improved. In addition, since the aspect of the application source is also modularized, there is an effect that the reusability is improved.

<ラダー言語によるシーケンス制御プログラムの記述例>
まず、本発明の実施の形態の説明に先立って、図1および図2を用いて、ラダー言語によるシーケンス制御プログラムの一例について説明する。
<Description example of sequence control program in ladder language>
Prior to the description of the embodiment of the present invention, an example of a sequence control program using a ladder language will be described with reference to FIGS.

図1には、ラダー言語によって記述されたシーケンス制御プログラムを示し、図2には、各接点でのタイミングチャートを示す。   FIG. 1 shows a sequence control program written in a ladder language, and FIG. 2 shows a timing chart at each contact.

図1に示されるように、シーケンス制御プログラムは、リレー接点とコイルと呼称されるアクチュエータで構成される行を単位としており、各コイルには、同じ番号が付された接点が接続されている。図1のプログラムは01〜04の4行で構成され、上から順に繰り返し実行される。   As shown in FIG. 1, the sequence control program is based on a row composed of relay contacts and actuators called coils, and contacts with the same numbers are connected to the coils. The program of FIG. 1 is composed of four lines 01 to 04, and is repeatedly executed in order from the top.

基本的な動作は、各行の左側にある入力側の接点がONすることで、行の右側にある出力側のコイルがONすることとなる。   The basic operation is that the input side contact on the left side of each row is turned on, and the output side coil on the right side of the row is turned on.

図1に示したシーケンス制御プログラムでは、装置故障時、すなわち、03行の接点M1020がONした時に、04行のコイルM1050をONさせて処理を中断させることがメインプログラムとなるが、さらに、停電時の状態を保持する復電処理や、故障を検出するためのタイムアウト処理を行うため、01行での復電タイマT335(タイマ(1)と記載)の起動、02行のコイルM1254での復電信号の生成、03行での故障検出のためのタイマT300の起動、04行で復電信号がOFF(接点M1254がOFF)になった場合に、タイマT300(タイマ(2)と記載)がタイムアップしている場合には処理を中断させるという補助的なプログラムを有している。   In the sequence control program shown in FIG. 1, the main program is to interrupt the process by turning on the coil M1050 in the 04th row when the device fails, that is, when the contact M1020 in the 03th row is turned on. In order to perform a power recovery process for maintaining the current state and a time-out process for detecting a failure, the power recovery timer T335 (described as timer (1)) is started in line 01, and the power recovery in the coil M1254 in line 02 Timer T300 (described as timer (2)) is generated when the generation of an electric signal, the start of timer T300 for detecting a failure at line 03, and the power recovery signal at line 04 are OFF (contact M1254 is OFF). If the time is up, there is an auxiliary program that interrupts the processing.

上記シーケンス制御プログラムの動作について図2を用いてさらに説明すると、図2の(a)部に示すように、停電が発生して接点M1250がOFFすると、(b)部に示すように、コイルM1254で復電信号が生成されるが、停電が終了して復電すると、復電タイマT335が起動するので、復電タイマT335が起動中は復電後も復電信号が生成され続ける。   The operation of the sequence control program will be further described with reference to FIG. 2. When a power failure occurs and the contact M1250 is turned off as shown in FIG. 2A, a coil M1254 is shown as shown in FIG. However, when the power failure ends and the power is restored, the power recovery timer T335 is started. Therefore, the power recovery signal continues to be generated after the power recovery while the power recovery timer T335 is active.

このような状況で、(c)部に示されるように停電中に装置故障が発生すると、接点M1020がONして、タイマT300が一定期間起動する。しかし、復電信号が生成されている期間は、復電しても処理をすぐに中断するのではなく、故障発生から復電信号が解消するまでの期間、すなわちOFFディレイ(Doff)が経過した後に処理が中断することとなる。 In such a situation, as shown in part (c), when a device failure occurs during a power failure, the contact M1020 is turned on and the timer T300 is activated for a certain period. However, the period during which the power recovery signal is generated is not immediately interrupted even if the power recovers, but the period from when the power failure occurs until the power recovery signal is eliminated, that is, the OFF delay (D off ) has elapsed. After that, the process will be interrupted.

<実施の形態>
以下、図3〜図15を用いて、本発明に係るプログラム作成装置の実施の形態について説明する。
<Embodiment>
Hereinafter, an embodiment of a program creation device according to the present invention will be described with reference to FIGS.

<A.装置構成>
図3は、本発明に係る実施の形態の、シーケンス制御プログラム作成装置10の構成を示すブロック図である。シーケンス制御プログラム作成装置10は、PLC22上で動作するシーケンス制御プログラムを作成する装置であり、作成されたシーケンス制御プログラムはコンパイラ21に与えられて、実行可能な形式に変換され、RS232CやEthernet(登録商標)のネットワークを介してPLC22に送られ、実行される。
<A. Device configuration>
FIG. 3 is a block diagram showing the configuration of the sequence control program creation device 10 according to the embodiment of the present invention. The sequence control program creation device 10 is a device that creates a sequence control program that operates on the PLC 22. The created sequence control program is given to the compiler 21, converted into an executable format, and RS232C or Ethernet (registered). (Trademark) to the PLC 22 via the network and executed.

図1に示すように、シーケンス制御プログラム作成装置10は、エンジニアリングツール部11、エンジニアリングデータベース12およびプログラム生成部13を備えている。   As shown in FIG. 1, the sequence control program creation device 10 includes an engineering tool unit 11, an engineering database 12, and a program generation unit 13.

エンジニアリングツール部11は、ユーザがシーケンス制御プログラムの作成に使用するプログラム編集部111と、作成されたシーケンス制御プログラムからアクションを挿入可能な点を検出するアクション挿入点検出部112と、アクションと、当該アクションの挿入可能点とが対となった情報の集合をモジュール化(モジュール化したものをアスペクトと呼称)するアスペクト定義部113と、ユーザがアクションの挿入時に操作するアクション編集部114とを備えている。   The engineering tool unit 11 includes a program editing unit 111 used by a user to create a sequence control program, an action insertion point detection unit 112 that detects a point where an action can be inserted from the created sequence control program, an action, It includes an aspect definition unit 113 that modularizes a set of information paired with action insertable points (a modularized form is referred to as an aspect), and an action editing unit 114 that a user operates when inserting an action. Yes.

エンジニアリングデータベース12は、プログラム編集部111で作成されたシーケンス制御プログラムを保存するプログラムテーブル121と、アクション挿入点検出部112から与えられたアクション挿入可能点のデータを保存するアクション挿入点テーブル122と、アスペクト定義部113で定義されたアスペクトを保存するアスペクトテーブル123とを備えている。   The engineering database 12 includes a program table 121 that stores a sequence control program created by the program editing unit 111, an action insertion point table 122 that stores action insertion point data given from the action insertion point detection unit 112, And an aspect table 123 that stores the aspect defined by the aspect definition unit 113.

また、プログラム生成部13は、ソースバッファ132と、エンジニアリングデータベース12からシーケンス制御プログラムを読み出し、アクション挿入点単位でソースバッファ132に格納するプログラム合成部131とを備えている。   The program generation unit 13 includes a source buffer 132 and a program synthesis unit 131 that reads a sequence control program from the engineering database 12 and stores the sequence control program in the source buffer 132 in units of action insertion points.

<B.装置動作>
<B−1.全体動作>
図3を参照しつつ、図4に示すフローチャートを用いて、シーケンス制御プログラム作成装置10の全体動作について説明する。
<B. Device operation>
<B-1. Overall operation>
With reference to FIG. 3, the overall operation of the sequence control program creation device 10 will be described using the flowchart shown in FIG.

シーケンス制御プログラムの作成を開始すると、まず、ユーザがエンジニアリングツール部11のプログラム編集部111を使ってシーケンス制御プログラムを作成し(ステップST101)、当該シーケンス制御プログラムを、エンジニアリングデータベース12のプログラムテーブル121に保存する(ステップST102)。   When the creation of the sequence control program is started, the user first creates a sequence control program using the program editing unit 111 of the engineering tool unit 11 (step ST101), and the sequence control program is stored in the program table 121 of the engineering database 12. Save (step ST102).

このとき、アクション挿入点検出部112においてシーケンス制御プログラムを解析し、アクションを挿入できる点を検出して(ステップST103)、エンジニアリングデータベース12のアクション挿入点テーブル122を更新する(ステップST104)。ここで、アクションが挿入できる点としては、メインとなるプログラム(メインプログラム)の実行開始前および実行終了後、また、接点のロード、参照およびコイルへの出力が行われている点が挙げられる。   At this time, the action insertion point detection unit 112 analyzes the sequence control program, detects a point where an action can be inserted (step ST103), and updates the action insertion point table 122 of the engineering database 12 (step ST104). Here, the point at which an action can be inserted includes a point before the start of execution of the main program (main program) and after the end of execution, and a point where contact loading, reference and output to the coil are performed.

次に、ユーザがエンジニアリングツール部11のアクション編集部114を操作して、挿入すべきアクションを記述するとともに(ステップST105)、当該アクションの挿入点および挿入方法を選択する(ステップST106)。この結果は、アスペクトにまとめられて、エンジニアリングデータベース12のアスペクトテーブル123に保存される(ステップST107)。   Next, the user operates the action editing unit 114 of the engineering tool unit 11 to describe an action to be inserted (step ST105), and selects an insertion point and an insertion method of the action (step ST106). The results are collected into aspects and stored in the aspect table 123 of the engineering database 12 (step ST107).

その後、ユーザはプログラム生成部13のプログラム合成部131を用いて、エンジニアリングデータベース12からシーケンス制御プログラム(メインプログラム)を選択し、当該プログラムに、アスペクトテーブル123において指定されたアクション挿入点があるか否かを確認し、該当するアクション挿入点があればアスペクトに指定されたアクションを選択してソースバッファ132に挿入することで、実行可能なソースプログラムを作成する(ステップST108)。   Thereafter, the user uses the program synthesis unit 131 of the program generation unit 13 to select a sequence control program (main program) from the engineering database 12 and whether or not the program has an action insertion point specified in the aspect table 123. If there is a corresponding action insertion point, an action designated in the aspect is selected and inserted into the source buffer 132, thereby creating an executable source program (step ST108).

そして、作成されたプログラムの種類に応じてコンパイラ21が呼び出され、作成されたソースプログラムをプログラムPLC22に転送することで(ステップST109)、シーケンス制御プログラムの作成を終了する。   Then, the compiler 21 is called according to the type of the created program, and the created source program is transferred to the program PLC 22 (step ST109), thereby completing the creation of the sequence control program.

<B−2.各部の動作>
次に、図1を用いて説明したラダープログラムを例として、シーケンス制御プログラム作成装置10の各部の動作について説明する。
<B-2. Operation of each part>
Next, the operation of each unit of the sequence control program creation device 10 will be described using the ladder program described with reference to FIG. 1 as an example.

なお、以下においては、複雑なデータ構造を簡易に表記するため、W3C(The World Wide Web Consortium)の勧告であるXML(Extensible Markup Language)を使用してデータ構造を定義する。すなわち、データ構造は開始タグ(“<XXX>”)から終了タグ(“</XXX>”)を使って定義する。定義したデータの中に別のデータ、データ構造が含まれる場合は開始タグの中に入れ子にして記述する。   In the following, in order to simply describe a complicated data structure, the data structure is defined using XML (Extensible Markup Language), which is a recommendation of the World Wide Web Consortium (W3C). That is, the data structure is defined using the start tag (“<XXX>”) to the end tag (“</ XXX>”). If other data or data structure is included in the defined data, describe it nested in the start tag.

<B−2−1.プログラム編集部の動作>
シーケンス制御プログラムの編集では、まず、ユーザがエンジニアリングツール部11を使ってラダー図などの図的言語で記述されたプログラムを入力する。以下の説明では、図1に示したシーケンス制御プログラムを入力した場合の動作について説明する。
<B-2-1. Operation of the program editor>
In editing the sequence control program, first, the user uses the engineering tool unit 11 to input a program described in a graphical language such as a ladder diagram. In the following description, an operation when the sequence control program shown in FIG. 1 is input will be described.

なお、入力されたシーケンス制御プログラムは、メモリ上で専用の言語、例えば、プログラマブルコントローラのプログラミング言語の標準規格であるIEC61131−3のLD(Ladder diagram)やIL(Instruction List)、ST(Structured Text)やPOL(Problem Oriented Language)などの言語に変換される。   The input sequence control program is stored in a dedicated language on the memory, for example, LD (Ladder diagram), IL (Instruction List), ST (Structured Text) of IEC61131-3, which is a standard for programming languages of programmable controllers. Or POL (Problem Oriented Language).

ここで、図1に示したシーケンス制御プログラムをPOLで記述した例を図5に示す。図5においては、図1における01〜04行のそれぞれに対応したPOL表現を示しており、”$”や”;”はコマンドであり、これらに続くオペランドに記述される接点の値をロードする。例えば”$”は接点の論理否定の値をロードし、また”−>”は、接点への出力を示すコマンドであり、これに続くオペランドに記述されるコイルに、ロードされている値を出力する。また、”or”,”ani”は論理演算子であり、これに続くオペランドに記述される接点とロードされている値との論理演算をとることを示している。”or”は論理和であり、”ani”は論理積であるが、この例では、例えば04行目はタイマT300の値をロードし、その値とレジスタM1254の否定値の論理積をとり、その結果を接点M1050に代入することを示している。   Here, FIG. 5 shows an example in which the sequence control program shown in FIG. 1 is described in POL. FIG. 5 shows a POL expression corresponding to each of lines 01 to 04 in FIG. 1. “$” and “;” are commands, and the values of the contacts described in the operands following these are loaded. . For example, “$” loads a logical negation value of the contact, and “−>” is a command indicating an output to the contact, and the loaded value is output to the coil described in the following operand. To do. In addition, “or” and “ani” are logical operators, which indicate that a logical operation is performed between a contact point described in an operand following this and a loaded value. “Or” is a logical sum, and “ani” is a logical product. In this example, for example, line 04 loads the value of timer T300 and takes the logical product of the value and the negative value of register M1254. It shows that the result is assigned to the contact M1050.

以上のようなPOLにより、図1に示したシーケンス制御プログラムのメインプログラム、すなわち、装置故障時に、コイルM1050をONさせて処理を中断させるというプログラムを記述したものが図6である。   FIG. 6 describes the main program of the sequence control program shown in FIG. 1, that is, the program for interrupting the processing by turning on the coil M1050 when the apparatus fails.

ここで、プログラム編集部111での編集動作の説明に戻り、以下、図7に示すフローチャートを用いて、プログラム編集部111での編集動作を説明する。   Returning to the description of the editing operation in the program editing unit 111, the editing operation in the program editing unit 111 will be described below using the flowchart shown in FIG.

編集動作を開始すると、まず、プログラムIDがユーザにより入力される(ステップST601)。プログラムIDは、以下において作成するソースプログラムを一義的に識別するための識別番号であり、ユーザが任意に設定する。   When the editing operation is started, first, a program ID is input by the user (step ST601). The program ID is an identification number for uniquely identifying the source program created below, and is arbitrarily set by the user.

その後、ユーザはシーケンス制御プログラム(図1)をラダー言語で入力する(ステップST602)。なお、ラダー言語で入力されたシーケンス制御プログラムは、例えば、POL言語に変換され、以下の処理は当該変換後の言語に基づいて実施される。   Thereafter, the user inputs a sequence control program (FIG. 1) in a ladder language (step ST602). Note that the sequence control program input in the ladder language is converted into, for example, the POL language, and the following processing is performed based on the converted language.

次に、ステップST603において、入力されたシーケンス制御プログラムの1つの行に、接点のロード命令が含まれるか否かを判断し、ロード命令が含まれる場合には、ステップST604において、接点のロード命令を単位命令として分割し、属性type(後に説明)を”Load”とする(ステップST604)。   Next, in step ST603, it is determined whether or not a contact load instruction is included in one row of the input sequence control program. If a load instruction is included, in step ST604, a contact load instruction is included. Are divided into unit instructions, and the attribute type (explained later) is set to “Load” (step ST604).

なお、接点のロード命令が含まれない場合は、ステップST605に進んで、入力されたシーケンス制御プログラムの1つの行に、コイルへの出力命令が含まれるか否かを判断し、コイルへの出力命令が含まれる場合には、ステップST606において、コイルへの出力命令を単位命令として分割し、属性typeを”Store”とする(ステップST606)。   If a contact load command is not included, the process proceeds to step ST605, where it is determined whether or not an output command to the coil is included in one row of the input sequence control program. If an instruction is included, in step ST606, the output instruction to the coil is divided as a unit instruction, and the attribute type is set to “Store” (step ST606).

なお、コイルへの出力命令が含まれない場合は、ステップST607に進んで、入力されたシーケンス制御プログラムの1つの行に、接点の参照命令が含まれるか否かを判断し、接点の参照命令が含まれる場合には、ステップST608において、接点の参照命令を単位命令として分割し、属性typeを”Reference”とする(ステップST608)。なお、接点の参照命令が含まれない場合には、シーケンス制御プログラムの次の行に対して、ステップST602以下の処理を繰り返す。ここで、属性typeの判別順序は上述した順序に限定されるものではない。   If the output instruction to the coil is not included, the process proceeds to step ST607, where it is determined whether or not the reference instruction for the contact is included in one line of the input sequence control program. In step ST608, the contact reference instruction is divided as a unit instruction, and the attribute type is set to “Reference” (step ST608). If the contact reference command is not included, the process from step ST602 onward is repeated for the next line of the sequence control program. Here, the order of determining the attribute type is not limited to the order described above.

ステップST604、ST606およびST608において命令の属性が判別した後は、ステップST609で、当該命令に、属性index(後に説明)の番号としての命令実行番号を付与するが、最初に判別した命令の命令実行番号を1とし、以後は、新たな命令が判別するごとに、命令実行番号を1つ増やして与え、当該属性indexと、それを付与した命令をプログラム編集部111内部に記憶する。   After the attribute of the instruction is determined in steps ST604, ST606, and ST608, in step ST609, an instruction execution number is assigned to the instruction as the attribute index number (to be described later). The number is set to 1, and thereafter, every time a new instruction is identified, the instruction execution number is incremented by one, and the attribute index and the instruction assigned thereto are stored in the program editing unit 111.

次に、ステップST610で、シーケンス制御プログラムの全ての行についての入力が完了したか否かについて確認を行い、入力が完了していない場合には、シーケンス制御プログラムの次の行に対して、ステップST602以下の処理を繰り返す。一方、シーケンス制御プログラムの全ての行についての入力が完了している場合には、プログラム編集部111内部に記憶された内容を、図8に示すXML形式にしてプログラムテーブル121に保存する。   Next, in step ST610, it is checked whether or not the input for all the lines of the sequence control program has been completed. If the input has not been completed, the step is performed for the next line of the sequence control program. The processing from ST602 is repeated. On the other hand, when all the lines of the sequence control program have been input, the contents stored in the program editing unit 111 are stored in the program table 121 in the XML format shown in FIG.

ここで、図8を用いて、プログラムテーブル121に保存されるXML形式のシーケンス制御プログラムの一例を説明する。   Here, an example of an XML sequence control program stored in the program table 121 will be described with reference to FIG.

図8は、図6に示したメインプログラムをXML形式に変換したものであり、図8において、XMLタグである”Program”はプログラムを定義し、プログラムを識別する属性idを有する。ここではidが001のプログラムであることを示している。   FIG. 8 is obtained by converting the main program shown in FIG. 6 into the XML format. In FIG. 8, “Program”, which is an XML tag, defines a program and has an attribute id for identifying the program. Here, it is shown that the program is id 001.

XMLタグである”Instruction”は、プログラムに含まれる単位命令を示す。また、属性indexは、1から始まる命令実行番号を示すIDであり、属性typeは命令の種別を示している。命令の種別には、図7を用いて説明した”Load(接点のロード)”、”Store(コイルへの出力)”、”Reference(接点の参照)”が含まれる。   An XML tag “Instruction” indicates a unit instruction included in the program. The attribute index is an ID indicating an instruction execution number starting from 1. The attribute type indicates the type of instruction. The types of instructions include “Load (load contact)”, “Store (output to coil)”, and “Reference (contact reference)” described with reference to FIG.

<B−2−2.アクション挿入点検出部の動作>
次に、アクション挿入点検出部112での検出動作について説明する。
アクション挿入点検出部112では、プログラム編集部111で作成されたXML形式のシーケンス制御プログラムを解析して、アクション挿入点を検出してアクション挿入点テーブルを作成する。アクション挿入点には、プログラムの実行前、プログラムの実行後、接点のロード、コイルへの出力および接点の参照箇所が対応し、図9には、図8で示したプログラムテーブルの情報から生成されるアクション挿入点テーブルの例を示す。
<B-2-2. Action of Action Insertion Point Detection Unit>
Next, the detection operation in the action insertion point detection unit 112 will be described.
The action insertion point detection unit 112 analyzes the XML-format sequence control program created by the program editing unit 111, detects an action insertion point, and creates an action insertion point table. The action insertion point corresponds to the load point of the contact, the output to the coil, and the reference point of the contact point before and after the program execution, and is generated from the information in the program table shown in FIG. An example of an action insertion point table is shown.

図9において、XMLタグである”PointCuts”はアクション挿入点のリストを示し、XMLタグである”JoinPoints”は、それぞれの挿入点を表し、関連するプログラムのIDを示す属性pid、命令の実行順序を示す属性index、挿入の仕方を示す属性adviceの情報を有している。属性adviceには、命令の前に挿入する”before”、命令そのものを置き換える”around”、命令実行後に挿入を行う”after”がある。   In FIG. 9, “PointCuts” that is an XML tag indicates a list of action insertion points, “JoinPoints” that is an XML tag indicates each insertion point, an attribute pid indicating an ID of a related program, and an instruction execution order And an attribute index indicating how to insert the attribute index. The attribute advice includes “before” to be inserted before the instruction, “around” to replace the instruction itself, and “after” to insert after the instruction is executed.

ここで、図1に示したシーケンス制御プログラムについて、メインプログラムのラダー図を図10に示し、復電処理アスペクトとしてまとめた補助的な処理のラダー図を図11に示す。図10に示すように、メインプログラムの実行前には”JoinPoints”としてJP(1)が検出され、JP(1)の属性adviceは”before”となる。また、装置故障を検出する接点M1020がロードされる部分では、”JoinPoints”としてJP(2)が検出され、JP(2)の属性adviceは”around”となる。また、処理中断を実行するコイルM1050への出力部分では、”JoinPoints”としてJP(3)が検出され、JP(3)の属性adviceは”around”となる。なお、メインプログラムの終了後に”JoinPoints”が検出される場合にはJP(4)となり、JP(4)の属性adviceは”after”となるが、図1に示したラダー図には、”after”に該当するアクションは存在せず、仮想的に示している。   Here, with respect to the sequence control program shown in FIG. 1, a ladder diagram of the main program is shown in FIG. 10, and a ladder diagram of auxiliary processing summarized as a power recovery processing aspect is shown in FIG. As shown in FIG. 10, JP (1) is detected as “JoinPoints” before the execution of the main program, and the attribute advice of JP (1) becomes “before”. Further, JP (2) is detected as “JoinPoints” and the attribute advice of JP (2) is “around” in the portion where the contact M1020 for detecting a device failure is loaded. In the output part to the coil M1050 that executes the process interruption, JP (3) is detected as “JoinPoints”, and the attribute advice of JP (3) becomes “around”. Note that if “JoinPoints” is detected after the main program ends, JP (4) and the attribute advice of JP (4) are “after”, but the ladder diagram shown in FIG. There is no action corresponding to "", which is virtually shown.

図11には、”JoinPoints”JP(1)〜JP(3)のそれぞれに挿入されるアクションを、ラダー図として示している。なお、JP(2)のボックス(A)は接点M1020での装置故障の検出動作に対応し、JP(3)のボックス(B)はコイルM1050での処理中断動作に対応する。   FIG. 11 shows a ladder diagram of actions inserted in each of “JoinPoints” JP (1) to JP (3). The box (A) of JP (2) corresponds to the device failure detection operation at the contact M1020, and the box (B) of JP (3) corresponds to the processing interruption operation at the coil M1050.

ここで、アクション挿入点検出部112での検出動作について、図12に示すフローチャートを用いて説明する。   Here, the detection operation in the action insertion point detection unit 112 will be described with reference to the flowchart shown in FIG.

アクション挿入点検出部112では、検出動作を開始すると、まず、プログラム編集部111から入力されるXML形式のシーケンス制御プログラムより、命令(XMLタグInstruction)リストを読み出す(ステップST801)。   When the action insertion point detection unit 112 starts the detection operation, first, an instruction (XML tag instruction) list is read from the sequence control program in the XML format input from the program editing unit 111 (step ST801).

次に、読み出した命令リストから、メインプログラムの実行開始前に挿入されるべきアクションが存在するか否かを確認し、当該アクションを検出した場合には、プログラム実行開始点を示す挿入点(属性adviceがbeforeとなる挿入点)を作成する(ステップST802)。   Next, it is confirmed from the read instruction list whether or not there is an action to be inserted before the execution of the main program starts. When the action is detected, an insertion point (attribute) indicating the program execution start point is detected. An insertion point where advice becomes before is created (step ST802).

次に、読み出した命令リストから、置き換えすべきアクションが存在するか否かを確認し、当該アクションを検出した場合には、置き換えを示す挿入点(属性adviceがaroundとなる挿入点)を作成する(ステップST803)。   Next, it is confirmed whether or not there is an action to be replaced from the read instruction list, and when the action is detected, an insertion point indicating the replacement (insertion point where the attribute advice is around) is created. (Step ST803).

置き換えの挿入点を作成した後は、ステップST804で、属性indexの番号としての命令実行番号を1つ増やして、命令リストの次の行の読み出しに備える。そして、ステップST805において、命令リストの全ての行についての入力が完了したか否かについて確認を行い、入力が完了していない場合には、命令リストの次の行に対して、ステップST803以下の処理を繰り返す。一方、命令リストの全ての行についての入力が完了している場合には、ステップST806において、メインプログラムの実行終了後を示す挿入点(属性adviceがafterとなる挿入点)を作成し、検出動作を終了する。   After creating the replacement insertion point, in step ST804, the instruction execution number as the attribute index number is incremented by one to prepare for reading the next line of the instruction list. Then, in step ST805, it is checked whether or not the input for all the lines of the instruction list is completed. If the input is not complete, the process following step ST803 is performed for the next line of the instruction list. Repeat the process. On the other hand, if input for all the lines of the instruction list has been completed, in step ST806, an insertion point indicating the end of execution of the main program (insertion point where the attribute advice is after) is created and detected. Exit.

以上の処理を経ることで、図9に示すようなアクション挿入点テーブルを作成し、アクション挿入点テーブル122としてエンジニアリングデータベース12に保存する。   Through the above processing, an action insertion point table as shown in FIG. 9 is created and stored in the engineering database 12 as the action insertion point table 122.

<B−2−3.アスペクト定義部の動作>
次に、アスペクト定義部113での定義動作について説明する。
ここで、アスペクトとはアクション挿入点と、挿入点に挿入するアクションとが対となった情報をまとめたものであり、本実施の形態では、図11において、装置故障時の停止回路に復電処理を施す”復電アスペクト”として示している。なお、これまでの説明では、メインプログラムに対する補助的なプログラムをアクションとしていたが、例外的な処理を行うプログラム等も含め、メインプログラム以外のプログラムをアクションとして扱っても良く、それらによってアスペクトが構成される場合もある。
<B-2-3. Operation of aspect definition section>
Next, the definition operation in the aspect definition unit 113 will be described.
Here, an aspect is a collection of information in which an action insertion point and an action inserted at the insertion point are paired. In this embodiment, in FIG. This is shown as the “power recovery aspect” to which the process is applied. In the description so far, an auxiliary program for the main program has been used as an action. However, programs other than the main program, including programs that perform exceptional processing, may be handled as actions, and the aspect constitutes them. Sometimes it is done.

アスペクト定義部113での定義動作について、図13に示すフローチャートを用いて説明する。   The definition operation in the aspect definition unit 113 will be described with reference to the flowchart shown in FIG.

アスペクト定義部113では、定義動作を開始すると、まず、プログラムテーブル121に保存された、単位命令ごとに分割されたシーケンス制御プログラムをソースプログラムとして読み出す(ステップST1001)。   When the definition operation is started, the aspect definition unit 113 first reads out a sequence control program stored in the program table 121 and divided for each unit instruction as a source program (step ST1001).

次に、エンジニアリングデータベース12からアクション挿入点テーブル122を読み出す(ステップST1002)。   Next, the action insertion point table 122 is read from the engineering database 12 (step ST1002).

次に、ユーザがアクション挿入点テーブル122から、アクションを挿入する点を選択すると(ステップST1003)、アスペクト定義部113では、選択された挿入点の属性adviceの種別によって、処理を分岐する。   Next, when the user selects a point at which an action is inserted from the action insertion point table 122 (step ST1003), the aspect definition unit 113 branches the process depending on the type of the attribute advice of the selected insertion point.

具体的には、ステップST1004において、選択された挿入点の属性adviceが”before”であるか否かを判断し、”before”である場合はステップST1008に進んで、ユーザが、”before”として挿入するシーケンス制御プログラム、すなわちアクションをエンジニアリングデータベース12のアスペクトテーブル123に記述する。   Specifically, in step ST1004, it is determined whether or not the attribute advice of the selected insertion point is “before”. If “before”, the process proceeds to step ST1008, and the user sets “before”. The sequence control program to be inserted, that is, the action is described in the aspect table 123 of the engineering database 12.

一方、ステップST1004において、選択された挿入点の属性adviceが”before”ではないと判断された場合は、ステップST1005において、選択された挿入点の属性adviceが”after”であるか否かを判断し、”after”である場合はステップST1008に進んで、ユーザが、”after”として挿入するシーケンス制御プログラム、すなわちアクションをエンジニアリングデータベース12のアスペクトテーブル123に記述する。   On the other hand, when it is determined in step ST1004 that the attribute advice of the selected insertion point is not “before”, it is determined in step ST1005 whether or not the attribute advice of the selected insertion point is “after”. If it is “after”, the process proceeds to step ST1008, and the user describes the sequence control program to be inserted as “after”, that is, the action in the aspect table 123 of the engineering database 12.

一方、ステップST1005において、選択された挿入点の属性adviceが”after”ではないと判断された場合は、ステップST1006において、選択された挿入点の属性adviceが”around”であると判断し、ステップST1007に進んで、ユーザが、挿入すべきボックスを選択する。ここでボックスとは、挿入点の属性adviceが”around”に挿入されるアクションにおいてメインプログラムの構成要素(接点やコイル)に相当する部分をブラックボックスとして扱うもので、図11では、ボックス(A)、ボックス(B)として示された部分に相当する。   On the other hand, if it is determined in step ST1005 that the attribute advice of the selected insertion point is not “after”, it is determined in step ST1006 that the attribute advice of the selected insertion point is “around”. Proceeding to ST1007, the user selects a box to be inserted. Here, the box is a portion that corresponds to a component (contact or coil) of the main program in the action in which the insertion point attribute advice is inserted “around” as a black box. In FIG. ), Which corresponds to the portion indicated as box (B).

このように、メインプログラムの構成要素に相当する部分をブラックボックスとして扱うことで、異なるメインプログラムを適用先とする場合には、当該ブラックボックスに、その適用先の構成要素を入れることで対応することができ、アクションの再利用性を高めることができる。   In this way, by handling a part corresponding to a component of the main program as a black box, and using a different main program as an application destination, it can be handled by putting the component of the application destination in the black box. This can increase the reusability of actions.

ボックスの選択が終了した後は、ステップST1008において、ユーザが、”around”として挿入するシーケンス制御プログラム、すなわちアクションをエンジニアリングデータベース12のアスペクトテーブル123に記述する。   After the selection of the box is completed, in step ST1008, the user describes the sequence control program to be inserted as “around”, that is, the action in the aspect table 123 of the engineering database 12.

アスペクトテーブル123へのアクションの記述が終わった後、ユーザによるアクション挿入点の入力(選択)が完了しているか否かを確認し(ステップST1009)、入力が終わっていない場合にはステップST1003以下の処理を繰り返し、入力が完了している場合には、定義動作を終了する。   After the description of the action in the aspect table 123 is completed, it is confirmed whether or not the input (selection) of the action insertion point by the user has been completed (step ST1009). The process is repeated, and when the input is completed, the definition operation is terminated.

以上説明したように、挿入点の属性adviceを、”before”、”after”および”around”を分類することで、あらゆるシーケンス制御プログラムに対応することができる。   As described above, by classifying the insertion point attribute advice into “before”, “after”, and “around”, any sequence control program can be supported.

ここで、アスペクトテーブル123の一例について、図14を用いて説明する。
図14に示すように、アスペクトテーブルはアクション挿入点を識別するIDと、挿入するアクションが記述されたもので、ソースプログラム中で実行される順番に並べて格納されている。図14において、XMLタグである”Aspect”は、アスペクト全体の定義を示したもので、その属性nameは”復電処理”と名付けられている。
Here, an example of the aspect table 123 will be described with reference to FIG.
As shown in FIG. 14, the aspect table describes an ID for identifying an action insertion point and an action to be inserted, and is stored in the order in which it is executed in the source program. In FIG. 14, the XML tag “Aspect” indicates the definition of the entire aspect, and the attribute name is named “recovery processing”.

また、XMLタグである”Advice”は、アクションの挿入点と、挿入するアクションを記述したものであり、図14では、02行において、図9に示すアクション挿入点テーブルの”JP(1)”の挿入点において、03行から始まるアクションを実行することを示している。03行から始まるアクションは、図11において”JP(1)”で示されるアクションに対応する。   The XML tag “Advice” describes the action insertion point and the action to be inserted. In FIG. 14, in line 02, “JP (1)” in the action insertion point table shown in FIG. This indicates that an action starting from line 03 is executed at the insertion point. The action starting from line 03 corresponds to the action indicated by “JP (1)” in FIG.

そして、挿入点JP(1)は、図9に示すアクション挿入点テーブルから、プログラム001(図8に示すメインプログラム)の実行前を示す挿入点であることが判るので、ユーザがアクション編集部114を操作して、03行から04行までのアクションを記述する。なお、記述されたアクションは、後に、プログラム生成部13のソースバッファ132に挿入される。   Since the insertion point JP (1) is found from the action insertion point table shown in FIG. 9 to be an insertion point before the execution of the program 001 (main program shown in FIG. 8), the user can edit the action editing unit 114. To describe the actions from line 03 to line 04. The described action is inserted into the source buffer 132 of the program generation unit 13 later.

また、06行においては、図9に示すアクション挿入点テーブルの”JP(2)”の挿入点において、07行のアクションを実行することを示しており、ここでは{□}の表記が図11におけるボックス(A)となる。   Further, line 06 indicates that the action of line 07 is executed at the insertion point of “JP (2)” in the action insertion point table shown in FIG. 9, and the notation {□} is shown in FIG. Box (A).

そして、挿入点JP(2)は、図9に示すアクション挿入点テーブルから、プログラム001の命令番号1(単位命令1)の点であることが判る。ここで、単位命令1は図8より、接点M1020のロードであることが判るので、ユーザがアクション編集部114を操作して、ボックス部分をM1020に置き換え、;M1020−>T300のアクションを記述する。なお、記述されたアクションは、後に、プログラム生成部13のソースバッファ132に挿入される。   The insertion point JP (2) is found from the action insertion point table shown in FIG. 9 to be the point of the instruction number 1 (unit instruction 1) of the program 001. Here, it can be seen from FIG. 8 that the unit instruction 1 is a load of the contact M1020, so the user operates the action editing unit 114 to replace the box part with M1020; and describes the action of M1020-> T300. . The described action is inserted into the source buffer 132 of the program generation unit 13 later.

同様に、09行においては、図9に示すアクション挿入点テーブルの”JP(3)”の挿入点において、10行のアクションを実行することを示しており、ここでは{□}の表記が図11におけるボックス(B)となる。   Similarly, line 09 indicates that 10 lines of action are executed at the insertion point of “JP (3)” in the action insertion point table shown in FIG. 11 is box (B).

そして、挿入点JP(3)は、図9に示すアクション挿入点テーブルから、プログラム001の命令番号2(単位命令2)の点であることが判る。ここで、単位命令2は図8より、接点M1050のコイルへの出力であることが判るので、ユーザがアクション編集部114を操作して、ボックス部分をM1050に置き換え、;T300 ani M1254 −> M1050のアクションを記述する。なお、記述されたアクションは、後に、プログラム生成部13のソースバッファ132に挿入される。   The insertion point JP (3) is found from the action insertion point table shown in FIG. 9 to be the point of the instruction number 2 (unit instruction 2) of the program 001. Here, it can be seen from FIG. 8 that the unit command 2 is an output to the coil of the contact point M1050, so that the user operates the action editing unit 114 to replace the box part with M1050; T300 ani M1254-> M1050 Describe the action. The described action is inserted into the source buffer 132 of the program generation unit 13 later.

ここで、アクション編集部114の具体的な例としては、テキストエディタに相当する機能を有したプログラムが挙げられ、アクション編集部114はエディタなどで編集した内容をアスペクトテーブル123に追記する機能も有している。   Here, a specific example of the action editing unit 114 is a program having a function corresponding to a text editor, and the action editing unit 114 also has a function of adding contents edited by the editor or the like to the aspect table 123. is doing.

<B−2−4.プログラム生成部の動作>
次に、プログラム生成部13でのプログラムの生成動作について、図15に示すプログラム合成部131の動作を示すフローチャートを用いて説明する。
<B-2-4. Operation of the program generator>
Next, the program generation operation in the program generation unit 13 will be described with reference to the flowchart showing the operation of the program synthesis unit 131 shown in FIG.

プログラム合成部131では、合成動作を開始すると、まず、ステップST1101において、適用先のプログラムとなるメインプログラムを、ソースプログラムとしてエンジニアリングデータベース12のプログラムテーブル121から読み出し、その一覧を表示する。   When the synthesizing operation is started, the program synthesizing unit 131 first reads a main program, which is an application program, from the program table 121 of the engineering database 12 as a source program and displays a list thereof in step ST1101.

次に、ステップST1102において、ユーザは表示されたプログラムの中から対象となるプログラムを選択する。ここでは、図8に示すメインプログラムを選択する場合を例に採り、001という名前のプログラムを選択する。   Next, in step ST1102, the user selects a target program from the displayed programs. Here, a case where the main program shown in FIG. 8 is selected is taken as an example, and a program named 001 is selected.

次に、ステップST1103において、プログラム合成部131は、エンジニアリングデータベース12のアスペクトテーブル123の内容を読み出し、アスペクトの一覧を表示する。   Next, in step ST1103, the program composition unit 131 reads the contents of the aspect table 123 of the engineering database 12 and displays a list of aspects.

次に、ステップST1104において、ユーザは表示されたアスペクトの中から適用対象となるアスペクト、すなわち適用元のプログラムを選択する。ここでは、図14に示す”復電処理”を選択する場合を例に採り、アスペクト”復電処理”を選択する。   Next, in step ST1104, the user selects an aspect to be applied from the displayed aspects, that is, an application source program. Here, the case of selecting “recovery processing” shown in FIG. 14 is taken as an example, and the aspect “recovery processing” is selected.

プログラム合成部131では、アスペクトテーブル123から選択されたアスペクトの内容を最初の挿入点まで読み出し、読み出した中にXMLタグ”Advice”が含まれているか否かについて確認を行う(ステップST1105)。そして、”Advice”が含まれていない場合にはステップST1108に進み、”Advice”が含まれている場合には、当該”Advice”がプログラム実行前を示すアクション挿入点”before”を指定しているか否かについて確認を行う(ステップST1106)。   The program composition unit 131 reads the contents of the selected aspect from the aspect table 123 up to the first insertion point, and checks whether or not the XML tag “Advice” is included in the read (step ST1105). If “Advice” is not included, the process proceeds to step ST1108. If “Advice” is included, the “Advice” designates an action insertion point “before” indicating that the program is not yet executed. Whether or not there is is confirmed (step ST1106).

”before”を指定している場合には、ステップST1104において対応するアクション(ユーザがアクション編集部114を操作して記述したもの)をソースバッファ132に挿入する。なお、”before”を指定していない場合には、ステップST1108に進む。   If “before” is designated, the corresponding action (described by the user operating the action editing unit 114) is inserted into the source buffer 132 in step ST1104. If “before” is not designated, the process proceeds to step ST1108.

ステップST1108では、選択されたアスペクトの次の挿入点まで読み出し、読み出した中にXMLタグ”Advice”が含まれているか否かについて確認を行う(ステップST1109)。そして、”Advice”が含まれていない場合にはステップST1113に進み、”Advice”が含まれている場合には、当該”Advice”が置き換えを示すアクション挿入点”around”を指定しているか否かについて確認を行う(ステップST1110)。   In step ST1108, reading is performed up to the next insertion point of the selected aspect, and it is confirmed whether or not the XML tag “Advice” is included in the read (step ST1109). If “Advice” is not included, the process proceeds to step ST1113. If “Advice” is included, whether or not “Advice” specifies an action insertion point “around” indicating replacement is determined. This is confirmed (step ST1110).

”around”を指定している場合には、対応するアクションについてボックス部分を、ユーザがアクション編集部114を操作して置き換えを指定した接点、あるいはコイルに置き換え(ステップST1111)、その結果をソースバッファ132に挿入する(ステップST1112)。なお、”around”を指定していない場合には、ステップST1113に進む。   If “around” is designated, the box portion of the corresponding action is replaced with a contact or coil for which the user has designated replacement by operating the action editing unit 114 (step ST1111), and the result is stored in the source buffer. It inserts in 132 (step ST1112). If “around” is not designated, the process proceeds to step ST1113.

ステップST1113では、選択されたアスペクトのさらに次の挿入点を読み出し、当該読み出したアクション挿入点が最後の挿入点であるか否かを確認する。そして、読み出したアクション挿入点が最後の挿入点ではない場合には、ステップST1108以下の処理を繰り返し、最後の挿入点である場合にはステップST1114に進む。   In step ST1113, the next insertion point of the selected aspect is read, and it is confirmed whether or not the read action insertion point is the last insertion point. If the read action insertion point is not the last insertion point, the process from step ST1108 is repeated, and if it is the last insertion point, the process proceeds to step ST1114.

ステップST1114では、読み出した中にXMLタグ”Advice”が含まれているか否かについて確認を行う。そして、”Advice”が含まれていない場合にはプログラムの生成動作を終了し、”Advice”が含まれている場合には、当該”Advice”がプログラム実行終了後を示すアクション挿入点”after”を指定しているか否かについて確認を行う(ステップST1115)。   In step ST1114, it is confirmed whether or not the XML tag “Advice” is included in the read. If “Advice” is not included, the program generation operation is terminated. If “Advice” is included, the “Advice” is an action insertion point “after” indicating that the program has been completed. Is checked (step ST1115).

”after”を指定している場合には、ステップST1116において対応するアクション(ユーザがアクション編集部114を操作して記述したもの)をソースバッファ132に挿入する。なお、”after”を指定していない場合には、プログラムの生成動作を終了する。   If “after” is designated, the corresponding action (described by the user operating the action editing unit 114) is inserted into the source buffer 132 in step ST1116. If “after” is not designated, the program generation operation is terminated.

<C.変形例>
以上の説明においては、適用するアスペクトとして”復電処理”のみを例示したが、アスペクトテーブルに複数のアスペクトを保存している場合には、プログラム合成部131で、それらをメインプログラムに適用することで、より複雑な処理を実行するプログラムを取り扱うことができる。
<C. Modification>
In the above description, only “recovery processing” is illustrated as an aspect to be applied. However, when a plurality of aspects are stored in the aspect table, the program composition unit 131 applies them to the main program. Therefore, it is possible to handle a program that executes more complicated processing.

この場合、複数のアスペクトが同一のアクション挿入点を指定する場合があるので、アスペクトの適用順序を指定する必要がある。例えば、プログラムの実行前に、他の装置が動作していないことをチェックするアスペクトや、インターロックのアスペクト、前のプログラム工程が終わっているか否かをチェックするアスペクトなどを組み合わせる場合には、アスペクトどうしで同じソースプログラムを共有する場合には、優先順位を決めて適用することになる。   In this case, since a plurality of aspects may specify the same action insertion point, it is necessary to specify the application order of the aspects. For example, when combining aspects that check that other devices are not operating before the execution of the program, interlock aspects, and aspects that check whether the previous program process is complete, etc. When sharing the same source program, the priority order is determined and applied.

<D.効果>
以上説明したように、シーケンス制御プログラム作成装置10においては、メインプログラムとは別に、複数のプログラム間で共通に使うことが可能な補助的な処理や、例外的な処理のプログラムをアスペクトと呼ぶモジュールにまとめて適用元のプログラムとし、それを適用先のメインのプログラムと合成してPLCで実行可能なシーケンス制御プログラムを作成する構成を採っている。このように、適用元のプログラムを、適用先のメインのプログラムとは別に管理することにしたので、メインプログラムが理解しやすくなり保守性、再利用性を向上させることができる。また適用元のアスペクトについてもモジュール化されているので再利用性が向上するという効果が得られる。
<D. Effect>
As described above, in the sequence control program creation device 10, the auxiliary processing that can be used in common among a plurality of programs and an exceptional processing program called an aspect separately from the main program. Thus, the application source program is combined with the main program of the application destination to create a sequence control program that can be executed by the PLC. As described above, since the application source program is managed separately from the application target main program, the main program can be easily understood, and maintainability and reusability can be improved. In addition, since the aspect of the application source is also modularized, there is an effect that the reusability is improved.

ラダー言語によって記述されたシーケンス制御プログラムを示す図である。It is a figure which shows the sequence control program described by the ladder language. シーケンス制御プログラムの各接点でのタイミングチャートを示す図である。It is a figure which shows the timing chart in each contact of a sequence control program. 本発明に係る実施の形態の、シーケンス制御プログラム作成装置の構成を示すブロック図である。It is a block diagram which shows the structure of the sequence control program creation apparatus of embodiment which concerns on this invention. 本発明に係る実施の形態の、シーケンス制御プログラム作成装置の全体動作を説明するフローチャートである。It is a flowchart explaining the whole operation | movement of the sequence control program creation apparatus of embodiment which concerns on this invention. シーケンス制御プログラムをPOLで記述した図である。It is the figure which described the sequence control program by POL. シーケンス制御プログラムのメインプログラムをPOLで記述した図である。It is the figure which described the main program of the sequence control program by POL. プログラム編集部の動作を説明するフローチャートである。It is a flowchart explaining operation | movement of a program edit part. プログラムテーブルに保存されるXML形式のシーケンス制御プログラムを示す図である。It is a figure which shows the sequence control program of the XML format preserve | saved at a program table. アクション挿入点テーブルを示す図である。It is a figure which shows an action insertion point table. ラダー言語によって記述されたメインプログラムを示す図である。It is a figure which shows the main program described by the ladder language. ラダー言語によって記述された復電処理アスペクトを示す図である。It is a figure which shows the power recovery process aspect described by the ladder language. アクション挿入点検出部の動作を説明するフローチャートである。It is a flowchart explaining operation | movement of an action insertion point detection part. アスペクト定義部の動作を説明するフローチャートである。It is a flowchart explaining operation | movement of an aspect definition part. アスペクト表示テーブルを示す図である。It is a figure which shows an aspect display table. プログラム合成部の動作を説明するフローチャートである。It is a flowchart explaining operation | movement of a program synthetic | combination part.

Claims (4)

ラダー言語で記述されたシーケンス制御プログラムを入力して所定のプログラミング言語に変換し、変換後の前記シーケンス制御プログラムを、メインフローであるメインプログラムと、接点のロード、接点の参照およびコイルへの出力で定義される単位命令とに分割するプログラム編集部と、
変換後の前記シーケンス制御プログラムを解析して、前記メインプログラムに対して、該メインプログラム以外のプログラムとして規定されるアクションの挿入点を検出するアクション挿入点検出部と、
検出した前記挿入点と、そこに挿入すべき前記アクションとが対になった情報をまとめてモジュール化してアスペクトとして定義するアスペクト定義部と、
前記プログラム編集部において、前記メインプログラムと前記単位命令とに分割された分割済みプログラムを保持するプログラム保持部と、
前記アクション挿入点検出部で検出された前記挿入点を保持するアクション挿入点保持部と、
前記アスペクト定義部で定義された、前記アスペクトを保持するアスペクト保持部と、
前記プログラム保持部に保持された前記メインプログラムと、前記アスペクト保持部に保持された前記アスペクトとを読み出し、前記アクション挿入点保持部に保持された前記挿入点に基づいて、前記メインプログラムと前記アクションとを合成するプログラム合成部、とを備えるプログラム作成装置。
A sequence control program written in a ladder language is input and converted into a predetermined programming language. The converted sequence control program is a main program as a main flow, contact loading, contact reference, and output to a coil. A program editing unit that divides the unit command defined by
An action insertion point detector that analyzes the sequence control program after conversion and detects an insertion point of an action defined as a program other than the main program for the main program;
An aspect definition unit that collectively defines information in which the detected insertion point and the action to be inserted therein are paired and defines it as an aspect;
In the program editing unit, a program holding unit that holds a divided program divided into the main program and the unit instruction;
An action insertion point holding unit for holding the insertion point detected by the action insertion point detection unit;
An aspect holding unit that holds the aspect defined by the aspect definition unit;
Reading the main program held in the program holding unit and the aspect held in the aspect holding unit, and based on the insertion point held in the action insertion point holding unit, the main program and the action And a program composition unit for synthesizing the program.
前記アクション挿入点検出部は、
前記アクションの前記挿入点が、前記メインプログラムの実行開始前を示す点であるか、前記メインプログラムの置き換えを示す点であるか、前記メインプログラムの実行終了後を示す点である場合に分類して、前記挿入点を検出する、請求項1記載のプログラム作成装置。
The action insertion point detector is
Classification is made when the insertion point of the action is a point indicating the start of execution of the main program, a point indicating replacement of the main program, or a point indicating the end of execution of the main program. The program creation device according to claim 1, wherein the insertion point is detected.
前記アスペクト定義部は、
前記メインプログラムの前記置き換えを示す点に挿入される前記アクションにおいては、前記メインプログラムの構成要素に相当する部分をブラックボックスとして処理し、前記プログラム合成部において、前記ブラックボックスに前記メインプログラムの前記構成要素を挿入する、請求項2記載のプログラム作成装置。
The aspect definition unit includes:
In the action inserted at the point indicating the replacement of the main program, a portion corresponding to a component of the main program is processed as a black box, and the program synthesis unit stores the part of the main program in the black box. The program creation device according to claim 2, wherein a component is inserted.
前記プログラム合成部は、
前記メインプログラムと前記アクションとの合成に際して、種類の異なる複数の前記アスペクトを、適用順序を指定して、前記メインプログラムに適用する、請求項1記載のプログラム作成装置。
The program synthesis unit
The program creation device according to claim 1, wherein when combining the main program and the action, a plurality of different types of aspects are applied to the main program by specifying an application order.
JP2007134963A 2007-05-22 2007-05-22 Programming device Pending JP2008293058A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2007134963A JP2008293058A (en) 2007-05-22 2007-05-22 Programming device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2007134963A JP2008293058A (en) 2007-05-22 2007-05-22 Programming device

Publications (1)

Publication Number Publication Date
JP2008293058A true JP2008293058A (en) 2008-12-04

Family

ID=40167747

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2007134963A Pending JP2008293058A (en) 2007-05-22 2007-05-22 Programming device

Country Status (1)

Country Link
JP (1) JP2008293058A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2010089862A1 (en) * 2009-02-04 2010-08-12 三菱電機株式会社 Ladder program edition device

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2010089862A1 (en) * 2009-02-04 2010-08-12 三菱電機株式会社 Ladder program edition device
CN102308263A (en) * 2009-02-04 2012-01-04 三菱电机株式会社 Ladder program edition device
JPWO2010089862A1 (en) * 2009-02-04 2012-08-09 三菱電機株式会社 Ladder program editing device
JP5073067B2 (en) * 2009-02-04 2012-11-14 三菱電機株式会社 Ladder program editing device

Similar Documents

Publication Publication Date Title
KR101558832B1 (en) Sequence-program debugging assistance apparatus
JP4541418B2 (en) Programmable controller peripheral device, replacement method and program
JP2008269569A (en) Code converter
JP2008039784A (en) Pattern generator and pattern generating method for semiconductor test
JP5777837B2 (en) Program development support apparatus and method
JP6550268B2 (en) Program creation support apparatus, program and determination method
JP2008293058A (en) Programming device
JP2000020114A (en) Method for generating and executing program for motion controller
JP4494361B2 (en) Ladder program optimization device and optimization program
JP5086296B2 (en) Programmable controller control program creation method and programmable controller control program creation system
JP2009086898A (en) Method for compiling machine code program for programmable logic controller
JP2005309593A (en) Program preparation device and program preparation method
JP5041990B2 (en) Software component extraction support device
JP2010097414A (en) Apparatus and method for controlling machine tool
JP2007102380A (en) Debugging method for control component having variability and debugging support device
JP5589670B2 (en) How to debug
JP2011022838A (en) Debug device and ladder program verification method
JP2004341824A (en) Programming device of programmable controller
JP4387288B2 (en) Display device for control, editor device, program, and recording medium
WO2022185670A1 (en) Development support device, method for controlling development support device, information processing program, and recording medium
JP2011238079A (en) Control program development assist device
JP2005316710A (en) Software test support device
JP2006338391A (en) State machine and operation method for it
JP4483543B2 (en) Batch processing verification apparatus, batch processing verification program, and batch processing verification method
JP2007265098A (en) Macro definition information acquisition device