JPH05297933A - Execution time monitoring device for programmable controller - Google Patents

Execution time monitoring device for programmable controller

Info

Publication number
JPH05297933A
JPH05297933A JP4128087A JP12808792A JPH05297933A JP H05297933 A JPH05297933 A JP H05297933A JP 4128087 A JP4128087 A JP 4128087A JP 12808792 A JP12808792 A JP 12808792A JP H05297933 A JPH05297933 A JP H05297933A
Authority
JP
Japan
Prior art keywords
execution
control program
memory
priority
execution time
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
JP4128087A
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 JP4128087A priority Critical patent/JPH05297933A/en
Publication of JPH05297933A publication Critical patent/JPH05297933A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To early detect the program that discontinues the operation of a programmable controller PC by the delay of execution by providing an execution monitoring means which works periodically to monitor the execution time of a control program. CONSTITUTION:An identification code and a priority code under execution are written into a memory 5 pointed by a pointer 1 based on a control program before the start of execution of the program. Then, the control program monitoring periodically both the identification and priority codes reads the priority cods as well as a control program identification code under execution out of the memory 5 pointed by the pointer 1 and then adds (n) to a memory 4H and a memory 4L when priority code shows a higher order scan and a lower order scan respectively with the identification code used as an index. Thus, the execution time is stored in both memories 4H and 4L of a system memory within a single period of the control program set for each priority. In such a constitution, the control program that caused the delay of execution can be easily detected.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、プログラマブル・コン
トローラの実行時間監視方式に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an execution time monitoring system for a programmable controller.

【0002】[0002]

【従来の技術】近年、産業用設備の制御システムにおい
て、システムの高速化、高性能化が進み、プログラマブ
ル・コントローラ(以下、PCと呼ぶ)の制御内容も複
雑化してきた。このためPCによる制御プログラムは、
それぞれの制御対象に対応した応答時間毎に分割し、実
行されてきている。PCによる動作は、外部からの入力
データを入力部を通して取り込み、データ・メモリに記
憶し、制御プログラムに従って各種演算処理を行い、実
行中の制御プログラムの演算処理終了後、更新されたデ
ータ・メモリの内容を出力部を通して外部に出力する。
以上の動作シーケンスを1スキャンと呼び、複数の優先
順位に割り当てられた複数の制御プログラムは、優先順
位毎に予め定められたスキャン周期(実行周期と同じ意
味)で繰り返し実行される。各スキャンは、PC内部の
制御機構によりPC内部の中央処理装置(以下、CPU
と呼ぶ)に対する割り込みによって開始され、その割り
込みレベルの優先順位はより高速な応答を必要とするも
のほど高く設定されている。従って、上位スキャンは下
位スキャンに割り込んで実行される。当然のことながら
下位スキャンは、上位スキャンの実行中には割り込めず
待機状態となる。予め定められたスキャン周期で繰り返
し実行されるPCでは、繰り返し実行される下位スキャ
ンの実行に先立ち、一般に数100msecに設定され
ているハードウェア・タイマ(以後、ウォッチ・ドッグ
・タイマと呼ぶ)を起動し、制御プログラムの実行渋滞
を監視している。しかし、何らかの原因で一部の制御プ
ログラムで実行時間が延びたり、あるいは実行渋滞が発
生した場合、必ずしも原因となった制御プログラム内で
ウォッチ・ドッグ・タイマが動作する保証はない。図5
は下位スキャンの一部の制御プログラム内で実行渋滞が
発生した場合のウォッチ・ドッグ・タイマの動作状況を
示している。図4にもとづいてウォッチ・ドッグ・タイ
マが動作するまでの動作例を説明する。すなわち、下位
スキャンの実行に先立ち、ウォッチ・ドッグ・タイマを
起動し、下位スキャンに割り付けられている入力動作を
実行する(図5−)。引き続き下位スキャンの制御プ
ログラムP1、P2を実行するが制御プログラムP2実
行中に上位スキャンの実行要求が発生すると、下位スキ
ャンの制御プログラムP2の実行は中断され、上位スキ
ャンの実行に移る(図5−)。上位スキャンの実行が
終了すれば、実行制御は下位スキャンの制御プログラム
P2の中断した番地より再開される(図5−)。しか
し、制御プログラムP2内で何らかの原因(例えば、繰
り返し処理における条件判定の誤り、演算結果のオーバ
ーフローやアンダーフローなど)で実行渋滞が発生する
と、予め定められた下位スキャン実行周期に到達しても
同一優先順位のスキャン処理が終了していないため、ウ
ォッチ・ドッグ・タイマは再起動されずにカウント動作
を接続し(図5−)、引き続き下位スキャンの制御プ
ログラムP2が実行される。このとき前述した上位スキ
ャンの実行要求が発生すれば上位スキャンの実行に移る
(図5−)。上位スキャン実行中に図5−で起動し
たウォッチ・ドッグ・タイマが動作(カウントアップ)
するとPCは図5−で停止し、上位スキャン実行中に
実行渋滞が発生したことを記録することになる。
2. Description of the Related Art In recent years, in a control system for industrial equipment, the speed and performance of the system have advanced, and the control contents of a programmable controller (hereinafter referred to as PC) have become complicated. Therefore, the control program by PC is
It is executed by dividing it for each response time corresponding to each control target. The operation by the PC is to take in input data from the outside through the input section, store it in the data memory, perform various arithmetic processing according to the control program, and after the arithmetic processing of the control program being executed is completed, update the data memory. Output the contents to the outside through the output unit.
The above operation sequence is called one scan, and a plurality of control programs assigned to a plurality of priorities are repeatedly executed at a scan cycle (same meaning as an execution cycle) predetermined for each priority. Each scan is executed by a central processing unit (hereinafter, CPU) in the PC by a control mechanism in the PC.
Called), and the priority of the interrupt level is set higher for those requiring a faster response. Therefore, the upper scan is executed by interrupting the lower scan. As a matter of course, the lower scan cannot be interrupted during the execution of the upper scan and is in a standby state. In a PC that is repeatedly executed at a predetermined scan cycle, a hardware timer (hereinafter referred to as a watch dog timer) that is generally set to several 100 msec is started prior to the execution of the repeatedly executed lower scan. However, the control program is being monitored for congestion. However, if the execution time is extended or the execution congestion occurs in some control programs for some reason, there is no guarantee that the watch dog timer will operate in the control program that caused it. Figure 5
Shows the operation status of the watch dog timer when an execution congestion occurs in some control programs of the lower scan. An operation example until the watch dog timer operates will be described based on FIG. That is, prior to the execution of the lower scan, the watch dog timer is activated and the input operation assigned to the lower scan is executed (FIG. 5). Then, the lower scan control programs P1 and P2 are executed, but if an upper scan execution request is issued while the control program P2 is being executed, the execution of the lower scan control program P2 is interrupted and the upper scan is executed (FIG. ). When the execution of the upper scan is completed, the execution control is resumed from the interrupted address of the control program P2 of the lower scan (FIG. 5). However, if execution congestion occurs for some reason (for example, an error in condition determination in repeated processing, overflow or underflow of calculation results) in the control program P2, it is the same even if a predetermined lower scan execution cycle is reached. Since the priority scan processing is not completed, the watch dog timer connects the count operation without restarting (FIG. 5), and the lower scan control program P2 is subsequently executed. At this time, if the above-described request for execution of the upper scan is generated, execution of the upper scan is started (FIG. 5). The watch dog timer started in Figure 5 operates during the upper scan (counts up)
Then, the PC stops in FIG. 5 and records that the execution congestion has occurred during the execution of the upper scan.

【0003】[0003]

【発明が解決しようとする課題】このように、制御プロ
グラムの実行渋滞を監視しているウォッチ・ドッグ・タ
イマでは、必ずしも実行渋滞の原因となっている制御プ
ログラム内で停止するとは限らない。そのため、実行渋
滞の原因となっている制御プログラムを見つけだすまで
に多大な時間を費やし、PCを長時間停止することにな
り、制御対象に与える影響が大きい。
As described above, the watch dog timer that monitors the execution congestion of the control program does not always stop within the control program that causes the execution congestion. Therefore, it takes a lot of time to find the control program that causes the execution congestion, and the PC is stopped for a long time, which has a great influence on the control target.

【0004】[0004]

【課題を解決するための手段】この架台を解決するた
め、本発明のPCの実行時間監視装置は、分割された各
制御プログラムごとに実行時間を記憶する記憶手段と、
実行中の制御プログラムの識別コードを記憶する記憶手
段と、前記優先順位毎に設定された実行周期とは独立
に、分割された制御プログラムの実行時間を監視するた
めに定周期で動作する各制御プログラム実行時間監視手
段を設けたこと特徴とするものである。
In order to solve this gantry, a PC execution time monitoring device of the present invention comprises a storage means for storing an execution time for each divided control program.
Storage means for storing the identification code of the control program being executed, and each control that operates at a fixed cycle to monitor the execution time of the divided control program, independently of the execution cycle set for each priority. The program execution time monitoring means is provided.

【0005】[0005]

【作用】このような手段を用いることにより、PCが実
行渋滞で動作停止した場合、原因となる制御プログラム
を早期に発見することができるので、プログラム不良な
どによるPCの停止時間を短縮することが可能となる。
By using such means, it is possible to detect the control program that causes the error at an early stage when the operation of the PC is stopped due to traffic congestion. Therefore, it is possible to shorten the time for which the PC is stopped due to a defective program or the like. It will be possible.

【0006】[0006]

【実施例】以下、本発明の実施例について図を参照して
説明する。図1は、本発明の一実施例を示すブロック図
で、プログラマブル・コントローラ(PC)1は利用者
によって作成された制御プログラムを記憶しているプロ
グラム・メモリ1と、外部入出力機器との入出力データ
およびPCの動作中の各種データを記憶しているデータ
・メモリ2と、プログラム・メモリに記憶している内容
に従って実行する演算処理部3と、制御プログラムの実
行時間記憶部4および実行中の制御プログラムの識別コ
ード記憶部5を包含するシステム・メモリ6と、プログ
ラム入力装置9との通信を制御する通信制御部7と、外
部入出力機器とのインターフェースを行う入出力インタ
ーフェース部8とから構成されている。図2は、システ
ム・メモリ内に組み込まれた実行時間記憶部4(以下メ
モリ4と称す)の説明図で、制御プログラムの識別コー
ドにより優先順位別に配置し、制御プログラム毎の実行
時間を独立に記憶する。メモリ4Hは上位スキャン用、
メモリ4Lは下位スキャングループの実行時間記憶メモ
リを示す。例えば図2で+l1は、下位スキャンで実行
する識別コードがPid02の制御プログラムの実行時
間を記憶していることを示している。前記メモリ4H、
4Lは各優先順位の実行開始時に全ての領域が0にされ
1スキャン内での実行時間のみを記憶することにしてい
る。図3は実行中の制御プログラムの識別コードと実行
優先順位コードを記憶する識別コード記憶部5(以下メ
モリ5と称す)を示す。前記メモリ5への書き込み、読
み出しはポインタ1によって示された場所に対して行わ
れる。図3で、lvlo1は現在実行中の制御プログラ
ムの優先順位を示すデータで、例えば実行時間記憶部4
の優先順位別に配置されたメモリのベース・アドレスを
記憶する。Pid03は現在実行中の制御プログラムの
識別コードである。つぎに、本発明の実施例の動作を図
4のフローチャートで説明する。一般に分割された制御
プログラムは、CALL命令などによりメイン制御プロ
グラムから呼び出される。分割された制御プログラム
は、その実行開始に先立ち、その制御プログラムの識別
コードと実行中の優先順位コードを記憶するためシステ
ム・メモリ内のメモリ5(図3)示すポインタ1をディ
クリメントし(ステップー01)、ポインタ1が示すメ
モリ5に識別コードと実行中の優先順位コードを書き込
み、現在実行中の制御プログラムの識別コードと優先順
位コードを記憶し(ステップー02)、制御プログラム
を実行する(ステップー03)。制御プログラムの実行
が終了すると前記ポインタ1をインクリメントし(ステ
ップー04)、実行を呼出元に戻す(ステップー0
5)。つぎに、制御プログラムの実行に先立ちメモリ5
に記憶された識別コードと優先順位コードを定周期で監
視する制御プログラム実行時間監視の動作を説明する。
定周期の時間設定は、各優先順位に予め定められた実行
周期より十分短い値とする事が実行時間監視の精度から
望ましい。また、時間設定はシステム的に固定とするこ
とも可変とすることも可能である。ポインタ1が指して
いるメモリ5から実行中の制御プログラム識別コードと
優先順位コードを読み出す(ステップー10)。読み出
した優先順位コードを調べ(ステップー11)、優先順
位コードが上位スキャンであれば、読み出した識別コー
ドをインデックスとしたメモリ1H[識別コード]にn
を加算する(ステップ12)。ここでnは、実行時間監
視が動作する定周期の時間で、たとえば定周期の時間設
定が5msecであればn=5となる。読み出した優先
順位コードが下位スキャンであれば、読み出した識別コ
ードをインデックスとしたメモリ4L[識別コード]に
nを加算する(ステップ13)。以上のことから、シス
テム・メモリ内のメモリ4H、およびメモリ4Lには各
優先順位毎の制御プログラムの1スキャン内での実行時
間が記憶されることになり、制御プログラムに実行渋滞
が発生しPCが停止した場合、操作者はプログラム入力
装置7を操作することによって、制御プログラム実行時
間記憶領域メモリ4H、およびメモリ4Lの記憶内容を
調べることにより、実行渋滞の原因となった制御プログ
ラムを容易に知ることができる。
Embodiments of the present invention will be described below with reference to the drawings. FIG. 1 is a block diagram showing an embodiment of the present invention. A programmable controller (PC) 1 includes a program memory 1 storing a control program created by a user and an external input / output device. A data memory 2 that stores output data and various data during operation of the PC, an arithmetic processing unit 3 that executes according to the contents stored in the program memory, an execution time storage unit 4 of the control program, and a running program. From the system memory 6 including the identification code storage unit 5 of the control program, the communication control unit 7 that controls communication with the program input device 9, and the input / output interface unit 8 that interfaces with external input / output devices. It is configured. FIG. 2 is an explanatory diagram of the execution time storage unit 4 (hereinafter referred to as the memory 4) incorporated in the system memory, which is arranged by priority according to the identification code of the control program, and the execution time of each control program is independently set. Remember. Memory 4H is for upper scan,
The memory 4L is an execution time storage memory of the lower scan group. For example, +11 in FIG. 2 indicates that the identification code executed in the lower scan stores the execution time of the control program of Pid02. The memory 4H,
In 4L, all areas are set to 0 at the start of execution of each priority, and only the execution time within one scan is stored. FIG. 3 shows an identification code storage unit 5 (hereinafter referred to as memory 5) that stores the identification code and the execution priority code of the control program being executed. Writing to and reading from the memory 5 are performed at the location indicated by the pointer 1. In FIG. 3, lvlo1 is data indicating the priority order of the control program currently being executed, for example, the execution time storage unit 4
The base addresses of the memories arranged according to the priority order of are stored. Pid03 is an identification code of the control program currently being executed. Next, the operation of the embodiment of the present invention will be described with reference to the flowchart of FIG. Generally, the divided control program is called from the main control program by a CALL instruction or the like. The divided control program decrements the pointer 1 shown in the memory 5 (FIG. 3) in the system memory in order to store the identification code of the control program and the priority code being executed (prior to starting the execution). 01), the identification code and the priority code being executed are written in the memory 5 indicated by the pointer 1, the identification code and the priority code of the control program currently being executed are stored (step-02), and the control program is executed (step-). 03). When the execution of the control program is completed, the pointer 1 is incremented (step-04) and the execution is returned to the caller (step-0).
5). Next, before executing the control program, the memory 5
The operation of the control program execution time monitoring for monitoring the identification code and the priority code stored in (1) at regular intervals will be described.
It is desirable from the viewpoint of accuracy of execution time monitoring that the fixed cycle time is set to a value that is sufficiently shorter than the execution cycle predetermined for each priority. Further, the time setting can be fixed or variable systematically. The control program identification code and the priority code being executed are read from the memory 5 pointed to by the pointer 1 (step-10). The read priority code is checked (step-11). If the priority code is the upper scan, n is stored in the memory 1H [identification code] using the read identification code as an index.
Is added (step 12). Here, n is a fixed cycle time during which the execution time monitoring operates. For example, if the fixed cycle time setting is 5 msec, n = 5. If the read priority code is the lower scan, n is added to the memory 4L [identification code] using the read identification code as an index (step 13). From the above, the execution time within one scan of the control program for each priority is stored in the memory 4H and the memory 4L in the system memory, and the execution congestion occurs in the control program and the PC When the stop occurs, the operator operates the program input device 7 to check the stored contents of the control program execution time storage area memory 4H and the memory 4L to easily find the control program causing the execution congestion. I can know.

【0007】[0007]

【発明の効果】以上、述べたように、本発明によれば、
実行渋滞の原因となったプログラムを早期に発見でき、
PCの停止時間を大幅に短縮できる。
As described above, according to the present invention,
The program that caused the execution congestion can be found early,
The downtime of the PC can be greatly reduced.

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

【図1】本発明に従うプログラマブル・コントローラの
基本構成を示すブロック図。
FIG. 1 is a block diagram showing a basic configuration of a programmable controller according to the present invention.

【図2】実行時間を記憶するメモリの記憶態様を示す
図。
FIG. 2 is a diagram showing a storage mode of a memory that stores execution time.

【図3】識別コードを記憶するメモリの記憶態様を示す
図。
FIG. 3 is a diagram showing a storage mode of a memory that stores an identification code.

【図4】動作プログラムを説明するためのフローチャー
ト。
FIG. 4 is a flowchart for explaining an operation program.

【図5】従来技術での実行渋滞を説明する図。FIG. 5 is a diagram for explaining execution congestion in the related art.

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

1 プログラムメモリ 2 データメモリ 3 演算処理 4 実行時間記憶部 5 識別コード記憶部 6 システムメモリ 7 通信制御部 8 入出力インターフェイス 9 プログラム入力装置 1 Program Memory 2 Data Memory 3 Arithmetic Processing 4 Execution Time Storage 5 Identification Code Storage 6 System Memory 7 Communication Control 8 Input / Output Interface 9 Program Input Device

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】 優先順位と優先順位毎に任意に設定され
た実行周期とにより複数に分割された制御プログラムを
実行するプログラマブル・コントローラにおいて、分割
された各制御プログラムごとに実行時間を記憶する記憶
手段と、実行中の制御プログラムの識別コードを記憶す
る記憶手段と、前記優先順位毎に設定された実行周期と
は独立に、分割された各制御プログラムの実行時間を監
視するために定周期で動作する制御プログラム実行時間
監視手段とを設けたことを特徴とするプログラマブル・
コントローラ。
1. A programmable controller for executing a control program divided into a plurality of units according to a priority order and an execution cycle arbitrarily set for each priority order, and a memory for storing an execution time for each of the divided control programs. Means, a storage means for storing an identification code of the control program being executed, and an execution cycle set for each of the priorities, independently of the execution cycle, in a fixed cycle to monitor the execution time of each divided control program. A programmable program characterized by having a control program execution time monitoring means that operates.
controller.
JP4128087A 1992-04-20 1992-04-20 Execution time monitoring device for programmable controller Pending JPH05297933A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP4128087A JPH05297933A (en) 1992-04-20 1992-04-20 Execution time monitoring device for programmable controller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP4128087A JPH05297933A (en) 1992-04-20 1992-04-20 Execution time monitoring device for programmable controller

Publications (1)

Publication Number Publication Date
JPH05297933A true JPH05297933A (en) 1993-11-12

Family

ID=14976084

Family Applications (1)

Application Number Title Priority Date Filing Date
JP4128087A Pending JPH05297933A (en) 1992-04-20 1992-04-20 Execution time monitoring device for programmable controller

Country Status (1)

Country Link
JP (1) JPH05297933A (en)

Similar Documents

Publication Publication Date Title
JPS59205605A (en) Sequence controller
JPH02235156A (en) Information processor
US7168075B1 (en) Automation device and updating method
JP2004504667A (en) Method and apparatus for measuring the run time of a task in a real-time system
US9824229B2 (en) Controller with enhanced reliability
JP2544960B2 (en) Programmable controller
CN116679962A (en) Method, device, equipment and medium for updating firmware of basic input/output system
JPH05297933A (en) Execution time monitoring device for programmable controller
JPS63163932A (en) System monitoring system for control computer
CN111796571A (en) Equipment fault detection method and device, computer equipment and storage medium
JPH1069470A (en) Multiprocessor system
US6992644B1 (en) Peripheral device of a programmable controller and monitoring method of the peripheral device
JP2663540B2 (en) Programmable controller
JP3015793B1 (en) Programmable controller
JPH03147157A (en) Information processor
JPS6232510A (en) Abnormality diagnostic device for sequencer
EP0402483A1 (en) Control method for robot
JPH03105503A (en) Programmable controller
KR100426201B1 (en) A task imformation driving system of e.c.u
JPH1115701A (en) Method and system for collecting data
JP4527419B2 (en) Program trace method and trace processing system
JPS59205613A (en) Sequence monitor device
JPH0683652A (en) Microcomputer system
JPS62237558A (en) Initialization control system for shared memory
JP2002251299A (en) Program tracing device