JPH02280201A - Method and device for digital control - Google Patents
Method and device for digital controlInfo
- Publication number
- JPH02280201A JPH02280201A JP1102062A JP10206289A JPH02280201A JP H02280201 A JPH02280201 A JP H02280201A JP 1102062 A JP1102062 A JP 1102062A JP 10206289 A JP10206289 A JP 10206289A JP H02280201 A JPH02280201 A JP H02280201A
- Authority
- JP
- Japan
- Prior art keywords
- program
- mode
- source program
- stage
- execution
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims description 8
- 230000004048 modification Effects 0.000 claims 1
- 238000010586 diagram Methods 0.000 description 3
- 230000000694 effects Effects 0.000 description 3
- 241000862969 Stella Species 0.000 description 1
Landscapes
- Devices For Executing Special Programs (AREA)
- Control By Computers (AREA)
- Programmable Controllers (AREA)
- Numerical Control (AREA)
- Debugging And Monitoring (AREA)
Abstract
Description
【発明の詳細な説明】
〔産業上の利用分野〕
この発明は、自動機械等を実時間制御するディジタル制
御方法およびその装置に関する。DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to a digital control method and apparatus for controlling automatic machines and the like in real time.
上記のディジタル制御装置において、ベーシック、パス
カル、フォートラン等の高級言語によってかかれたソー
スプログラムを実行する場合に、コンパイラを用いると
、−括して翻訳した後実行するため、実行時間は短縮さ
れるが、デバッグを簡単に行うことが出来ないという欠
点がある。また、インタプリタを用いると、各段階にお
いてソースプログラムを翻訳しながら実行するため、デ
バッグには有利であるが、実行に時間がかかり本装置の
目的である、実時間制御を行うことが出来ないという欠
点がある。When executing a source program written in a high-level language such as Basic, Pascal, or Fortran in the above-mentioned digital control device, if a compiler is used, the execution time is shortened because the program is translated all at once and then executed. , the disadvantage is that debugging cannot be easily performed. Furthermore, when using an interpreter, the source program is translated and executed at each stage, which is advantageous for debugging, but it takes a long time to execute, making it impossible to perform real-time control, which is the purpose of this device. There are drawbacks.
そこで、ソースプログラムの修正時には、主演算装置上
で実行されるインタプリタを用いて各段階ごとにデバッ
グを行い、副演算装置上で実行されるコンパイラにより
、各段階ごとに、当該段階におけるソースプログラムを
コンパイルしていくという方法が、提案されている(特
開昭63−157240号公報参照)。Therefore, when modifying a source program, an interpreter running on the main processing unit is used to debug each stage, and a compiler running on the sub-processing unit is used to modify the source program at each stage. A method of compiling has been proposed (see Japanese Unexamined Patent Publication No. 157240/1983).
これによれば、装置は、インタプリタが実行される主演
算装置と、コンパイラが実行される副演算装置をもち、
ソースプログラムのデバッグ時には、インタプリタを用
いて適宜デバッグをしながらプログラムの修正を行い、
当該段階ごとにソースプログラムをコンパイルしていく
もので、ソースプログラム完成後は、改めて一括コンパ
イルを行う必要がない、というものであった。According to this, the device has a main processing unit in which an interpreter is executed, a sub-processing unit in which a compiler is executed,
When debugging a source program, modify the program while debugging as appropriate using an interpreter.
The source program was compiled at each stage, and once the source program was completed, there was no need to perform batch compilation again.
ところが、上記従来例では、1つの装置上に主演算装置
と、副演算装置を持たなければならず、また、ソースプ
ログラムの各段階の実行は、インタプリタによって実行
されるので、実時間実行が行われないという課題があっ
た。However, in the conventional example described above, it is necessary to have a main processing unit and a sub-processing unit on one device, and each stage of the source program is executed by an interpreter, so real-time execution is not possible. The problem was that it was not possible to do so.
この発明は上記の課題に鑑みてなされたものであり、ソ
ースプログラムの各段階の実行は実時間実行され、また
、1つの演算装置のみで実施可能なディジタル制御方法
およびその装置を提供することを目的としている。The present invention has been made in view of the above-mentioned problems, and aims to provide a digital control method and apparatus in which execution of each stage of a source program is executed in real time, and which can be executed using only one arithmetic unit. The purpose is
上記の目的を達成するためのこの発明のディジタル制御
方法およびその装置は、ソースプログラムを各段階ごと
にブレークポイントを設けながら、実行プログラムに変
換するコンパイラと、変換された実行プログラムとソー
スプログラムを対応づけながら、各段階を実行し、かつ
必要に応じてデバッグ可能なデバッガを具備するもので
ある。To achieve the above object, the digital control method and device of the present invention include a compiler that converts a source program into an executable program while setting breakpoints at each stage, and a compiler that converts the source program into an executable program while setting breakpoints at each stage, and a compiler that converts the converted executable program and the source program. It is equipped with a debugger that executes each step while attaching the program and debugs it as necessary.
以上のディジタル制御装置であれば、コンパイラによっ
てソースプログラムを実行プログラムに変換し、デバッ
ガによりソースプログラムは各段階ごとに実時間実行さ
れるとともにデパックされるので、デバッグが終了した
後、再コンパイルを行う事なく、実行プログラムを得る
ことが出来る。With the above digital control devices, the compiler converts the source program into an executable program, and the debugger executes the source program at each stage in real time and depacks it, so after debugging is completed, recompilation is required. You can get an executable program without any trouble.
以下、本発明による一実施例を、図面によって詳細に説
明する。Hereinafter, one embodiment of the present invention will be described in detail with reference to the drawings.
第1図は、ディジタル制御装置の概略、構成図である。FIG. 1 is a schematic diagram of a digital control device.
ディジタル制御装置2は、外部機器との信号をやり取り
する入出力装置4と、オペレーティングシステム(O8
)、コンパイラ、デバッガ1、ソースプログラムを記録
保存している外部記憶装置6と、コンパイラによるソー
スプログラムの変換を行い、また、デバッガにより実行
プログラムのデバッグを行う演算装置8と、演算装置8
からアクセス可能な記憶装置10と、各装置を互いに接
続するバス12とKよって構成されている。記憶装置1
0には、OS、コンパイラ、デバッガがそれぞれロード
される。The digital control device 2 includes an input/output device 4 that exchanges signals with external devices, and an operating system (O8).
), a compiler, a debugger 1, an external storage device 6 that records and saves source programs, an arithmetic unit 8 that converts the source program with the compiler, and debugs the executed program with the debugger, and an arithmetic unit 8 that uses the debugger to debug the executed program.
It consists of a storage device 10 that can be accessed from the computer, and buses 12 and K that connect each device to each other. Storage device 1
0 is loaded with the OS, compiler, and debugger, respectively.
演算装置8に用いるプロセッサ(CPU)は、本実施例
の場合、分岐命令が実行されると割り込みを発生し、あ
らかじめ設定された番地に実行が移される、という機能
を持つものを使用することによって実現している。In this embodiment, the processor (CPU) used in the arithmetic unit 8 is one that has the function of generating an interrupt when a branch instruction is executed and moving the execution to a preset address. It has been realized.
以上の構成によるディジタル制御装置2の動作について
説明する。ディジタル制御装置2を可動状態にすると、
外部記憶装置6に格納されたO8が記憶装置10にロー
ドされ、この後、コンパイラ、及びデバッガが記憶装置
10にロードされる。The operation of the digital control device 2 with the above configuration will be explained. When the digital control device 2 is put into a movable state,
O8 stored in the external storage device 6 is loaded into the storage device 10, and then the compiler and debugger are loaded into the storage device 10.
ここで、O8,コンパイラ、デバッガ、ソースプログラ
ムが記憶装置10に初めから記憶されているのであれば
、外部記憶装置6は必要ない。Here, if the O8, compiler, debugger, and source program are stored in the storage device 10 from the beginning, the external storage device 6 is not necessary.
そして、ソースプログラムのコンパイルに取りかかると
、ソースプログラムが記憶装置10にロードされ、演算
装置8において、コンパイラにより、実行コードへの変
換が行われる。コンパイル方法を、フローチャート(第
2図)を参照して説明する。ソースプログラムの各段階
を符号Sで表し、全段階をmとする。まず、s = 1
とおき(ステラ7’l)、第1段階のソースプログラム
を、実行プログラムへ変換する(ステップ2)。この段
階のコンパイルが終了した時点で、割り込みな発生させ
る分岐命令を、ステップ2で生成された実行プログラム
に付加する(ステップ3)。この分岐命令は、デバッグ
時に割り込みを発生させるために、挿入される。この後
、s=mであるかどうか、すなわち、全段階が変換され
たかどうかを判別しくステップ4)、s=mでなければ
、Sに1を加えてS+1とし、ステップ2に戻って、第
S+1段階を変換する。全段階のコンパイルを終了して
生成された実行プログラムの例を、第3図を参照して説
明する。第3図(a)は、ソースプログラムの例を示し
たものである。このソースプログラムを、コンパイラに
より実行コードに変換すること釦より、第3図(b)で
示される、実行プログラムが生成される。すなわち、こ
の実行プログラムは、ソースプログラムの各段階ごとに
変換された実行プログラムと、各段階の直後に付加され
た、直後の段階ヘジャンプする分岐命令によって、構成
される。Then, when the source program is compiled, the source program is loaded into the storage device 10, and converted into executable code by the compiler in the arithmetic unit 8. The compilation method will be explained with reference to the flowchart (FIG. 2). Each stage of the source program is represented by the symbol S, and the total stage is designated as m. First, s = 1
Next (Stella 7'l), the first stage source program is converted into an executable program (Step 2). When this stage of compilation is completed, a branch instruction for generating an interrupt is added to the execution program generated in step 2 (step 3). This branch instruction is inserted to generate an interrupt during debugging. After this, step 4) determines whether s = m, that is, whether all stages have been converted. If s = m, then add 1 to S to make S + 1, and return to step 2. Convert S+1 stage. An example of an executable program generated by completing all stages of compilation will be described with reference to FIG. FIG. 3(a) shows an example of a source program. By pressing the button to convert this source program into an executable code by a compiler, an executable program shown in FIG. 3(b) is generated. That is, this execution program is composed of an execution program converted for each stage of the source program, and a branch instruction added immediately after each stage to jump to the immediately following stage.
次に、コンパイラによって生成された、実行プログラム
のデバッグについて、フローチャート(第4図)を参照
して説明する。実行プログラムの各段階を符号Sで表し
、全段階をmとする。デバッガは、まず、CPUを第1
のモードに切り替える。次にs = lとおき(ステッ
プl)、第1段階に当該するソースプログラムを表示す
る(ステップ2)。第1段階のソースプログラムが表示
された後、当該段階を実行するかどうか、使用者のキー
人力待ちとなる。第1段階においては実行するか否かの
入力にのみ対応するが、第2段階以降は前の段階の実行
の結果、実行結果に誤りがあったときに、ソースプログ
ラムを修正することも可能となる。この場合、再度コン
パイルすることになる。(ステップ3)。当該段階の実
行を促すキー人力がなされた場合、デバッガは、CPU
を第2のモードに切り替え、当該段階の実行プログラム
を実行する(ステップ4)。当該段階の実行が終了し、
コンパイラによって付加された分岐命令を実行すると、
演算装置は割り込みを発生させ、CPUは第1のモード
に切り替えられる(ステップ5)。Next, debugging of the execution program generated by the compiler will be explained with reference to the flowchart (FIG. 4). Each stage of the execution program is represented by the symbol S, and the total stage is assumed to be m. The debugger first selects the CPU as
Switch to mode. Next, set s = l (step l), and display the relevant source program in the first stage (step 2). After the source program of the first step is displayed, the user's key input is awaited to determine whether to execute the step. The first stage only responds to the input of whether to execute or not, but from the second stage onwards, it is also possible to modify the source program if there is an error in the execution result as a result of the execution of the previous stage. Become. In this case, you will need to compile again. (Step 3). If a key effort is made to prompt the execution of that step, the debugger will
is switched to the second mode, and the execution program at the relevant stage is executed (step 4). The execution of the relevant stage is completed,
When you execute a branch instruction added by the compiler,
The arithmetic unit generates an interrupt and the CPU is switched to the first mode (step 5).
次に、s=mであるかどうか、すなわち全段階が実行さ
れたかどうか判別しくステップ6)、s = mでなけ
れば、Sは1を加えてS+1としくステップ7)、ステ
ップ2に戻って、第S+1段階を実行する。全段階の実
行を終了すると、実行はオペレーティングシステムに戻
される。Next, determine whether s = m, that is, whether all steps have been executed (step 6); if s = m, add 1 to S and make it S + 1 (step 7); return to step 2; , executes the S+1th stage. Once all stages have finished executing, execution is returned to the operating system.
デバッグが終了した実行プログラムは、デバッグのため
に付加された情報は、割り込みを発生させるための分岐
命令のみであり、この分岐命令の飛び先番地は、直後の
次の段階の実行プログラムを指しているので、デバッグ
が終了し、自動実行する段になっても、ソースプログラ
ムを再コンパイルすることなく、充分、実時間実行の行
えるものである。For the executable program that has been debugged, the only information added for debugging is a branch instruction for generating an interrupt, and the jump address of this branch instruction points to the executable program at the next stage immediately after. Therefore, even after debugging is finished and it is time to start automatic execution, real-time execution can be performed without recompiling the source program.
以上のようkこの発明は、ソースプログラムの変換にあ
たり、各段階ごとに実行を行うことができ、また、各段
階において実時間実行が可゛能であるような実行プログ
ラムを生成するので、デバッガを用いたプログラムのト
レースでは、各段階において実時間実行が可能であり、
デバッグの終了した時点で、自動実行可能な実行プログ
ラムを得ることができ、実行プログラムの作成時間をほ
とんど取らなくてもすむという、特有の効果を奏する。As described above, when converting a source program, this invention generates an executable program that can be executed at each stage and can be executed in real time at each stage, so a debugger can be used. The trace of the program used can be executed in real time at each stage.
When debugging is completed, an executable program that can be automatically executed can be obtained, and it has the unique effect of requiring almost no time to create an executable program.
第1図乃至第4図は本発明によるディジタル制御装置の
一実施例を示し、第1図は概略構成図、第2図はコンパ
イル時の動作を説明するためのフローチャート、第3図
(a)、(b)はそれぞれソースプログラムと、本発明
による変換された実行プログラムの例を示す機能図、第
4図はデバッグ時の動作を説明するためのフローチャー
トである。
2・・・・・・ディジタル制御装置、
4・・・・・・入出力装置、
6・・・・・・第2の記憶装置、
8・・・・・・演算装置、
10・・・・・・第1の記憶装置、1 to 4 show an embodiment of a digital control device according to the present invention, in which FIG. 1 is a schematic configuration diagram, FIG. 2 is a flowchart for explaining the operation during compilation, and FIG. 3(a) , (b) are functional diagrams showing examples of a source program and an execution program converted according to the present invention, respectively, and FIG. 4 is a flowchart for explaining operations during debugging. 2... Digital control device, 4... Input/output device, 6... Second storage device, 8... Arithmetic device, 10... ...first storage device,
Claims (2)
デバッガとからなり、 前記ソースプログラムは、複数の段階からなり、前記コ
ンパイラは、前記ソースプログラムのそれぞれの段階毎
に、実行プログラムに変換し、かつ割り込みを発生させ
る分岐命令を付加し、前記デバッガは、第1のモードと
第2のモードとを有し、 前記第1のモードは、前記ソースプログラムのそれぞれ
の段階毎に、ソースプログラムを表示し、その段階の実
行命令あるいはその前の段階のソースプログラムの修正
命令を受けて該当動作可能とし、 前記第2のモードは、前記実行命令を受けたときに前記
第1のモードから切り替えられるモードであって、実行
プログラムを実行し、前記分岐命令の実行によって前記
第1のモードに戻ることを特徴とするディジタル制御方
法。(1) At least a source program and a compiler,
The source program consists of a plurality of stages, the compiler converts the source program into an executable program at each stage, and adds a branch instruction to generate an interrupt, and the debugger , has a first mode and a second mode, and the first mode displays the source program at each stage of the source program, and displays the execution instructions at that stage or the source at the previous stage. The second mode is a mode that is switched from the first mode when the execution instruction is received, and the execution program is executed and the branch instruction is executed. A digital control method characterized in that execution returns to the first mode.
プログラムが記憶される記憶装置と、前記プログラムの
命令に従って演算を実行する演算装置とからなるディジ
タル制御装置において、 前記複数のプログラムは、少なくともオペレーティング
システムと、ソースプログラムと、コンパイラと、デパ
ッガとからなり、 前記ソースプログラムは、複数の段階からなり前記コン
パイラは、前記ソースプログラムのそれぞれの段階毎に
、実行プログラムに変換し、かつ割り込みを発生させる
分岐命令を付加し、前記デバッガは、第1のモードと第
2のモードとを有し、 前記第1のモードは、前記ソースプログラムのそれぞれ
の段階毎に、ソースプログラムを表示し、その段階の実
行命令あるいはその前の段階のソースプログラムの修正
命令を受けて該当動作可能とし、 前記第2のモードは、前記実行命令を受けたときに前記
第1のモードから切り換えられるモードであって、実行
プログラムを実行し、前記分岐命令の実行によって前記
第1のモードに戻ることを特徴とするディジタル制御装
置。(2) In a digital control device comprising an input/output device capable of transmitting information to an external device, a storage device storing a plurality of programs, and an arithmetic unit that executes arithmetic operations according to instructions of the program, the plurality of programs are , consisting of at least an operating system, a source program, a compiler, and a debugger, and the source program has multiple stages, and the compiler converts the source program into an executable program at each stage, and processes interrupts. the debugger has a first mode and a second mode, the first mode displays the source program at each stage of the source program; The corresponding operation is enabled in response to an execution command at that stage or a source program modification command at a previous stage, and the second mode is a mode to which the first mode is switched when the execution command is received. The digital control device is characterized in that the digital control device executes the execution program and returns to the first mode by executing the branch instruction.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP1102062A JPH02280201A (en) | 1989-04-21 | 1989-04-21 | Method and device for digital control |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP1102062A JPH02280201A (en) | 1989-04-21 | 1989-04-21 | Method and device for digital control |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JPH02280201A true JPH02280201A (en) | 1990-11-16 |
Family
ID=14317283
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP1102062A Pending JPH02280201A (en) | 1989-04-21 | 1989-04-21 | Method and device for digital control |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH02280201A (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2005332030A (en) * | 2004-05-18 | 2005-12-02 | Mitsubishi Electric Corp | controller |
-
1989
- 1989-04-21 JP JP1102062A patent/JPH02280201A/en active Pending
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2005332030A (en) * | 2004-05-18 | 2005-12-02 | Mitsubishi Electric Corp | controller |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| KR20000028921A (en) | Program production system for semiconductor tester | |
| JPH02280201A (en) | Method and device for digital control | |
| JPS62113244A (en) | Program test device | |
| JPS626260B2 (en) | ||
| JP2802128B2 (en) | Program development equipment | |
| JPS61180342A (en) | Step execution system for high level language | |
| JPH0695869A (en) | Input and output interface information capturing system for dynamic link library program | |
| JPS59202548A (en) | Debugging device | |
| JPH04155540A (en) | Program correcting system by interactive debugger | |
| JPH01244547A (en) | Program development debugging backup system | |
| JP2659366B2 (en) | Debugging method and device | |
| CN119620679A (en) | A programmable logic debugging method and system | |
| JPS63180142A (en) | Debugging device | |
| JPH0546434A (en) | Program debugging system | |
| JPS61180344A (en) | Step execution system for high level language | |
| JPH0695910A (en) | Interactive debugging control system for abnormality processing | |
| JPS6365542A (en) | Debugging system | |
| JPS63157240A (en) | Digital control device | |
| JPH03290739A (en) | Dynamic analysis system for program | |
| JPH05204698A (en) | Debugger processing system | |
| JPH03130840A (en) | Trace control system for overlay module | |
| JPH0353334A (en) | Output processing system for debug information on language process program | |
| JPH04209028A (en) | Expert system structuring tool | |
| JPH06149616A (en) | Program debugging method | |
| JPH03141436A (en) | Debugging device |