JP6812637B2 - Programmable controller system, its development support device, target device - Google Patents

Programmable controller system, its development support device, target device Download PDF

Info

Publication number
JP6812637B2
JP6812637B2 JP2016009301A JP2016009301A JP6812637B2 JP 6812637 B2 JP6812637 B2 JP 6812637B2 JP 2016009301 A JP2016009301 A JP 2016009301A JP 2016009301 A JP2016009301 A JP 2016009301A JP 6812637 B2 JP6812637 B2 JP 6812637B2
Authority
JP
Japan
Prior art keywords
instruction
specific
program
machine language
memory address
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2016009301A
Other languages
Japanese (ja)
Other versions
JP2017130068A (en
Inventor
吉原 大助
大助 吉原
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fuji Electric Co Ltd
Original Assignee
Fuji Electric Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fuji Electric Co Ltd filed Critical Fuji Electric Co Ltd
Priority to JP2016009301A priority Critical patent/JP6812637B2/en
Publication of JP2017130068A publication Critical patent/JP2017130068A/en
Application granted granted Critical
Publication of JP6812637B2 publication Critical patent/JP6812637B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Programmable Controllers (AREA)

Description

本発明は、プログラマブルコントローラのプログラムのデバッグに関する。 The present invention relates to debugging a program of a programmable controller.

プログラマブルロジックコントローラ(PLC)のプログラムは、任意の制御対象の制御用プログラム等である。このプログラムのソースコード(ソースプログラム)を開発支援装置上でユーザが任意に作成する。作成されたソースコードは、開発支援装置のコンパイラによってコンパイルされて、PLCにおける実行形式(機械語オブジェクト)に変換される。これに伴って、ソースコード中の各変数に対して、PLCの任意のメモリ領域が割り当てられる。 The program of the programmable logic controller (PLC) is a control program or the like of an arbitrary control target. The user arbitrarily creates the source code (source program) of this program on the development support device. The created source code is compiled by the compiler of the development support device and converted into an executable format (machine language object) in PLC. Along with this, an arbitrary memory area of PLC is allocated to each variable in the source code.

プログラマブルロジックコントローラ(PLC)のエンジニアリングでは、入出力機器や上位の監視画面と連携するために、上記変数のメモリアドレス割り付けをユーザが手動で実施している場合がある。変数のメモリ割付は、コンパイラが自動で割り付ける場合が多いが、何らかの事情により、人間が所望のメモリアドレスを手動で割り付ける場合もある。この手動メモリ割付に関して、例えば、配列A[i](iは変数/インデックス)のようにiが取り得る値に応じた複数の要素を持った配列Aに関して、メモリアドレスを割り当てる場合に、要素数に応じたアドレス範囲を指定する場合などがある。尚、この様な配列Aも、変数の一種であると見做せる。 In the engineering of the programmable logic controller (PLC), the user may manually assign the memory address of the above variable in order to cooperate with the input / output device and the upper monitoring screen. The memory allocation of variables is often done automatically by the compiler, but for some reason, humans may manually allocate the desired memory address. Regarding this manual memory allocation, for example, when allocating a memory address for an array A having a plurality of elements according to possible values of i such as array A [i] (i is a variable / index), the number of elements There are cases where the address range is specified according to. It should be noted that such an array A can also be regarded as a kind of variable.

尚、上記配列A[i](iは変数/インデックス)によって、“アクセスするメモリアドレスが動作中に(そのときの変数iの値に応じて)随時決定/変更される”ことになる場合がある。 Note that the array A [i] (i is a variable / index) may cause "the memory address to be accessed is determined / changed at any time during operation (according to the value of the variable i at that time)". is there.

複数のプログラムに関して、それぞれ、上記アドレス範囲の割当てが行われることもあり、この複数のアドレス範囲同士が一部重複するように割り当てられる場合もある。これは、誤って重複してしまう場合もあれば、意図的に重複させる場合もある。意図的に重複させる場合、そのユーザは、重複があってもシステムの動作に問題が生じないと判断している場合もある。 The above address ranges may be assigned to each of the plurality of programs, and the plurality of address ranges may be assigned so as to partially overlap each other. This can be accidentally duplicated or intentionally duplicated. In the case of intentional duplication, the user may have determined that the duplication does not cause any problems in the operation of the system.

上記ユーザの手動によるメモリ割付けが行われる場合、ユーザがメモリ割付けを誤ると、プログラムをPLCで実行中に、異なるプログラムから同じメモリ領域に対して重複してアクセス(書き込み等)する事態が生じ得ることになり、これよりシステムの動作が不安定になるという問題が生じる。 When the above user manually allocates memory, if the user makes a mistake in allocating memory, a situation may occur in which different programs access (write, etc.) the same memory area in duplicate while the program is being executed by PLC. As a result, there is a problem that the operation of the system becomes unstable.

上記問題に対する対策として、一般的に、ユーザが作成したプログラム(ソースコード)を静的に解析して、上記「異なるプログラムから同じメモリに対して重複してアクセスする(書き込む等)という異常」の有無を検査する、静的解析が行われている。しかしながら、この静的解析では、例えば配列、ポインタなどに係わる“アクセスするメモリアドレスが動作中に随時決定/変更される”処理が含まれる場合には、検査できない、等という課題がある。 As a countermeasure against the above problem, in general, a program (source code) created by a user is statically analyzed, and the above-mentioned "abnormality of accessing (writing, etc.) the same memory from different programs in duplicate". A static analysis is being performed to check for the presence. However, this static analysis has a problem that it cannot be inspected when it includes a process of "determining / changing the memory address to be accessed at any time during operation" related to an array, a pointer, or the like.

静的解析関連の従来技術として、例えば特許文献1が知られているが、特許文献1には動的に検査することについては記載が無い。また、上記配列A[i]等に係わる上記手動による上記アドレス範囲の指定に関して、複数のアドレス範囲が相互に重複しているか否かについては、静的解析で検出することは可能である。しかしながら、実際の動作において、アドレス範囲内の全アドレスにアクセスするとは限らない。従って、複数のアドレス範囲が相互に重複している場合であっても、異なるプログラムから同じメモリ領域に対して重複してアクセスする事態(二重書き込みなど)が生じるか否かは、分からない。これは、実際にプログラムを動作させなければ分からないことである。 For example, Patent Document 1 is known as a prior art related to static analysis, but Patent Document 1 does not describe dynamic inspection. Further, regarding the manual designation of the address range related to the array A [i] and the like, it is possible to detect by static analysis whether or not a plurality of address ranges overlap each other. However, in actual operation, not all addresses within the address range are accessed. Therefore, even when a plurality of address ranges are duplicated with each other, it is unknown whether or not a situation (such as double writing) in which different programs access the same memory area in duplicate occurs. This is something that cannot be understood without actually running the program.

動的に異常を検出する従来技術として、例えば特許文献2に記載の“コントローラでプログラムを実行させ、異常を検出してトレースデータを記録する”技術が知られている。
しかしながら、特許文献2の技術では、上述した“アクセスするメモリアドレスが動作中に随時決定/変更される”場合に係わる二重書き込みは、検出できない。
As a conventional technique for dynamically detecting an abnormality, for example, a technique described in Patent Document 2 in which a program is executed by a controller, an abnormality is detected, and trace data is recorded is known.
However, in the technique of Patent Document 2, the double write related to the above-mentioned case where the memory address to be accessed is determined / changed at any time during operation cannot be detected.

また、例えば、特許文献3の従来技術が知られている。
特許文献3には、ソースコードを、まず、フロントエンドコンパイラによって中間コードに変換し、この中間コードをバックエンドコンパイラによって機械語オブジェクトに変換する従来技術が、開示されている。
Further, for example, the prior art of Patent Document 3 is known.
Patent Document 3 discloses a prior art in which a source code is first converted into an intermediate code by a front-end compiler, and the intermediate code is converted into a machine language object by a back-end compiler.

特許文献1の発明では、フロントエンドコンパイラはソースコードと中間コードの対応情報である第1の対応表を、バックエンドコンパイラは中間コードと機械語オブジェクトの対応情報である第2の対応表を作成する。 In the invention of Patent Document 1, the front-end compiler creates a first correspondence table which is the correspondence information between the source code and the intermediate code, and the back-end compiler creates the second correspondence table which is the correspondence information between the intermediate code and the machine language object. To do.

特開2004−171064号公報Japanese Unexamined Patent Publication No. 2004-171604 特開平9−325900号公報Japanese Unexamined Patent Publication No. 9-325900 特開2007−188366号公報JP-A-2007-188366

上述したように、従来では、PLCのプログラムにおいて、例えば配列、ポインタなどに係わる“アクセスするメモリアドレスが動作中に随時決定/変更される”処理に関しては、上記「異なるプログラムから同じメモリに対して重複してアクセスする(書き込む等)という異常」の有無を検査することは、出来なかった。 As described above, in the conventional PLC program, for example, regarding the process of "determining / changing the memory address to be accessed at any time during operation" related to arrays, pointers, etc., the above-mentioned "from different programs to the same memory" It was not possible to inspect for the presence or absence of "abnormalities such as duplicate access (writing, etc.)".

本発明の課題は、コントローラのプログラムに“アクセスするメモリアドレスが動作中に随時決定/変更される”処理が含まれる場合でも、異なるプログラムからの重複アクセスの有無を検査できるプログラマブルコントローラシステム、その開発支援装置と、ターゲット装置等を、提供することである。 An object of the present invention is to develop a programmable controller system capable of inspecting the presence or absence of duplicate access from different programs even when the controller program includes a process of "determining / changing the memory address to be accessed at any time during operation". It is to provide a support device, a target device, and the like.

本発明のプログラマブルコントローラシステムは、1以上のプログラムのソースコードを機械語オブジェクトに変換するコンパイル処理を行う開発支援装置と、ターゲット装置を有するプログラマブルコントローラシステムであって、下記の構成を有する。 The programmable controller system of the present invention is a programmable controller system having a development support device that performs a compilation process for converting the source code of one or more programs into a machine language object and a target device, and has the following configuration.

前記開発支援装置は、下記の各手段を有する。
・前記各プログラムの前記コンパイル処理の際に、アクセス先メモリアドレスが動作中に随時決定又は変更される処理に係わる特定の監視対象命令を検出する特定命令検出手段であって、前記特定の監視対象命令は、前記ターゲット装置の特定のレジスタ経由で、該特定のレジスタに格納されたメモリアドレスにアクセスしてデータを書き込む間接アドレス指定命令であ前記特定のレジスタは、動作中に随時決定又は変更されるメモリアドレスをアクセス先メモリアドレスとして格納するレジスタである、特定命令検出手段;
・該検出した特定の監視対象命令の前記プログラム上の位置を示す情報である特定情報を生成する特定情報生成手段;
・該特定情報を前記ターゲット装置に転送する転送手段。
The development support device has the following means.
-A specific instruction detecting means for detecting a specific monitored instruction related to a process in which the access destination memory address is determined or changed at any time during the compile process of each program, and the specific monitored object. instruction via specific register of the target device, Ri indirect addressing instruction der writing data by accessing the memory address stored in the particular register, the particular register, from time to time determined or during operation Specific instruction detection means , which is a register that stores the changed memory address as the access destination memory address ;
-Specific information generating means for generating specific information which is information indicating the position of the detected specific monitored instruction on the program;
-A transfer means for transferring the specific information to the target device.

前記ターゲット装置は、前記各プログラムの機械語オブジェクトの実行中に、前記特定情報に基づいて、前記特定の監視対象命令の実行時のアクセス先メモリアドレスと、実行中の1つ以上のプログラムの各々とを対応付けて、書き込みアドレス記録表として記録する実アクセス先記録手段を有する。
前記開発支援装置または前記ターゲット装置は、前記書き込みアドレス記録表を表示するか、または、前記書き込みアドレス記録表に基づいて抽出された、複数のプログラムから重複してアクセスされるメモリアドレスを表示する表示手段を更に有する。
The target device, the running of the machine language object in each program, based on the specific information, the access Sakime memory address at runtime of a particular monitored instructions, the one or more programs running It has an actual access destination recording means for recording as a write address recording table in association with each other.
The development support device or the target device displays the write address record table, or displays a memory address that is extracted based on the write address record table and is accessed duplicately from a plurality of programs. It has more means.

本発明のプログラマブルコントローラシステム、その開発支援装置と、ターゲット装置等によれば、コントローラのプログラムに“アクセスするメモリアドレスが動作中に随時決定/変更される”処理が含まれる場合でも、異なるプログラムからの重複アクセスの有無を検査できる。 According to the programmable controller system of the present invention, its development support device, the target device, and the like, even if the controller program includes a process of "determining / changing the memory address to be accessed at any time during operation" from a different program. Can be inspected for duplicate access.

本例のプログラマブルコントローラシステムの構成図である。It is a block diagram of the programmable controller system of this example. 開発支援装置上に表示されるプログラム記述用の画面例を示す図である。It is a figure which shows the screen example for program description displayed on the development support apparatus. ユーザが記述したソースコードをコンパイルして生成した中間言語(中間コード)の一例である。This is an example of an intermediate language (intermediate code) generated by compiling the source code written by the user. 図3の中間コードへのコンパイルに係わるメモリ割り付け例である。It is an example of memory allocation related to compilation to the intermediate code of FIG. (a)、(b)は、監視対象コード表の生成過程の具体例を示す図である。(A) and (b) are diagrams showing a specific example of the generation process of the monitored code table. “書き込みアドレス記録表(雛形)”23の具体例である。This is a specific example of the “write address record table (template)” 23. (a)、(b)は、書き込みアドレス記録表42の具体例である。(A) and (b) are specific examples of the writing address recording table 42. ターゲット装置のプログラム実行管理機能を示す図である。It is a figure which shows the program execution management function of a target apparatus.

以下、図面を参照して、本発明の実施の形態について説明する。
図1は、本例のプログラマブルコントローラシステムの構成図である。
尚、本説明では、プログラマブルコントローラを、単にコントローラと記す場合やPLC等と記す場合もあるものとする。尚、ここでは、制御装置(コントローラ)の一例としてPLCを示すが、この例に限らず、例えばDCS(分散制御システム;Distributed Control System)等であってもよい。本システムは、PLC、DCS等の制御装置のプログラムを、管理するものである。
Hereinafter, embodiments of the present invention will be described with reference to the drawings.
FIG. 1 is a configuration diagram of a programmable controller system of this example.
In this description, the programmable controller may be simply referred to as a controller or PLC or the like. Although PLC is shown here as an example of a control device (controller), the present invention is not limited to this example, and may be, for example, a DCS (Distributed Control System) or the like. This system manages programs of control devices such as PLC and DCS.

図1に示す例のプログラマブルコントローラシステムは、開発支援装置10、“シミュレータ又はPLC”30等を有する。開発支援装置10は、“シミュレータ又はPLC”30におけるPLCのプログラム(制御用プログラム等)を生成して、これをPLCに転送する。PLCがこのプログラムを実行することで、運用(何らかの制御対象の制御実行)が行われることになる。 The programmable controller system of the example shown in FIG. 1 includes a development support device 10, a “simulator or PLC” 30, and the like. The development support device 10 generates a PLC program (control program, etc.) in the “simulator or PLC” 30 and transfers the PLC program to the PLC. When the PLC executes this program, the operation (control execution of some control target) is performed.

但し、本手法は、運用前に行う上記プログラムのチェックに係わるものであり、このチェック処理は、PLCで行ってもよいし、PLCの機能・動作を模擬するコンピュータ装置であるシミュレータで行ってもよい。これより、上記の通り、“シミュレータ又はPLC”としている。そして、本手法のチェック処理では、コントローラのプログラムに“アクセスするメモリアドレスが動作中に随時決定/変更される”処理が含まれる場合でも、異なるプログラムからの重複アクセスの有無を検出することが可能となる。 However, this method is related to the check of the above program performed before operation, and this check process may be performed by the PLC or by a simulator which is a computer device that simulates the functions and operations of the PLC. Good. From this, as described above, it is referred to as "simulator or PLC". Then, in the check process of this method, it is possible to detect the presence or absence of duplicate access from different programs even when the controller program includes a process of "determining / changing the memory address to be accessed at any time during operation". It becomes.

尚、“シミュレータ又はPLC”30を、ターゲット装置30と呼ぶ場合もあるものとする。換言すれば、ターゲット装置30は、シミュレータ又はPLCであると言える。また、“シミュレータ又はPLC”30のなかで特にPLCを指したい場合には、PLC30と記す場合があるものとする。同様に、“シミュレータ又はPLC”30のなかで特にシミュレータを指したい場合には、シミュレータ30と記す場合があるものとする。 The "simulator or PLC" 30 may be referred to as a target device 30. In other words, the target device 30 can be said to be a simulator or PLC. Further, when it is desired to particularly refer to PLC in "Simulator or PLC" 30, it may be described as PLC30. Similarly, when it is desired to particularly refer to the simulator in the "simulator or PLC" 30, it may be referred to as the simulator 30.

また、上記のことから、PLC(プログラマブルコントローラ)の代わりに、上記DCSにおけるコントローラを用いても構わないのであり、両者を特に区別せずにまとめて制御装置と呼んでもよいものとする。つまり、プログラマブルコントローラは、制御装置の一例である。また、これより、ターゲット装置30は、“シミュレータ又は制御装置”であると言うこともできる。 Further, from the above, the controller in the DCS may be used instead of the PLC (programmable controller), and the two may be collectively referred to as a control device without any particular distinction. That is, the programmable controller is an example of a control device. Further, from this, it can be said that the target device 30 is a “simulator or control device”.

開発支援装置(ローダ)10は、まず、任意のPLC用プログラムのソースコード21をユーザに作成させるインタフェース機能部11(エディタ機能も含む)を有する。このインタフェース機能部11は、よく知られた既存の機能であり、ここでは特に説明しない。 The development support device (loader) 10 first has an interface function unit 11 (including an editor function) that allows the user to create a source code 21 of an arbitrary PLC program. The interface function unit 11 is a well-known existing function and will not be described in particular here.

尚、上記PLC用プログラムは、PLC30で実行させることで任意の制御対象の制御を行わせる制御プログラム等である。これは、複数のプログラム(POU等)が作成されて、各プログラムが各々の定周期で繰り返し実行される場合が多い。繰り返し実行されるので、あるプログラムが任意のメモリ領域に何度も繰り返しアクセスすることは、問題とはならない(むしろ、当然の動作である)。しかしながら、別のプログラムがこのメモリ領域にアクセスすると、問題と成り得る。この為、この様な重複アクセス(二重書き込みなど)は、上記チェック処理で検出しなければならない。重複アクセスが検出されたら、例えばプログラム(ソースコード)の修正などが行われることになる。 The PLC program is a control program or the like that controls an arbitrary control target by being executed by the PLC 30. In many cases, a plurality of programs (POU, etc.) are created, and each program is repeatedly executed at its own fixed cycle. Since it is executed repeatedly, it is not a problem (rather, it is a natural operation) that a program repeatedly accesses an arbitrary memory area many times. However, if another program accesses this memory area, it can be a problem. Therefore, such duplicate access (double writing, etc.) must be detected by the above check process. If duplicate access is detected, for example, the program (source code) will be modified.

開発支援装置(ローダ)10は、また、上記ユーザが作成したソースコード21を、ターゲット装置30上で動作する機械語オブジェクト24に変換するコンパイラ機能部(フロントエンドコンパイラ12、バックエンドコンパイラ13)を有する。これは、ソースコード21を、中間言語22(中間コード)に変換してから、機械語オブジェクト24に変換するものである。中間コードについては、例えば上記特許文献3等に記載の既存のものであり、ここでは特に説明しない。 The development support device (loader) 10 also has a compiler function unit (front-end compiler 12, back-end compiler 13) that converts the source code 21 created by the user into a machine language object 24 that operates on the target device 30. Have. In this method, the source code 21 is converted into the intermediate language 22 (intermediate code) and then converted into the machine language object 24. The intermediate code is an existing one described in, for example, Patent Document 3 and the like, and is not particularly described here.

まず、フロントエンドコンパイラ12が、上記ソースコード21を解析して中間言語22に変換する。続いて、バックエンドコンパイラ13が、この中間言語22をターゲット装置30上で動作する機械語オブジェクト24に変換する。この様な中間言語22、機械語オブジェクト24への変換機能自体は、よく知られた既存機能であるので、ここでは特に説明しない。 First, the front-end compiler 12 analyzes the source code 21 and converts it into the intermediate language 22. Subsequently, the back-end compiler 13 converts the intermediate language 22 into a machine language object 24 operating on the target device 30. Since the conversion function itself to the intermediate language 22 and the machine language object 24 is a well-known existing function, it will not be described in particular here.

上記のように、開発支援装置10は、ユーザが任意の制御プログラムのソースコード21を作成するのを支援する支援機能や、このソースコード21をコンパイルしてPLC30で実行可能な形式(機械語オブジェクト24)に変換する機能などを有する。 As described above, the development support device 10 has a support function for assisting the user in creating the source code 21 of an arbitrary control program, and a format (machine language object) in which the source code 21 can be compiled and executed by the PLC 30. It has a function of converting to 24).

また、従来より、コンパイラ機能部は、上記コンパイル処理に伴って、ソースコード21に記述される各変数に対して任意のメモリアドレスを割り当てている。このメモリアドレスは、ターゲット装置30(特にPLC30)に備えられる不図示のメモリの任意のアドレスである。 Further, conventionally, the compiler function unit has assigned an arbitrary memory address to each variable described in the source code 21 in accordance with the above compilation process. This memory address is an arbitrary address of a memory (not shown) provided in the target device 30 (particularly PLC30).

ここで、本例のコンパイラ機能部(特にバックエンドコンパイラ13)は、上記機械語オブジェクト24の生成処理に伴って、後述する特定の命令を検出して、これに基づいて一例としては図示の監視対象コード表25を生成する処理等も実行する。尚、更に図示の“書き込みアドレス記録表(雛形)”23も生成してもよいが、これは生成しなくても構わない。 Here, the compiler function unit (particularly the back-end compiler 13) of this example detects a specific instruction described later in association with the generation process of the machine language object 24, and based on this, the monitoring shown in the figure as an example. The process of generating the target code table 25 is also executed. Further, the illustrated "write address record table (template)" 23 may be generated, but it is not necessary to generate this.

この監視対象コード表25の生成等については、後に詳しく説明するが、概略的には、コンパイル処理の際に、プログラム中に存在する特定の命令(監視対象命令)を検出して、この監視対象命令を示す情報を、監視対象コード表25に登録するものである。本例では後述するように、監視対象命令は例えば“(特定の)レジスタ経由で(データを)書き込む命令”(“間接アドレス指定により書き込む命令”等とも言える)などであり、一例としては、検出した監視対象命令を示す情報として監視対象命令の命令番号を登録するが、この例に限らない。 The generation of the monitored code table 25 and the like will be described in detail later. Generally, during the compilation process, a specific instruction (monitored instruction) existing in the program is detected and the monitored object is monitored. Information indicating an instruction is registered in the monitored code table 25. In this example, as will be described later, the monitored instruction is, for example, an "instruction to write (data) via a (specific) register" (also called an "instruction to write by specifying an indirect address"), and as an example, detection. The instruction number of the monitored instruction is registered as information indicating the monitored instruction, but the present invention is not limited to this example.

尚、上記のことから、本例のコンパイラ機能部(特に、バックエンドコンパイラ13)は、後述する不図示の特定命令検出機能部(不図示)、特定情報生成機能部(不図示)、転送機能部(不図示)等も備えるものと見做してもよい。但し、これは一例であり、これら不図示の機能部は、コンパイラ機能部とは別に備えられるものであっても構わない。 From the above, the compiler function unit (particularly, the back-end compiler 13) of this example has a specific instruction detection function unit (not shown), a specific information generation function unit (not shown), and a transfer function, which will be described later. It may be considered that a part (not shown) or the like is also provided. However, this is only an example, and these functional parts (not shown) may be provided separately from the compiler functional parts.

また、開発支援装置(ローダ)10は、通信機能部14を有する。通信機能部14によって、不図示の通信線などを介して、例えばターゲット装置30との通信を行うことができる。これより、例えば、コンパイラ機能部(特に、バックエンドコンパイラ13)は、上記コンパイル処理によって生成された機械語オブジェクト24や監視対象コード表25等を、通信機能部12を介して、ターゲット装置30にダウンロードする。尚、更に“書き込みアドレス記録表(雛形)”23もターゲット装置30にダウンロードしてもよいが、この例に限らない(ダウンロードしなくてもよい)。 Further, the development support device (loader) 10 has a communication function unit 14. The communication function unit 14 can communicate with, for example, the target device 30 via a communication line (not shown) or the like. From this, for example, the compiler function unit (particularly, the back-end compiler 13) transfers the machine language object 24, the monitored code table 25, etc. generated by the compilation process to the target device 30 via the communication function unit 12. to download. Further, the “write address record table (template)” 23 may also be downloaded to the target device 30, but is not limited to this example (it does not have to be downloaded).

ターゲット装置30は、その通信機能部31によって開発支援装置(ローダ)10と通信することができ、以って上記ダウンロードされる機械語オブジェクト24等を受信する。そして、受信した機械語オブジェクト24や監視対象コード表25等を図示の機械語オブジェクト41や監視対象コード表43として記憶する。これは、自装置内の不図示のメモリ等の所定の記憶領域に記憶する。 The target device 30 can communicate with the development support device (loader) 10 by its communication function unit 31, and thus receives the downloaded machine language object 24 and the like. Then, the received machine language object 24, the monitored code table 25, and the like are stored as the illustrated machine language object 41 and the monitored code table 43. This is stored in a predetermined storage area such as a memory (not shown) in the own device.

尚、上記のことから実質的に、機械語オブジェクト24=機械語オブジェクト41と見做してよいし、監視対象コード表25=監視対象コード表43と見做してよいので、符号について特に区別せずに記す場合もあるものとする。つまり、例えば、機械語オブジェクト24と記した場合に、それが機械語オブジェクト24を意味するものであっても機械語オブジェクト41を意味するものであってもよいものとする。これは、監視対象コード表についても同様である。 From the above, the machine language object 24 = the machine language object 41 may be regarded as substantially the same, and the monitored code table 25 = the monitored code table 43 may be regarded as the same. It may be written without mentioning it. That is, for example, when the machine language object 24 is described, it may mean the machine language object 24 or the machine language object 41. This also applies to the monitored code table.

ターゲット装置30は、プログラム実行管理機能部32を有しており、ターゲット装置30がPLCである場合には、運用中にはプログラム実行管理機能部32が機械語オブジェクト41を実行することで、不図示の制御対象機器の制御が行われることになる。 The target device 30 has a program execution management function unit 32, and when the target device 30 is a PLC, the program execution management function unit 32 executes the machine language object 41 during operation, which is not possible. The control target device shown in the figure will be controlled.

但し、本手法は、運用開始前に係わるものであり、PLC30におけるプログラム実行管理機能部32は、通常モードでは上記の通り機械語オブジェクト41を実行することで不図示の制御対象機器の制御を行うが、特定のモード(チェックモードと呼ぶものとする)の場合には、プログラム実行管理機能部32は、以下に説明するようにプログラム異常等を検出するためのチェック処理を実行する。尚、例えばユーザが、通常モード、チェックモードの何れかのモードを指定できる。また、尚、シミュレータ30の場合には、通常モードはなく、常にチェックモードで動作するものとしてもよい。 However, this method is related to before the start of operation, and the program execution management function unit 32 in the PLC 30 controls the device to be controlled (not shown) by executing the machine language object 41 as described above in the normal mode. However, in the case of a specific mode (referred to as a check mode), the program execution management function unit 32 executes a check process for detecting a program abnormality or the like as described below. For example, the user can specify either a normal mode or a check mode. Further, in the case of the simulator 30, there is no normal mode, and the simulator 30 may always operate in the check mode.

本例では、プログラム実行管理機能部32は、チェックモードにおいては、上記チェック処理を行うものとする。このチェック処理について、詳しくは後述するが、概略的には、機械語オブジェクト41を実行しつつ、上記監視対象コード表43を用いることで、書き込みアドレス記録表42を生成するものである。これは、例えば、機械語オブジェクト41の実行中に、随時、現在実行する命令が監視対象命令であるか否かを判定して、監視対象命令の実行時にアクセスするメモリアドレスを、書き込みアドレス記録表42に記録する。監視対象命令は、監視対象コード表43を参照することで判断できる。複数の各プログラムの各機械語オブジェクト41について、それぞれ上記チェック処理を行うことで、書き込みアドレス記録表42が生成(完成)される。 In this example, the program execution management function unit 32 performs the above check process in the check mode. This check process will be described in detail later, but roughly, the write address recording table 42 is generated by using the monitoring target code table 43 while executing the machine language object 41. For example, during the execution of the machine language object 41, it is determined at any time whether or not the instruction currently executed is a monitored instruction, and the memory address to be accessed when the monitored instruction is executed is recorded in the write address record table. Record at 42. The monitored instruction can be determined by referring to the monitored code table 43. The write address recording table 42 is generated (completed) by performing the above check processing for each machine language object 41 of each of the plurality of programs.

尚、書き込みアドレス記録表42は、上記“書き込みアドレス記録表(雛形)”23に基づいて生成してもよいが、この例に限らない。
プログラム実行管理機能部32は、更に、上記生成した書き込みアドレス記録表42に基づいて、異なるプログラムからの重複アクセス(二重書き込み等)があるか否かを判別してもよい。これは、特に、配列、ポインタなどに係わる“アクセスするメモリアドレスが動作中に随時決定/変更される”処理に関して、重複アクセスの有無を判別可能となる。但し、この例に限らず、この様な判別を行わずに、単に、上記生成した書き込みアドレス記録表42を、ディスプレイに表示して、異常があるか否かをユーザに判断させるようにしてもよい。
The write address record table 42 may be generated based on the above "write address record table (template)" 23, but is not limited to this example.
The program execution management function unit 32 may further determine whether or not there is duplicate access (double writing, etc.) from different programs based on the generated write address recording table 42. This makes it possible to determine the presence or absence of duplicate access, particularly with respect to the process of "determining / changing the memory address to be accessed at any time during operation" related to arrays, pointers, and the like. However, the present invention is not limited to this example, and instead of making such a determination, the generated write address recording table 42 may be simply displayed on the display so that the user can determine whether or not there is an abnormality. Good.

尚、開発支援装置10は、例えばパソコン等の汎用のコンピュータ上で実現されるものであり、ハードウェア的にはパソコン等の一般的な構成を有している。つまり、特に図示しないが、例えばCPU、ハードディスクやメモリ等の記憶装置等を有しており、更に図示の画面(ディスプレイ)15、入力装置16(キーボード、マウス等)を備えている。 The development support device 10 is realized on a general-purpose computer such as a personal computer, and has a general configuration such as a personal computer in terms of hardware. That is, although not particularly shown, it has, for example, a storage device such as a CPU, a hard disk, and a memory, and further includes a screen (display) 15 and an input device 16 (keyboard, mouse, etc.) shown.

上記記憶装置には予め所定のアプリケーションプログラムが記憶されている。上記CPUが、このアプリケーションプログラムを実行することで、上記インタフェース機能部11、コンパイラ機能部(フロントエンドコンパイラ12、バックエンドコンパイラ13)、通信機能部14等の各種機能部や後述する不図示の各種処理機能部が実現される。 A predetermined application program is stored in advance in the storage device. When the CPU executes this application program, various functional units such as the interface function unit 11, the compiler function unit (front-end compiler 12, back-end compiler 13), and the communication function unit 14, and various types not shown later are not shown. The processing function unit is realized.

また、上記コンパイラ機能部は、ここでは上記フロントエンドコンパイラ12、バックエンドコンパイラ13の2つに分けて示しているが、中間言語22(中間コード22)を経て機械語オブジェクト24に変換する1つのコンパイラであってもよい。この場合、中間コード22を出力する(そして一時的に保持する)ことは、必要ない。 Further, the compiler function unit is shown here by being divided into the front-end compiler 12 and the back-end compiler 13, but one that converts to the machine language object 24 via the intermediate language 22 (intermediate code 22). It may be a compiler. In this case, it is not necessary to output (and temporarily hold) the intermediate code 22.

また、特に図示しないが、上記コンパイラ機能部は、上記コンパイル処理に伴って、中間コード22の各命令(中間言語命令と呼ぶものとする)と、機械語オブジェクトの各命令(機械語命令と呼ぶものとする)とを対応付けた中間−機械対応付けテーブル(不図示)を、生成してもよい。 Further, although not particularly shown, the compiler function unit performs each instruction of the intermediate code 22 (referred to as an intermediate language instruction) and each instruction of the machine language object (referred to as a machine language instruction) in accordance with the above compilation process. An intermediate-machine association table (not shown) associated with (assuming) may be generated.

これは、例えば、各中間言語命令毎に、それぞれ、その中間言語命令に、当該中間言語命令を変換して成る機械語命令群を対応付けた中間−機械対応付けテーブル(不図示)を生成する。対応付け方法としては、各命令のプログラム上の位置を示す情報(命令番号など)を用いるものとする。例えば、後述する図3に示す中間言語22の具体例における5行目の中間言語命令が、不図示の機械語オブジェクトにおける15行〜17行目の機械語命令群に変換されたとした場合、‘5’と‘15〜17’とが、対応付けられることになる。 This generates, for example, an intermediate-machine correspondence table (not shown) in which a machine language instruction group obtained by converting the intermediate language instruction is associated with the intermediate language instruction for each intermediate language instruction. .. As the associating method, information (instruction number, etc.) indicating the position of each instruction on the program shall be used. For example, if the intermediate language instruction on the 5th line in the specific example of the intermediate language 22 shown in FIG. 3 to be described later is converted into the machine language instruction group on the 15th to 17th lines in the machine language object (not shown),' 5'and '15 -17' will be associated with each other.

尚、ここでは、例えば後述する図3における各行(1行分)を、1つの中間言語命令と見做すものとする。これは、機械語オブジェクト(機械語命令群)についても同様であり、不図示の機械語命令群の各行を、それぞれ、1つの機械語命令と見做すものとする。また、通常、1つの中間言語命令は、複数の機械語命令(すなわち機械語命令群)に変換される場合が多い。 Here, for example, each line (one line) in FIG. 3, which will be described later, is regarded as one intermediate language instruction. This also applies to a machine language object (machine language instruction group), and each line of the machine language instruction group (not shown) is regarded as one machine language instruction. Further, usually, one intermediate language instruction is often converted into a plurality of machine language instructions (that is, a group of machine language instructions).

また、“シミュレータ又はPLC”30も、特に図示しないCPU/MPU等の演算プロセッサやメモリ等を有しており、メモリには予め所定のアプリケーションプログラムが記憶されている。演算プロセッサが、このアプリケーションプログラムを実行することで、通信機能部31やプログラム実行管理機能部32等の各種機能部や後述する不図示の各種処理機能部が実現される。 Further, the "simulator or PLC" 30 also has an arithmetic processor such as a CPU / MPU (not shown), a memory, and the like, and a predetermined application program is stored in the memory in advance. When the arithmetic processor executes this application program, various functional units such as the communication function unit 31 and the program execution management function unit 32 and various processing function units (not shown) described later are realized.

ユーザは、開発支援装置10上で任意のプログラムのソースコード21を記述する。
図2に、プログラム記述例を示す。
図2は、開発支援装置10上に表示されるプログラム記述用の画面例を示す。
The user describes the source code 21 of an arbitrary program on the development support device 10.
FIG. 2 shows an example of program description.
FIG. 2 shows an example of a screen for program description displayed on the development support device 10.

図示の例では、INT型であって5つの要素をもった配列変数が宣言されており、更に配列A[i](i=0,1,2,3,4)に所定の数値‘10’を代入するプログラムが示されている。尚、A[i]におけるiは、変数であり、配列に付けられたインデックス等と呼ばれる。上記のように、iは、0,1,2,3,4の何れかの値を取り得る変数となる。 In the illustrated example, an array variable that is of type INT and has five elements is declared, and a predetermined numerical value '10' is further expressed in the array A [i] (i = 0,1,2,3,4). A program to substitute for is shown. Note that i in A [i] is a variable and is called an index or the like attached to an array. As described above, i is a variable that can take any value of 0, 1, 2, 3, or 4.

そして、プログラム実行中にそのときの変数iの値によってアクセスするメモリアドレスが決定/変更されるので、従来技術ではアクセスするメモリ位置が特定できない。
尚、上記のように従来より、変数のメモリアドレス割り付けをユーザが手動で実施している場合があり、ここでも特に図示しないが、上記配列A[i]に対してユーザが例えば「6154〜6158」のアドレス範囲を指定しているものとする。コンパイラ機能部は、この様な指定に応じて、例えば図3に示す中間言語を生成する。また、特に図示しないが、変数iの値の決定/変更に係わる処理も、プログラム中に記述されているものとする。
Then, since the memory address to be accessed is determined / changed by the value of the variable i at that time during program execution, the memory position to be accessed cannot be specified by the prior art.
As described above, the user may manually assign the memory address of the variable as described above, and although not particularly shown here, the user may, for example, "6154 to 6158" with respect to the above array A [i]. It is assumed that the address range of "" is specified. The compiler function unit generates, for example, the intermediate language shown in FIG. 3 in response to such a specification. Further, although not particularly shown, it is assumed that the processing related to the determination / change of the value of the variable i is also described in the program.

図3は、フロントエンドコンパイラ12が、上記ユーザが記述したソースコード21をコンパイルして生成した中間言語(中間コード)の一例である。
図4は、図3の中間コードへのコンパイルに係わるメモリ割り付け例である。
FIG. 3 is an example of an intermediate language (intermediate code) generated by the front-end compiler 12 by compiling the source code 21 described by the user.
FIG. 4 is an example of memory allocation related to compilation to the intermediate code of FIG.

尚、上記中間言語生成やメモリ割付の仕組みは、一般的なコンパイラで実現している技術であり、よって詳細な説明は行わないものとする。
以下、図3の各中間言語命令について簡単に説明する。
The mechanism of intermediate language generation and memory allocation is a technique realized by a general compiler, and therefore detailed explanation will not be given.
Hereinafter, each intermediate language instruction of FIG. 3 will be briefly described.

尚、ここでは、変数iに対してメモリアドレス6159が割り当てられたものとする。また、上記アドレス範囲「6154〜6158」の指定により、配列Aの先頭アドレスとしてメモリアドレス6154が割り当てられるものとする。また、尚、図3に示す各中間言語命令の左側に示す1,2,3、4,5は、各中間言語命令のプログラム先頭からの順番を示す番号(命令番号と呼ぶ)である。
・「LD 10」は、定数‘10’をアキュムレータに読み込む。
・「PLD M,WI,6159」は、アキュムレータの値(=10)をスタックに積み、メモリアドレス6159の格納データの値(変数iの値)を、アキュムレータに読み込む。
Here, it is assumed that the memory address 6159 is assigned to the variable i. Further, it is assumed that the memory address 6154 is assigned as the start address of the array A by specifying the address range "6154 to 6158". Further, 1, 2, 3, 4, and 5 shown on the left side of each intermediate language instruction shown in FIG. 3 are numbers (referred to as instruction numbers) indicating the order of each intermediate language instruction from the beginning of the program.
-"LD 10" reads the constant '10' into the accumulator.
-For "PLD M, WI, 6159", the accumulator value (= 10) is pushed onto the stack, and the stored data value (variable i value) of the memory address 6159 is read into the accumulator.

尚、不図示の他の処理によって、メモリアドレス6159の格納データ(変数iの値)が更新される処理が行われているものとする。上記具体例の場合、アキュムレータに読み込まれる値は、0,1,2,3,4のうちの何れかということになるはずである。
・「LEAAX M,DU,6154」は、AXレジスタにメモリアドレス6154(配列Aの先頭アドレス)を設定する。
・「AXADDP DU」は、AXレジスタの値にアキュムレータの値を足した値(6154+i)を、AXレジスタに格納し、スタックに積んである値(=10)をアキュムレータに取り込む。
・「ST AX」は、AXレジスタに格納されているデータによって示されるアドレス‘6154+i’に、アキュムレータの値(=10)を書き込む。つまり、この時のAXレジスタの格納データが、書き込み対象(アクセス先)のメモリアドレスになる。例えば、i=2の場合には、AXレジスタが示しているアドレスは、6154+2=6156番地となる。
It is assumed that the stored data (value of the variable i) of the memory address 6159 is updated by another process (not shown). In the case of the above specific example, the value read into the accumulator should be one of 0, 1, 2, 3, and 4.
-"LEAAX M, DU, 6154" sets the memory address 6154 (the start address of array A) in the AX register.
-The "AXADDP DU" stores the value (6154 + i) obtained by adding the value of the accumulator to the value of the AX register in the AX register, and takes the value (= 10) loaded on the stack into the accumulator.
-"ST AX" writes the accumulator value (= 10) to the address '6154 + i'indicated by the data stored in the AX register. That is, the stored data of the AX register at this time becomes the memory address of the write target (access destination). For example, in the case of i = 2, the address indicated by the AX register is 6154 + 2 = 6156.

このように「ST AX」命令実行の際のAXレジスタの値が、アクセス先メモリアドレスを示すので、本手法では、プログラム実行中に、随時、現在実行する命令が特定の命令(「ST AX」命令など)であるか否かをチェックして、特定の命令(「ST AX」命令など)である場合には、そのときのAXレジスタの値(=6156)を記録する。 In this way, the value of the AX register when executing the "ST AX" instruction indicates the access destination memory address. Therefore, in this method, the instruction currently executed is a specific instruction ("ST AX"" at any time during program execution. It checks whether it is an instruction or not, and if it is a specific instruction (such as an "ST AX" instruction), records the value of the AX register (= 6156) at that time.

この記録方法は、様々であってよく、単にそのときのAXレジスタの値(=6156)を、書き込みアドレス記録表42に追加格納(蓄積)するものであってもよいが、本例では後述する図6〜図7のような方法を示す。つまり、予め作成してある上記“書き込みアドレス記録表(雛形)”23に対して、該当箇所にチェックを入れる方法である。これについては、後に、図6、図7を参照して説明する。 This recording method may be various, and the value (= 6156) of the AX register at that time may be additionally stored (stored) in the write address recording table 42, but will be described later in this example. The methods shown in FIGS. 6 to 7 are shown. That is, it is a method of checking the corresponding part with respect to the above-mentioned "write address record table (template)" 23 created in advance. This will be described later with reference to FIGS. 6 and 7.

尚、上記のことから、上記「ST AX」命令は、“(特定の)レジスタ経由で(データを)書き込む命令”(間接アドレス指定命令)の一例であると言うこともできる。特定のレジスタは、上記一例ではAXレジスタであるが、この例に限らない。上記の通り、AXレジスタにはアクセス先のアドレスが格納されているので、上記「ST AX」命令は、AXレジスタからアクセス先のアドレスを取得することでアクセス先にデータを書き込む命令であり、これは“AXレジスタ経由で(データを)書き込む命令”と言うことができる。 From the above, it can be said that the above "ST AX" instruction is an example of "an instruction to write (data) via a (specific) register" (indirect address specification instruction). The specific register is the AX register in the above example, but is not limited to this example. As described above, since the access destination address is stored in the AX register, the above "ST AX" instruction is an instruction to write data to the access destination by acquiring the access destination address from the AX register. Can be said to be an "instruction to write (data) via the AX register".

上記「ST AX」命令等のような“特定のレジスタ経由で(データを)書き込む命令”は、例えば上記図3のような処理に係わる命令群に含まれる。図3のような処理とは、配列A[i]に係わり変数iの値によってアクセス先が決まる処理であり、これは“アクセスするメモリアドレスが動作中に随時決定/変更される処理”や“アクセス先が可変の処理”の一例である等と言うこともできる。上述したように、従来では、この様な処理に係わる複数プログラムからの二重書き込みは、検査できない。 An "instruction to write (data) via a specific register" such as the "ST AX" instruction is included in a group of instructions related to processing as shown in FIG. 3, for example. The process as shown in FIG. 3 is a process in which the access destination is determined by the value of the variable i related to the array A [i], and this is "a process in which the memory address to be accessed is determined / changed at any time during operation" or ". It can be said that it is an example of "processing in which the access destination is variable". As described above, conventionally, double writing from a plurality of programs related to such processing cannot be inspected.

これに対して、本手法では、ターゲット装置30において、プログラム実行中に、現在実行する命令が、上記特定の命令(監視対象命令)であるか否か、すなわち例えば“特定のレジスタ経由で(データを)書き込む命令”であるか否かを判別でき、“特定のレジスタ経由で(データを)書き込む命令”である場合には、現在の“特定のレジスタ”(AXレジスタ等)の格納データ(その状況でのアクセス先アドレス)を、記録する。これを、複数のプログラムそれぞれについて実行することで、各プログラム毎の実際のアクセス先アドレス群が、記録されることになる。よって、この記録に基づいて、複数のプログラムで重複するアクセス先アドレスがあるか否かを判別できる。 On the other hand, in the present method, whether or not the instruction currently executed in the target device 30 during program execution is the specific instruction (monitored instruction), that is, for example, "via a specific register (data)". It can be determined whether or not it is an "instruction to write", and if it is an "instruction to write (data) via a specific register", the stored data (its) of the current "specific register" (AX register, etc.) The access destination address in the situation) is recorded. By executing this for each of the plurality of programs, the actual access destination address group for each program will be recorded. Therefore, based on this record, it is possible to determine whether or not there are duplicate access destination addresses in a plurality of programs.

尚、上記“現在実行する”とは、実行直前、実行中、実行直後の何れを意味するものであってもよい。
尚、上記のように「ST AX」命令は、上記特定の命令の一例であるが、「ST AX」命令を機械語に変換して成る機械語命令群(特に具体例は示さない)も、上記特定の命令の一例であるものとする。つまり、特定の命令とは、中間言語命令であるか機械語命令であるかは関係ない。上記一例では、「ST AX」命令も、「ST AX」命令に相当する機械語命令群(特に具体例は示さない)も、どちらも、特定の命令であると見做してよい。
The above-mentioned "currently executed" may mean any of immediately before execution, during execution, and immediately after execution.
As described above, the "ST AX" instruction is an example of the above-mentioned specific instruction, but a machine language instruction group (not particularly specified) formed by converting the "ST AX" instruction into a machine language is also available. It shall be an example of the above specific instruction. That is, it does not matter whether the specific instruction is an intermediate language instruction or a machine language instruction. In the above example, both the "ST AX" instruction and the machine language instruction group corresponding to the "ST AX" instruction (specific examples are not shown) can be regarded as specific instructions.

ターゲット装置30において上記のように現在実行する命令が特定の命令であるか否かを判別できるようにする為に、開発支援装置10において、プログラム(ソースコード21)のコンパイルの際に、このプログラムの各命令の中から特定の命令を検出して、検出した特定命令に係わる情報である特定情報を生成して、この特定情報をターゲット装置30に渡す。この特定情報の一例が監視対象コード表であるが、この例に限らない。特定情報の他の例としては、後述する“プログラム中の所定の位置に付される所定の印”や、“プログラム中に挿入される所定の命令”等が挙げられるが、これらの例に限るものでもない。 In order to make it possible to determine whether or not the instruction currently executed in the target device 30 is a specific instruction as described above, this program is compiled in the development support device 10 when the program (source code 21) is compiled. A specific instruction is detected from each of the instructions in the above, specific information that is information related to the detected specific instruction is generated, and this specific information is passed to the target device 30. An example of this specific information is a monitored code table, but it is not limited to this example. Other examples of the specific information include "a predetermined mark attached to a predetermined position in the program" and "a predetermined instruction inserted in the program", which will be described later, but are limited to these examples. It's not a thing.

上記図3に示す中間コードの場合、その生成に伴うコンパイラによるメモリ割付けは、例えば図4に示すものとなる。図3の例では、配列Aの先頭アドレスが上記の通り‘6154’であり、要素は0〜4であるので、配列Aに対しては図4に示すようにアドレス‘6154’、6155’、6156’、6157’、6158’が、割り当てられる。また、ここでは変数iに対しては上記の通りアドレス‘6159’が割り当てられている。 In the case of the intermediate code shown in FIG. 3, the memory allocation by the compiler accompanying the generation is, for example, as shown in FIG. In the example of FIG. 3, since the start address of the array A is '6154' and the elements are 0 to 4 as described above, the addresses '6154', 6155', are shown for the array A as shown in FIG. 6156', 6157', 6158' are assigned. Further, here, the address ‘6159’ is assigned to the variable i as described above.

尚、後述する“書き込みアドレス記録表(雛形)”23の作成の際には、図4の配列Aへのメモリ割当結果(アドレス‘6154’、6155’、6156’、6157’、6158’)を用いればよい。 When creating the "write address record table (template)" 23, which will be described later, the memory allocation results (addresses '6154', 6155', 6156', 6157', 6158') to the array A in FIG. 4 are used. You can use it.

図5は、監視対象コード表25の生成過程の具体例を示す図である。
図5(a)は、監視対象コード表25の初期状態を示す図であり、図5(b)はこの初期状態から上記図2、図3のプログラム例に応じてデータが格納された状態を示す。
FIG. 5 is a diagram showing a specific example of the generation process of the monitored code table 25.
FIG. 5A is a diagram showing an initial state of the monitored code table 25, and FIG. 5B shows a state in which data is stored from this initial state according to the program examples of FIGS. 2 and 3. Shown.

監視対象コード表25には、開発支援装置10における任意のプログラムのコンパイル処理に伴って、監視対象命令のオフセット位置が登録される。
図5に示す例では、監視対象コード表25は、管理番号51、プログラム名52、監視命令オフセット位置53の各データ項目よりなる。
In the monitored code table 25, the offset position of the monitored instruction is registered in accordance with the compilation process of an arbitrary program in the development support device 10.
In the example shown in FIG. 5, the monitoring target code table 25 includes each data item of the control number 51, the program name 52, and the monitoring instruction offset position 53.

管理番号51は、内部で表を管理するための一意の番号である。プログラム名52には、コンパイル対象のプログラム名が登録される。
監視命令オフセット位置53には、監視対象命令のオフセット位置(命令番号など)が登録される。
The control number 51 is a unique number for managing the table internally. The program name to be compiled is registered in the program name 52.
The offset position (instruction number, etc.) of the monitored instruction is registered in the monitoring instruction offset position 53.

ここで、監視対象命令の検出方法について説明する。まず、監視対象命令は、例えば“特定のレジスタ経由で書き込む命令”等である。“特定のレジスタ経由で書き込む命令”は、例えば、“アクセスするメモリアドレスが動作中に随時決定/変更される”処理に係わる命令群に含まれる。 Here, a method of detecting a monitored instruction will be described. First, the monitored instruction is, for example, an "instruction to be written via a specific register" or the like. The "instruction to be written via a specific register" is included in, for example, an instruction group related to the process of "determining / changing the memory address to be accessed at any time during operation".

“特定のレジスタ経由で書き込む命令”は、本例の場合、「ST AX」で始まる命令である。これより、中間言語22を検索して、「ST AX」で始まる命令を全て検出して、それらのオフセット位置を監視命令オフセット位置53に登録する。 The "instruction to write via a specific register" is an instruction starting with "ST AX" in this example. From this, the intermediate language 22 is searched, all the instructions starting with "ST AX" are detected, and their offset positions are registered in the monitoring instruction offset position 53.

尚、上記“特定のレジスタ経由で書き込む命令”における“特定のレジスタ”は、上記一例では上記AXレジスタであるが、この例に限らない。“特定のレジスタ経由で書き込む命令”は、上記一例では、AXレジスタの格納データ(アドレス)が指すメモリ領域に、所定のデータ(上記具体例では‘10’)を書き込む命令である。 The "specific register" in the "instruction to write via a specific register" is the AX register in the above example, but is not limited to this example. The "instruction to write via a specific register" is an instruction to write predetermined data ('10' in the above specific example) to the memory area pointed to by the stored data (address) of the AX register in the above example.

図3の例の場合、5行目(命令番号=‘5’)の「ST AX,WI」命令のみが監視対象命令になるので、監視命令オフセット位置53には、図5(b)に示すように‘5’のみが格納される。 In the case of the example of FIG. 3, since only the "ST AX, WI" instruction on the fifth line (instruction number = '5') is the instruction to be monitored, the monitoring instruction offset position 53 is shown in FIG. 5 (b). As such, only '5' is stored.

但し、この例に限らず、例えば、監視対象命令としての中間言語命令に対応する機械語命令のオフセット位置を、上記中間−機械対応付けテーブルを参照して求めて、これを監視命令オフセット位置53に登録するようにしてもよい。上述した仮の具体例では、図3の5行目の中間言語命令に対応する機械語命令群のオフセット位置は‘15〜17行目’であるとしているので、例えばその先頭である‘15’が、図示のように監視命令オフセット位置53に登録されてもよい。 However, the present invention is not limited to this example, and for example, the offset position of the machine language instruction corresponding to the intermediate language instruction as the monitoring target instruction is obtained by referring to the above intermediate-machine correspondence table, and this is determined by the monitoring instruction offset position 53. You may register in. In the tentative specific example described above, the offset position of the machine language instruction group corresponding to the intermediate language instruction in the fifth line of FIG. 3 is '15 to the 17th line', so for example, '15' which is the beginning thereof. May be registered at the monitoring instruction offset position 53 as shown in the figure.

図6は、“書き込みアドレス記録表(雛形)”23の具体例である。尚、図6は、書き込みアドレス記録表42の初期状態を示すものと見做すこともできるので、以下、これに基づいて説明する。 FIG. 6 is a specific example of the “write address record table (template)” 23. Note that FIG. 6 can be regarded as showing the initial state of the write address recording table 42, and thus will be described below based on this.

書き込みアドレス記録表42(その雛形23)は、メモリアドレス61、プログラム名62の各データ項目より成る。
開発支援装置10は、メモリアドレス61の欄に、対象となるメモリアドレスを登録する。これは、上記具体例の場合、図4に示す配列Aへのメモリ割付け結果(配列Aに対応するアドレス)を、メモリアドレス61の欄に登録する。これより、図6に示すように、‘6154’、6155’、6156’、6157’、6158’が、メモリアドレス61の欄に登録される。
The write address record table 42 (the template 23 thereof) is composed of each data item of the memory address 61 and the program name 62.
The development support device 10 registers the target memory address in the memory address 61 field. In the case of the above specific example, the memory allocation result (address corresponding to the array A) to the array A shown in FIG. 4 is registered in the column of the memory address 61. From this, as shown in FIG. 6, '6154', 6155', 6156', 6157', and 6158' are registered in the column of the memory address 61.

また、プログラム名62の欄に、ターゲット装置30で実行させるプログラムの名称等を登録する。つまり、コンパイルした各プログラムの名称等を登録する。名称は、プログラムのソースコード21中に記述されている。図示の例では、PG1,PG2の2つのプログラム名が登録される。これによって、例えば図6に示すような書き込みアドレス記録表42の初期状態(雛形23)が作成される。 Further, in the column of the program name 62, the name of the program to be executed by the target device 30 and the like are registered. That is, the name of each compiled program is registered. The name is described in the source code 21 of the program. In the illustrated example, two program names, PG1 and PG2, are registered. As a result, for example, the initial state (template 23) of the write address record table 42 as shown in FIG. 6 is created.

その後、この雛形23が、コンパイル結果である機械語オブジェクト24と共に、ターゲット装置30にダウンロードされ、ターゲット装置30において、書き込みアドレス記録表42(その初期状態)として記憶される。 After that, the template 23 is downloaded to the target device 30 together with the machine language object 24 which is the compilation result, and is stored in the target device 30 as the write address recording table 42 (its initial state).

その後、ターゲット装置30において、上記チェック処理が実行されると、ダウンロードされた各プログラム(機械語オブジェクト)が実行される。PLC30で実行する場合、運用としての実行ではなく、チェックモードで実行するので、制御対象機器への指令出力等は行われない。 After that, when the above check process is executed in the target device 30, each downloaded program (machine language object) is executed. When it is executed by the PLC 30, it is executed in the check mode, not as an operation, so that the command output to the controlled device is not performed.

そして、上記各プログラム実行中に特定の命令を実行する際に実際にアクセスするメモリアドレスを検出して、検出したメモリアドレスを書き込みアドレス記録表42に記録することを繰り返すことで、書き込みアドレス記録表42を完成させる。この記録処理は、本例の場合には、検出したメモリアドレスと一致するメモリアドレス61がある場合、該当箇所に図7に示すようにチェックを付ける。 Then, the memory address actually accessed when executing a specific instruction during the execution of each of the above programs is detected, and the detected memory address is repeatedly recorded in the write address record table 42, thereby repeating the write address record table. Complete 42. In this recording process, in the case of this example, if there is a memory address 61 that matches the detected memory address, a check is made in the corresponding place as shown in FIG.

図7(a)は、上記チェック処理中における書き込みアドレス記録表42の具体例であり、図7(b)は書き込みアドレス記録表42が完成した状態の具体例である。
図7(a)の例は、プログラムPG1を実行中に“特定の命令(監視対象命令)を実行する際に実際にアクセスするメモリアドレス”として‘6156’が検出され、これより図示のように該当箇所にチェックが付けられた状態を示している。尚、基本的には、検出されたメモリアドレス(ここでは‘6156’)を記録するものであり、当該記録する方法の一例が上記「該当箇所にチェックが付ける」ものであり、この例に限るものではない。
FIG. 7A is a specific example of the write address recording table 42 during the check process, and FIG. 7B is a specific example of the state in which the write address recording table 42 is completed.
In the example of FIG. 7A, '6156' is detected as a "memory address actually accessed when executing a specific instruction (monitored instruction)" while the program PG1 is being executed, and as shown in the figure. It shows the state where the corresponding part is checked. Basically, the detected memory address ('6156' in this case) is recorded, and one example of the recording method is the above-mentioned "check the relevant part", which is limited to this example. It's not a thing.

本例の場合、実行中のプログラムに対応する監視命令オフセット位置53に基づいて、現在実行する命令が上記監視対象命令であるか否かを判別する。上記の通り、監視命令オフセット位置53には、監視対象命令に相当する中間言語命令の位置(中間言語における命令番号など;中間言語命令番号と呼ぶ)が格納されてもよいし、監視対象命令に相当する機械語命令の位置(機械語における命令番号など;機械語命令番号と呼ぶ)が格納されてもよい。上記具体例の場合、中間言語命令番号は‘5’であり、機械語命令番号は‘15’であることになる。何れにしても、監視命令オフセット位置53には、特定の命令を示す情報の一例である、特定の命令の位置(監視対象命令の位置)の情報が格納されているものと言える。 In the case of this example, it is determined whether or not the currently executed instruction is the monitored instruction based on the monitoring instruction offset position 53 corresponding to the program being executed. As described above, the position of the intermediate language instruction corresponding to the monitored instruction (such as the instruction number in the intermediate language; called the intermediate language instruction number) may be stored in the monitored instruction offset position 53, or the monitored instruction may be used. The position of the corresponding machine language instruction (such as the instruction number in the machine language; called the machine language instruction number) may be stored. In the case of the above specific example, the intermediate language instruction number is '5' and the machine language instruction number is '15'. In any case, it can be said that the monitoring instruction offset position 53 stores information on the position of the specific instruction (position of the instruction to be monitored), which is an example of the information indicating the specific instruction.

そして、現在実行する命令の位置が、監視対象命令の位置と一致する場合には、現在実行する命令は、監視対象命令であると判別する。ターゲット装置30におけるプログラム実行は、機械語オブジェクト(機械語命令群)を実行するものであるので、現在実行する命令の位置は、現在実行する命令の機械語命令番号等によって示されるものであり、これは例えば後述するプログラムカウンタ(PC)の現在値である。監視命令オフセット位置53に監視対象命令に対応する機械語命令番号が格納されている場合には、プログラムカウンタ(PC)の現在値が、監視命令オフセット位置53と一致するか否かを判定すればよい。一方、監視命令オフセット位置53に監視対象命令に対応する中間言語命令番号が格納されている場合には、まず、この中間言語命令番号を対応する機械語命令番号に変換する必要がある。この変換には例えば上記中間−機械対応付けテーブルを用いればよい。 Then, when the position of the currently executed instruction matches the position of the monitored instruction, it is determined that the currently executed instruction is the monitored instruction. Since the program execution in the target device 30 executes a machine language object (machine language instruction group), the position of the currently executed instruction is indicated by the machine language instruction number of the currently executed instruction or the like. This is, for example, the current value of the program counter (PC) described later. When the machine language instruction number corresponding to the monitored instruction is stored in the monitored instruction offset position 53, it is possible to determine whether or not the current value of the program counter (PC) matches the monitored instruction offset position 53. Good. On the other hand, when the intermediate language instruction number corresponding to the monitored instruction is stored in the monitoring instruction offset position 53, it is first necessary to convert this intermediate language instruction number into the corresponding machine language instruction number. For this conversion, for example, the intermediate-machine correspondence table may be used.

尚、上記具体例では、中間言語命令番号は‘5’、機械語命令番号は‘15’となり、これらの何れか一方がプログラムPG1に対応する監視命令オフセット位置53に格納されていることになる。 In the above specific example, the intermediate language instruction number is '5' and the machine language instruction number is '15', and one of these is stored in the monitoring instruction offset position 53 corresponding to the program PG1. ..

また、尚、上記判別に用いる監視命令オフセット位置53は、現在実行中のプログラムのプログラム名と同一のプログラム名52に対応する監視命令オフセット位置53である。 Further, the monitoring instruction offset position 53 used for the above determination is the monitoring instruction offset position 53 corresponding to the program name 52 which is the same as the program name of the program currently being executed.

上記特定の命令(監視対象命令)は、上記一例では“特定のレジスタ経由で(データを)書き込む命令”である。また、特定の命令は、一例としては、“アクセスするメモリアドレスが処理中に随時決定/変更される処理”に係わる命令であるとも言える。 The specific instruction (monitoring target instruction) is an "instruction to write (data) via a specific register" in the above example. Further, as an example, the specific instruction can be said to be an instruction related to "a process in which the memory address to be accessed is determined / changed at any time during processing".

図8は、ターゲット装置30のプログラム実行管理機能を示す図である。
ユーザが記述したソースコード21は、開発支援装置10のコンパイル機能で、ターゲット装置30で動作する機械語オブジェクト24に変換され、この機械語オブジェクト24がターゲット装置30に転送されて機械語オブジェクト41として格納される。従って、「機械語オブジェクト24=機械語オブジェクト41」と見做してよい。
FIG. 8 is a diagram showing a program execution management function of the target device 30.
The source code 21 described by the user is converted into the machine language object 24 operating in the target device 30 by the compilation function of the development support device 10, and the machine language object 24 is transferred to the target device 30 as the machine language object 41. It is stored. Therefore, it may be regarded as "machine language object 24 = machine language object 41".

ターゲット装置30のプログラム実行管理機能部32は、例えば上記チェックモードでは、各プログラムの機械語オブジェクト41(上記PG1やPG2等)を順次実行しつつ、上記監視対象命令を実行する際に実際にアクセスするメモリアドレスを検出して記録する処理を実行する。 For example, in the check mode, the program execution management function unit 32 of the target device 30 actually accesses the machine language object 41 (PG1, PG2, etc.) of each program when executing the monitored instruction. Detects and records the memory address to be executed.

尚、各プログラムの実行動作自体は、運用中におけるプログラム実行動作と同様であってよく、つまり既存の一般的な動作であってよく、特に詳細には説明しないが、図示のPG実行リストに従って、図示のプログラム用メモリに格納された各プログラム(機械語オブジェクト41;本例ではPG1,PG2)を、順次、実行する処理となる。 The execution operation of each program itself may be the same as the program execution operation during operation, that is, it may be an existing general operation, and although not described in detail, according to the illustrated PG execution list. Each program (machine language object 41; PG1 and PG2 in this example) stored in the illustrated program memory is sequentially executed.

ターゲット装置30のプログラム実行管理機能部32には、一般にプログラムカウンタ(PC)と呼ばれる、プログラムの実行位置を示すポインタがある。プログラム実行管理機能部32による機械語オブジェクト41実行の際には、随時、そのときにPCが示す位置のデータ(命令)を取り込み、取り込んだ命令を命令実行機能によって実行し、その後PCを次の命令の位置に移動する(例えばPCの値を+1インクリメントする)。命令の実行に応じてメモリに対して読み書きを実施する。 The program execution management function unit 32 of the target device 30 has a pointer indicating a program execution position, which is generally called a program counter (PC). When the machine language object 41 is executed by the program execution management function unit 32, the data (instruction) at the position indicated by the PC at that time is fetched at any time, the captured command is executed by the command execution function, and then the PC is executed next. Move to the position of the instruction (for example, increment the PC value by +1). Reads and writes to the memory according to the execution of the instruction.

以上が、一般的なプログラム実行動作であるが、本例のプログラム実行管理機能部32は、このプログラム実行動作に伴って、監視対象命令を実行する際に実際にアクセスするメモリアドレスを検出して「書き込みアドレス記録表」42に記録する処理を行う。 The above is a general program execution operation, but the program execution management function unit 32 of this example detects a memory address that is actually accessed when executing a monitored instruction in accordance with this program execution operation. The process of recording in the "write address recording table" 42 is performed.

上記プログラム実行に伴って「書き込みアドレス記録表」42にデータを記録する処理の流れを、以下に記載する。
PC(プログラムカウンタ)は、実行する機械語命令の位置(相対アドレス等)を示すので、各機械語命令を実行する際に、そのときのPCの値を、監視対象コード表43の監視命令オフセット位置53の値と比較して、一致した場合は、現在実行する機械語命令が上記特定の命令に相当すると判定する。但し、この処理は、監視命令オフセット位置53に、機械語命令のオフセット位置(上記具体例の場合、‘15’)が、登録される形態の場合の処理である。
The flow of the process of recording data in the "write address recording table" 42 with the execution of the above program is described below.
Since the PC (program counter) indicates the position (relative address, etc.) of the machine language instruction to be executed, when each machine language instruction is executed, the value of the PC at that time is set to the monitoring instruction offset in the monitored code table 43. When compared with the value at position 53, if they match, it is determined that the machine language instruction currently executed corresponds to the specific instruction. However, this processing is a processing in the case where the offset position of the machine language instruction ('15' in the case of the above specific example) is registered in the monitoring instruction offset position 53.

監視命令オフセット位置53に、上記監視対象命令に相当する中間言語命令のオフセット位置(上記具体例の場合、‘5’)が登録される形態の場合には、上記中間−機械対応付けテーブルを参照することで、上記中間言語命令に対応する機械語命令のオフセット位置を、求める処理が必要となる。そして、上記PCの値が、この機械語命令のオフセット位置と一致する場合には、現在実行する命令が特定の命令に相当すると判定することになる。尚、勿論、この処理を実現する為に、予め、上記中間−機械対応付けテーブル(不図示)を、ターゲット装置30にダウンロードしておく必要がある。 In the case where the offset position of the intermediate language instruction corresponding to the monitored instruction ('5' in the case of the above specific example) is registered in the monitored instruction offset position 53, refer to the intermediate-machine correspondence table. By doing so, it is necessary to perform a process of obtaining the offset position of the machine language instruction corresponding to the intermediate language instruction. Then, when the value of the PC matches the offset position of the machine language instruction, it is determined that the instruction currently executed corresponds to a specific instruction. Of course, in order to realize this process, it is necessary to download the intermediate-machine association table (not shown) to the target device 30 in advance.

上記何れの形態であっても、監視対象コード表43の監視命令オフセット位置53を参照することで、そのとき実行する機械語命令が、特定の命令(監視対象命令)に係わるものであるか否かを判定できる点では、同じことである。 In any of the above forms, by referring to the monitoring instruction offset position 53 in the monitoring target code table 43, whether or not the machine language instruction executed at that time is related to a specific instruction (monitoring target instruction). It is the same in that it can be determined.

上述した本例の場合、特定の命令の実行時には、AXレジスタにはアクセス先のメモリアドレスが格納されているので、このときのAXレジスタの格納データを、実行しているプログラム(その名称等)に対応付けて、書き込みアドレス記録表42に記録する。この処理は、本例の場合には、上記図7で説明したように、書き込みアドレス記録表42のメモリアドレス61の欄を検索して、上記AXレジスタの格納データ(アクセス先メモリアドレス)と一致するアドレスがあるか否かを判定する。そして、ある場合には、該当個所に特定の印(チェック)をつける。該当箇所とは、書き込みアドレス記録表42において、プログラム名62が現在実行しているプログラムのプログラム名である列において、上記“一致するアドレス”に対応するセルである。 In the case of the above-mentioned example, since the memory address of the access destination is stored in the AX register when a specific instruction is executed, the stored data of the AX register at this time is stored in the program (its name, etc.) being executed. Is recorded in the writing address recording table 42 in association with. In the case of this example, as described in FIG. 7, this process searches the column of the memory address 61 in the write address recording table 42 and matches the stored data (access destination memory address) of the AX register. Determine if there is an address to do. Then, in some cases, a specific mark (check) is added to the relevant part. The corresponding location is a cell corresponding to the above-mentioned "matching address" in the column in which the program name 62 is the program name of the program currently being executed in the write address recording table 42.

上述した具体例の場合、仮に上記プログラムPG1を実行中の場合、例えばiの値が2の場合、AXレジスタの値は、6156(=6154+2)なので、図7(a)に示すようにPG1の6156にチェックをつける。 In the case of the above-mentioned specific example, if the program PG1 is being executed, for example, if the value of i is 2, the value of the AX register is 6156 (= 6154 + 2), and therefore, as shown in FIG. 7A, the PG1 Check 6156.

この動作をプログラムPG2の実行の際にも行い、書き込みアドレス記録表42の該当箇所にチェックをつけることで、「書き込みアドレス記録表」42は最終的には図7(b)に示す状態になったものとする。つまり、「書き込みアドレス記録表」42が完成したことになる。 This operation is also performed when the program PG2 is executed, and by checking the corresponding part of the write address record table 42, the "write address record table" 42 finally becomes the state shown in FIG. 7 (b). It shall be assumed. That is, the "write address record table" 42 is completed.

尚、本例では、複数のプログラムとしてプログラムPG1,PG2の2つを示すが、この例に限らず、3つ以上あってもよい。基本的には、全てのプログラムについて、その実行の際に上記の動作を行って、特定の命令がある場合にはその実行時の上記AXレジスタの現在値と一致するアドレスに対応して印(チェック)を付ける。 In this example, two programs PG1 and PG2 are shown as a plurality of programs, but the present invention is not limited to this example, and there may be three or more programs. Basically, for all programs, the above operation is performed at the time of execution, and if there is a specific instruction, it is marked corresponding to the address that matches the current value of the above AX register at the time of execution ( Check).

例えば図7(b)の完成した「書き込みアドレス記録表」42を用いて、異なるプログラムからの重複アクセス(二重書き込み等)があるアドレスを判別できる。これは、例えば、図7(b)の完成した「書き込みアドレス記録表」42を、ディスプレイに表示する。このディスプレイ表示は、ターゲット装置30で行ってもよいし、開発支援装置10で行ってもよい。 For example, by using the completed "write address record table" 42 of FIG. 7B, it is possible to determine an address having duplicate access (double write, etc.) from different programs. This displays, for example, the completed "write address recording table" 42 of FIG. 7 (b) on the display. This display display may be performed by the target device 30 or the development support device 10.

ユーザは、このディスプレイ表示を参照することで、実際の動作において複数のプログラムから重複してアクセスされるアドレスを、判断することができる。どのプログラムとどのプログラムから重複してアクセスされるのかを判断することができる。例えば、図7(b)の例の場合には、アドレス‘6156’が、プログラムPG1とプログラムPG2とから重複してアクセスされるものであると判断することができる。 By referring to this display display, the user can determine the addresses that are duplicatedly accessed by a plurality of programs in the actual operation. It is possible to determine which program and which program are accessed in duplicate. For example, in the case of the example of FIG. 7B, it can be determined that the address '6156' is accessed in duplicate from the program PG1 and the program PG2.

また、重複アクセスされるアドレスがある場合に、更に、この重複アクセスが問題となるものであるか否かを、ユーザが判断するものであってもよい。
複数のプログラムから重複してアクセスされるアドレスがあっても、それがユーザが意図したものであれば特に問題はないが、ユーザが意図しないものであれば問題となる。この様な判断は、ユーザが行うしかないので、上記ディスプレイ表示を行って、ユーザに判断させる。
Further, when there are addresses to be duplicated and accessed, the user may further determine whether or not this duplicated access is a problem.
Even if there are addresses that are accessed in duplicate from a plurality of programs, there is no particular problem if they are intended by the user, but if they are not intended by the user, there is a problem. Since such a judgment can only be made by the user, the display is displayed so that the user can make the judgment.

この例に限らず、例えば、完成した「書き込みアドレス記録表」42に基づいて、複数のプログラムから重複してアクセスされるアドレスを抽出して、これをディスプレイ表示するようにしてもよい。これは、完成した書き込みアドレス記録表42を検索して、2つ以上のチェックが存在するメモリのアドレスを抽出する。これにより、二重書き込みされるアドレスを検出して表示することができる。 Not limited to this example, for example, based on the completed "write address record table" 42, addresses that are duplicatedly accessed from a plurality of programs may be extracted and displayed on a display. It searches the completed write address record table 42 and extracts the address of the memory in which two or more checks exist. This makes it possible to detect and display the address to be double-written.

尚、「監視対象コード表」により、監視対象命令の位置が特定できるので、この位置から対応するソースコードも表示することが可能であり、不具合の修正が容易に実施できる。 Since the position of the monitored instruction can be specified from the "monitored code table", the corresponding source code can also be displayed from this position, and the defect can be easily corrected.

上述した一実施例の場合、ターゲット装置30において、プログラム実行に伴って、監視対象コード表25に対してPCの値と一致するアドレスの検索を実施しているが、テーブルの検索処理はオーバーヘッドがあり、プログラムの実行性能を劣化させる。 In the case of the above-described embodiment, the target device 30 searches the monitored code table 25 for an address that matches the value of the PC as the program is executed, but the table search process has an overhead. Yes, it deteriorates the execution performance of the program.

そこで、監視対象コード表25を用いない形態(変形例)を提案する。この変形例は、監視対象コード表25を生成する代わりに、以下に説明するような、“プログラム中の所定の位置に付される所定の印”や、“プログラム中に挿入される所定の命令”等の情報を、生成するものである。 Therefore, we propose a form (modification example) that does not use the monitored code table 25. In this variant, instead of generating the monitored code table 25, a "predetermined mark placed at a predetermined position in the program" or a "predetermined instruction inserted in the program" as described below is used. Information such as "is generated.

変形例では、例えば、開発支援装置10においてコンパイルの際に上記のように監視対象命令を検出すると、この監視対象命令を変換してなる機械語命令に対して、予め決められている所定の印等を付しておく。これによって、生成される機械語オブジェクト24において、特定の位置に上記所定の印が付された状態になっている。 In the modified example, for example, when the monitoring target instruction is detected in the development support device 10 during compilation as described above, a predetermined predetermined mark is given to the machine language instruction obtained by converting the monitored instruction. Etc. are attached. As a result, in the generated machine language object 24, the above-mentioned predetermined mark is attached to a specific position.

ターゲット装置30は、機械語オブジェクトの実行に伴ってその各機械語命令の実行時、上記所定の印が付されているか否かをチェックして、印が付されている場合には、そのときのAXレジスタの値を書き込みアドレス記録表42に記録する。 The target device 30 checks whether or not the above-mentioned predetermined mark is attached at the time of executing each machine language instruction along with the execution of the machine language object, and if the mark is attached, at that time. The value of the AX register of is recorded in the write address recording table 42.

あるいは、上記所定の印を付す代わりに、所定の命令を挿入するようにしてもよい。つまり、開発支援装置10においてコンパイルの際に上記のように監視対象命令を検出すると、この監視対象命令を変換してなる機械語命令の前または後等に、予め決められている所定の命令を挿入しておく。 Alternatively, a predetermined command may be inserted instead of the above-mentioned predetermined mark. That is, when the development support device 10 detects the monitored instruction as described above during compilation, a predetermined predetermined instruction is issued before or after the machine language instruction obtained by converting the monitored instruction. Insert it.

これより、ターゲット装置30において機械語オブジェクト実行すると、上記監視対象命令に相当する機械語命令を実行する際に(その直前/直後のタイミングで)、上記所定の命令が実行されることになる。所定の命令とは、上述した“そのときのAXレジスタの格納データを、「書き込みアドレス記録表」42に記録する”処理を行うものである。 From this, when the machine language object is executed in the target device 30, the predetermined instruction is executed when the machine language instruction corresponding to the monitored instruction is executed (at the timing immediately before / immediately after that). The predetermined instruction is to perform the above-mentioned process of "recording the stored data of the AX register at that time in the" write address recording table "42".

この様にすることで、テーブル検索による性能劣化を防止することも可能である。
尚、上記プログラムPG1、PG2は、それぞれが、例えばIEC61131−3の1個のPOU(Program Organization Unit)に相当すると考えてもよいが、この例に限らない。PLCでは、通常、複数のPOUが、それぞれ、自己に割り当てられた所定の周期で、定周期動作する。あるPOUを実行する際にアクセスするメモリ(アドレス)に、別のPOUを実行する際にもアクセスされる場合、問題が生じる場合がある。但し、必ず問題が生じるわけではないので、開発者が意図的に複数のPOUが同一アドレスにアクセスするようにプログラミングするケースも有り得る。
By doing so, it is possible to prevent performance deterioration due to table search.
The programs PG1 and PG2 may be considered to correspond to one POU (Program Organization Unit) of IEC61131-3, for example, but the present invention is not limited to this example. In PLC, usually, a plurality of POUs operate at a fixed cycle in a predetermined cycle assigned to each of them. If the memory (address) accessed when executing one POU is also accessed when executing another POU, a problem may occur. However, since problems do not always occur, there may be cases where the developer intentionally programs multiple POUs to access the same address.

従来は、ユーザが作成したプログラム(ソースコード)に関して、特に、“アクセスするメモリアドレスが動作中に随時決定/変更される”処理が含まる場合、(更に、変数のメモリアドレス割り付けをユーザが手動で実施している場合)、ユーザが意図しない二重書き込みでシステムに障害が発生する可能性があったが、プログラム中のこの様な問題箇所を検出することは困難であった。この為、ユーザは、膨大なプログラムとメモリマップを確認しながら、不具合箇所を絞り込んでいた。 Conventionally, regarding a program (source code) created by a user, especially when a process of "determining / changing the memory address to be accessed at any time during operation" is included (in addition, the user manually assigns a memory address of a variable). (When implemented in), there was a possibility that the system would fail due to double writing that the user did not intend, but it was difficult to detect such a problematic part in the program. For this reason, the user has narrowed down the defective parts while checking a huge number of programs and memory maps.

これに対して、本手法を用いることにより、ユーザが意図しない二重書き込みを事前に検出でき、システムの安定稼働や、意図しない二重書き込みが原因の不具合調査、対策のための時間が不要になり、ユーザのソフトウエア開発効率、品質が向上する効果がある。 On the other hand, by using this method, it is possible to detect unintended double writing in advance by the user, eliminating the need for stable system operation, defect investigation due to unintended double writing, and time for countermeasures. This has the effect of improving the software development efficiency and quality of the user.

本手法では、ユーザが作成したプログラム(ソースコード)を開発支援装置がコンパイルする際に、プログラム中から監視対象命令を検出して当該監視対象命令を示す情報を「監視対象コード表」に記録する。 In this method, when the development support device compiles a program (source code) created by the user, the monitored instruction is detected from the program and the information indicating the monitored instruction is recorded in the "monitored code table". ..

ターゲット装置(コントローラまたはシミュレータ)が上記プログラム(機械語)を実行する時、上記「監視対象コード表」に基づいて、現在実行する命令が上記監視対象命令であるか否かを判別できる。現在実行する命令が上記監視対象命令である場合、そのときの特定のレジスタの格納データを、「書き込みアドレス記録表」に記録する。この処理を、複数のプログラムについて実行する。そして、「書き込みアドレス記録表」の記録内容から、複数のプログラムから重複してアクセスされるアドレスを検出して、ユーザに通知する。 When the target device (controller or simulator) executes the program (machine language), it can be determined whether or not the currently executed instruction is the monitored instruction based on the "monitored code table". When the instruction currently executed is the above-mentioned monitored instruction, the stored data of the specific register at that time is recorded in the "write address recording table". This process is executed for a plurality of programs. Then, from the recorded contents of the "write address record table", addresses that are duplicately accessed by a plurality of programs are detected and notified to the user.

本発明によれば、動的にメモリアクセスする場合でも、異なるプログラムからの二重書き込みを検出することができる。これによる、ユーザの意図しないメモリの書き込みが検出可能となり、プログラムの品質向上を実現する。 According to the present invention, double writing from different programs can be detected even when the memory is dynamically accessed. As a result, it becomes possible to detect an unintended memory write by the user, and the quality of the program is improved.

尚、特に図示しないが、開発支援装置(ローダ)10やターゲット装置30は、以下に説明する各種処理機能部を有するものと言うこともできる。
開発支援装置10は、プログラマブルコントローラ用の各プログラムのソースコードを、機械語オブジェクトに変換するコンパイル処理を装置である。
Although not particularly shown, it can be said that the development support device (loader) 10 and the target device 30 have various processing function units described below.
The development support device 10 is a device that compiles the source code of each program for the programmable controller into a machine language object.

開発支援装置10は、上記各プログラムのコンパイル処理の際に、特定の命令を検出する特定命令検出機能部(不図示)、該検出した特定命令に係わる情報である特定情報を生成する特定情報生成機能部(不図示)、該特定情報をターゲット装置30に転送する転送機能部(不図示)等を有する。 The development support device 10 has a specific instruction detection function unit (not shown) that detects a specific instruction during the compilation process of each of the above programs, and a specific information generation that generates specific information that is information related to the detected specific instruction. It has a functional unit (not shown), a transfer functional unit (not shown) that transfers the specific information to the target device 30, and the like.

ターゲット装置30は、上記各プログラムの機械語オブジェクトの実行中に、上記特定情報に基づいて、上記特定命令の実行時のアクセス先のメモリアドレスを、実行中のプログラムに対応付けて記録する実アクセス先記録機能部(不図示)を有する。 The target device 30 records, based on the specific information, the memory address of the access destination at the time of execution of the specific instruction in association with the program being executed during the execution of the machine language object of each program. It has a pre-recording function unit (not shown).

上記特定命令(特定の命令)や特定情報については、具体例について既に説明しており、ここでは簡単に説明するものとする。
すなわち、上記特定命令は、“(特定の)レジスタ経由で書き込む命令”であり、上記特定命令の実行時の該特定のレジスタの格納データが、上記特定命令の実行時のアクセス先のメモリアドレスとなる。これより、上記実アクセス先記録機能部(不図示)は、上記特定命令の実行時の該特定のレジスタの格納データを上記アクセス先のメモリアドレスとして取得する。特定のレジスタは、上記具体例ではAXレジスタであるが、この例に限らない。
Specific examples of the specific command (specific command) and specific information have already been described, and a brief description will be given here.
That is, the specific instruction is an "instruction to be written via a (specific) register", and the stored data of the specific register at the time of execution of the specific instruction is the memory address of the access destination at the time of execution of the specific instruction. Become. As a result, the actual access destination recording function unit (not shown) acquires the stored data of the specific register at the time of execution of the specific instruction as the memory address of the access destination. The specific register is the AX register in the above specific example, but is not limited to this example.

例えば、上記特定情報は、一例としては、上記特定命令の上記プログラム上の位置を示す情報(例えば、命令番号など;上記中間言語命令番号であってよいし、上記機械語命令番号であってもよい)である。 For example, the specific information may be, for example, information indicating the position of the specific instruction on the program (for example, an instruction number; the intermediate language instruction number, or even the machine language instruction number. Good).

この例において、上記実アクセス先記録機能部(不図示)は、上記機械語オブジェクト実行中に、現在のプログラム実行位置が、上記特定情報が示す位置と一致する場合に、上記特定命令の実行時と見做して、上記アクセス先のメモリアドレスを、実行中のプログラムに対応付けて記録する。 In this example, the actual access destination recording function unit (not shown) is at the time of executing the specific instruction when the current program execution position matches the position indicated by the specific information during the execution of the machine language object. The memory address of the access destination is recorded in association with the running program.

この処理の一例が、上述したプログラムカウンタと監視命令オフセット位置53を用いた処理である。この例の場合、上記特定命令の上記プログラム上の位置を示す情報は、該特定命令の命令番号であり、上実アクセス先記録機能部(不図示)は、プログラムカウンタの値が上記特定命令の命令番号と一致するときに、上記特定命令の実行時と見做すことになる。 An example of this process is a process using the program counter and the monitoring instruction offset position 53 described above. In the case of this example, the information indicating the position of the specific instruction on the program is the instruction number of the specific instruction, and in the actual access destination recording function unit (not shown), the value of the program counter is the value of the specific instruction. When it matches the instruction number, it is regarded as the execution time of the above specific instruction.

尚、上記「特定情報が示す位置」は、特定情報が例えば上記中間言語命令番号である場合には、これを対応する機械語命令番号に変換したものとなる(その際、例えば上記中間−機械対応付けテーブル(不図示)を用いる)。 When the specific information is, for example, the intermediate language instruction number, the "position indicated by the specific information" is converted into the corresponding machine language instruction number (at that time, for example, the intermediate-machine). Use a mapping table (not shown).

また、例えば、上記特定情報生成機能部(不図示)による上記特定情報の生成は、一例としては、上記機械語オブジェクト上の上記特定命令に、所定のマークを付すことである。この例の場合、上記転送機能部(不図示)による上記特定情報の転送は、該所定のマークが付された機械語オブジェクトを転送することを意味することになる。 Further, for example, the generation of the specific information by the specific information generation function unit (not shown) is, for example, to add a predetermined mark to the specific instruction on the machine language object. In the case of this example, the transfer of the specific information by the transfer function unit (not shown) means that the machine language object with the predetermined mark is transferred.

そして、この例において、上記実アクセス先記録機能部(不図示)は、上記機械語オブジェクト実行中に該マークを検出すると、上記特定命令の実行時と見做して、上記アクセス先のメモリアドレスを、実行中のプログラムに対応付けて記録する。 Then, in this example, when the actual access destination recording function unit (not shown) detects the mark during the execution of the machine language object, the memory address of the access destination is regarded as the time when the specific instruction is executed. Is recorded in association with the running program.

また、例えば、上記特定情報生成機能部(不図示)による上記特定情報の生成は、一例としては、上記記機械語オブジェクトにおける上記特定命令の前または後に、上記アクセス先のメモリアドレスを、実行したプログラムに対応付けて記録する処理を実現する所定の命令を、挿入するものである。この例の場合、上記転送機能部(不図示)による上記特定情報の転送は、該所定の命令が含まれる上記機械語オブジェクトを転送することを意味することになる。 Further, for example, in the generation of the specific information by the specific information generation function unit (not shown), as an example, the memory address of the access destination is executed before or after the specific instruction in the machine language object. It inserts a predetermined instruction that realizes the process of recording in association with the program. In the case of this example, the transfer of the specific information by the transfer function unit (not shown) means transferring the machine language object including the predetermined instruction.

そして、この例の場合、上記実アクセス先記録機能部(不図示)は、単にこの機械語オブジェクトを実行することで、上述した“特定命令の実行時のアクセス先のメモリアドレスを、実行中のプログラムに対応付けて記録する”処理を、実現させることになる。 Then, in the case of this example, the actual access destination recording function unit (not shown) simply executes the machine language object to execute the above-mentioned "memory address of the access destination at the time of executing the specific instruction". The process of "recording in association with the program" will be realized.

ターゲット装置30は、例えば、上記記録したメモリアドレスに基づいて、上記複数のプログラムで同一のメモリアドレスにアクセスするか否かをチェックするチェック機能部(不図示)を、更に有するものであっても構わない。 Even if the target device 30 further has a check function unit (not shown) for checking whether or not the same memory address is accessed by the plurality of programs based on the recorded memory address, for example. I do not care.

また、上記特定命令は、例えば、“アクセスするメモリアドレスがその都度決定/変更される処理”に係わる命令であるが、この例に限らない。
また、本説明において、“/”は、基本的には(数式等は除く)、“または”や“あるいは”を意味するものとする。これより、例えば、“または/及び”は、“または、あるいは、及び”を意味するものとなる。
Further, the specific instruction is, for example, an instruction related to "a process in which the memory address to be accessed is determined / changed each time", but is not limited to this example.
Further, in this description, "/" basically means "or" or "or" (excluding mathematical formulas and the like). From this, for example, "or / and" means "or, or, and".

10 開発支援装置(ローダ)
11 インタフェース機能部
12 フロントエンドコンパイラ
13 バックエンドコンパイラ
14 通信機能部
15 画面(ディスプレイ)
16 入力装置
21 ソースコード
22 中間言語
23 “書き込みアドレス記録表(雛形)”
24 機械語オブジェクト
25 監視対象コード表
30 ターゲット装置
31 通信機能部
32 プログラム実行管理機能部
41 機械語オブジェクト
42 書き込みアドレス記録表
43 監視対象コード表
51 管理番号
52 プログラム名
53 監視命令オフセット位置
61 メモリアドレス
62 プログラム名
10 Development support device (loader)
11 Interface function unit 12 Front-end compiler 13 Back-end compiler 14 Communication function unit 15 Screen (display)
16 Input device 21 Source code 22 Intermediate language 23 “Write address record table (template)”
24 Machine language object 25 Monitoring target code table 30 Target device 31 Communication function unit 32 Program execution management function unit 41 Machine language object 42 Write address recording table 43 Monitoring target code table 51 Management number 52 Program name 53 Monitoring instruction offset position 61 Memory address 62 Program name

Claims (10)

1以上のプログラムのソースコードを機械語オブジェクトに変換するコンパイル処理を行う開発支援装置と、ターゲット装置を有するプログラマブルコントローラシステムであって、
前記開発支援装置は、
前記各プログラムの前記コンパイル処理の際に、アクセス先メモリアドレスが動作中に随時決定又は変更される処理に係わる特定の監視対象命令を検出する特定命令検出手段であって、前記特定の監視対象命令は、前記ターゲット装置の特定のレジスタ経由で、該特定のレジスタに格納されたメモリアドレスにアクセスしてデータを書き込む間接アドレス指定命令であ前記特定のレジスタは、動作中に随時決定又は変更されるメモリアドレスをアクセス先メモリアドレスとして格納するレジスタである、特定命令検出手段と、
該検出した特定の監視対象命令の前記プログラム上の位置を示す情報である特定情報を生成する特定情報生成手段と、
該特定情報を前記ターゲット装置に転送する転送手段とを有し、
前記ターゲット装置は、
前記各プログラムの機械語オブジェクトの実行中に、前記特定情報に基づいて、前記特定の監視対象命令の実行時のアクセス先メモリアドレスと、実行中の1つ以上のプログラムの各々とを対応付けて、書き込みアドレス記録表として記録する実アクセス先記録手段を有し、
前記開発支援装置または前記ターゲット装置は、
前記書き込みアドレス記録表を表示するか、または、前記書き込みアドレス記録表に基づいて抽出された、複数のプログラムから重複してアクセスされるメモリアドレスを表示する表示手段を更に有することを特徴とするプログラマブルコントローラシステム。
A programmable controller system having a development support device that performs a compilation process that converts the source code of one or more programs into a machine language object and a target device.
The development support device
A specific instruction detecting means for detecting a specific monitored instruction related to a process in which the access destination memory address is determined or changed at any time during the compilation process of each program, and the specific monitored instruction. , the via certain registers of the target device, Ri indirect addressing instruction der writing data by accessing the memory address stored in the particular register, the particular register, from time to time determined or changed during operation Specific instruction detection means , which is a register that stores the memory address to be accessed as the access destination memory address ,
Specific information generating means for generating specific information which is information indicating the position of the detected specific monitored instruction on the program, and
It has a transfer means for transferring the specific information to the target device.
The target device is
Wherein during execution of the machine language object in each program, based on the specific information, associates the a particular access Sakime memory address at runtime monitored instruction, and each of the one or more programs running It has an actual access destination recording means that records as a write address recording table.
The development support device or the target device
Programmable, further comprising a display means for displaying the write address record table or displaying memory addresses that are duplicated and accessed from a plurality of programs extracted based on the write address record table. Controller system.
前記実アクセス先記録手段は、前記特定の監視対象命令の実行時の前記特定のレジスタの格納データを前記アクセス先メモリアドレスとして取得することを特徴とする請求項1記載のプログラマブルコントローラシステム。 The actual access destination recording means, a programmable controller system of claim 1, wherein the acquiring the data stored in the specified register in the execution of the specific monitored command as the access Sakime memory address. 前記実アクセス先記録手段は、前記機械語オブジェクト実行中に、現在のプログラム実行位置が、前記特定情報が示す位置と一致する場合に、前記特定の監視対象命令の実行時と見做して、前記アクセス先メモリアドレスと、実行中の1つ以上のプログラムの各々とを対応付けて、前記書き込みアドレス記録表として記録することを特徴とする請求項1または2記載のプログラマブルコントローラシステム。 When the current program execution position coincides with the position indicated by the specific information during the execution of the machine language object, the actual access destination recording means considers that the specific monitored instruction is being executed. It said access Sakime memory and address in association with each of the one or more programs running programmable controller system according to claim 1 or 2, wherein the recording as the write address record table. 前記特定情報生成手段による前記特定情報の生成は、前記機械語オブジェクト上の前記特定の監視対象命令に、所定のマークを付すことであり、
前記転送手段による前記特定情報の転送は、該所定のマークが付された前記機械語オブジェクトを転送するものであり、
前記実アクセス先記録手段は、前記機械語オブジェクト実行中に該マークを検出すると、前記特定の監視対象命令の実行時と見做して、前記アクセス先メモリアドレスと、実行中の1つ以上のプログラムの各々とを対応付けて、前記書き込みアドレス記録表として記録することを特徴とする請求項1または2記載のプログラマブルコントローラシステム。
The generation of the specific information by the specific information generating means is to add a predetermined mark to the specific monitored instruction on the machine language object.
The transfer of the specific information by the transfer means is to transfer the machine language object with the predetermined mark.
The actual access destination recording means detects the mark in the machine language object execution, the specific and regarded runtime and monitored instruction, said access Sakime memory address, one or more running The programmable controller system according to claim 1 or 2, wherein the program is associated with each of the programs and recorded as the write address recording table.
前記特定情報生成手段による前記特定情報の生成は、前記機械語オブジェクトにおける前記特定の監視対象命令の前または後に、前記アクセス先メモリアドレスを、実行中のプログラムに対応付けて記録する処理を実現する所定の命令を、挿入するものであり、
前記転送手段による前記特定情報の転送は、該所定の命令が含まれる前記機械語オブジェクトを転送するものであり、
前記実アクセス先記録手段は、該機械語オブジェクトを実行することで、前記特定の監視対象命令の実行時のアクセス先メモリアドレスと、実行中の1つ以上のプログラムの各々とを対応付けて、前記書き込みアドレス記録表として記録することを特徴とする請求項1または2記載のプログラマブルコントローラシステム。
Wherein the generation of the specific information according to identification information generating means, before or after the specific monitored instruction in the machine language object, realize the process of the access Sakime memory address, and records in association with the running program Inserts a given command to
The transfer of the specific information by the transfer means transfers the machine language object including the predetermined instruction.
The actual access destination recording unit, by executing the machine language object, in association with the access Sakime memory address at runtime of the specific monitored instruction, and each of the one or more programs running The programmable controller system according to claim 1 or 2, wherein the write address recording table is used for recording.
前記特定の監視対象命令の前記プログラム上の位置を示す情報は、該特定の監視対象命令の機械語命令番号であり、
前記実アクセス先記録手段は、プログラムカウンタの値が前記特定の監視対象命令の機械語命令番号と一致するときに、前記特定の監視対象命令の実行時と見做すことを特徴とする請求項3記載のプログラマブルコントローラシステム。
The information indicating the position of the specific monitored instruction on the program is the machine language instruction number of the specific monitored instruction.
The actual access destination recording means, when the value of the program counter matches the machine language instruction number of the specific monitored instruction, claims, characterized in that regarded runtime and the specific monitored instruction 3. The programmable controller system according to 3.
前記ターゲット装置または前記開発支援装置は、前記記録したメモリアドレスに基づいて、複数のプログラムで同一のメモリアドレスにアクセスするか否かをチェックするチェック手段を更に有することを特徴とする請求項1または2記載のプログラマブルコントローラシステム。 The target device or the development support device further includes a checking means for checking whether or not a plurality of programs access the same memory address based on the recorded memory address. 2. The programmable controller system according to 2. 前記ターゲット装置は、制御装置または該制御装置のシミュレータであることを特徴とする請求項1または2記載のプログラマブルコントローラシステム。 The programmable controller system according to claim 1 or 2, wherein the target device is a control device or a simulator of the control device. 機械語オブジェクトを実行するターゲット装置に通信可能に構成され、1以上のプログラムのソースコードを前記機械語オブジェクトに変換するコンパイル処理を行う開発支援装置であって、
前記各プログラムのコンパイル処理の際に、アクセス先メモリアドレスが動作中に随時決定又は変更される処理に係わる特定の監視対象命令を検出する特定命令検出手段であって、前記特定の監視対象命令は、前記ターゲット装置における特定のレジスタ経由で、該特定のレジスタに格納されたメモリアドレスにアクセスしてデータを書き込む間接アドレス指定命令であ前記特定のレジスタは、動作中に随時決定又は変更されるメモリアドレスをアクセス先メモリアドレスとして格納するレジスタである、特定命令検出手段と、
該検出した特定の監視対象命令の前記プログラム上の位置を示す情報である特定情報を生成する特定情報生成手段と、
該特定情報を前記機械語オブジェクトと共に前記ターゲット装置に転送して前記ターゲット装置の記憶手段に前記特定情報を記憶させる転送手段と、
前記ターゲット装置によって作成された書き込みアドレス記録表を表示するか、または、前記書き込みアドレス記録表に基づいて抽出された、複数のプログラムから重複してアクセスされるメモリアドレスを表示する表示手段であって、前記書き込みアドレス記録表は、前記ターゲット装置が、前記各プログラムの機械語オブジェクトの実行中に、前記特定情報に基づき、前記特定の監視対象命令の実行時のアクセス先メモリアドレスと、実行中の1つ以上のプログラムの各々とを対応付けて記録したものである、表示手段と、
を有することを特徴とする開発支援装置。
A development support device that is configured to be able to communicate with a target device that executes a machine language object and performs a compilation process that converts the source code of one or more programs into the machine language object.
A specific instruction detecting means for detecting a specific monitored instruction related to a process in which the access destination memory address is determined or changed at any time during operation during the compilation process of each program, and the specific monitored instruction is , via certain registers in the target device, Ri indirect addressing instruction der writing data by accessing the memory address stored in the particular register, the particular register is determined from time to time or changed during operation Specific instruction detection means , which is a register that stores the memory address as the access destination memory address ,
Specific information generating means for generating specific information which is information indicating the position of the detected specific monitored instruction on the program, and
A transfer means that transfers the specific information to the target device together with the machine language object and stores the specific information in the storage means of the target device.
A display means for displaying a write address record table created by the target device, or displaying memory addresses duplicatedly accessed by a plurality of programs extracted based on the write address record table. , the write address record table, the target device, the running of the machine language object for each program, based on the specific information, said a particular access Sakime memory address at runtime monitored instruction being executed A display means and a display means, which are recorded in association with each of one or more programs of the above.
A development support device characterized by having.
1以上のプログラムのソースコードを機械語オブジェクトに変換するコンパイル処理を行う開発支援装置と通信可能なターゲット装置であって、
前記各プログラムの機械語オブジェクトの実行中に、前記開発支援装置が前記コンパイル処理の際に生成した、アクセス先メモリアドレスが動作中に随時決定又は変更される処理に係わる特定の監視対象命令の前記プログラム上の位置を示す特定情報に基づいて、前記特定の監視対象命令の実行時のアクセス先メモリアドレスと、実行中の1つ以上のプログラムの各々とを対応付けて、書き込みアドレス記録表として記録する実アクセス先記録手段であって、前記特定の監視対象命令は、前記ターゲット装置における特定のレジスタ経由で、該特定のレジスタに格納されたメモリアドレスにアクセスしてデータを書き込む間接アドレス指定命令であ前記特定のレジスタは、動作中に随時決定又は変更されるメモリアドレスをアクセス先メモリアドレスとして格納するレジスタである、実アクセス先記録手段と、
前記書き込みアドレス記録表を表示するか、または、前記書き込みアドレス記録表に基づいて抽出された、複数のプログラムから重複してアクセスされるメモリアドレスを表示する表示手段と、
を有することを特徴とするターゲット装置。
A target device that can communicate with a development support device that performs a compilation process that converts the source code of one or more programs into machine language objects.
The specific monitored instruction related to the process in which the access destination memory address is determined or changed at any time during the operation, which is generated by the development support device during the compilation process during the execution of the machine language object of each program. based on the specific information indicating the position on the program, said a particular access Sakime memory address at runtime monitored instruction, in association with each of the one or more programs running, as a write address record table The actual access destination recording means for recording, the specific monitored instruction is an indirect address specification instruction for accessing a memory address stored in the specific register and writing data via a specific register in the target device. der is, the specific register is a register for storing a memory address from time to time determined or changed during operation as the access destination memory address, and the actual access destination recording means,
A display means for displaying the write address record table or displaying memory addresses that are duplicated and accessed from a plurality of programs extracted based on the write address record table.
A target device characterized by having.
JP2016009301A 2016-01-20 2016-01-20 Programmable controller system, its development support device, target device Active JP6812637B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2016009301A JP6812637B2 (en) 2016-01-20 2016-01-20 Programmable controller system, its development support device, target device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2016009301A JP6812637B2 (en) 2016-01-20 2016-01-20 Programmable controller system, its development support device, target device

Publications (2)

Publication Number Publication Date
JP2017130068A JP2017130068A (en) 2017-07-27
JP6812637B2 true JP6812637B2 (en) 2021-01-13

Family

ID=59395721

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2016009301A Active JP6812637B2 (en) 2016-01-20 2016-01-20 Programmable controller system, its development support device, target device

Country Status (1)

Country Link
JP (1) JP6812637B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6720993B2 (en) 2018-03-07 2020-07-08 オムロン株式会社 Support devices and programs
CN114968307A (en) * 2022-06-15 2022-08-30 深圳市汇川技术股份有限公司 Control program updating method, terminal device and storage medium

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH03286303A (en) * 1990-04-02 1991-12-17 Hitachi Ltd Sequence control test system
JPH05158741A (en) * 1991-12-03 1993-06-25 Nippon Steel Corp Test verification method for computer program
JP3358759B2 (en) * 1994-06-08 2002-12-24 株式会社安川電機 Data trace method for programmable controller
JPH08305609A (en) * 1995-04-28 1996-11-22 Oki Electric Ind Co Ltd Program test method and device
JP3379675B2 (en) * 1995-06-21 2003-02-24 沖電気工業株式会社 Reverse execution debugging system
JPH0962538A (en) * 1995-08-29 1997-03-07 Nec Corp Efficiency supporting device
JP3476003B2 (en) * 1999-06-22 2003-12-10 日本電気株式会社 Automatic address assignment check method and method
JP4569011B2 (en) * 2001-02-21 2010-10-27 三菱電機株式会社 Programmable controller and peripheral device thereof
US7676795B2 (en) * 2005-01-13 2010-03-09 International Business Machines Corporation Error detection in a data processing system
JP4780308B2 (en) * 2005-03-15 2011-09-28 オムロン株式会社 Control program development support apparatus and computer program
JP2008159004A (en) * 2006-12-26 2008-07-10 Okuma Corp Data trace device of programmable logic controller
JP2011216056A (en) * 2010-04-02 2011-10-27 Mitsubishi Electric Corp Programmable controller and peripheral device thereof

Also Published As

Publication number Publication date
JP2017130068A (en) 2017-07-27

Similar Documents

Publication Publication Date Title
US9898387B2 (en) Development tools for logging and analyzing software bugs
JP7220833B2 (en) Automatic generation of machine learning models for software tools that run on source code
US8601436B2 (en) Simulation-based interface testing automation system and method for robot software components
US6286132B1 (en) Debugging support apparatus, a parallel execution information generation device, a computer-readable recording medium storing a debugging support program, and a computer-readable recording medium storing a parallel execution information generation program
JP5495515B2 (en) Test apparatus for testing at least one electronic control system and method for operating the test apparatus
US8397104B2 (en) Creation of test plans
US20070250815A1 (en) Measuring code coverage
CN101739339A (en) Program dynamic dependency relation-based software fault positioning method
US20090119649A1 (en) Static analysis defect detection in the presence of virtual function calls
US10209984B2 (en) Identifying a defect density
JP6342129B2 (en) Source code error position detection apparatus and method for mixed mode program
US20120185669A1 (en) Program inspection method and non-transitory, computer readable storage medium storing inspection program
CN111897727A (en) Software testing method and device, computer equipment and storage medium
CN113094252B (en) Test case generation method and device, computer equipment and storage medium
JP6812637B2 (en) Programmable controller system, its development support device, target device
CN102722438B (en) Kernel debugging method and equipment
US10572369B2 (en) Method for testing a control program of a control device in a simulation environment on a computer
US7409677B1 (en) Method and system for creation and use of embedded trace description
Lunnikivi et al. Transpiling python to rust for optimized performance
JPH096628A (en) Method and device for parallel processing procedure selection
JP2013218492A (en) Software test automatic evaluation device and method
US8756580B2 (en) Instance-based field affinity optimization
JP6717140B2 (en) Analysis program, analysis method, and analysis device
CN108614704B (en) Code compiling method and device
JP2010282441A (en) Apparatus for calculating inter-module dependent strength, method and program for measuring inter-module dependent strength

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20181214

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20191016

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20191023

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20191121

RD03 Notification of appointment of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7423

Effective date: 20191121

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20200414

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20200601

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20200908

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20201009

C60 Trial request (containing other claim documents, opposition documents)

Free format text: JAPANESE INTERMEDIATE CODE: C60

Effective date: 20201009

A911 Transfer to examiner for re-examination before appeal (zenchi)

Free format text: JAPANESE INTERMEDIATE CODE: A911

Effective date: 20201019

C21 Notice of transfer of a case for reconsideration by examiners before appeal proceedings

Free format text: JAPANESE INTERMEDIATE CODE: C21

Effective date: 20201020

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: 20201117

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20201130

R150 Certificate of patent or registration of utility model

Ref document number: 6812637

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250