Movatterモバイル変換


[0]ホーム

URL:


JPH04367902A - Programmable controller - Google Patents

Programmable controller

Info

Publication number
JPH04367902A
JPH04367902AJP14463591AJP14463591AJPH04367902AJP H04367902 AJPH04367902 AJP H04367902AJP 14463591 AJP14463591 AJP 14463591AJP 14463591 AJP14463591 AJP 14463591AJP H04367902 AJPH04367902 AJP H04367902A
Authority
JP
Japan
Prior art keywords
data
sequence program
address
control signal
access
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
JP14463591A
Other languages
Japanese (ja)
Inventor
Haruhiko Kondo
治彦 近藤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Mitsubishi Electric CorpfiledCriticalMitsubishi Electric Corp
Priority to JP14463591ApriorityCriticalpatent/JPH04367902A/en
Publication of JPH04367902ApublicationCriticalpatent/JPH04367902A/en
Pendinglegal-statusCriticalCurrent

Links

Landscapes

Abstract

PURPOSE:To efficiently execute the debug without generating a sequence program for detecting a device access, at the time of executing the debug of the sequence program. CONSTITUTION:The programmable controller is provided with a storage part 4 in which an access condition to each device is stored in advance, and a comparing circuit 5 to which an address, data and a control signal corresponding to a designated device are inputted by executing a sequence program, and this comparing circuit 5 compares the address, the data and the control signal to the designated device and the access condition corresponding to the designated device stored in the storage part 4, and stops executing the sequence program, when they coincide with each other.

Description

Translated fromJapanese
【発明の詳細な説明】[Detailed description of the invention]

【0001】0001

【産業上の利用分野】この発明は、シーケンスプログラ
ムのデバッグを効率的に行うことのできるプログラマブ
ルコントローラ(以下PCと称する)に関するものであ
る。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a programmable controller (hereinafter referred to as a PC) that can efficiently debug sequence programs.

【0002】0002

【従来の技術】図5は、従来のプログラマブルコントロ
ーラにおいて、デバイスのアクセス検出を行うためのプ
ログラムの一例を示すシーケンスプログラムのラダー図
であり、図6はそのラダー図を処理するときのフローチ
ャートである。
2. Description of the Related Art FIG. 5 is a sequence program ladder diagram showing an example of a program for detecting device access in a conventional programmable controller, and FIG. 6 is a flowchart for processing the ladder diagram. .

【0003】次に、デバイスのアクセス検出を行うため
のシーケンスプログラム動作について説明する。シーケ
ンスプログラムはデバイスXの変化についてのデバッグ
用プログラム例であり、処理A、処理B、処理Cで各処
理ごとに1カ所だけデバイスXが変化するポイントが入
るように全体の処理プログラムを分割する。デバイスX
の変化するポイントが3カ所以上あるときは処理を更に
細かく分ける必要がある。
Next, a sequence program operation for detecting device access will be explained. The sequence program is an example of a debugging program regarding changes in device X, and the entire processing program is divided into process A, process B, and process C so that each process includes only one point at which device X changes. device
When there are three or more points at which the value changes, it is necessary to divide the processing into smaller parts.

【0004】まず、シーケンスプログラムにおいて、処
理Aを実行する(ステップS601)。次に、デバイス
Xのデータを比較し(ステップS602)、そのデータ
が比較条件を満足させるものであれば、デバイスXの変
化のあった処理Aのステップ番号を格納し(ステップS
603)、JMPP0 の命令実行により、ポインタP
0 へジャンプし、無処理であるNOP命令を実行し(
ステップS604)、END命令を実行して(ステップ
S605)、再度0ステップ目から実行する。
First, processing A is executed in the sequence program (step S601). Next, the data of device
603), by executing the JMPP0 instruction, the pointer P
Jump to 0 and execute a no-process NOP instruction (
Step S604), executes the END command (step S605), and executes again from step 0.

【0005】比較条件を満足されるものでなければ、更
に、次の処理Bを実行して(ステップS606)、デバ
イスXのデータの条件を比較し(ステップ607)、さ
らに、処理Cを実行し(ステップS608)、条件を比
較し(ステップS609)、もしも比較条件が成立しな
い場合は、JMPP1 の命令実行により、ポインタP
0 の処理命令NOPを実行することなしに、ポインタ
P1 へジャンプし、END命令を実行して(ステップ
S605)、0ステップから同様の処理を繰り返す。し
たがって、プログラムストップ(ブレークポイント)を
ポインタP0 のステップに指定しておけば、デバイス
Xの変化によって比較条件が成立したときだけ比較条件
の成立したステップを格納し、シーケンスプログラムを
ストップさせることができる。
[0005] If the comparison conditions are not satisfied, the next process B is further executed (step S606), the data conditions of device X are compared (step 607), and then process C is executed. (Step S608), compare the conditions (Step S609), and if the comparison condition does not hold, the pointer P
Without executing the 0 processing instruction NOP, the CPU 1 jumps to the pointer P1, executes the END instruction (step S605), and repeats the same process from step 0. Therefore, by specifying a program stop (breakpoint) at the step of pointer P0, it is possible to store the step where the comparison condition is satisfied and stop the sequence program only when the comparison condition is satisfied due to a change in device X. .

【0006】[0006]

【発明が解決しようとする課題】従来のPCは以上のよ
うに構成されているため、デバイスの変化が比較条件を
満足させたときだけシーケンスプログラムをストップさ
せるためには、そのデバイスの変化を検知するシーケン
スプログラムをデバッグしたい各デバイスごとに作成す
る必要があり、余分なシーケンスプログラムを作成しな
ければならず、プログラムが複雑となって拡大してしま
い、また、デバイスのアクセス条件が複雑になる場合、
たとえば特定ビットのみマスクをかけたり、読み出し書
き込みのなどの条件を加えたい場合などデバッグ用のシ
ーケンスプログラムを作成できないなどの課題があった
[Problem to be Solved by the Invention] Since conventional PCs are configured as described above, in order to stop the sequence program only when a change in the device satisfies the comparison condition, it is necessary to detect the change in the device. It is necessary to create a sequence program for each device that you want to debug, and if you have to create an extra sequence program, the program becomes complicated and expands, and the device access conditions become complicated. ,
For example, there were issues such as the inability to create sequence programs for debugging when you wanted to mask only specific bits or add conditions such as reading and writing.

【0007】この発明は上記のような課題を解決するた
めになされたもので、デバイスアクセス検出用のシーケ
ンスプログラムを作成することなく、シーケンスプログ
ラムのデバッグが効率的に行えるようにしたPCを得る
ことを目的とする。
[0007] The present invention has been made to solve the above-mentioned problems, and it is an object of the present invention to provide a PC that allows debugging of sequence programs efficiently without creating sequence programs for device access detection. With the goal.

【0008】[0008]

【課題を解決するための手段】この発明におけるPCは
、各デバイスに対するアクセス条件をあらかじめ記憶し
ている記憶部と、シーケンスプログラムの実行により指
定デバイスに対応するアドレス、データ及びコントロー
ル信号が入力される比較回路とを備え、この比較回路は
上記指定デバイスに対するアクセス条件と上記記憶手段
に記憶された指定デバイス対応のアクセス条件とを比較
して一致したときシーケンスプログラムの実行を停止さ
せるようにしたものである。
[Means for Solving the Problems] A PC according to the present invention includes a storage section that stores access conditions for each device in advance, and an address, data, and control signal corresponding to a designated device are inputted by executing a sequence program. and a comparison circuit, which compares the access condition for the specified device with the access condition corresponding to the specified device stored in the storage means, and stops the execution of the sequence program when they match. be.

【0009】[0009]

【作用】この発明においては、シーケンスプログラムを
実行すると、指定デバイスに対応するアドレス、データ
及びコントロール信号と、あらかじめ記憶部に記憶され
た当該デバイスに対応するアクセス条件とが比較され、
両者が一致した時シーケンスプログラムの実行を停止さ
せる。
[Operation] In the present invention, when a sequence program is executed, the address, data, and control signal corresponding to a designated device are compared with the access conditions corresponding to the device stored in advance in the storage section.
When both match, execution of the sequence program is stopped.

【0010】0010

【実施例】図1は、この発明になるPCの構成を示した
ブロック図であり、1は中央処理装置(以下CPUと称
す)、2はCPU1から各デバイスへ出力されるアドレ
スバス、3はCPU1から各デバイスへ出力されるデー
タバス、4は各デバイスに対するアクセス条件をあらか
じめ記憶しておく記憶部、5はCPU1から出力された
アドレス、データと、記憶部4に記憶されたアクセス条
件とを比較する比較回路で、両者が一致したとき一致割
込み信号6を出力する。7はCPU1から比較回路5に
出力されるたとえばリードライト信号のようなコントロ
ール信号、8、9は記憶部4から比較回路5に出力され
るアドレス及びデータ、10は記憶部4から出力される
上記コントロール信号に対応するコントロール信号、1
1はデータバスの比較回路への入力側に設けた遅延回路
である。
[Embodiment] Fig. 1 is a block diagram showing the configuration of a PC according to the present invention, in which 1 is a central processing unit (hereinafter referred to as CPU), 2 is an address bus output from the CPU 1 to each device, and 3 is a block diagram showing the configuration of a PC according to the present invention. A data bus is output from the CPU 1 to each device, 4 is a storage unit that stores access conditions for each device in advance, and 5 is a storage unit that stores addresses and data output from the CPU 1 and access conditions stored in the storage unit 4. A comparison circuit that compares outputs a match interrupt signal 6 when the two match. 7 is a control signal such as a read/write signal that is output from the CPU 1 to the comparison circuit 5; 8 and 9 are addresses and data that are output from the storage section 4 to the comparison circuit 5; and 10 is the above control signal that is output from the storage section 4. Control signal corresponding to the control signal, 1
1 is a delay circuit provided on the input side of the data bus to the comparison circuit.

【0011】図2は、比較回路5の内部ブロック図であ
り、20はCPU1から出力されたアドレス及びデータ
と、記憶部4に記憶されたアクセス条件に対応するアド
レス及びデータとを直接比較する比較部、21は比較部
20における比較動作の際に比較の対象としないビット
をあらかじめ記憶しておくマスクレジスタ、22はマス
クレジスタ21に記憶された内容に従い比較部20の比
較結果に対し不必要なビットにマスクをかけるマスク回
路、23は一致割込み信号の入力によりその時のCPU
からの出力アドレスとデータをラッチする実アドレスデ
ータラッチ回路である。
FIG. 2 is an internal block diagram of the comparison circuit 5, and 20 is a comparison circuit that directly compares the address and data output from the CPU 1 with the address and data corresponding to the access condition stored in the storage section 4. 21 is a mask register that stores in advance bits that are not to be compared during the comparison operation in the comparison unit 20; A mask circuit 23 masks bits, and 23 is a mask circuit that masks the bits by inputting a match interrupt signal.
This is a real address data latch circuit that latches the output address and data from.

【0012】次に、動作について説明する。図3にシー
ケンスプログラムの一例を示す。このシーケンスプログ
ラムは1ステップづつ実行され、シーケンス命令の解読
、処理で1ステップの処理が完了する。もし、シーケン
ス命令がデバイスのアクセスに関する処理であれば、そ
のデバイスに対して読み書きを行う。今、図1において
、デバイスのアクセス処理を行う場合について説明する
。デバイスのアクセスに際しCPU1はアドレスバス2
に各デバイスに割り当てられたアドレスを出力し、その
後、該デバイスからのデータ読み取りであれば、コント
ロール信号7としてリード信号を出力するとともにデー
タバス3にデバイスからデータを出力し、一方、デバイ
スに対する書き込みであれば、コントロール信号として
ライト信号を出力するとともに、データバス3に書き込
みデータを出力する。
Next, the operation will be explained. FIG. 3 shows an example of a sequence program. This sequence program is executed step by step, and one step of processing is completed by decoding and processing the sequence command. If the sequence instruction is a process related to accessing a device, it reads and writes to that device. Now, referring to FIG. 1, a case will be described in which device access processing is performed. When accessing a device, CPU1 uses address bus 2.
When reading data from the device, a read signal is output as the control signal 7 and data is output from the device to the data bus 3. On the other hand, when writing to the device, the address assigned to each device is output. If so, a write signal is output as a control signal, and write data is output to the data bus 3.

【0013】アクセス条件記憶部4は、どのデバイスに
対し、どのようなデータでもってリードあるいはライト
を実行した時、CPU1に対し割込みをかけるかその条
件を記憶している。この条件の登録は外部に設した周辺
機器またはシーケンスプログラムから登録可能である。したがって、比較回路5はCPU1がデバイスにアクセ
スするに際し、アクセス条件記憶部4に登録されたデバ
イスのアドレス8、デバイスのデータ9及びコントロー
ル信号10と、CPU1がデバイスをアクセスする時に
出力するアドレスバス2及びデータバス3のアドレス及
びデータ、さらには、コントロール信号7とを比較する
。以上3つの条件がすべて一致した時、比較回路5はC
PU1に対し割込み信号を出力する。もし、条件が一致
しなければ、そのまま次のシーケンス処理が実行される
。この割込み信号によりCPU1はシーケンス命令に実
行を一時中断し、その時のアドレス及びデータを記憶し
、ユーザからの再運転指令がくるまで待機する。
[0013] The access condition storage section 4 stores the conditions under which an interrupt is to be generated to the CPU 1 when a read or write is executed to which device and with what kind of data. This condition can be registered from an external peripheral device or a sequence program. Therefore, when the CPU 1 accesses the device, the comparison circuit 5 uses the device address 8, device data 9, and control signal 10 registered in the access condition storage section 4, and the address bus 2 output when the CPU 1 accesses the device. and the address and data of the data bus 3, as well as the control signal 7. When all the above three conditions match, the comparator circuit 5
Outputs an interrupt signal to PU1. If the conditions do not match, the next sequence process is executed as is. In response to this interrupt signal, the CPU 1 temporarily suspends execution of the sequence command, stores the address and data at that time, and waits until a restart command is received from the user.

【0014】更に詳述すると、図4のフローチャートに
おいて、比較回路5は比較部20で記憶部4に記憶され
たアドレス8とCPU1から出力されたアドレス2を比
較して(ステップS401)、次にデータ9とデータ3
を比較し(ステップS402)、さらにアクセス条件と
してのコントロール信号10とコントロール信号7を比
較し(ステップS403)する。その結果、全てが一致
すればCPU1へ一致割込み信号を出力し(ステップS
404)、そのときのデータとアドレスを格納して(ス
テップS405)、再運転指令を待つ(ステップS40
6)。特に、アドレス及びデータについては全てのビッ
トを比較する。その結果をマスク回路22に出力し、こ
のマスク回路ではあらかじめマスクレジスタ21に登録
された内容にて特定ビットのみをマスクする。つまり、
それらの比較結果に一部相違が生じても、その部分にマ
スクがかけてあれば、両者は一致しているものとして一
致割込み信号6を出力する。この割込み信号により、C
PU1に対し割込みをかけ、それと同時に実アドレスデ
ータラッチ回路23にCPU1から出力された実アドレ
ス、実データをラッチする。
More specifically, in the flowchart of FIG. 4, the comparison circuit 5 compares the address 8 stored in the storage unit 4 with the address 2 output from the CPU 1 in the comparison unit 20 (step S401), and then data 9 and data 3
(step S402), and further compares control signal 10 and control signal 7 as access conditions (step S403). As a result, if everything matches, a match interrupt signal is output to CPU1 (step S
404), stores the data and address at that time (step S405), and waits for a restart command (step S40).
6). In particular, all bits are compared for addresses and data. The result is output to the mask circuit 22, and this mask circuit masks only specific bits based on the contents registered in the mask register 21 in advance. In other words,
Even if there is a difference in some of the comparison results, if that part is masked, it is assumed that the two match, and a match interrupt signal 6 is output. This interrupt signal causes C
An interrupt is applied to the PU1, and at the same time, the real address and real data output from the CPU1 are latched in the real address data latch circuit 23.

【0015】以上述べたようなCPU1に対する割り込
み信号6により、シーケンスプログラムの実行が中断し
、その時のステップNo.実アドレス、実データをプロ
グラマブルコントローラの内部メモリに格納し、ユーザ
からの再運転指令を待つ。そして、この中断したときの
ステップ及びデバイスのデータをユーザに知らせること
ができるため、シーケンスプログラムのデバッグ効率を
向上させることができる。これらの一連の処理を繰り返
すことにより、指定のデバイスへ登録データで登録アク
セス方法でアクセスしたかどうかを検知し、シーケンス
プログラムを一時中断させることができる。
The execution of the sequence program is interrupted by the interrupt signal 6 to the CPU 1 as described above, and the current step No. The actual address and actual data are stored in the internal memory of the programmable controller, and the controller waits for a restart command from the user. Since the step and device data at the time of interruption can be notified to the user, the debugging efficiency of the sequence program can be improved. By repeating these series of processes, it is possible to detect whether or not a specified device has been accessed using the registered access method using registered data, and to temporarily suspend the sequence program.

【0016】なお、上記実施例では、比較回路により比
較条件が成立した場合、比較回路がCPUに割込みをか
けてシーケンスプログラムの実行を停止させていたが、
比較回路により比較条件が成立したら、比較回路からC
PUに停止コードを送るようにしてもよい。また、上記
実施例では、全てH/Wにより比較検出動作を行ってい
るが、これをS/Wで構成しても同様な効果を奏し得る
ものである。
In the above embodiment, when the comparison condition is satisfied by the comparison circuit, the comparison circuit interrupts the CPU to stop the execution of the sequence program.
When the comparison condition is satisfied by the comparison circuit, C is sent from the comparison circuit.
A stop code may also be sent to the PU. Further, in the above embodiment, the comparison and detection operation is entirely performed by H/W, but the same effect can be achieved even if this is configured by S/W.

【0017】[0017]

【発明の効果】以上のようにこの発明によれば、シーケ
ンスプログラムにデバッグ用のプログラムを作成する必
要がなく、効率的にデバッグを行うことができる効果が
ある。
As described above, according to the present invention, there is no need to create a debugging program in the sequence program, and debugging can be carried out efficiently.

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

【図1】この発明になるPCのハードウェア構成を示す
ブロック図である。
FIG. 1 is a block diagram showing the hardware configuration of a PC according to the present invention.

【図2】この発明になるPCの要部構成を示すブロック
図である。
FIG. 2 is a block diagram showing the main part configuration of a PC according to the present invention.

【図3】この発明によるシーケンスプログラムを示す図
である。
FIG. 3 is a diagram showing a sequence program according to the present invention.

【図4】この発明になるシーケンスプログラムのフロー
チャートである。
FIG. 4 is a flowchart of a sequence program according to the present invention.

【図5】従来のPCにおけるシーケンスプログラムを示
す図である。
FIG. 5 is a diagram showing a sequence program in a conventional PC.

【図6】従来のPCにおけるシーケンスプログラムのフ
ローチャートである。
FIG. 6 is a flowchart of a sequence program in a conventional PC.

【符号の説明】[Explanation of symbols]

1  中央処理装置(CPU)2  アドレスバス3  データバス4  アクセス条件記憶部5  比較回路6  割込み信号7  コントロール信号8  アドレス9  データ10  アクセス条件11  遅延回路20  比較部21  マスクレジスタ22  マスク回路23  実アドレスデータラッチ1 Central processing unit (CPU)2 Address bus3 Data bus4 Access condition storage section5 Comparison circuit6 Interrupt signal7 Control signal8 Address9 Data10 Access conditions11 Delay circuit20 Comparison section21 Mask register22 Mask circuit23 Real address data latch

Claims (1)

Translated fromJapanese
【特許請求の範囲】[Claims]【請求項1】  各デバイスに対するアクセス条件をあ
らかじめ記憶している記憶部と、シーケンスプログラム
の実行により指定デバイスに対応するアドレス、データ
及びコントロール信号が入力される比較回路とを備え、
この比較回路は上記指定デバイスに対するアドレス、デ
ータ及びアントロール信号と上記記憶部に記憶された指
定デバイス対応のアクセス条件とを比較して一致したと
きシーケンスプログラムの実行を停止させるようにした
ことを特徴とするプログラマブルコントローラ。
1. A storage unit that stores access conditions for each device in advance, and a comparison circuit that receives an address, data, and control signal corresponding to a designated device by executing a sequence program,
This comparison circuit is characterized in that it compares the address, data, and antroll signal for the specified device with the access conditions corresponding to the specified device stored in the storage section, and stops the execution of the sequence program when they match. A programmable controller.
JP14463591A1991-06-171991-06-17Programmable controllerPendingJPH04367902A (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
JP14463591AJPH04367902A (en)1991-06-171991-06-17Programmable controller

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
JP14463591AJPH04367902A (en)1991-06-171991-06-17Programmable controller

Publications (1)

Publication NumberPublication Date
JPH04367902Atrue JPH04367902A (en)1992-12-21

Family

ID=15366645

Family Applications (1)

Application NumberTitlePriority DateFiling Date
JP14463591APendingJPH04367902A (en)1991-06-171991-06-17Programmable controller

Country Status (1)

CountryLink
JP (1)JPH04367902A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US6263490B1 (en)1997-06-272001-07-17Nec CorporationGraphic device capable of carrying out debug of a device driver program at a high speed

Citations (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
JPS59174912A (en)*1983-03-251984-10-03Toshiba CorpProgramming device
JPS60128541A (en)*1983-12-161985-07-09Matsushita Electric Ind Co LtdMicroprocessor
JPS6270947A (en)*1985-09-241987-04-01Nec CorpControl system for debug interruption
JPH01223503A (en)*1988-03-031989-09-06Fanuc LtdProgram execution control system for pc

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
JPS59174912A (en)*1983-03-251984-10-03Toshiba CorpProgramming device
JPS60128541A (en)*1983-12-161985-07-09Matsushita Electric Ind Co LtdMicroprocessor
JPS6270947A (en)*1985-09-241987-04-01Nec CorpControl system for debug interruption
JPH01223503A (en)*1988-03-031989-09-06Fanuc LtdProgram execution control system for pc

Cited By (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US6263490B1 (en)1997-06-272001-07-17Nec CorporationGraphic device capable of carrying out debug of a device driver program at a high speed

Similar Documents

PublicationPublication DateTitle
US7334161B2 (en)Breakpoint logic unit, debug logic and breakpoint method for a data processing apparatus
US5717851A (en)Breakpoint detection circuit in a data processor and method therefor
JP2008009721A (en)Evaluation system and evaluation method thereof
JPH04367902A (en)Programmable controller
JP2607319B2 (en) Programmable controller
JPH0581087A (en)Processor monitoring system
KR920003909B1 (en)Debugging supporting circuit
JP3171615B2 (en) Data transfer retry control method
JPH02103643A (en)Interruption generation circuit for debug
JPH0652013A (en)Tracing circuit
JPH03204004A (en) programmable controller
JP3098501B2 (en) Source step execution method and apparatus
JPS6270947A (en)Control system for debug interruption
JPH0346053A (en)Control system between plural processors
JPS60193046A (en) Instruction exception detection method
JPH07107669B2 (en) Processor
JPS6349943A (en)Arithmetic processing unit
JPH0782447B2 (en) DMA data transfer control device
JPS63165931A (en)Storing system for information on discontinuous instruction fetch address
JPS60193047A (en)Mode checking system of microprogram
JPH1055289A (en) Debug information generation circuit and information processing device using the same
JPH0635760A (en) Buffer device with trace function
JPH07271608A (en)Interruption generating circuit
JPH0432418B2 (en)
JPS61141046A (en)System for controlling debug interruption

[8]ページ先頭

©2009-2025 Movatter.jp