JP2853774B2 - Programmable controller - Google Patents

Programmable controller

Info

Publication number
JP2853774B2
JP2853774B2 JP40195190A JP40195190A JP2853774B2 JP 2853774 B2 JP2853774 B2 JP 2853774B2 JP 40195190 A JP40195190 A JP 40195190A JP 40195190 A JP40195190 A JP 40195190A JP 2853774 B2 JP2853774 B2 JP 2853774B2
Authority
JP
Japan
Prior art keywords
subroutine
program
instruction
return address
sequence
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.)
Expired - Fee Related
Application number
JP40195190A
Other languages
Japanese (ja)
Other versions
JPH04215106A (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 JP40195190A priority Critical patent/JP2853774B2/en
Publication of JPH04215106A publication Critical patent/JPH04215106A/en
Application granted granted Critical
Publication of JP2853774B2 publication Critical patent/JP2853774B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Programmable Controllers (AREA)

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【産業上の利用分野】本発明は、シーケンスプログラム
を実行したときにサブルーチンプログラムに対する演算
の異常を検出する機能を有するプログラマブルコントロ
ーラに関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a programmable controller having a function of detecting an abnormal operation in a subroutine program when a sequence program is executed.

【0002】[0002]

【従来の技術】従来、シーケンスプログラム中のサブル
ーチンプログラムの実行時の異常を検出する機能を有す
るプログラマブルコントローラでは、メインルーチンへ
の中央処理装置(CPU)内のスタック領域に格納され
たサブルーチンの戻り番地を異常検出のために参照して
いる。
2. Description of the Related Art Conventionally, in a programmable controller having a function of detecting an abnormality during execution of a subroutine program in a sequence program, a return address of a subroutine stored in a stack area in a central processing unit (CPU) to a main routine. Is referenced for abnormality detection.

【0003】[0003]

【発明が解決しようとする課題】しかしながら従来装置
ではスタック領域に他種の情報をも書き込むために、ス
タック領域内における戻り先番地の格納位置が移動(プ
ッシュ)されてしまう。このため、他種の情報をスタッ
ク領域に書き込むときに上記戻り先番地をスタック領域
から読出し、汎用レジスタに記憶する処理が必要であ
り、この処理を指示するプログラム命令の分だけシーケ
ンスプログラムの容量が増大するという不具合があっ
た。
However, in the conventional device, the storage location of the return address in the stack area is moved (pushed) in order to write other types of information in the stack area. For this reason, when writing other types of information to the stack area, it is necessary to read the return address from the stack area and store it in a general-purpose register, and the capacity of the sequence program is reduced by the number of program instructions instructing this processing. There was a problem that it increased.

【0004】この点について、図6を参照して詳しく説
明する。
[0004] This point will be described in detail with reference to FIG.

【0005】図6は2つのサブルーチンプログラムを有
するシーケンスプログラムの一例を示す。
FIG. 6 shows an example of a sequence program having two subroutine programs.

【0006】中間語のシーケンスプログラムをCPUの
実行可能な機械語に翻訳する際に、またはユーザ自身が
中間語のシーケンスプログラムを作成する際に、メイン
ルーチンMAIN内に記載されたサブルーチン実行命令
PP2の前に、入出力パラメータにより逆算要求を行う
ためのプログラム命令PP1が挿入される。
When translating an intermediate language sequence program into a machine language executable by the CPU or when the user himself creates an intermediate language sequence program, the subroutine execution instruction PP2 described in the main routine MAIN is executed. Before this, a program instruction PP1 for making a back calculation request by an input / output parameter is inserted.

【0007】この入力パラメータがレベルオンを示すと
きには次に移動するサブルーチンプログラムにおいて、
スタック領域に通常のデータ格納を行うこと、すなわ
ち、サブルーチンの戻り番地のスタック領域の格納位置
の変更があることを表わす。
When the input parameter indicates level on, in a subroutine program to be moved next,
This means that normal data storage is performed in the stack area, that is, the storage position of the stack area at the return address of the subroutine is changed.

【0008】また、サブルーチンの中の、スタック領域
にデータを格納する命令PP3,PP7の後には上記入
力パラメータのオン/オフを確認し、サブルーチンの戻
り番地の格納されたスタック領域のアドレスを逆算し、
サブルーチンの戻り番地を読出し、汎用レジスタに書き
込む旨を指示するプログラム命令(図6のPP4,PP
5,PP8,PP9)が挿入される。
After the instructions PP3 and PP7 for storing data in the stack area in the subroutine, on / off of the input parameters is confirmed, and the address of the stack area where the return address of the subroutine is stored is calculated backward. ,
A program instruction for reading the return address of the subroutine and writing it to the general-purpose register (PP4, PP in FIG. 6)
5, PP8, PP9) are inserted.

【0009】このような図6のシーケンスプログラムを
実行するときのCPUの動作手順をプルグラム命令毎に
説明する。
The operation procedure of the CPU when executing the sequence program shown in FIG. 6 will be described for each program instruction.

【0010】プログラム命令PP1:メインルーチンM
AINにおいて、サブルーチンSUB1を実行(CAL
L)する際に、戻り番地逆算要求を示すオンの入力パラ
メータがCPU内のレジスタにセットされる。
Program instruction PP1: Main routine M
AIN executes subroutine SUB1 (CAL
L), an ON input parameter indicating a return address reverse calculation request is set in a register in the CPU.

【0011】プログラム命令PP2:サブルーチン実行
命令CALL SUBにより周知のシステム動作してC
PUはスタック領域4にサブルーチンSUB1のメイン
ルーチンへの戻り番地を格納し、実行手順をサブルーチ
ンSUB1に移す。
Program instruction PP2: A known system operation is performed by a subroutine execution instruction CALL SUB, and C
The PU stores the return address of the subroutine SUB1 to the main routine in the stack area 4, and shifts the execution procedure to the subroutine SUB1.

【0012】プログラム命令PP3:このプログラム命
令によりCPU内のスタック領域にレジスタReg.1
のデータが格納される。
Program instruction PP3: The register Reg. 1
Is stored.

【0013】プログラム命令PP4:入力パラメータが
オンに設定されているのでこの判定処理は肯定判定が得
られ、次のプログラム命令の番地逆算の処理に移る。
Program instruction PP4: Since the input parameter is set to ON, a positive determination is obtained in this determination processing, and the processing shifts to the address reverse calculation processing of the next program instruction.

【0014】プログラム命令PP5:スタックポインタ
の値より、サブルーチンSUB1についての戻り番地が
格納されているスタック領域アドレス(すなわち図7の
符号Aの位置)を逆算し、次にこのアドレスからサブル
ーチンSUB1の戻り番地情報を読出し、CPU内の汎
用レジスタReg.0にセーブ(記憶)しておく(図
7,8参照)。
Program instruction PP5: The stack area address storing the return address of subroutine SUB1 (that is, the position of reference symbol A in FIG. 7) is calculated backward from the value of the stack pointer, and then the subroutine SUB1 is returned from this address. The address information is read, and the general-purpose register Reg. 0 is saved (see FIGS. 7 and 8).

【0015】プログラム命令PP6:サブルーチン実行
命令CALL SUB2により、スタック領域にサブル
ーチンSUB2の戻り番地が格納され(図6参照)、サ
ブルーチンSUB2に実行手順が移る。
Program instruction PP6: The return address of subroutine SUB2 is stored in the stack area by the subroutine execution instruction CALL SUB2 (see FIG. 6), and the execution procedure shifts to subroutine SUB2.

【0016】プログラム命令PP7:このプルグラム命
令によりレジスタReg.2をセーブ(PUSH)して
いるので、スタック領域にレジスタReg.2のデータ
が格納される。
Program instruction PP7: The register Reg. 2 is saved (PUSH), so that the register Reg. 2 are stored.

【0017】プログラム命令PP8:サブルーチンSU
B2についての戻り番地逆算要求プログラムに記載され
ていないので、実行手順は逆算の処理に移らず飛び越
す。
Program instruction PP8: Subroutine SU
Since the return address back calculation request program for B2 is not described, the execution procedure jumps without moving to the back calculation process.

【0018】プログラム命令PP9:サブルーチンSU
B1の戻り番地を使用したエラー検出処理をするため、
先ほどセーブした汎用レジスタReg.0により、戻り
番地を参照する。
Program instruction PP9: Subroutine SU
To perform error detection processing using the return address of B1,
The general-purpose register Reg. 0 refers to the return address.

【0019】以上のように、2つのサブルーチン(プロ
グラム)をネスト的に実行する際に、第2番目のサブル
ーチンにおいて、メインルーチンに対する戻り番地を知
るためには、プログラム命令PP1,3,4,8,9を
シーケンスプログラム内に挿入しておかなければならな
い。また、メインプログラム上のサブルーチンの実行回
数が増える程その実行回数分だけプログラム命令PP1
は必要となる。
As described above, when two subroutines (programs) are executed in a nested manner, in order to know the return address to the main routine in the second subroutine, the program instructions PP1, 3, 4, 8 , 9 must be inserted in the sequence program. Also, as the number of executions of the subroutine on the main program increases, the number of program instructions PP1
Is required.

【0020】このため、従来装置では、サブルーチンの
実行エラー処理を検出する場合、シーケンスプログラム
の容量が増大するという不具合があった。
For this reason, the conventional apparatus has a problem that the capacity of the sequence program increases when detecting the execution error processing of the subroutine.

【0021】そこで、本発明の目的は、このような点に
鑑みて、シーケンスプログラムの容量を従来よりも短縮
し、かつ、サブルーチンの戻り番地を記憶しておくこと
ができるプログラマブルコントローラを提供することに
ある。
In view of the above, an object of the present invention is to provide a programmable controller capable of reducing the capacity of a sequence program as compared with the related art and storing a return address of a subroutine. It is in.

【0022】[0022]

【課題を解決するための手段】このような目的を達成す
るために、本発明は、サブルーチンの実行異常を検出す
る機能を有するプログラマブルコントローラにおいて、
前記実行異常の検出のためにサブルーチンの戻り先番地
を示す情報を専用的に記憶する記憶手段と、シーケンス
プログラムに記載された実行対象の第1プログラム命令
の種類内容を識別する識別手段と、サブルーチンの実行
を指示する第2プログラム命令であって、かつ、当該サ
ブルーチンの戻り先番地の記憶を指示する第2プログラ
ム命令を予め定め、前記実行対象の第1プログラム命令
が当該第2プログラム命令であると前記識別手段により
識別されたときは、当該第1プログラム命令の示すサブ
ルーチンに対する戻り先番地を前記記憶手段に書き込む
書き込み手段とを具えたことを特徴とする。
In order to achieve the above object, the present invention provides a programmable controller having a function of detecting a subroutine execution abnormality.
Storage means for exclusively storing information indicating the return address of the subroutine for detecting the execution abnormality; identification means for identifying the type and content of the first program instruction to be executed described in the sequence program; And a second program instruction instructing storage of a return address of the subroutine is determined in advance, and the first program instruction to be executed is the second program instruction. And writing means for writing the return address to the subroutine indicated by the first program instruction in the storage means when the identification means has been identified.

【0023】[0023]

【作用】本発明では、ユーザは新たに定義されたサブル
ーチン実行命令をシーケンスプログラムに記載しておく
だけで、シーケンスプログラムの実行時に書き込み手段
により自動的にサブルーチンの戻り先情報が記憶手段に
書き込まれる。
In the present invention, the user simply writes a newly defined subroutine execution instruction in the sequence program, and the return information of the subroutine is automatically written into the storage means by the writing means when the sequence program is executed. .

【0024】[0024]

【実施例】以下、図面を参照して本発明の実施例を詳細
に説明する。
Embodiments of the present invention will be described below in detail with reference to the drawings.

【0025】図1は本発明実施例の基本構成を示す。FIG. 1 shows a basic configuration of an embodiment of the present invention.

【0026】本実施例のプログラマブルコントローラは
サブルーチンの実行異常を検出する機能を有するプログ
ラマブルコントローラである。
The programmable controller according to the present embodiment is a programmable controller having a function of detecting a subroutine execution abnormality.

【0027】図1において、100は前記実行異常の検
出のためにサブルーチンの戻り先番地を示す情報を専用
的に記憶する記憶手段である。
In FIG. 1, reference numeral 100 denotes storage means for exclusively storing information indicating a return address of a subroutine for detecting the execution abnormality.

【0028】200はシーケンスプログラムに記載され
た実行対象の第1プログラム命令の種類内容を識別する
識別手段である。
Reference numeral 200 denotes identification means for identifying the type and content of the first program instruction to be executed described in the sequence program.

【0029】300はサブルーチンの実行を指示する第
2プログラム命令であって、かつ、当該サブルーチンの
戻り先番地の記憶を指示する第2プログラム命令を予め
定め、前記実行対象の第1プログラム命令が当該第2プ
ログラム命令であると前記識別手段により識別されたと
きは、当該第1プログラム命令の示すサブルーチンに対
する戻り先番地を前記記憶手段に書き込む書き込み手段
である。
Reference numeral 300 denotes a second program instruction for instructing execution of a subroutine, and a second program instruction for instructing storage of a return address of the subroutine is determined in advance. When the identification means identifies the instruction as the second program instruction, the writing means writes the return address to the subroutine indicated by the first program instruction in the storage means.

【0030】図2は本発明実施例におけるプログラマブ
ルコントローラの主要回路の構成を示す。
FIG. 2 shows a configuration of a main circuit of the programmable controller in the embodiment of the present invention.

【0031】図2において、CPU10およびユーザプ
ログラムメモリ20がバスに共通接続されている。
In FIG. 2, a CPU 10 and a user program memory 20 are commonly connected to a bus.

【0032】CPU10はシステムプログラムに従っ
て、ユーザプログラムメモリ20に格納されたシーケン
スプログラムをシーケンス命令単位で読出し、内部の演
算回路10−1によりシーケンス命令で規定されたシー
ケンス演算を実行する。
The CPU 10 reads the sequence program stored in the user program memory 20 in units of sequence instructions according to the system program, and executes a sequence operation specified by the sequence instructions by the internal arithmetic circuit 10-1.

【0033】読出しのシーケンス命令がサブルーチン命
令であるときは、従来同様そのサブルーチンの戻り先番
地がスタック領域10−2に記憶され、同時に、本発明
に関わる専用レジスタ領域10−3にもサブルーチンの
戻り先番地が記憶される。
When the read sequence instruction is a subroutine instruction, the return address of the subroutine is stored in the stack area 10-2 as in the prior art, and at the same time, the return of the subroutine is performed in the special register area 10-3 according to the present invention. The first address is stored.

【0034】専用レジスタ領域10−3が本発明の記憶
手段として動作する。
The dedicated register area 10-3 operates as the storage means of the present invention.

【0035】このような回路におけるシーケンスプログ
ラムの実行手順を図4を参照して説明する。
An execution procedure of a sequence program in such a circuit will be described with reference to FIG.

【0036】図4はCPU10の実行するシステム処理
手順を示し、CPU10内または外部のシステムプログ
ラムメモリに予め格納されている。
FIG. 4 shows a system processing procedure executed by the CPU 10, which is stored in the system program memory inside or outside the CPU 10 in advance.

【0037】また、実行対象のシーケンスプログラムに
は従来例と同一内容の図3のプログラムを用いるが、次
の点が従来のシーケンスプログラムと異なる。
The sequence program to be executed uses the program of FIG. 3 having the same contents as the conventional example, but differs from the conventional sequence program in the following points.

【0038】サブルーチンの戻り先番地の記憶を付加的
に指示するサブルーチン実行命令“CALLS+「サブ
ルーチン名」”を従来のサブルーチン実行命令“CAL
L+「サブルーチン名」”とは別個に定め、サブルーチ
ンの実行異常を検出したいときにはこの新サブルーチン
実行命令をシーケンスプログラムにおいて用いる。
A subroutine execution instruction "CALLS +" subroutine name "" additionally instructing storage of a return address of a subroutine is replaced with a conventional subroutine execution instruction "CAL
L + "subroutine name"", and this new subroutine execution instruction is used in a sequence program when it is desired to detect a subroutine execution abnormality.

【0039】このような図3のシーケンスプログラムを
実行するために、CPU10は、図4において、プログ
ラムカウンタの示す読出しアドレスをユーザプログラム
メモリ20の先頭アドレスに設定し、先頭のシーケンス
命令を読出す(ステップS10→S20)。
In order to execute the sequence program of FIG. 3, the CPU 10 sets the read address indicated by the program counter in FIG. 4 to the start address of the user program memory 20 and reads the start sequence instruction (FIG. 4). Step S10 → S20).

【0040】続いて、CPU10は読出したシーケンス
命令を、予め種類内容の判別している各種シーケンス命
令とコード比較する。この比較により、読出しのシーケ
ンス命令の中の“CALLS”を含むサブルーチン実行
命令を識別する(ステップS30)。このときのCPU
10が本発明の識別手段として動作する。
Subsequently, the CPU 10 compares the code of the read sequence command with various sequence commands whose type and contents are determined in advance. By this comparison, a subroutine execution instruction including "CALLS" in the read sequence instruction is identified (step S30). CPU at this time
10 operates as the identification means of the present invention.

【0041】図3のシーケンスプログラム例では先頭の
シーケンス命令はサブルーチン命令ではないので、CP
U10の実行手順はステップS30→S80の順序で進
み、従来同様そのシーケンス命令の指示する処理がCP
U10において実行される。次に、プログラムカウンタ
が更新されて次のシーケンス命令がユーザプログラムメ
モリ20から読出される(ステップS90→S70→S
20)。
In the example of the sequence program shown in FIG. 3, the first sequence instruction is not a subroutine instruction.
The execution procedure of U10 proceeds in the order of steps S30 → S80.
Executed in U10. Next, the program counter is updated and the next sequence instruction is read from the user program memory 20 (steps S90 → S70 → S
20).

【0042】このような処理を繰り返し実施し、図3の
シーケンスプログラムをシーケンス命令の記載順に実行
してゆくと、メインルーチン中のサブルーチン実行命令
“CALLS SUB1”がステップS30で検出され
る。
When such a process is repeatedly performed and the sequence program of FIG. 3 is executed in the order described in the sequence command, a subroutine execution command "CALLS SUB1" in the main routine is detected in step S30.

【0043】CPU10はプログラムカウンタの示す現
在の計数値に“1”を加えた値をサブルーチンの戻り先
番地としてスタック領域に書き込む(ステップS4
0)。このスタック領域10−2の戻り先番地情報はサ
ブルーチン実行後、実行手順をメインルーチンに復帰さ
せる際に用いられる。これら処理手順は周知のため詳細
な説明を省略する。
The CPU 10 writes a value obtained by adding "1" to the current count value indicated by the program counter in the stack area as a return address of the subroutine (step S4).
0). The return address information of the stack area 10-2 is used when the execution procedure is returned to the main routine after executing the subroutine. Since these processing procedures are well known, detailed description will be omitted.

【0044】次にCPU10は上記戻り先番地情報を専
用レジスタ領域のレジスタReg.0に格納する(ステ
ップS50)。このときのCPU10が本発明の書き込
み手段として動作する。次にCPU10はシーケンス命
令の示す識別名に基づきプログラムカウンタの計数値を
ユーザプログラムメモリ20上のサブルーチンSUB1
の先頭格納アドレスに設定してサブルーチンSUB1の
先頭のシーケンス命令を読出す(ステップS60→S7
0→S20)。
Next, the CPU 10 stores the return address information in the register Reg. 0 (step S50). At this time, the CPU 10 operates as the writing unit of the present invention. Next, the CPU 10 stores the count value of the program counter on the subroutine SUB1 in the user program memory 20 based on the identification name indicated by the sequence command.
And reads the first sequence instruction of subroutine SUB1 (step S60 → S7).
0 → S20).

【0045】以下、図3のサブルーチンプログラムSU
B1,SUB2はCPU10では従来同様の処理手順に
より演算実行される(ステップS30→S80→S90
→S70→S20のループ処理)。
The subroutine program SU shown in FIG.
B1 and SUB2 are calculated and executed by the CPU 10 according to the same processing procedure as before (steps S30 → S80 → S90).
→ loop processing of S70 → S20).

【0046】また、サブルーチンSUB2において、サ
ブルーチンSUB1の戻り番地を使用する処理を行う場
合は、CPU10は専用レジスタ領域10−3のレジス
タReg.0を読出し、参照する。
Further, in the subroutine SUB2, when performing processing using the return address of the subroutine SUB1, the CPU 10 operates the register Reg. Read 0 and refer to.

【0047】CPU10はこのような処理手順を順次に
実行し、ユーザプログラムメモリ20の全てのシーケン
ス命令を読出し実行すると、1回のシーケンス演算を終
了する(ステップS70)。
The CPU 10 sequentially executes such a processing procedure, and when all the sequence instructions are read and executed from the user program memory 20, one sequence operation is completed (step S70).

【0048】以上、説明したように、本実施例において
はユーザは戻り番地を記憶させたいサブルーチンについ
ては“CALLS”のサブルーチン実行命令を記載して
おくだけでよい。本実施例ではサブルーチンの実行エラ
ーの検出に際し、従来のように、スタック領域の戻り番
地を使用しないので、スタック領域の格納位置の移動に
伴う戻り番地の再格納処理も不要となる。
As described above, in this embodiment, the user only needs to describe the subroutine execution instruction of "CALLS" for the subroutine for which the return address is to be stored. In this embodiment, the return address of the stack area is not used to detect the execution error of the subroutine as in the related art, so that the process of restoring the return address accompanying the movement of the storage position of the stack area is not required.

【0049】本実施例の他に次にの例が挙げられる。The following examples are given in addition to the present embodiment.

【0050】1)本実施例では、サブルーチンの戻り番
地を専用レジスタに格納しているが、処理速度の遅延を
許せばCPU10内の汎用レジスタや外付きのメモリに
戻り番地を専用的に格納するようにしてもよい。
1) In this embodiment, the return address of the subroutine is stored in the dedicated register. However, if the processing speed is allowed to delay, the return address is stored exclusively in a general-purpose register in the CPU 10 or an external memory. You may do so.

【0051】2)本実施例ではソフトウェア(システム
プログラム)を実行するCPU10により識別手段を構
成しているが、シーケンス命令をユーザプログラムメモ
リ20から読出したときに、デコーダによりシーケンス
命令の内容を識別してもよい。
2) In this embodiment, the identification means is constituted by the CPU 10 executing software (system program). When the sequence instruction is read from the user program memory 20, the content of the sequence instruction is identified by the decoder. You may.

【0052】3)本実施例では新たなサブルーチン実行
命令“CALLS”をメインルーチンMAIN上におい
て用いる例を示したが、サブルーチン上においても用い
てもよく、この場合図5に示すように、サブルーチンの
分岐回数に対応させて戻り先番地を累積的にレジスタ領
域10−3に格納する。
3) In this embodiment, an example is shown in which a new subroutine execution instruction "CALLS" is used in the main routine MAIN. However, it may be used in a subroutine. In this case, as shown in FIG. The return address is stored in the register area 10-3 cumulatively in accordance with the number of branches.

【0053】[0053]

【発明の効果】以上、説明したように、本発明によれ
ば、サブルーチンの戻り番地を記憶する指示を付加した
サブルーチン実行命令を新たに定め、この命令を実行す
る手段を設けたので、従来のようにスタック領域の戻り
番地情報を用いる必要がなくなる。この結果、スタック
領域の情報の格納位置の移動に伴う戻り番地情報の再記
憶のための複数のプログラム処理命令をシーケンスプロ
グラムに記載する必要がなくなり、シーケンスプログラ
ムの容量を従来よりも縮小化することができる。さら
に、シーケンスプログラムの縮小に伴ってプログラムメ
モリを小型化でき、シーケンス演算時間も短縮すること
ができるという効果も得られる。
As described above, according to the present invention, a subroutine execution instruction to which an instruction to store a return address of a subroutine is added is newly determined, and means for executing this instruction is provided. Thus, it is not necessary to use the return address information of the stack area. As a result, it is not necessary to write a plurality of program processing instructions for restoring the return address information in accordance with the movement of the storage location of the information in the stack area in the sequence program, and the capacity of the sequence program can be reduced more than before. Can be. In addition, the program memory can be reduced in size with the reduction in the sequence program, and the effects of reducing the sequence calculation time can be obtained.

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

【図1】本発明実施例の基本構成を示すブロック図であ
る。
FIG. 1 is a block diagram showing a basic configuration of an embodiment of the present invention.

【図2】本発明実施例の回路構成を示すブロック図であ
る。
FIG. 2 is a block diagram showing a circuit configuration of an embodiment of the present invention.

【図3】本発明実施例のシーケンスプログラムの内容を
示すフローチャートである。
FIG. 3 is a flowchart showing the contents of a sequence program according to the embodiment of the present invention.

【図4】本発明実施例の動作手順を示すフローチャート
である。
FIG. 4 is a flowchart showing an operation procedure of the embodiment of the present invention.

【図5】本発明実施例のレジスタの格納例を示す説明図
である。
FIG. 5 is an explanatory diagram showing a storage example of a register according to the embodiment of the present invention.

【図6】従来例のシーケンスプログラムの内容を示すフ
ローチャートである。
FIG. 6 is a flowchart showing the contents of a sequence program in a conventional example.

【図7】従来例のスタック領域の格納内容を示す説明図
である。
FIG. 7 is an explanatory diagram showing storage contents of a stack area in a conventional example.

【図8】従来例のサブルーチン関連記憶情報の内容を示
す説明図である。
FIG. 8 is an explanatory diagram showing the contents of subroutine-related storage information of a conventional example.

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

10 CPU 10−1 演算回路 10−2 スタック領域 10−3 専用レジスタ領域 10 CPU 10-1 Arithmetic circuit 10-2 Stack area 10-3 Dedicated register area

Claims (1)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 サブルーチンの実行異常を検出する機能
を有するプログラマブルコントローラにおいて、前記実
行異常の検出のためにサブルーチンの戻り先番地を示す
情報を専用的に記憶する記憶手段と、シーケンスプログ
ラムに記載された実行対象の第1プログラム命令の種類
内容を識別する識別手段と、サブルーチンの実行を指示
する第2プログラム命令であって、かつ、当該サブルー
チンの戻り先番地の記憶を指示する第2プログラム命令
を予め定め、前記実行対象の第1プログラム命令が当該
第2プログラム命令であると前記識別手段により識別さ
れたときは、当該第1プログラム命令の示すサブルーチ
ンに対する戻り先番地を前記記憶手段に書き込む書き込
み手段とを具えたことを特徴とするプログラマブルコン
トローラ。
In a programmable controller having a function of detecting a subroutine execution error, a storage means for exclusively storing information indicating a return address of the subroutine for detecting the execution error, and a sequence program. Identification means for identifying the type and content of the first program instruction to be executed, and a second program instruction for instructing execution of a subroutine and for instructing storage of a return address of the subroutine. Writing means for writing, in the storage means, a return address to a subroutine indicated by the first program instruction when the identification means identifies the first program instruction to be executed as the second program instruction in advance And a programmable controller comprising:
JP40195190A 1990-12-13 1990-12-13 Programmable controller Expired - Fee Related JP2853774B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP40195190A JP2853774B2 (en) 1990-12-13 1990-12-13 Programmable controller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP40195190A JP2853774B2 (en) 1990-12-13 1990-12-13 Programmable controller

Publications (2)

Publication Number Publication Date
JPH04215106A JPH04215106A (en) 1992-08-05
JP2853774B2 true JP2853774B2 (en) 1999-02-03

Family

ID=18511768

Family Applications (1)

Application Number Title Priority Date Filing Date
JP40195190A Expired - Fee Related JP2853774B2 (en) 1990-12-13 1990-12-13 Programmable controller

Country Status (1)

Country Link
JP (1) JP2853774B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4760607B2 (en) * 2006-08-10 2011-08-31 株式会社明電舎 Programmable controller
CN105009006B (en) * 2013-03-06 2017-04-05 三菱电机株式会社 Programmable Logic Controller, programable controller system and execution error message generation method

Also Published As

Publication number Publication date
JPH04215106A (en) 1992-08-05

Similar Documents

Publication Publication Date Title
US7353500B2 (en) Suppressing execution of monitoring measurement program pointed to by inserted branch after threshold number of coverage to reduce instruction testing overhead
JPH02202642A (en) Device for supervising program action
US5963741A (en) Information processor which rewrites instructions in program to dynamically change program structure and method therefor
JP2853774B2 (en) Programmable controller
US6785883B1 (en) Software system for tracing data
CN116450398A (en) Exception backtracking method, device, equipment and medium
JP2010102454A (en) Information processing apparatus and information processing program
JP2000076095A (en) Device and method for tracing program and storage medium storing program therefor
JP3130798B2 (en) Bus transfer device
KR20080044652A (en) Method for debugging by using stack of cpu
JPH0581087A (en) Processor monitoring system
JP2754899B2 (en) Return address monitoring circuit of debug device
CN114880149A (en) Stack backtracking method and device, electronic equipment and computer readable storage medium
CN114296982A (en) Exception handling method and device of intelligent wearable device, equipment and storage medium
JPS5822765B2 (en) Program loading method in electronic computer system
JPS6240550A (en) Program debug device
CN117289965A (en) Expansion instruction updating method and device, electronic equipment and storage medium
JPH03208132A (en) Single chip microcomputer
JP2000057012A (en) Trace device
JPH064356A (en) Abnormal operation detecting system for software
JPH1139897A (en) Stored data inspection of digital memory means
JPH06139084A (en) Information processor
JPS6349943A (en) Arithmetic processing unit
JPS5977553A (en) Data gathering system
JPH06332508A (en) Programmable controller

Legal Events

Date Code Title Description
R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20071120

Year of fee payment: 9

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20081120

Year of fee payment: 10

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20091120

Year of fee payment: 11

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20091120

Year of fee payment: 11

FPAY Renewal fee payment (prs date is renewal date of database)

Year of fee payment: 12

Free format text: PAYMENT UNTIL: 20101120

LAPS Cancellation because of no payment of annual fees