JP5019021B2 - Control program development support device - Google Patents
Control program development support device Download PDFInfo
- Publication number
- JP5019021B2 JP5019021B2 JP2006071886A JP2006071886A JP5019021B2 JP 5019021 B2 JP5019021 B2 JP 5019021B2 JP 2006071886 A JP2006071886 A JP 2006071886A JP 2006071886 A JP2006071886 A JP 2006071886A JP 5019021 B2 JP5019021 B2 JP 5019021B2
- Authority
- JP
- Japan
- Prior art keywords
- program
- subroutine
- control
- memory
- programs
- 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
Links
- 238000004590 computer program Methods 0.000 claims description 4
- 239000000284 extract Substances 0.000 claims description 3
- 230000006870 function Effects 0.000 claims description 2
- 238000000034 method Methods 0.000 description 17
- 102100036464 Activated RNA polymerase II transcriptional coactivator p15 Human genes 0.000 description 13
- 101000713904 Homo sapiens Activated RNA polymerase II transcriptional coactivator p15 Proteins 0.000 description 13
- 229910004444 SUB1 Inorganic materials 0.000 description 13
- 229910004438 SUB2 Inorganic materials 0.000 description 13
- 101100311330 Schizosaccharomyces pombe (strain 972 / ATCC 24843) uap56 gene Proteins 0.000 description 13
- 101150018444 sub2 gene Proteins 0.000 description 13
- 238000010586 diagram Methods 0.000 description 9
- 102100026205 1-phosphatidylinositol 4,5-bisphosphate phosphodiesterase gamma-1 Human genes 0.000 description 6
- 101000691599 Homo sapiens 1-phosphatidylinositol 4,5-bisphosphate phosphodiesterase gamma-1 Proteins 0.000 description 6
- 101150080287 SUB3 gene Proteins 0.000 description 6
- 101100408464 Caenorhabditis elegans plc-1 gene Proteins 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 238000000605 extraction Methods 0.000 description 1
- 230000007257 malfunction Effects 0.000 description 1
Images
Description
本発明は、プログラマブル・コントローラ(以下、PLCと言う)の制御プログラム(ユーザプログラム)を開発する場合等に好適な制御プログラム開発支援装置に関するものである。 The present invention relates to a control program development support apparatus suitable for developing a control program (user program) for a programmable controller (hereinafter referred to as PLC).
PLCで実行される制御プログラム(ユーザプログラム)の作成を支援するものとして制御プログラム開発支援装置(以下、開発支援装置)が知られている。この開発支援装置を使ってユーザプログラムを作成する際には、既存プログラムの流用がしばしば行なわれる。 2. Description of the Related Art A control program development support device (hereinafter referred to as a development support device) is known as a device that supports creation of a control program (user program) executed by a PLC. When creating a user program using this development support apparatus, existing programs are often used.
通常、ユーザプログラムは、複数のプログラムモジュールから構成されており、さらには、あるプログラムモジュール内において他のプログラムモジュールをサブルーチンプログラムとして呼び出すように構成されることがある。このようなサブルーチンプログラム間や、サブルーチンプログラムとサブルーチンプログラムでない(サブルーチンプログラムを呼び出す側)プログラムモジュール間で共通に参照されるメモリアドレスが存在する。 Usually, a user program is composed of a plurality of program modules, and may be configured to call another program module as a subroutine program within a certain program module. There is a memory address that is commonly referred to between such subroutine programs or between program modules that are not subroutine programs (subroutine calling side).
このように異なるプログラムモジュール間で共通に参照されるメモリアドレスが存在する場合は、そのプログラムモジュールを流用する際は注意が必要となる。これを怠ると、予期せぬ誤動作の原因となる。 Thus, when there is a memory address that is commonly referred to between different program modules, care must be taken when diverting the program module. Failure to do so may cause an unexpected malfunction.
あるメモリアドレスがユーザプログラム内のどこに使用されているか検索するためのものとしては、クロスリファレンスと称される参照テーブルが知られている。なお、クロスリファレンスを利用する検索については、各種の公知技術が知られている(例えば、特許文献1参照)。 A reference table called a cross reference is known as a method for searching where a certain memory address is used in a user program. Note that various known techniques are known for searching using a cross reference (see, for example, Patent Document 1).
クロスリファレンス表示例が図14に示されている。この例では、メモリアドレス「A200.11」がプログラム名「新規プログラム1」なるプログラムを構成するセクション名「セクション1」なるプログラムモジュール内で使用されていることを示している。さらに、そのプログラムモジュール内の使用場所として、プログラムアドレスが「0」であり、命令語「LD」のオペランドとして使用されていることを表している。
しかしながら、従来のクロスリファレンス表示は、あるメモリアドレスが使用されているプログラムモジュールの名称やプログラムモジュール内での使用場所等を当該メモリアドレスを行の先頭として同一行に並べて表示するというメモリアドレス中心の表示となっている。したがって、あるサブルーチンプログラム内で使用されているメモリが他のサブルーチンプログラムやサブルーチンプログラムを呼び出す側のプログラムモジュールでも使用されているかどうかを一目で理解できるものではなかったため、使い勝手が悪いと言う問題点が指摘されている。 However, the conventional cross-reference display is based on the memory address center, in which the name of the program module in which a certain memory address is used, the location in the program module, etc. are displayed side by side on the same line with the memory address as the head of the line. It is displayed. Therefore, it was not possible to understand at a glance whether the memory used in a subroutine program is also used in other subroutine programs or the program module that calls the subroutine program. It has been pointed out.
この発明は、上述の問題点に着目してなされたものであり、その目的とするところは、あるプログラムモジュール内に使用されているメモリが他のサブルーチンプログラムやサブルーチンプログラムを呼び出す側のプログラムモジュールでも使用されているかどうかを一目で理解できるような表示を提供できる制御プログラム開発支援装置を提供することにある。 The present invention has been made by paying attention to the above-mentioned problems, and the object of the present invention is that a memory used in a certain program module is a program module that calls another subroutine program or subroutine program. It is an object of the present invention to provide a control program development support apparatus that can provide a display that can be understood at a glance whether or not it is used.
本発明の制御プログラム開発支援装置は、複数のプログラムモジュールと複数のサブルーチンプログラムで構成される制御プログラムを解析する制御プログラムの開発支援装置であって、制御プログラムを読み出し、使用されているメモリアドレスのサブルーチンプログラム間や、サブルーチンプログラムとサブルーチンプログラムを呼び出すプログラムモジュール間での重複使用状況を解析する解析手段と、解析手段で解1析した結果を表示する解析結果表示手段とを備え、サブルーチンプログラム毎に他のサブルーチンプログラムやサブルーチンプログラムを呼び出すプログラムモジュールとの使用メモリアドレスの重複使用状況を表示可能とする、ことを特徴とするものである。 A control program development support apparatus according to the present invention is a control program development support apparatus that analyzes a control program composed of a plurality of program modules and a plurality of subroutine programs. Analyzing means for analyzing the overlapping usage status between subroutine programs or between subroutine programs and program modules that call subroutine programs, and analysis result displaying means for displaying the results of analysis by the analyzing means, each subroutine program The present invention is characterized in that it is possible to display the overlapping usage status of memory addresses used with other subroutine programs and program modules that call subroutine programs.
このような構成によれば、あるプログラムモジュール内に使用されているメモリが他のサブルーチンプログラムやサブルーチンプログラムを呼び出す側のプログラムモジュールでも使用されているかどうかを一目で理解できるような表示をユーザに提供することができる。 According to such a configuration, a display is provided to the user so that the user can understand at a glance whether the memory used in a certain program module is also used in another subroutine program or a program module that calls a subroutine program. can do.
本発明の好ましい実施の形態においては、解析手段は、使用メモリアドレスの重複使用状況を解析する場合、重複使用されるメモリアドレスのサイズを抽出し、解析結果表示手段は、解析手段で抽出された重複使用メモリアドレスのサイズをサブルーチンプログラム名と共に表示するようにしてもよい。 In a preferred embodiment of the present invention, the analyzing means extracts the size of the memory address to be used redundantly when analyzing the overlapping usage status of the used memory address, and the analysis result displaying means is extracted by the analyzing means. The size of the overlapping memory address may be displayed together with the subroutine program name.
このような構成によれば、どのサブルーチンプログラムとの間でどの程度のメモリ容量が重複しようされているかをユーザは表示に基づいて的確に把握することができる。 According to such a configuration, the user can accurately grasp how much memory capacity is overlapped with which subroutine program based on the display.
別の一面から見た本発明は、そのような開発支援装置をパソコンに実現させることができるコンピュータプログラムとして把握することもできる。 The present invention viewed from another aspect can also be grasped as a computer program capable of realizing such a development support apparatus on a personal computer.
本発明によれば、あるプログラムモジュール内に使用されているメモリが他のサブルーチンプログラムやサブルーチンプログラムでないプログラムモジュールでも使用されているかどうかを一目で理解できるような表示をユーザに提供することができる。 According to the present invention, it is possible to provide a display to the user so that it can be understood at a glance whether a memory used in a certain program module is also used in another subroutine program or a program module that is not a subroutine program.
以下に、この発明に係る制御プログラム開発支援装置の好適な実施の一形態を添付図面を参照しながら詳細に説明する。 Hereinafter, a preferred embodiment of a control program development support device according to the present invention will be described in detail with reference to the accompanying drawings.
本発明の制御プログラム開発支援装置は、例えばパソコンに所定のアプリケーションソフトをインストールすることによって実現することができる。ここで、パソコンのハードウェア構成については種々の文献において周知であるから、この明細書においては詳細な説明は省略する。 The control program development support apparatus of the present invention can be realized, for example, by installing predetermined application software on a personal computer. Here, since the hardware configuration of a personal computer is well known in various documents, detailed description thereof is omitted in this specification.
サブルーチンでのメモリ使用状況の説明図が図1に示されている。PLCのプログラムは、複数のプログラムモジュールから構成されており、さらには、あるプログラムモジュール内において他のプログラムモジュールをサブルーチンプログラムとして読み出すように構成されることがある。このようなサブルーチンプログラム間や、サブルーチンプログラムとサブルーチンプログラムを呼び出す側のプログラムモジュール間で共通に参照されるメモリアドレスが存在する。 An explanatory diagram of the memory use status in the subroutine is shown in FIG. The PLC program is composed of a plurality of program modules, and may be configured to read out another program module as a subroutine program within a certain program module. There is a memory address that is commonly referenced between such subroutine programs and between the subroutine program and the program module that calls the subroutine program.
サブルーチン間でのメモリ使用状況の説明図が図1に示されている。図1では、PLCのユーザプログラムは複数の「タスク」と呼ばれるプログラム単位で構成され、各タスクは、複数の「セクション」と呼ばれるプログラムモジュールで構成され、さらに、各セクションは「サブルーチン」と呼ばれるサブルーチンプログラムを含んで構成されている例を示している。 FIG. 1 shows an explanatory diagram of the memory usage status between subroutines. In FIG. 1, the PLC user program is composed of a plurality of program units called “tasks”, each task is composed of a plurality of program modules called “sections”, and each section is a subroutine called “subroutine”. An example including a program is shown.
図1に示されるPLCのユーザプログラムは、タスク名称が制御Aと制御Bと制御Cとからなる3個のタスクを有する。制御Aのタスク内にはセクション名称が制御A_1のセクションが含まれており、さらにこの制御A_1のセクション内にはサブルーチン名称がSUB1のサブルーチンが含まれている。 The PLC user program shown in FIG. 1 has three tasks whose task names are control A, control B, and control C. The control A task includes a section whose section name is control A_1, and the control A_1 includes a subroutine whose subroutine name is SUB1.
制御B(タスク)内には制御B_1(セクション)が含まれており、この制御B_1(セクション)内にはさらにSUB2(サブルーチン)が含まれている。制御C(タスク)内には制御C_1(セクション)が含まれており、この制御C_1(セクション)内にはSUB3(サブルーチン)がさらに含まれている。PLCのメモリ内には、入出力リレー領域、内部補助リレー領域、保持リレー領域、特殊補助リレー領域、データメモリ領域、拡張データメモリ領域などのメモリエリアがそれぞれ設けられている。 A control B_1 (section) is included in the control B (task), and a SUB2 (subroutine) is further included in the control B_1 (section). A control C_1 (section) is included in the control C (task), and a SUB3 (subroutine) is further included in the control C_1 (section). In the PLC memory, memory areas such as an input / output relay area, an internal auxiliary relay area, a holding relay area, a special auxiliary relay area, a data memory area, and an extended data memory area are provided.
それらの中で、入出力リレー領域(A)は、制御A(タスク)内のSUB1(サブルーチン)によって使用される。また、保持リレー領域(B)は、制御A(タスク)内のSUB1(サブルーチン)と制御B(タスク)内のSUB2(サブルーチン)とに共用される。また、データメモリ領域(C)は、制御B(タスク)内の制御B_1(セクション)と制御B_1(セクション)に含まれるSUB2(サブルーチン)とで共用される。また、拡張データメモリ領域(D)は、制御B(タスク)内のSUB2(サブルーチン)と、制御C(タスク)内の制御C_1(セクション)と、制御C_1(セクション)内のSUB3(サブルーチン)とで共用される。 Among them, the input / output relay area (A) is used by SUB1 (subroutine) in the control A (task). The holding relay area (B) is shared by SUB1 (subroutine) in control A (task) and SUB2 (subroutine) in control B (task). The data memory area (C) is shared by the control B_1 (section) in the control B (task) and the SUB2 (subroutine) included in the control B_1 (section). The extended data memory area (D) includes a SUB2 (subroutine) in the control B (task), a control C_1 (section) in the control C (task), and a SUB3 (subroutine) in the control C_1 (section). Shared by.
これを踏まえて、サブルーチンからコールされるメモリを下記のように分類することができる。
(1)1つのサブルーチン内でのみ使用される領域(A)
(2)2つ以上のサブルーチン内で使用される領域(B)
(3)1つのサブルーチン内と通常ルーチンで使用される領域(C)
(4)2つ以上のサブルーチン内と通常ルーチンで使用される領域(D)
Based on this, the memory called from the subroutine can be classified as follows.
(1) Area used only within one subroutine (A)
(2) Area used in two or more subroutines (B)
(3) Area used in one subroutine and normal routine (C)
(4) Area used in two or more subroutines and normal routine (D)
次に、本発明装置を実現するために、例えばパソコンにインストールされるべき、サブルーチン間のメモリ使用状況の解析処理を示すフローチャートが図2に示されている。 Next, FIG. 2 shows a flowchart showing an analysis process of the memory usage status between subroutines to be installed in a personal computer, for example, in order to realize the apparatus of the present invention.
同図において処理が開始されると、サブルーチン毎の使用メモリ一覧を解析する処理(ステップ201)が、全サブルーチンについて順次実行される(ステップ202NO)。 When the process is started in the figure, the process of analyzing the used memory list for each subroutine (step 201) is sequentially executed for all subroutines (NO in step 202).
サブルーチン毎の使用メモリ一覧の解析処理(ステップ201)が全サブルーチンについて終了すると(ステップ202YES)、サブルーチン間で同じメモリを使用している箇所の抽出が行われ(ステップ203)、この抽出結果に基づいて、一覧表の作成が行われ、作成された一覧表はパソコンの画面に表示される(ステップ204)。なお、ステップ203でメモリアドレスの重複使用を抽出する際に、その重複されているメモリアドレスで指定されるメモリエリアの合計サイズをメモリエリアの種別毎に求め、その求めたサイズをステップ204の処理で画面表示するように構成しても良い。
When the analysis processing of the used memory list for each subroutine (step 201) is completed for all subroutines (YES in step 202), a portion using the same memory is extracted between the subroutines (step 203), and based on this extraction result Then, a list is created, and the created list is displayed on the screen of the personal computer (step 204). When extracting the overlapping use of the memory address in
次に、ユーザプログラムの構造の一例を示す説明図が図3に示されている。このユーザプログラムは、PLC1内に、タスク1とタスク2とからなる2個のタスクを含んでいる。タスク1内にはセクション1が含まれ、セクション1内には1個のサブルーチンSUB1が含まれている。このサブルーチンSUB1は、DM0,DM1,DM2で表される3個のメモリアドレスを使用している。
Next, an explanatory diagram showing an example of the structure of the user program is shown in FIG. This user program includes two tasks including a
タスク2内にはセクション1が含まれており、このセクション1内にはサブルーチンSUB2が含まれている。このサブルーチンSUB2は、DM10,EM0,WR10で表される3個のメモリアドレスを使用している。この例で、「DM」、「EM」、「WR」は、メモリエリアの種別を表す文字列である。「DM」、「EM」、「WR」に続く数字は、当該メモリエリア種別内でのアドレスを表している。このようにメモリエリアの種別を表す文字列と、そのメモリエリア種別内でのアドレスを表す数字との組み合わせでメモリアドレスを表現することがある。
The
換言すれば、PLC1のタスク1/セクション1内のサブルーチンSUB1でメモリDM0〜DM2を使用すると共に、PLC1のタスク2/セクション1内のサブルーチンSUB2でメモリDM10/EM0/WR10を使用しているのである。
In other words, memory DM0 to DM2 are used in subroutine SUB1 in
このようなユーザプログラムを作成した場合、パソコンのRAM内に保存されているデータの説明図が図4に示されている。同図に示されるように、ユーザが作成したプログラムは、RAMアドレス、メモリアドレス、SUB番号に分けてパソコンのRAM内に保存される。ポインタPの位置に着目して具体的に説明すると、RAMアドレス1にはメモリアドレス「DM0」とSUB1を識別するデータ「1」が保存されている。図4の例では、SUB1、SUB2を識別するデータとしてそれぞれ「1」、「2」が対応している。
When such a user program is created, an explanatory diagram of data stored in the RAM of the personal computer is shown in FIG. As shown in the figure, the program created by the user is stored in the RAM of the personal computer divided into a RAM address, a memory address, and a SUB number. Specifically, focusing on the position of the pointer P,
次に、サブルーチン単位使用のメモリ一覧表示処理のフローチャートが図5に示されている。このフローチャートに示されるプログラムをパソコンにインストールすることによって、本発明に係る制御プログラム開発支援装置が実現される。 Next, FIG. 5 shows a flowchart of a memory list display process using subroutine units. The control program development support apparatus according to the present invention is realized by installing the program shown in this flowchart in a personal computer.
同図において処理が開始されると、サブルーチン番号レジスタ(SUB_No)が初期値「1」に設定される。続くステップ502においては、ポインタPにサブルーチン番号レジスタ(SUB_No)のRAMアドレスを入力する。続くステップ503においては、カウンタ(Num)に初期値「1」を設定する(ステップ503)。
When the processing is started in the figure, the subroutine number register (SUB_No) is set to the initial value “1”. In the
続くステップ504においては、サブルーチン番号レジスタ(SUB_No)とカウンタ(Num)とに基づいてメモリアドレスの取得を行う(ステップ504)。続くステップ505においては、取得されたメモリアドレスに基づいて、SUB[SUB_No][NUM]を求める。
In the
続くステップ506においては、ポインタPおよびカウンタNumをプラス1更新する。続くステップ507においては、取得されたメモリアドレスが0であるか否かを判定する。ここで0であれば(ステップ507NO)、再びステップ504へ戻って、先と同様の処理を実行する。これに対してメモリアドレスが0と判定されると(ステップ507YES)、ステップ508へ進んで、サブルーチン番号SUB_Noをプラス1更新する。
In the
続くステップ509では、以上一連の処理をあらかじめ登録されているサブルーチン番号(SUB_No)数分だけ繰り返したかどうかの判定を行い、未だ繰り返し数に達していなければ(ステップ509NO)、ステップ502へ戻って以上の処理を繰り返す。これに対して、登録されている繰り返し数に達していれば(ステップ509YES)、プログラムの実行を終了する。
In the
図4に示されるデータに対して、図5に示されるプログラムが実行されると、その結果、下記のようなデータが生成される。
SUB[1][1]=DM0
SUB[1][2]=DM1
SUB[1][3]=DM2
SUB[2][1]=DM10
SUB[2][2]=EM0
SUB[2][3]=WR10
ここで、データのフォーマットは、PLC1[SUB_No][設定値]とされている。
When the program shown in FIG. 5 is executed on the data shown in FIG. 4, the following data is generated as a result.
SUB [1] [1] = DM0
SUB [1] [2] = DM1
SUB [1] [3] = DM2
SUB [2] [1] = DM10
SUB [2] [2] = EM0
SUB [2] [3] = WR10
Here, the data format is PLC1 [SUB_No] [setting value].
以上得られたデータに基づく描画処理のフローチャートが図6に示されている。同図において処理が開始されると、ステップ601においては、初期化処理(i=1,j=1)が実行される。
FIG. 6 shows a flowchart of the drawing process based on the data obtained above. When the processing is started in the figure, in
続くステップ602においては、描画用の演算処理(描画[i][j]=PLC1[i][j]が実行される。続くステップ603においては、画素の更新処理(j=j+1)が行われる。続くステップ604においては、PLC1[i][j]の値が0であるか否かの判定を行う。
In the
ここで判定結果が0であれば、ステップ602へ戻って、以上の処理が繰り返される。これに対して、判定結果が0であれば(ステップ604YES)、ステップ605へ進んで、画素の更新処理(j=1,i=i+1)が実行される。 If the determination result is 0, the process returns to step 602 and the above processing is repeated. On the other hand, if the determination result is 0 (YES in step 604), the process proceeds to step 605, and pixel update processing (j = 1, i = i + 1) is executed.
続くステップ606では、PLC1[i][j]が0であるか否かの判定が行われる。ここで判定結果が0でなければ(ステップ606NO)、ステップ602へ戻って同様な処理が実行されるのに対し、判定結果が0であれば(ステップ606YES)、プログラムの実行は終了する。
In the
このような描画処理によってパソコンの画面上に得られた解析結果の表示例の説明図が図7に示されている。同図に示されるように、この表示態様によれば、サブルーチン内で使用しているメモリがひと目でわかる。 FIG. 7 shows an explanatory diagram of a display example of the analysis result obtained on the screen of the personal computer by such drawing processing. As shown in the figure, according to this display mode, the memory used in the subroutine can be known at a glance.
最後に、より具体的な例を挙げて、サブルーチンの解析処理について説明する。 Finally, the subroutine analysis process will be described with a more specific example.
サブルーチン内メモリ使用状況の一例を示す図が図8に、解析結果の表示例を示す図が図9にそれぞれ示されている。 FIG. 8 is a diagram showing an example of the memory usage status in the subroutine, and FIG. 9 is a diagram showing a display example of the analysis result.
図8に示されるPLCのプログラムは、制御A(タスク)と制御B(タスク)とからなる2個のタスクを含んでいる。制御A(タスク)内には、制御A_1(セクション)が含まれ、さらにこの制御A_1(セクション)内にはSUB1(サブルーチン)が含まれている。 The PLC program shown in FIG. 8 includes two tasks including control A (task) and control B (task). Control A (task) includes control A_1 (section), and control A_1 (section) includes SUB1 (subroutine).
同様にして、制御B(タスク)内には制御B_1(セクション)が含まれており、この制御B_1(セクション)内には、SUB2(サブルーチン)とSUB3(サブルーチン)とからなる2個のサブルーチンが含まれている。 Similarly, a control B_1 (section) is included in the control B (task), and two subroutines consisting of SUB2 (subroutine) and SUB3 (subroutine) are included in the control B_1 (section). include.
一方、PLCのメモリ内には、入出力リレー領域、内部補助リレー領域、保持リレー領域、特殊補助リレー領域、データメモリ領域、拡張データメモリ領域がそれぞれ設けられている。 On the other hand, an input / output relay area, an internal auxiliary relay area, a holding relay area, a special auxiliary relay area, a data memory area, and an extended data memory area are provided in the PLC memory.
それらの中で、内部補助リレー領域は、制御A(タスク)内に存在するSUB1(サブルーチン)と制御B(タスク)内に含まれるSUB2(サブルーチン)とで共用される。 Among them, the internal auxiliary relay area is shared by SUB1 (subroutine) existing in the control A (task) and SUB2 (subroutine) included in the control B (task).
また、メモリ内のデータメモリ領域は、制御B(タスク)内の制御B_1(セクション)とSUB3(サブルーチン)とで共用される。 The data memory area in the memory is shared by the control B_1 (section) and SUB3 (subroutine) in the control B (task).
換言すれば、このPLCのプログラムは、2つのタスク(制御A,制御B)と2つのセクション(制御A_1,制御B_1)から構成され、図示のように同じメモリを複数のサブルーチンで共有していることとなる。 In other words, the PLC program is composed of two tasks (control A and control B) and two sections (control A_1 and control B_1), and the same memory is shared by a plurality of subroutines as shown in the figure. It will be.
このようなPLCのプログラムを解析すると、図9に示されるような解析結果の表示が得られる。図から明らかなように、この表示例にあっては、パソコンの画面上には横長長方形状の領域が描かれ、この領域は左右方向へ3列に分割される。各分割領域には、サブルーチン、リンク先サブルーチン、リンク点数がそれぞれ割り付けられる。 When such a PLC program is analyzed, an analysis result display as shown in FIG. 9 is obtained. As is apparent from the figure, in this display example, a horizontally long rectangular area is drawn on the screen of the personal computer, and this area is divided into three columns in the left-right direction. Each divided area is assigned a subroutine, a linked subroutine, and the number of link points.
サブルーチンは、左右方向3列にさらに分割され、左から順にサブルーチン、タスク、セクションがそれぞれ割り付けられる。 The subroutine is further divided into three columns in the left-right direction, and the subroutine, task, and section are assigned in order from the left.
サブルーチン列は、上下3段に分割され、順にSUB1,SUB2,SUB3が割り付けられる。 The subroutine row is divided into upper and lower three stages, and SUB1, SUB2, and SUB3 are assigned in order.
タスクの列は、同様にして各サブルーチンに対応させて、制御A,制御B,制御Bといったように、タスクの種別が格納される。 Similarly, the task column stores task types such as control A, control B, and control B in association with each subroutine.
さらに、セクションの列についても、制御A,制御B内にそれぞれ含まれるセクションが、制御A_1,制御B_1,制御B_1のように割り付けられる。 Furthermore, with regard to the column of sections, sections included in the control A and the control B, respectively, are allocated as a control A_1, a control B_1, and a control B_1.
同様に、リンク先サブルーチンの列についても、左右方向3列に分割され、左から順にサブルーチン、タスク、セクションがそれぞれ割り付けられる。 Similarly, the link destination subroutine column is also divided into three columns in the left-right direction, and subroutines, tasks, and sections are allocated in order from the left.
サブルーチンの列は、さらに上下に3段に分割され、先ほどと同様にサブルーチンのそれぞれが、SUB2,SUB1,なしといったように割り付けられる。 Subroutine columns are further divided into three stages vertically, and the subroutines are assigned in the same manner as before, such as SUB2, SUB1, and none.
また、タスクの列については、各サブルーチンに対応して上下3段に分割され、順に制御B,制御A,制御Bのように割り付けられる。 The task column is divided into upper and lower three stages corresponding to each subroutine, and assigned in the order of control B, control A, and control B.
さらに、セクションの列についても、上下3段に分割され、各段には順に制御B_1,制御A_1,制御B_1のように各タスク内のセクションが割り付けられる。 Furthermore, the section row is also divided into upper and lower three stages, and sections in each task are assigned to each stage in order, such as control B_1, control A_1, and control B_1.
最後に、リンク点数の列については、左右方向5列に分割され、各列には入出力リレー、内部補助リレー、保持リレー、特殊補助リレー、データメモリ等のメモリエリア種別がそれぞれ割り付けられる。このリンク点数は、メモリエリアの種別毎にサブルーチン間で重複使用されているメモリのサイズを表している。例えば、表示例のデータ列の1行目からは、SUB1とSUB2との間で内部補助リレーが10点分重複使用されていることがわかる。また、3行目からは、SUB3と制御B(タスク)の制御B_1(セクション)との間でデータメモリが20点分重複使用されていることがわかる。 Finally, the column of link points is divided into five columns in the left-right direction, and each column is assigned a memory area type such as an input / output relay, an internal auxiliary relay, a holding relay, a special auxiliary relay, or a data memory. The number of link points represents the size of the memory that is used repeatedly between subroutines for each type of memory area. For example, it can be seen from the first row of the data string in the display example that 10 internal auxiliary relays are used overlappingly between SUB1 and SUB2. Further, it can be seen from the third row that 20 points of data memory are used redundantly between SUB3 and control B_1 (section) of control B (task).
このような表示態様によれば、サブルーチン間の相関が表示され、サブルーチン間のメモリ使用状況/共有状況を的確に把握することが可能となる。 According to such a display mode, the correlation between subroutines is displayed, and it becomes possible to accurately grasp the memory usage / sharing status between subroutines.
次に、サブルーチン階層構造の例が図10に示されている。プログラム内で部品化できる箇所、または再利用できる箇所をサブルーチンにするのが通例である。また、プログラム内の複数のサブルーチンはそれらの使用状況により階層構造が構成されている。複数セクション(制御1〜制御5)からサブルーチン(SUB.1〜SUB.10)が呼び出されて、サブルーチンの階層構造になっている例をもとに解説する。なお、図中矢印(→)はサブルーチンの呼び出しを行っていることを示している。
Next, an example of a subroutine hierarchy structure is shown in FIG. It is customary to make subroutines where parts can be converted into parts or reused in the program. In addition, a plurality of subroutines in the program have a hierarchical structure depending on their usage status. A description will be given based on an example in which a subroutine (SUB.1 to SUB.10) is called from a plurality of sections (
図から明らかなように、階層0にある制御1は、階層1にあるSUB.1(A)とSUB.2(A)とを呼び出す。同様にして、階層0にある制御2は、階層1にあるSUB.1(A)およびSUB.2(A)を呼び出す。
As is clear from the figure, the
階層0にある制御3は、階層1にあるSUB.3(A)を呼び出す。階層0にある制御4は、階層2にあるSUB.6(C)を呼び出す。階層0にある制御5は、階層2にあるSUB.7(C)を呼び出す。階層1にあるSUB.1(A)は、階層2にあるSUB.4(B)およびSUB.5(B)を呼び出す。階層1にあるSUB.3(A)は、階層2にあるSUB.6(C)とSUB.7(C)とを呼び出す。階層2にあるSUB.4(B)は、階層3にあるSUB.8(B)を呼び出す。階層2にあるSUB.6(C)は、階層3にあるSUB.9(B)を呼び出す。
サブルーチンの分類を示す図が図11に示されている。同図に示されるように、図10に示されたサブルーチンの階層構造は、図11の表に示されるように分類される。 A diagram showing the classification of the subroutine is shown in FIG. As shown in the figure, the hierarchical structure of the subroutine shown in FIG. 10 is classified as shown in the table of FIG.
すなわち、第1の分類は、単独ないし複数の通常プログラムからのみコールされるサブルーチンであり、図10において(A)に相当する。 That is, the first classification is a subroutine that is called only from one or a plurality of normal programs, and corresponds to (A) in FIG.
第2の分類は、単独ないし複数のサブルーチンからのみコールされるサブルーチンであって、図10における(B)に相当する。 The second classification is a subroutine called only from one or a plurality of subroutines, and corresponds to (B) in FIG.
第3の分類は、通常プログラムとサブルーチンの両方からコールされるサブルーチンであり、図10の(C)に相当する。 The third category is a subroutine called from both a normal program and a subroutine, and corresponds to (C) in FIG.
第4の分類は、全くコールされていないサブルーチンであり、図10の(D)に相当する。 The fourth category is a subroutine that is not called at all, and corresponds to (D) in FIG.
最後に、サブルーチン使用例を示す図が図12に、サブルーチン解析結果の表示例が図13にそれぞれ示されている。本発明によれば、図12に示されるように、複数のサブルーチンが存在する場合、これを本発明に従って解析することによって、図13に示されるような表示が得られる。このような表示態様によれば、階層(サブルーチンの呼び出し状況)を的確に把握することができる。 Finally, FIG. 12 shows a subroutine usage example, and FIG. 13 shows a subroutine analysis result display example. According to the present invention, as shown in FIG. 12, when a plurality of subroutines exist, the display as shown in FIG. 13 is obtained by analyzing them according to the present invention. According to such a display mode, it is possible to accurately grasp the hierarchy (calling status of subroutines).
このように本発明によれば、複数のプログラムモジュールと複数のサブルーチンプログラムで構成される制御プログラムを解析する制御プログラムの開発支援装置であって、制御プログラムを読み出し、使用されているメモリアドレスのサブルーチンプログラム間や、サブルーチンプログラムとサブルーチンプログラムを呼び出すプログラムモジュール間での重複使用状況を解析する解析手段と、解析手段で解析した結果を表示する解析表示手段とを備え、サブルーチンプログラム毎に他のサブルーチンプログラムやサブルーチンプログラムを呼び出すプログラムモジュールとの使用メモリアドレスの重複使用状況を表示可能としたものである。 As described above, according to the present invention, there is provided a control program development support apparatus for analyzing a control program composed of a plurality of program modules and a plurality of subroutine programs. Analyzing means for analyzing overlapping usage status between programs or between subroutine programs and program modules that call subroutine programs, and analysis display means for displaying the results analyzed by the analyzing means, each subroutine program having another subroutine program It is possible to display the overlapping use status of the memory addresses used with the program module that calls the subroutine program.
以上の実施例で説明したサブルーチンの他の実施例としては、PLCのユーザプログラムを記述するラダー図等で使用されるファンクションブロックにも適用できることは言うまでもない。 It goes without saying that other embodiments of the subroutine described in the above embodiments can also be applied to function blocks used in ladder diagrams describing PLC user programs.
本発明によれば、あるプログラムモジュール内に使用されているメモリが他のサブルーチンプログラムやサブルーチンプログラムを呼び出すプログラムモジュールでも使用されているかどうかを一目で理解できるような表示をユーザに提供することができる。 According to the present invention, it is possible to provide the user with a display that allows the user to understand at a glance whether the memory used in a certain program module is also used in another subroutine program or a program module that calls a subroutine program. .
SUB サブルーチン
(A)〜(D) メモリ領域
SUB subroutine (A) to (D) Memory area
Claims (6)
あるプログラムモジュール内において他のプログラムモジュールをサブルーチンプログラムとして読み出すように構成されており、
制御プログラムを読み出し、使用されているメモリアドレスのサブルーチンプログラム間や、サブルーチンプログラムとサブルーチンプログラムを呼び出すプログラムモジュール間での重複使用状況を解析する解析手段と、
解析手段で解析した結果を表示する解析結果表示手段とを備え、
解析結果表示手段による結果の表示は、サブルーチンプログラム毎に、当該サブルーチンプログラムとメモリアドレスを共用している他のサブルーチンプログラムやサブルーチンプログラムを呼び出すプログラムモジュール、及びそれらのサブルーチンプログラムやプログラムモジュールとの使用メモリアドレスのメモリエリアの種別毎の重複使用状況を表示可能とする、
ことを特徴とする制御プログラム開発支援装置。 A control program development support device for analyzing a control program composed of a plurality of program modules,
It is configured to read other program modules as subroutine programs within a program module.
An analysis means for reading the control program and analyzing the overlapping usage status between the subroutine programs of the memory addresses being used or between the subroutine program and the program module that calls the subroutine program;
An analysis result display means for displaying the result analyzed by the analysis means,
The results displayed by the analysis result display means are displayed for each subroutine program, other subroutine programs that share a memory address with the subroutine program, a program module that calls the subroutine program, and memory used by those subroutine programs and program modules. It is possible to display the overlapping usage status for each type of address memory area .
A control program development support device.
解析結果表示手段は、解析手段で抽出された重複使用メモリアドレスのサイズをサブルーチンプログラム名と共に表示する、ことを特徴とする請求項1に記載の制御プログラム開発支援装置。 The analysis means, when analyzing the overlapping usage status of the used memory address, extracts the size of the memory address used redundantly,
2. The control program development support apparatus according to claim 1, wherein the analysis result display means displays the size of the overlapping use memory address extracted by the analysis means together with the subroutine program name.
複数のプログラムモジュールで構成される制御プログラムを読み出し、また、プログラムモジュール内において他のプログラムモジュールをサブルーチンプログラムとして読み出し、使用されているメモリアドレスのサブルーチンプログラム間や、サブルーチンプログラムとサブルーチンプログラムを呼び出すプログラムモジュール間での重複使用状況を解析する解析手段と、
解析手段で解析した結果を表示する解析結果表示手段とを備え、
解析結果表示手段による結果の表示は、サブルーチンプログラム毎に、当該サブルーチンプログラムとメモリアドレスを共用している他のサブルーチンプログラムやサブルーチンプログラムを呼び出すプログラムモジュール、及びそれらのサブルーチンプログラムやプログラムモジュールとの使用メモリアドレスのメモリエリアの種別毎の重複使用状況を表示可能とする制御プログラム開発支援装置として機能させるコンピュータプログラム。 Computer
A program module that reads a control program composed of a plurality of program modules, reads other program modules as subroutine programs in the program module, and calls subroutine programs and subroutine programs between subroutine programs at the memory address being used. An analysis means to analyze the overlapping usage status between,
An analysis result display means for displaying the result analyzed by the analysis means,
The results displayed by the analysis result display means are displayed for each subroutine program, other subroutine programs that share a memory address with the subroutine program, a program module that calls the subroutine program, and memory used by those subroutine programs and program modules. A computer program that functions as a control program development support device capable of displaying the overlapping usage status for each type of address memory area .
解析結果表示手段は、解析手段で抽出された重複使用メモリアドレスのサイズをサブルーチンプログラム名と共に表示する、ことを特徴とする請求項4に記載のコンピュータプログラム。 The analysis means, when analyzing the overlapping usage status of the used memory address, extracts the size of the memory address used redundantly,
5. The computer program according to claim 4 , wherein the analysis result display means displays the size of the overlapping use memory address extracted by the analysis means together with the subroutine program name.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2006071886A JP5019021B2 (en) | 2005-03-15 | 2006-03-15 | Control program development support device |
Applications Claiming Priority (3)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2005074139 | 2005-03-15 | ||
JP2005074139 | 2005-03-15 | ||
JP2006071886A JP5019021B2 (en) | 2005-03-15 | 2006-03-15 | Control program development support device |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2006294013A JP2006294013A (en) | 2006-10-26 |
JP5019021B2 true JP5019021B2 (en) | 2012-09-05 |
Family
ID=37414462
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2006071886A Active JP5019021B2 (en) | 2005-03-15 | 2006-03-15 | Control program development support device |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP5019021B2 (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10656611B2 (en) * | 2017-01-25 | 2020-05-19 | Fanuc Corporation | Programmable controller |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102317877B (en) | 2009-02-18 | 2014-07-09 | 三菱电机株式会社 | Program analysis support device |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH0344738A (en) * | 1989-07-12 | 1991-02-26 | Nec Corp | Automatic memory assignment check system |
JP3476003B2 (en) * | 1999-06-22 | 2003-12-10 | 日本電気株式会社 | Automatic address assignment check method and method |
JP2002358102A (en) * | 2001-05-31 | 2002-12-13 | Okuma Corp | Programming device for programmable logic controller |
JP2003122409A (en) * | 2001-10-11 | 2003-04-25 | Fuji Electric Co Ltd | Method for checking program, sequence program editing device, recording medium, and program |
-
2006
- 2006-03-15 JP JP2006071886A patent/JP5019021B2/en active Active
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10656611B2 (en) * | 2017-01-25 | 2020-05-19 | Fanuc Corporation | Programmable controller |
Also Published As
Publication number | Publication date |
---|---|
JP2006294013A (en) | 2006-10-26 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP1650619B1 (en) | Sequence program editing apparatus | |
CN102681933B (en) | For the code consultant of web compatibility and interoperability | |
US6119136A (en) | Manuscript text composition system featuring a parameter table for specifying template parameters and characters | |
CN1983173B (en) | Graphical user interface design method and device | |
KR20080043327A (en) | Designating, setting and discovering parameters for spreadsheet documents | |
JP4594726B2 (en) | Browser-independent popup window | |
JP4780308B2 (en) | Control program development support apparatus and computer program | |
EP2116925A1 (en) | Method, system, program for assisting object selection when web page is authored | |
JP4978432B2 (en) | Business specification understanding support system and method | |
CN101960419A (en) | Building operating system images based on applications | |
JP5019021B2 (en) | Control program development support device | |
JP5149525B2 (en) | Project management support apparatus and method | |
JP2007293801A (en) | Table editing device and program | |
US6658347B2 (en) | Vehicular information system developing apparatus, vehicular information system developing tool, vehicular information system developing method, and navigation system developing method | |
JP5098632B2 (en) | Activity management device, activity management system, and activity management program | |
JP7053219B2 (en) | Document retrieval device and method | |
JP2003303100A (en) | Information processing system, method for constructing information processing system, and program therefor | |
JP4957043B2 (en) | Information processing apparatus, program, and business application introduction method | |
JPS63109578A (en) | Processing system for logic diagram outline display | |
JP7477027B1 (en) | Information processing device, information processing method, and program | |
JP3809807B2 (en) | A program for creating structural calculations | |
JP4470776B2 (en) | Visual display program | |
JPH11296463A (en) | Marking/redisplay method for home page using frame | |
JP4663526B2 (en) | Form creation support device, form creation support method, and form creation support program | |
JP4628169B2 (en) | User program search device and program applied thereto |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20090114 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20110930 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20111012 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20111130 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20111214 |
|
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: 20120516 |
|
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20120529 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 5019021 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20150622 Year of fee payment: 3 |
|
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 |