JPH012103A - programmable controller - Google Patents

programmable controller

Info

Publication number
JPH012103A
JPH012103A JP62-158386A JP15838687A JPH012103A JP H012103 A JPH012103 A JP H012103A JP 15838687 A JP15838687 A JP 15838687A JP H012103 A JPH012103 A JP H012103A
Authority
JP
Japan
Prior art keywords
program
address
mode
contents
debug
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP62-158386A
Other languages
Japanese (ja)
Other versions
JPS642103A (en
Inventor
大 中井
Original Assignee
松下電工株式会社
Filing date
Publication date
Application filed by 松下電工株式会社 filed Critical 松下電工株式会社
Priority to JP62-158386A priority Critical patent/JPH012103A/en
Publication of JPS642103A publication Critical patent/JPS642103A/en
Publication of JPH012103A publication Critical patent/JPH012103A/en
Pending legal-status Critical Current

Links

Abstract

(57)【要約】本公報は電子出願前の出願データであるた
め要約のデータは記録されません。
(57) [Summary] This bulletin contains application data before electronic filing, so abstract data is not recorded.

Description

【発明の詳細な説明】 [技術分野1 本発明は、ユーザプログラムコード中に演算停止専用の
命令を有すると共に、実行及び停止以外にデバック専用
のモードを備えたプログラマブルコントローラに関する
ものである。
DETAILED DESCRIPTION OF THE INVENTION [Technical Field 1] The present invention relates to a programmable controller that has an instruction dedicated to stopping operations in a user program code, and has a mode dedicated to debugging in addition to execution and stopping.

[背景技術1 プログラマブルコントローラでユーザプログラムを開発
する際には、ユーザプログラムの大?tをある指定した
アドレスで停止させで、その時点でのプログラマブルコ
ントローラ内の各レジスタや内部リレーや入出力の状態
をモニタできるならば、デバック効率を向上させること
ができる。
[Background technology 1] When developing a user program for a programmable controller, how large is the user program? If it is possible to stop t at a specified address and monitor the status of each register, internal relay, and input/output in the programmable controller at that point, debugging efficiency can be improved.

従来は、ユーザがプログラム中の希望するアドレスにブ
レーク命令を挿入することにより、演算の一時停止を行
うようにしていたため、ユーザが各アドレスを指定する
ことと、ブレーク命令を挿[1− 入することとをその点数分だけ繰り返して行う必要があ
り、キー繰作が繁雑となっていた。また、デバックを止
めて、本運転に移行する際には、これらブレーク命令を
挿入した数だけ繰り返して、ブレーク命令の続出、削除
の処理を行う必要があり、ユーザにとって不便なもので
あった。
Previously, the user had to insert a break instruction at the desired address in the program to temporarily stop the operation, so the user had to specify each address and insert the break instruction. It was necessary to repeat the same thing for the number of points, making the keystrokes complicated. Furthermore, when stopping debugging and transitioning to actual operation, it is necessary to repeat these break instructions as many times as they have been inserted, and process the successive addition and deletion of break instructions, which is inconvenient for the user.

[発明の目的1 本発明は上述の魚に鑑みて為されたものであり、その目
的とするところ(土、ユーザプログラムのデバック処理
を効率的に甘うことができるプログラマブルコントロー
ラを提供することにある。
[Objective of the Invention 1 The present invention has been made in view of the above-mentioned problems, and its purpose is to provide a programmable controller that can efficiently debug a user program. be.

[発明の開示] (構成) 本発明は、システム制御用プログラムが記11されたシ
ステムROMと、電池でバックアップされたユーザプロ
グラム格納用のRAMを備え、上記[(OM及びRAM
に記憶されたプログラムに基づいてCPUで演算処理し
て機器の自動制御を行い、ユーザプログラムコード中に
演算停止専用の命令を有すると共に、実行及び停止以外
にデバック専用のモードを備えたプログラマブルコント
ローラにおいて、上記デバック専用のモードにおいて、
プログラマにより登録された演算停止したい任意のアド
レスのプログラム内容をメモリ上に退避し、かつ退避し
たことを記憶するフラッグを設定する退避手段と、上記
登録されたアドレスの内容をブレーク命令に書き換える
書換手段と、デバックモードより実行あるいは停止モー
ドに移行された時に、退避記憶されているプログラム内
容を自動的に元のアドレスに書き込んで元のプログラム
状態に復帰する復帰手段とを備えたものであり、ユーザ
がブレーク命令を書き込むことなしに、任意のアドレス
のみを指定することによって、退避手段にて登録された
アドレスのプログラム内容をメモリ上に退避し、書換手
段にて登録されたアドレスの内容をブレーク命令に書き
換えることにより、演算の停止条件を設定することがで
きるようにし、かつそのようにして設定されたブレーク
命令は実行やプログラムモードへの移行時に、復帰手段
にて退避記憶されているプログラム内容を自動的に元の
アドレスに書き込んで元のプログラム状態に復帰するこ
とにより、ブレーク命令を自動的に削除し、ユーザがブ
レーク命令の削除処理の禄作を行わずに済むようにし、
これによりユーザプログラムのデバ・7り処理を効率的
(二行うことができるようにしたものである。
[Disclosure of the Invention] (Configuration) The present invention includes a system ROM in which a system control program is written, and a battery-backed RAM for storing user programs.
In a programmable controller that performs arithmetic processing in a CPU based on a program stored in a CPU to automatically control equipment, has an instruction dedicated to stopping calculations in the user program code, and has a mode dedicated to debugging in addition to execution and stopping. , in the above debug-only mode,
A saving means for saving the program contents of an arbitrary address registered by the programmer at which the operation is desired to be stopped into memory and setting a flag to remember that the program has been saved; and a rewriting means for rewriting the contents of the registered address to a break instruction. and a return means that automatically writes the saved program contents to the original address and returns to the original program state when the program is moved from debug mode to run or stop mode, and the user By specifying only an arbitrary address without writing a break instruction, the program contents of the registered address are saved in memory by the saving means, and the contents of the registered address are written by the rewriting means with the break instruction. By rewriting it to , it is possible to set the conditions for stopping the operation, and when the break instruction set in this way is executed or transitioned to program mode, the program contents saved in the save memory are saved by the return means. By automatically writing to the original address and returning to the original program state, the break instruction is automatically deleted and the user does not have to perform the process of deleting the break instruction.
This makes it possible to efficiently perform debugging of user programs.

(実施例1) tjS1図乃至第8図に本発明の一実施例を示す。(Example 1) tjS1 to FIG. 8 show an embodiment of the present invention.

本発明のプログラマブルコントローラは、第2図に示す
ようにシステム制御用プログラムが記憶されたシステム
ROM2と、電池でバックアップされたユーザプログラ
ム格納用のRA M 3を備え、上記ROM2及びRA
M3に記憶されたプログラムに基づいてCPUIで演算
処理して機器の自動制御を行うものであり、かつこのプ
ログラマブルコントローラには、ユーザプログラムフー
ド中に演算停止専用の命令を有すると共に、実行及び停
止以外にデバック専用のモードを備えたものに関する。
As shown in FIG. 2, the programmable controller of the present invention includes a system ROM 2 in which a system control program is stored, and a battery-backed RAM 3 for storing user programs.
The programmable controller performs arithmetic processing on the CPUI based on the program stored in the M3 to automatically control the equipment, and this programmable controller has a dedicated instruction for stopping calculations in the user program hood, and also has commands other than execution and stopping. Regarding those with a debug-only mode.

そして、本実施例では上記デバック専用のモードにおい
て、プログラマにより登録された演−1: 算停止したい任意のアドレスのプログラム内容をメモリ
上に退避し、かつ退避したことを記憶するフラッグを設
定する退避手段と、上記登録されたアドレスの内容をブ
レーク命令に書き換える書換手段と、デバックモードよ
り実行あるいは停止モードに移行された時に、退避記憶
されているプログラム内容を自動的に元のアドレスに書
き込んで元のプログラム状態に復帰する復帰手段とを備
えている。
In this embodiment, in the above-described debug-only mode, operation 1 registered by the programmer: saves the program contents of any address desired to be stopped to the memory, and sets a flag to remember that the calculation has been saved. means for rewriting the contents of the registered address into a break instruction; and a rewriting means for rewriting the contents of the registered address into a break instruction; and return means for returning to the programmed state.

第3図はプログラマブルコントローラの一般的な処理フ
ローを示すもので、Iloをリフレッシュして通常のシ
ーケンスプログラムの実行を行い、このシーケンスプロ
グラムの実行後には周辺ツールサービス状態になり、こ
の周辺ツールサービス状態でユーザプログラムのデバッ
クを行うことができるようになっている。第1図はデバ
ックモード時にプログラマより停止アドレス(ブレーク
ポイント)を指定した場合のプログラマブルコントロー
ラの周辺ツールサービスの内のプログラマサービス部の
処P!70−を示す。いま、デバックモ一 −ド時にプログラマより停止アドレスを指定したトスル
と、まず指定アドレスのシーケンスプログラム内容を退
避し、この退避が完了すれば退避7フツグを記憶する。
Figure 3 shows the general processing flow of the programmable controller.Ilo is refreshed and a normal sequence program is executed.After executing this sequence program, it enters the peripheral tool service state, and this peripheral tool service state It is now possible to debug the user program. Figure 1 shows the processing of the programmer service section of the peripheral tool services of the programmable controller when a stop address (breakpoint) is specified by the programmer in debug mode. 70- is shown. Now, when the programmer is in the debug mode, the programmer specifies the stop address and the sequence program contents at the specified address are saved, and when this saving is completed, the save 7 flag is stored.

ついで、退避したアドレスのシーケンスプログラムの内
容をブレーク命令に書き変える。この処理をさらに具体
的に@4図に従って説明すると、元のシーケンスプログ
ラムが第4図(a)に示すようになっており、プログラ
マにより停止アドレスが同図(b)に示すように指定さ
れたとすると、指定されたアドレスのシーケンスプログ
ラム内容が退避され、同図(c)に示す退避テーブルが
作r&される。いま、指定されたアドレスのシーケンス
プログラム内容の退避が完了したときには、退避フラッ
グが1になり、このシーケンスプログラムの指定アドレ
スにはブレーク命令が書き込まれ、シーケンスプログラ
ムは第4111(d)に示すように書き換えられる。こ
の結果、このプログラムを実行すると、指定されたアド
レスのプログラムがブレーク命令に変わっているので、
そのアドレスでブレーク状態に移行する。なお、このと
きブレークフラッグを1にする。また、ブレーク状態を
解除し、停止アドレス以降のプログラムの続きを実行す
る場合、第5図に示すように、退避テーブルよりブレー
ク命令が書き込まれたアドレスのシーケンスプログラム
内容を読み出して元のアドレスに書き込み、ブレークフ
ラッグをクリアする。そして、再度デバックモードとし
た場合、前回復帰されたアドレスに再びブレーク命令を
書き込む。これにより、再度のデバックモード時にも同
じアドレスでブレーク状態とすることができる。
Next, the contents of the sequence program at the saved address are rewritten into break instructions. To explain this process more specifically according to Figure 4, the original sequence program is as shown in Figure 4 (a), and the stop address is specified by the programmer as shown in Figure 4 (b). Then, the contents of the sequence program at the designated address are saved, and a save table shown in FIG. 2(c) is created. Now, when the saving of the sequence program contents at the specified address is completed, the saving flag becomes 1, a break instruction is written to the specified address of this sequence program, and the sequence program starts as shown in Section 4111(d). Can be rewritten. As a result, when you run this program, the program at the specified address has been changed to a break instruction, so
Transition to break state at that address. Note that at this time, the break flag is set to 1. In addition, when canceling the break state and continuing the program after the stop address, as shown in Figure 5, read the sequence program contents at the address where the break instruction was written from the save table and write them to the original address. , clear the break flag. Then, when the debug mode is set again, a break instruction is written again to the address restored last time. This makes it possible to enter a break state at the same address even in debug mode again.

次に、デバックモードより実行モードまたは停止モード
に以降する場合や、電源切断後に再度電源がオンされた
時等の処J!!フローを!@6図に示す。
Next, what to do when going from debug mode to run mode or stop mode, or when the power is turned on again after being turned off. ! Flow! @ Shown in Figure 6.

この場合、退避フラッグを判定し、退避状態にあるなら
ば退避テーブルを参照しながら、元のプログラム内容を
対応するアドレスに復帰させる。そして、復帰処理が完
了した時点で退避フラッグをクリアする。このような処
理を行うととによって、他モードへの移住時にはデバッ
クモード中でブレーク命令に書き換えられたプログラム
は、ユーザがキー繰作をすることなく自動的に復帰され
、他モードに影響を全く与えないようにできる。
In this case, the save flag is determined, and if it is in the save state, the original program content is restored to the corresponding address while referring to the save table. Then, when the return processing is completed, the evacuation flag is cleared. By performing such processing, when migrating to another mode, a program that was rewritten to a break instruction in debug mode will be automatically restored without the user having to press any keys, and will not affect other modes at all. You can avoid giving it.

(実施例2) 第7図及びf58図に本発明の他の実施例を示す。(Example 2) FIG. 7 and FIG. f58 show other embodiments of the present invention.

上述の第1の実施例では、任意のアドレスに対してブレ
ークポイントを設ζす、このブレークポイントまでのシ
ーケンスプログラムを実行してデバックを行うようにし
てあったが、本実施例では1命令単位毎にステップ的に
プログラムを実行してデバックを行うことができるよう
にしたものである。
In the first embodiment described above, a breakpoint is set at an arbitrary address, and debugging is performed by executing the sequence program up to this breakpoint, but in this embodiment, the sequence program is executed in units of one instruction. This allows you to debug the program by executing it step by step.

第7図にステップ実行時の周辺ツールサービス部の処理
フローを示す。この1命令実行の処理70−を第8図に
示す具体処理動作に従って説明する。
FIG. 7 shows the processing flow of the peripheral tool service section during step execution. This one-instruction execution process 70- will be explained according to the specific processing operation shown in FIG.

まず、退避フラッグをチエツクし、既にプログラム内容
が第8図(a)に示すように退避されている場合には、
その内容を復帰し、現在のプログラムカウンタの次のア
ドレスを求め、そのアドレスのプログラム内容を退避し
、退j!L7ラツグのセットし、第8図(b)に示すよ
うに、次のアドレスにブレーク命令を書き込み、ブレー
クフラッグのクリアを行う。第8図(c)はさらに次の
アドレスについて上述の処理を行った場合を示す。この
ような処理によって1ステップ単位の実行を実現するこ
とができる。本実施例によれば、ビット演算専用のCP
Uを使用したプログラマブルコントローラについても、
その@w、CP U内に1#今実行用の専用回路を必要
としないので、コスト的に安価になる。
First, check the save flag, and if the program contents have already been saved as shown in FIG. 8(a),
Restore its contents, find the next address of the current program counter, save the program contents at that address, and save j! The L7 lag is set, a break instruction is written to the next address, and the break flag is cleared, as shown in FIG. 8(b). FIG. 8(c) shows a case where the above-described processing is further performed for the next address. Through such processing, execution in units of one step can be realized. According to this embodiment, a CP dedicated to bit operations
Regarding programmable controllers using U,
@w Since there is no need for a dedicated circuit for 1# current execution within the CPU, the cost is low.

[発明の効果1 本発明は上述のように、システム制御用プログラムが記
憶されたシステムROMと、電池でバンクアップされた
ユーザプログラム格納用のRAMを備え、上記!’?O
M及びRAMに記憶されたプログラムに基づいてCPU
で′@休体理して機器の自動制御を行い、ユーザプログ
ラムコード中に演算停止専用の命令を有すると共に、実
行及び停止以外にデバック専用のモードを備えたプログ
ラマブルコントローラにおいて、上記デバック専用のモ
ードにおいて、プログラマにより登録された演算停d−
したい任:Q;のアドレスのプログラム内容をメモリ上
に退避し、かつ退避したことを記憶するフラッグを設定
する退避手段と、上記登録されたアドレスの内容をブレ
ーク命令に書き換える書換手段と、デバックモードより
実行あるいは停止モードに移行された時に、退避記憶さ
れているプログラム内容を自動的に元のアドレスに書き
込んで元のプログラム状態に復帰する復帰手段とを備え
たものであり、ユーザがブレーク命令を書き込むことな
しに、任意のアドレスのみを指定することによって、退
避手段にて登録されたアドレスのプログラム内容をメモ
リ上に退避し、書換手段にて登録されたアドレスの内容
をブレーク命令に書き換えることにより、演算の停止l
:条件を設定することができ、かつそのようにして設定
されたブレーク命令は実行やプログラムモードへの移行
時に、復帰手段にて退避記憶されているプログラム内容
を自動的に元のアドレスに書き込んで元のプログラム状
態に復帰することにより、ブレーク命令を自動的に削除
し、ユーザがブレーク命令の削除処理の操作を行わずに
済み、従ってユーザプログラムのデバック処理を効率的
に行うことができる効果がある。
[Effect of the Invention 1] As described above, the present invention includes a system ROM in which a system control program is stored and a RAM for storing user programs backed up by a battery. '? O
CPU based on the program stored in M and RAM.
In a programmable controller that performs automatic control of equipment by restoring operations, has an instruction dedicated to stopping calculations in the user program code, and has a mode dedicated to debugging in addition to execution and stopping, the above-mentioned debugging-only mode , the calculation stop d− registered by the programmer
A saving means that saves the program contents at the address of desired address Q; onto memory and sets a flag to remember that the contents have been saved; a rewriting means that rewrites the contents of the registered address into a break instruction; and a debug mode. This system is equipped with a return means that automatically writes the saved program contents to the original address and returns to the original program state when the program transitions to execution or stop mode. By specifying only an arbitrary address without writing, the save means saves the program contents of the registered address into memory, and the rewrite means rewrites the contents of the registered address with a break instruction. , stop operation l
: Conditions can be set, and a break instruction set in this way automatically writes the saved program contents to the original address using the return means when executing or transitioning to program mode. By returning to the original program state, the break instruction is automatically deleted, eliminating the need for the user to delete the break instruction, and thus making it possible to efficiently debug the user program. be.

【図面の簡単な説明】[Brief explanation of the drawing]

第1図は本発明の一実施例のプログラマサービス部の処
理70−チャート、第2図は同上のプログラマブルコン
トローラの概略構成図、第3図は同上の基本処理70−
チャート、第4図(a)〜(d)は同上のプログラマサ
ービス部の処理フローの工(体的なプログラム処理の説
明図、第5図は演算停止状態を解除した場合の処理70
−チャート、第6図は同上デバック終了時などの処理フ
ローチャート、第7図はステップ実行の処理フローチャ
ート、第8図(、)〜(c)は1命令実行の具体的なプ
ログラム処理の説明図である。 1はCPU、2はROM、3はRA Mである。 代理人 弁理士 石 1)艮 七 (b) ム1(筐イ”t、r 111坊iアト°トス(C) プロ2゛ラム退517−フ゛ル
FIG. 1 is a process 70-chart of the programmer service section according to an embodiment of the present invention, FIG. 2 is a schematic configuration diagram of the programmable controller as described above, and FIG. 3 is a basic process 70-chart as described above.
The charts, Figures 4(a) to 4(d) are diagrams of the processing flow of the programmer service department (explanatory diagram of the physical program processing), and Figure 5 is the processing 70 when the operation stop state is released.
-Chart, Figure 6 is a processing flowchart at the end of debugging, etc., Figure 7 is a processing flowchart of step execution, and Figures 8 (,) to (c) are explanatory diagrams of specific program processing of one instruction execution. be. 1 is a CPU, 2 is a ROM, and 3 is a RAM. Agent Patent Attorney Ishi 1) 艮 7 (b) M 1 (Kakei "t, r 111 boi attos (C) Professional 2 program retirement 517-fil

Claims (1)

【特許請求の範囲】[Claims] (1)システム制御用プログラムが記憶されたシステム
ROMと、電池でバックアップされたユーザプログラム
格納用のRAMを備え、上記ROM及びRAMに記憶さ
れたプログラムに基づいてCPUで演算処理して機器の
自動制御を行い、ユーザプログラムコード中に演算停止
専用の命令を有すると共に、実行及び停止以外にデバッ
ク専用のモードを備えたプログラマブルコントローラに
おいて、上記デバック専用のモードにおいて、プログラ
マにより登録された演算停止したい任意のアドレスのプ
ログラム内容をメモリ上に退避し、かつ退避したことを
記憶するフラッグを設定する退避手段と、上記登録され
たアドレスの内容をブレーク命令に書き換える書換手段
と、デバックモードより実行あるいは停止モードに移行
された時に、退避記憶されているプログラム内容を自動
的に元のアドレスに書き込んで元のプログラム状態に復
帰する復帰手段とを備えて成るプログラマブルコントロ
ーラ。
(1) Equipped with a system ROM that stores system control programs and a battery-backed RAM for storing user programs, the CPU performs arithmetic processing based on the programs stored in the ROM and RAM to automatically control the equipment. In a programmable controller that performs control and has an instruction dedicated to stopping calculations in the user program code, and also has a debug-only mode in addition to execution and stop, in the debug-only mode, an arbitrary command registered by the programmer that the programmer wants to stop. A saving means that saves the program contents at the address in the memory and sets a flag to remember that it has been saved, a rewriting means that rewrites the contents of the registered address to a break instruction, and an execution mode or a stop mode from the debug mode. A programmable controller comprising a return means for automatically writing saved program contents to the original address and returning to the original program state when the program is moved to the original program state.
JP62-158386A 1987-06-25 programmable controller Pending JPH012103A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP62-158386A JPH012103A (en) 1987-06-25 programmable controller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP62-158386A JPH012103A (en) 1987-06-25 programmable controller

Publications (2)

Publication Number Publication Date
JPS642103A JPS642103A (en) 1989-01-06
JPH012103A true JPH012103A (en) 1989-01-06

Family

ID=

Similar Documents

Publication Publication Date Title
JPH012103A (en) programmable controller
JPH0410081B2 (en)
JPH03216743A (en) Parallel saving system for data base
JPS6348698A (en) Memory storage control device
JPH07200350A (en) Software debugger
JPS63157238A (en) Computer
JP3067651B2 (en) Configuration data recovery device
JPH0833838B2 (en) Computer system
JPS63177205A (en) Programming device for programmable controller
JPS62269256A (en) Data storage system for semiconductor file
JPH07129079A (en) Method for installing programming loader
JPS63159905A (en) Forcible on/off system for input/output of programmable controller
JPH11259308A (en) Programmable controller
JP2961781B2 (en) Data processing device
JPS6051736B2 (en) information processing equipment
JPS60142434A (en) Control processor
JPH0375942A (en) Editing history control system for file
JPH01240943A (en) Data content recovery system
JPH04167146A (en) Address tracing system for information processor
JP2000242524A (en) Software simulator for processor
JPH02125303A (en) Programmable controller
JPS5878203A (en) Programmable controller
JPH0436833A (en) Program correction system using patch
JPH02165358A (en) Program loading system with learning function
JPS61221943A (en) Arithmetic processor