JPH05241650A - Programmable controller - Google Patents

Programmable controller

Info

Publication number
JPH05241650A
JPH05241650A JP4078412A JP7841292A JPH05241650A JP H05241650 A JPH05241650 A JP H05241650A JP 4078412 A JP4078412 A JP 4078412A JP 7841292 A JP7841292 A JP 7841292A JP H05241650 A JPH05241650 A JP H05241650A
Authority
JP
Japan
Prior art keywords
data
memory
program
lower limit
instruction
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
JP4078412A
Other languages
Japanese (ja)
Inventor
Kazumi Kubo
和美 久保
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.)
Yaskawa Electric Corp
Original Assignee
Yaskawa 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 Yaskawa Electric Corp filed Critical Yaskawa Electric Corp
Priority to JP4078412A priority Critical patent/JPH05241650A/en
Publication of JPH05241650A publication Critical patent/JPH05241650A/en
Pending legal-status Critical Current

Links

Landscapes

  • Testing And Monitoring For Control Systems (AREA)

Abstract

PURPOSE:To prevent the destruction of data or the operational defect of programs generated at the time of index modification by tracing data to be set by accessing a data memory using an index register, and verifying the rationality of those data. CONSTITUTION:The program prepared by a program input device 10 is stored through a communication control part 4 into a program memory 1, and upper and lower limit values to the index register are stored in an upper/lower limit value storage part 8 together with an execution address. A program code is read from the memory 1 and transmitted to an instruction detection part 5 by a CPU part 3. When the program code is a write instruction, it is transmitted to a memory control part 6 and a rationality verification part 9 by the instruction detection part 5. The memory control part 6 stores the address, number of times of executing instructions and data value in a trace memory part 7. The rationality verification part 9 reads the execution address and the upper and lower limit values from the upper/lower limit value storage part, collates the transmitted execution address with the data value and reports the result to the CPU part 3.

Description

【発明の詳細な説明】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), and more particularly to a programmable controller capable of index-modifying a data memory using an index register.

【0002】[0002]

【従来の技術】一般的な計算機技術では、配列変数デー
タへのアクセス方式としてインデックスを用い、インデ
ックスの内容を任意に設定し、配列変数へのアクセスを
効率的に行うことは良く知られている。PCにおいて
も、インデックス修飾によるデータメモリへのアクセス
は、たとえば、外部からの入力信号、または、制御プロ
グラムの演算結果としての外部への出力信号など、外部
機器の接続状態によっては、一定の規則に従ってシーケ
ンス回路が作成できる。また、近年のPCも多機能化に
対応して、データ処理機能を取入れ、PC内においても
配列変数の取扱いが多く見られる。汎用計算機での配列
変数の取扱いは、任意の変数をインデックスレジスタと
して用いられることが一般的である。しかし、PCにお
いては、データメモリの特定の変数領域や、専用のハー
ドウェアレジスタをインデックスレジスタとして用い、
配列変数へのアクセス、あるいは一定の規則に従ったシ
ーケンス回路などの実行を制御している。図3にPCの
インデックス修飾のプログラム例を示す。図3の例は、
入力リレーの0010〜0019、および0030〜0
039、出力コイルの1000〜1009までが外部機
器に接続された一般的な運転停止回路である。ここで、
I=MX0010は、前記インデックスレジスタに変数
MX0010の内容を初期値として設定する命令であ
り、インデックスレジスタの内容が変数MX0011の
内容以上になるまで、前記運転停止回路を繰り返し実行
するプログラムである。この例のように、一定の規則に
従ったプログラムは、入出力機器番号、あるいは変数デ
ータをインデックス修飾してプログラミングすることで
プログラムを効率的に作成することができる。
2. Description of the Related Art In general computer technology, it is well known that an index is used as an access method for array variable data, the contents of the index are arbitrarily set, and the array variable is efficiently accessed. .. Even in the PC, access to the data memory by the index modification follows a certain rule, for example, depending on the connection state of the external device such as an input signal from the outside or an output signal to the outside as a calculation result of the control program. A sequence circuit can be created. Further, in recent years, PCs are also equipped with a data processing function in response to the multifunctionalization, and array variables are often handled in the PCs. When handling array variables in a general-purpose computer, it is common to use arbitrary variables as index registers. However, in the PC, a specific variable area of the data memory or a dedicated hardware register is used as an index register,
It controls access to array variables or execution of sequence circuits according to certain rules. FIG. 3 shows an example of a PC index modification program. The example in Figure 3
Input relays 0010-0019 and 0030-0
039, 1000 to 1009 of the output coil is a general operation stop circuit connected to an external device. here,
I = MX0010 is an instruction for setting the content of the variable MX0010 as an initial value in the index register, and is a program for repeatedly executing the operation stop circuit until the content of the index register becomes equal to or more than the content of the variable MX0011. As in this example, a program complying with a certain rule can be efficiently created by modifying the input / output device number or variable data by index modification and programming.

【0003】[0003]

【発明が解決しようとする課題】しかし、このようなイ
ンデックス修飾を用いたプログラミングでは、インデッ
クスレジスタへのデータの設定によっては、プログラム
が正常に動作しなくなることがある。図3の例ではイン
デックスレジスタの値としては0〜9となるが、初期値
設定の変数MX0010、あるいは繰り返し条件の判断
のための変数MX0011の値によって動作不良を引き
起こすことになり、当該プログラムのミスによる直接的
な不具合でなく、他の部分でのプログラムの誤りによっ
て発生する間接的な不具合として現れて来るため、その
原因究明には多大な時間を費やすことになる。本発明
は、インデックス修飾により引き起こされるデータの破
壊やプログラムの動作不良を防止することができるPC
を提供することを目的とする。
However, in programming using such index modification, the program may not operate normally depending on the setting of data in the index register. In the example of FIG. 3, the value of the index register is 0 to 9, but the value of the variable MX0010 for initial value setting or the value of the variable MX0011 for determining the repeating condition causes a malfunction, and the program error. Since it appears as an indirect defect caused by a program error in other parts, it takes a lot of time to investigate the cause. The present invention is a PC capable of preventing data destruction and program malfunction caused by index modification.
The purpose is to provide.

【0004】[0004]

【課題を解決するための手段】本発明のPCは、インデ
ックスレジスタによるデータメモリのアクセスにおい
て、インデックスレジスタの内容の上下限値を任意に設
定入力するための手段と、制御プログラム内でインデッ
クスレジスタへの書き込み命令を検出するための手段
と、検出指令に応答して同一アドレスの命令の実行回数
とアドレスと実行時の内容とを記憶する手段と、実行時
の内容の正当性を検証するための手段を備えたことを特
徴とする。
The PC of the present invention is a means for arbitrarily setting and inputting the upper and lower limit values of the contents of the index register in accessing the data memory by the index register, and to the index register in the control program. Means for detecting the write command of, the means for storing the number of times of execution of the instruction at the same address, the address, and the contents at the time of execution in response to the detection command, and the means for verifying the validity of the contents at the time of execution. It is characterized by comprising means.

【0005】[0005]

【作用】本発明によると、インデックスレジスタを用い
たデータメモリのアクセスで、インデックスレジスタへ
設定されるデータをトレースし、そのデータの合理性を
検証することで、インデックス修飾によるPCの誤動作
の原因を早期に究明できる。
According to the present invention, by accessing the data memory using the index register, the data set in the index register is traced, and the rationality of the data is verified, whereby the cause of the malfunction of the PC due to the index modification is eliminated. Can be investigated early.

【0006】[0006]

【実施例】本発明の一実施例について図面を参照して説
明する。図1は、本発明のPCの一実施例を表すブロッ
ク図である。利用者によって作成された制御プログラム
を記憶しているプログラムメモリ1と、外部入出力機器
との入出力データ、およびPCの動作中の各種データを
記憶しているデータメモリ2と、プログラムメモリに記
憶している内容に従って実行するCPU部3と、プログ
ラム入力装置との通信を制御する通信制御部4と、CP
U部3がプログラムメモリ1から実行命令をフェッチし
た時に、その実行命令がインデックスレジスタへの書き
込み命令であるか否かをチェックする命令検出部5と、
命令検出部5からの検出指令に応答して、当該実行命令
のアドレス、繰り返し実行回数、初期値、更新値を記憶
するための記憶制御部6と、前述の命令実行アドレス、
実行回数、初期値、更新値を記憶するトレースメモリ部
7と通信制御部4を介してプログラム入力装置10から
設定入力された任意の実行アドレスのインデックスレジ
スタの上下限値を保持する上下限値記憶部8と、命令検
出部5からの検出指令によって、当該実行アドレスのイ
ンデックスレジスタ書き込み命令のデータ値の合理性を
下限値記憶部8に記憶されている値を用いて検証する合
理性検証部9から構成される。図2は、本発明のPCの
プログラムコードを表し、命令の種別を表す命令コード
部と、その命令の取り得るオペランドの型などを表す修
飾部と、その命令のオペランド部とからなる。つぎに、
本発明の一実施例の動作について説明する。プログラム
入力装置9で作成されたプログラムを通信制御部4を介
してプログラムメモリ1に格納し、インデックスレジス
タへの上下限値設定がされていれば、その値を上下限値
記憶部7に実行アドレスと併せて記憶する。CPU部3
は、プログラムメモリ1に格納されているプログラムコ
ードを読み出し、命令検出部5に送信すると同時に命令
コードに従って実行する。命令検出部5では、CPU部
から送信されたプログラムコードがインデックスレジス
タへの書き込み命令であるか否かを調べ、書き込み命令
でなければ次のプログラムコードがCPU部3から送信
されてくるのを待つ。送信されたプログラムコードがイ
ンデックスレジスタへの書き込み命令であれば、当該命
令の実行アドレスとデータ値を記憶制御部6に送信す
る。記憶制御部6は、トレースメモリ部7に記憶されて
いる実行アドレスが命令検出部5から送信された実行ア
ドレスと等しいかどうかを調べ、等しければ実行回数を
増やし、送信されたデータ値をトレースメモリ部7に更
新値として記憶する。等しくなければ命令検出部5から
送信された実行アドレスとデータ値をトレースメモリ部
7に記憶し実行回数をリセット、すなわち1とする。命
令検出部5は、記憶制御部6に送信すると同時に、合理
性検証部9にも実行アドレスとデータ値を送信する。合
理性検証部9は、通信制御部4を介して設定入力された
インデックスレジスタへの上下限値を記憶している上下
限値記憶部8から実行アドレスと上下限値を読み出し、
命令検出部5から送信された実行アドレスと照合し、該
当アドレス範囲であれば、さらにデータ値を上下限設定
値と照合する。照合の結果、上下限設定値を越えていれ
ば、直ちにCPU部3に以後のインデックス修飾命令に
対する実行を停止、すなわち「NO OPERATIO
N」とするための指令を発し、トレースメモリ7に上下
限異常状態を記憶する。上下限設定値内にあれば、CP
U部3にインデックス修飾命令の実行停止指令を解除さ
せ、次の送信を待つ。CPU部3は合理性検証部9から
インデックス修飾命令の実行停止指令を受け取ると、イ
ンデックス修飾命令の実行のみ停止する。
An embodiment of the present invention will be described with reference to the drawings. FIG. 1 is a block diagram showing an embodiment of a PC of the present invention. A program memory 1 storing a control program created by a user, a data memory 2 storing input / output data with an external input / output device, and various data during operation of a PC, and a program memory CPU unit 3 that executes in accordance with the contents, a communication control unit 4 that controls communication with the program input device, and a CP
When the U unit 3 fetches an execution instruction from the program memory 1, an instruction detection unit 5 that checks whether the execution instruction is a write instruction to an index register,
In response to the detection command from the instruction detection unit 5, the storage control unit 6 for storing the address of the execution instruction, the number of repeated executions, the initial value, and the updated value, and the above-mentioned instruction execution address,
Upper and lower limit value storage for holding the upper and lower limit values of the index register of an arbitrary execution address set and input from the program input device 10 via the trace memory unit 7 for storing the number of executions, the initial value and the updated value and the communication control unit 4. The rationality verification unit 9 for verifying the rationality of the data value of the index register write command of the execution address by using the value stored in the lower limit value storage unit 8 according to the detection command from the unit 8 and the instruction detection unit 5. Composed of. FIG. 2 shows the program code of the PC of the present invention, and comprises an instruction code section showing the type of instruction, a modification section showing the type of operand that the instruction can take, and the operand section of the instruction. Next,
The operation of the embodiment of the present invention will be described. The program created by the program input device 9 is stored in the program memory 1 via the communication control unit 4, and if the upper and lower limit values are set in the index register, the value is stored in the upper and lower limit value storage unit 7 as an execution address. And also memorize. CPU part 3
Reads the program code stored in the program memory 1, transmits the program code to the instruction detection unit 5, and simultaneously executes it according to the instruction code. The instruction detection unit 5 checks whether the program code transmitted from the CPU unit is a write command to the index register, and if it is not a write command, waits for the next program code to be transmitted from the CPU unit 3. .. If the transmitted program code is an instruction to write to the index register, the execution address and data value of the instruction are transmitted to the storage controller 6. The storage control unit 6 checks whether or not the execution address stored in the trace memory unit 7 is equal to the execution address transmitted from the instruction detection unit 5, and if they are equal, increases the number of executions and stores the transmitted data value in the trace memory. Stored in the unit 7 as an updated value. If they are not equal, the execution address and the data value transmitted from the instruction detection unit 5 are stored in the trace memory unit 7 and the execution count is reset, that is, set to 1. The instruction detection unit 5 transmits the execution address and the data value to the rationality verification unit 9 at the same time as transmitting the storage control unit 6. The rationality verification unit 9 reads the execution address and the upper and lower limit values from the upper and lower limit value storage unit 8 that stores the upper and lower limit values in the index register set and input via the communication control unit 4,
The execution address transmitted from the instruction detection unit 5 is collated, and if it is in the corresponding address range, the data value is further collated with the upper and lower limit set values. As a result of the collation, if the upper and lower limit setting values are exceeded, the CPU unit 3 immediately stops the execution of the subsequent index modification instruction, that is, "NO OPERATIO".
A command for "N" is issued, and the upper and lower limit abnormal states are stored in the trace memory 7. If it is within the upper and lower limit settings, CP
The U unit 3 is caused to cancel the index modification instruction execution stop command, and waits for the next transmission. When the CPU unit 3 receives the instruction to stop the execution of the index modification instruction from the rationality verification unit 9, only the execution of the index modification instruction is stopped.

【0007】[0007]

【発明の効果】従って、本発明によると、何らかの原因
でインデックスレジスタの内容が設計値を外れた場合で
も、実行動作に影響を与えることがなく、インデックス
レジスタへの書き込みをトレースすることで、動作不良
の原因究明に多大な時間を費やすことがなくなる。ま
た、本発明は、インデックス修飾によるプログラミング
において、インデックスレジスタへの書き込み命令を監
視することでインデックス修飾により引き起こされるデ
ータの破壊、プログラムの動作不良を防ぐ効果がある。
Therefore, according to the present invention, even if the content of the index register deviates from the design value for some reason, the operation is executed by tracing the writing to the index register without affecting the execution operation. There is no need to spend a great deal of time in investigating the cause of defects. Further, in the programming by index modification, the present invention has an effect of preventing the data destruction and the program malfunction caused by the index modification by monitoring the write command to the index register.

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

【図1】本発明のPCの一実施例を表すブロック図。FIG. 1 is a block diagram showing an embodiment of a PC of the present invention.

【図2】PCのプログラムコードを示す図。FIG. 2 is a diagram showing a program code of a PC.

【図3】PCのインデックス修飾のプログラム例を示す
図。
FIG. 3 is a diagram showing an example of a program for PC index modification.

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

1 プログラムメモリ 2 データメモリ 3 CPU部 4 通信制御部 5 命令検出部 6 記憶制御部 7 トレースメモリ部 8 上下限値記憶部 9 合理性検証部 10 プログラム入力装置 1 Program Memory 2 Data Memory 3 CPU Section 4 Communication Control Section 5 Command Detection Section 6 Storage Control Section 7 Trace Memory Section 8 Upper and Lower Limit Value Storage Section 9 Rationality Verification Section 10 Program Input Device

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】 1つ以上のインデックスレジスタを有
し、このインデックスレジスタを介してデータメモリの
アクセスを可能とする命令を備えたプログラマブルコン
トローラにおいて、前記インデックスレジスタの内容の
上下限値を任意に設定入力するための手段と、制御プロ
グラム内で前記インデックスレジスタへの書き込み命令
を検出する手段と、検出指令に応答して同一アドレスの
命令の実行回数とアドレスと実行時の内容とを記憶する
手段と、実行時の内容の合理性を検証する手段を備えた
ことを特徴とするプログラマブルコントローラ。
1. A programmable controller having one or more index registers, and an instruction enabling access to a data memory via the index registers, wherein the upper and lower limit values of the contents of the index registers are arbitrarily set. Means for inputting, means for detecting a write command to the index register in the control program, means for storing the number of executions of the instruction at the same address in response to the detection command, the address and the content at the time of execution , A programmable controller characterized by having means for verifying the rationality of the contents at the time of execution.
JP4078412A 1992-02-27 1992-02-27 Programmable controller Pending JPH05241650A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP4078412A JPH05241650A (en) 1992-02-27 1992-02-27 Programmable controller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP4078412A JPH05241650A (en) 1992-02-27 1992-02-27 Programmable controller

Publications (1)

Publication Number Publication Date
JPH05241650A true JPH05241650A (en) 1993-09-21

Family

ID=13661326

Family Applications (1)

Application Number Title Priority Date Filing Date
JP4078412A Pending JPH05241650A (en) 1992-02-27 1992-02-27 Programmable controller

Country Status (1)

Country Link
JP (1) JPH05241650A (en)

Similar Documents

Publication Publication Date Title
US5257269A (en) Error controller for use in debugging microprocessor
JPH05241650A (en) Programmable controller
JPS60159951A (en) Tracing system in information processing device
JPH08171504A (en) Emulation device
JP2570593B2 (en) Debug device
KR100239438B1 (en) Cpu having function for preventing malfuction
JPH0581087A (en) Processor monitoring system
JPH05225361A (en) Register rewriting system
JP2677043B2 (en) Program development support device
JPS60193046A (en) Detecting system for instruction exception
KR100213095B1 (en) Method for checking networking status of PLC
JPH03296146A (en) Back-up device for program development
JPH03144705A (en) Operation state monitor for programmable controller
JPH02163842A (en) Program evaluating device for microcomputer
JP2507676B2 (en) Index I / O statement execution processing method
JPS6211746B2 (en)
JPS6162142A (en) I/o controller
JPS61169943A (en) Stack tracer circuit
JP2005327175A (en) Incircuit emulator device and stack access abnormality detection method
JPH0159608B2 (en)
JPH08123734A (en) Methods for checking occurrence of data destruction in data storing area and program runaway and methods for searching causes of data destruction occurrence and program runaway
JPS6029849A (en) Prevention system against malfunction of detecting circuit for processor malfunction
JPH02263243A (en) Runaway processor for computer
JPH01142948A (en) Symbolic debugger for microcomputer
JPH07253908A (en) Memory access device