JP2007299126A - Controller and program for controller - Google Patents
Controller and program for controller Download PDFInfo
- Publication number
- JP2007299126A JP2007299126A JP2006125203A JP2006125203A JP2007299126A JP 2007299126 A JP2007299126 A JP 2007299126A JP 2006125203 A JP2006125203 A JP 2006125203A JP 2006125203 A JP2006125203 A JP 2006125203A JP 2007299126 A JP2007299126 A JP 2007299126A
- Authority
- JP
- Japan
- Prior art keywords
- logging
- information
- log information
- storage
- unit
- 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
Links
Images
Landscapes
- Debugging And Monitoring (AREA)
Abstract
Description
この発明は、制御状況の記録であるログを取る機能を備えた制御装置に関するものであって、特に記憶領域を循環使用して情報を記憶する循環型記憶装置にログ情報を記憶する制御装置に関する。 The present invention relates to a control device having a function of taking a log that is a record of a control situation, and more particularly to a control device that stores log information in a circular storage device that stores information by using a storage area in a circulating manner. .
従来の循環型記憶装置(リングバッファー)にログを取る機能を備えた制御機器においては、プロトコルに関する制御を行うプロトコル制御部が検出した異常の種別に応じて割り込みを発生させるロギング停止割り込み発生手段と、ログ情報の収集を自動停止させる回線ロギング停止手段と、上記ロギング停止割込み発生手段による割り込みがあり、予めロギング機能の自動停止オプションが選択されている場合には、上記回線ロギング停止手段にロギング機能の停止を通知する割込み処理部とを備えたネットワーク通信の制御を行うシステムにおける回線ロギング自動停止制御方式がある(例えば特許文献1)。 In a control device having a function of logging to a conventional circular storage device (ring buffer), logging stop interrupt generating means for generating an interrupt according to the type of abnormality detected by the protocol control unit that performs control related to the protocol; If there is an interrupt by the line logging stop means for automatically stopping the collection of log information and the logging stop interrupt generating means, and the logging function automatic stop option is selected in advance, the logging function is added to the line logging stop means. There is a line logging automatic stop control method in a system that controls network communication including an interrupt processing unit that notifies the stop of the network (for example, Patent Document 1).
この構成によれば、プロトコル制御部が異常の種類に応じてロギング停止割込み発生手段を用いることにより、回線ロギング停止処理手段によって、ロギング機能の停止が行われる。従って、この時点における回線ログ情報が、エラー発生後に収集した新しいログ情報をリングバッファーに上書きするために失われることが無くなる。 According to this configuration, the logging function is stopped by the line logging stop processing unit when the protocol control unit uses the logging stop interrupt generating unit according to the type of abnormality. Therefore, the line log information at this point is not lost because new log information collected after the error occurs is overwritten in the ring buffer.
従来の回線ロギング自動停止制御方式では、プロトコルに関する制御を行うプロトコル制御部が検出した異常により、割込みを発生させて回線ロギングを自動停止させている。しかし、この方式は、プロトコル制御部が検出した異常が、ユーザが必要でない異常であってもロギングを停止させるので、本来ユーザに必要なログ情報をロギングできない問題点があった。すなわち、従来の方式は下位レベルプロトコルから発生する異常を無視し、上位レベルプロトコル制御の異常に基づきロギング停止している。この方式をプログラム実行に適用し、上位プログラムのからの異常に基づきロギング停止したのでは、プログラム検証時にユーザが意図しない上位プログラムの異常でロギングを停止するから、必要となる任意の関数プログラムに関するログ情報を取り出せない。 In the conventional line logging automatic stop control method, the line logging is automatically stopped by generating an interrupt due to an abnormality detected by the protocol control unit that controls the protocol. However, this method has a problem that the log information originally necessary for the user cannot be logged because the logging is stopped even if the abnormality detected by the protocol control unit is an abnormality that the user does not need. In other words, the conventional method ignores the abnormality generated from the lower level protocol and stops the logging based on the abnormality of the upper level protocol control. If this method is applied to program execution and logging is stopped based on an abnormality from a higher-level program, logging is stopped due to an abnormality in the higher-level program that is not intended by the user during program verification. Information cannot be retrieved.
この発明は、上記のような問題点を解決するためになされたものであり、循環型記憶装置に記憶された必要なログ情報に上書きすることなく、ユーザが必要なログ情報を確実にロギングすることを目的としている。 The present invention has been made to solve the above-described problems, and the necessary log information can be reliably logged by the user without overwriting the necessary log information stored in the circular storage device. The purpose is that.
この発明に係る制御装置においては、関数プログラムを含むプログラムを実行するプログラム実行手段、記憶領域を循環使用して情報を記憶する循環型記憶手段、プログラム実行手段のログ情報の記憶を停止する要因を設定した停止要因情報を記憶するロギング情報設定記憶手段、前記停止要因情報と前記関数プログラムの識別子及び戻り値又は前記ログ情報との一致を判断する出力情報監視手段、前記出力情報監視手段の判断結果によって前記ログ情報の記憶を停止するロギング停止命令を出力するロギング制御手段、及び前記循環型記憶手段に前記ログ情報を記憶させて前記ロギング停止命令を受けると前記ログ情報を記憶するのを停止させるロギング処理手段を設けたものである。 In the control device according to the present invention, program execution means for executing a program including a function program, circulation type storage means for storing information by cyclically using a storage area, and factors for stopping storage of log information by the program execution means Logging information setting storage means for storing the set stop factor information, output information monitoring means for determining the match between the stop factor information and the identifier and return value of the function program or the log information, the judgment result of the output information monitoring means Logging control means for outputting a logging stop command for stopping storage of the log information, and storing the log information in the circular storage means and stopping storing the log information upon receipt of the logging stop command Logging processing means is provided.
この発明によれば、循環型記憶装置にログ情報を記憶させる装置において、ユーザが設定したロギング停止要因情報でロギングを停止させることによって、ユーザが必要とする循環型記憶装置内のログ情報への上書を防ぐことができるので、ユーザは必要なログ情報を確実に取得することができる。 According to the present invention, in the device that stores the log information in the circular storage device, the logging to the log information in the circular storage device required by the user is stopped by stopping the logging with the logging stop factor information set by the user. Since overwriting can be prevented, the user can surely obtain necessary log information.
実施の形態1.
図1は、この発明を実施するための実施の形態1における制御装置を示すブロック図である。本実施の形態1の制御装置は、関数プログラムを含むプログラムを実行し、関数プログラムごとに当該関数プログラムの戻り値、及び記録すべきログ情報を出力するプログラム実行手段201、記憶領域を循環使用して情報を記憶する循環型記憶手段202、プログラム実行手段201のログ情報の記憶を停止する要因を設定したロギング停止要因となる停止要因情報が設定され、この停止要因情報を記憶するロギング情報設定記憶手段216、停止要因情報と関数プログラムの識別子及び戻り値又はログ情報との一致を判断する出力情報監視手段206、出力監視手段の判断結果によって前記ログ情報記憶を停止するロギング停止命令を出力するロギング制御手段207、及び循環型記憶手段にログ情報を記憶させてロギング停止命令を受けるとログ情報を記憶するのを停止させるロギング処理手段205が設けられている。
FIG. 1 is a block diagram showing a control device according to
また、プログラム実行手段201には、関数プログラムを実行する関数プログラム実行手段211が設けられている。ロギング情報設定記憶手段216は、ロギング停止要因情報が設定されるロギング停止要因情報設定手段203と、設定されたロギング停止要因情報を記憶するロギング停止要因情報記憶手段204とを備える。ロギング停止要因を制御装置以外で設定し、設定した停止要因情報が記憶されていれば機能するのでロギング情報記憶手段203だけで構成しても良い。
なお、ロギング処理手段205に、循環型記憶手段202のログ情報を不揮発性記憶手段209に記憶させるログ情報書き込み手段210を設けてもよい。ここで不揮発性記憶手段209は、不揮発性記憶装置104上に設けられた記憶手段である。
The program execution means 201 is provided with a function program execution means 211 for executing a function program. The logging information
The
ここで、プログラムとは、関数プログラム及びユーザプログラムを含む概念である。関数プログラムとは、他のプログラムから呼び出され、一の戻り値をそのプログラムに出力するプログラムである。また、ユーザプログラムとは、制御装置用のドライバ関数群、ライブラリ関数群を利用して制御装置のユーザが作成する制御用のプログラムである。
なお、ログとは、一般にコンピュータの利用状況やデータ通信の記録を取ること、またその記録。この記録には、操作やデータの送受信が行われた日時と、行われた操作の内容や送受信されたデータの中身などが含まれる。ログ情報とは、ログを計算機読み取り可能にした情報である。本実施の形態1においてログ情報の内容は、制御装置の利用状況、制御状況の記録である。また、ロギングとは、ログ情報を記録することである。
Here, the program is a concept including a function program and a user program. A function program is a program that is called from another program and outputs one return value to the program. The user program is a control program created by a user of the control device using a driver function group and a library function group for the control device.
The log generally refers to recording and recording of computer usage status and data communication. This record includes the date and time when the operation or data was transmitted / received, the contents of the operation performed, the contents of the transmitted / received data, and the like. The log information is information that enables the computer to read the log. In the first embodiment, the contents of the log information are records of the usage status and control status of the control device. Also, logging is recording log information.
図1において、プログラム実行手段201は、ログ情報を出力し、このログ情報を受けたロギング処理手段205が、循環型記憶手段202へログ情報を記憶させる。出力情報監視手段206は、ロギング情報設定記憶手段216によって設定、記憶された停止要因情報と、プログラム実行手段201からの停止要因情報と関数プログラムの識別子及び戻り値又はログ情報(出力情報)とを比較し、一致するとロギング制御手段207へ判断結果の情報を送る。ロギング制御手段207は、この情報を受けると、ロギング処理手段205へロギング停止命令を出力する。ロギング処理手段205は、このロギング停止命令を受けるとログ情報を新たに循環型記憶手段202へ記憶することを停止する。この構成によれば、ロギング情報設定記憶手段216において記憶される停止要因情報は、ユーザが所望する停止要因情報であるので、ユーザが所望した停止要因によって、循環型記憶手段202への記憶処理が停止される。
In FIG. 1, the
図2は、本実施の形態1の制御装置のハードウェアの構成図である。本実施の形態1の制御装置は、例えば、プログラマブルロジックコントローラ、各種機器のコントローラなどであって、ユーザ作成のプログラムを実行する機能を有する制御装置である。
キーボード、テンキー、カーソルキー、マウス、ジョイスティックなどの入力デバイスから情報を入力する入力部106と、情報を記憶する記憶部102と、この情報に基づき演算処理を行う中央演算処理装置101と、この演算処理結果を文字、画像などの表示情報として液晶ディスプレイ、CRTなどの出力デバイスおよび各種制御対象機器へ信号を出力する出力部107と、中央演算処理装置101でプログラムを実行時にログ情報を記憶する循環型記憶装置(リングバッファー)105とから構成される。なお、不揮発性記憶装置104にプログラム実行時の出力等を記憶するように構成しても良い。
FIG. 2 is a hardware configuration diagram of the control device according to the first embodiment. The control device according to the first embodiment is, for example, a programmable logic controller, a controller for various devices, and the like, and is a control device having a function of executing a user-created program.
An
制御装置で実行される演算を行う中央演算処理装置101は、中央演算処理装置101で用いられるプログラム、およびデータ(演算結果を含む)を一時的に記憶する主記憶装置102が密に結合されている。この主記憶装置102に記憶されるプログラム、およびデータは、不揮発性記憶装置104から読み出され、主記憶装置102に記憶された演算結果のデータの一部は、不揮発性記憶装置104へ記憶される。
主記憶装置102に記憶された演算結果のデータの中でログ情報に相当するデータは、記憶領域を循環使用して高速に記憶する循環型記憶装置105へ記憶される。この循環型記憶装置105は、記憶領域を循環使用する、いわゆるリングバッファーである。また、不揮発性記憶装置104に記憶されるプログラム、およびデータは、入力装置106によって入力され、出力装置107によって外部へ出力される。
A
The data corresponding to the log information among the calculation result data stored in the
また、不揮発性記憶装置104と循環型記憶装置105とは、SRAM(Static Random Access Memory)に構成することもできる。SRAMは、記憶保持のための動作を必要とせず、高速に動作することがでる。循環型記憶装置105は、このSRAMの記憶領域を循環使用するため、通常の記憶装置が行う記憶領域のオーバーフローの検知、およびその後のスワップ処理を行わないので、さらに高速に記憶動作を行える。
In addition, the
本実施の形態1の図1に示す循環型記憶手段202は、図2の循環型記憶装置105にて実行される。なお、ロギング停止要因情報記憶手段204および不揮発性記憶手段209は、不揮発性記憶装置104で実現される。また、プログラム実行手段201、関数プログラム実行手段211、ロギング停止要因情報設定手段203、出力情報監視手段206、ロギング処理手段205、ロギング制御手段207は、主記憶部102を利用して中央演算処理装置101で実行され、プログラム実行手段201の一部の処理は出力部に出力する。なお、ロギング停止要因情報設定手段203は、入力部106で入力される情報によって停止要因情報を設定する。
The circulation type storage means 202 shown in FIG. 1 of the first embodiment is executed by the circulation
以下各手段について説明する。
プログラム実行手段201は、関数プログラムを含むプログラムを実行し、プログラム実行手段201の関数プログラム実行手段211が出力する関数の戻り値及び当該関数の識別子を出力情報監視手段206に出力する。また、関数プログラム実行手段211が出力するログ情報をロギング処理手段205に出力する。
Each means will be described below.
The
循環型記憶手段202は、記憶領域を循環使用して、ロギング処理手段205が出力するログ情報を記憶する。また他の手段からの指示により記憶している情報を出力する。また、循環型記憶装置105をSRAM上に構築することにより、突然の電源遮断によるログ情報の喪失を防ぐことができる。
The circulation type storage unit 202 stores the log information output by the
ロギング情報設定記憶手段は、ロギング停止要因情報設定手段203及びロギング停止要因情報記憶手段204から構成される。ロギング停止要因情報設定手段203では、停止要因情報が入力装置106を用いて入力される。停止要因情報には、停止要因となる関数プログラムの識別子及び戻り値又はログ情報がある。またロギング停止要因情報記憶手段204は、停止要因情報を記憶し、出力情報監視手段206に停止要因情報を出力する。
The logging information setting storage unit includes a logging stop factor
出力情報監視手段206は、停止要因情報と関数プログラムの識別子及び戻り値又はログ情報との一致を判断し、判断結果をロギング制御手段207に出力する。一致したと判断したときにのみ結果をロギング制御手段207に出力することによって、その後の中央演算処理装置101の処理を削減することができる。
The output
ロギング制御手段207は、出力情報監視手段206の判断結果が、停止要因情報と関数プログラムの出力値とが一致することを示す場合、ログ情報の記憶を停止するロギング停止命令をロギング処理手段205に出力する。
When the determination result of the output
ロギング処理手段205は、プログラム実行手段201から出力されるログ情報を受けて、このログ情報を循環型記憶手段202に記憶させる。また、ロギング処理手段205は、ロギング制御手段207からロギング停止命令を受けるとログ情報記憶するのを停止する。なお、ロギング処理手段205に、次に示すログ情報書き込み手段210を設けることができる。
The
ログ情報書き込み手段210は、ロギング処理手段205に位置付けられ、循環型記憶手段202に記憶されたログ情報のIDとバイナリデータのログの内容情報とを文字列に変換し、ログファイルとして不揮発性記憶装置104に記憶する。
The log
図3は、図1のプログラム実行手段201を詳細化したブロック図、及び他の手段との関係を説明するための図である。プログラム実行手段201は、ユーザプログラム実行手段223、フック関数プログラム実行手段222及びドライバ関数プログラム実行手段221に詳細化したものである。
FIG. 3 is a detailed block diagram of the
ここで、ユーザプログラム実行手段223は、ユーザプログラムを実行する手段である。ドライバ関数プログラムとは、ユーザプログラム、またはフック関数プログラムから呼び出され、制御装置に固有の処理、および制御装置用のプログラムで共通して行われる処理を行うための関数プログラムである。ドライバ関数プログラム実行手段221は、このドライバ関数を実行する手段である。フック関数プログラムとは、ユーザプログラムから呼び出され、ログ情報を出力し、ドライバ関数プログラムを呼び出し、戻り値を出力する関数プログラムであり、通常プログラムのエラーの発生を検知し警告を発するプログラムである。フック関数プログラム実行手段222は、このフック関数プログラムを実行する手段である。フック関数プログラムは、通常ユーザにより作成される。 Here, the user program execution means 223 is a means for executing a user program. The driver function program is a function program that is called from a user program or a hook function program and performs processing unique to the control device and processing that is commonly performed by the control device program. The driver function program execution means 221 is a means for executing this driver function. A hook function program is a function program that is called from a user program, outputs log information, calls a driver function program, and outputs a return value, and is a program that detects the occurrence of an error in a normal program and issues a warning. The hook function program execution means 222 is a means for executing this hook function program. The hook function program is usually created by the user.
ユーザプログラム実行手段223が、フック関数プログラム実行手段222の1のフック関数プログラムの処理を実行すると、このフック関数プログラムの処理において呼び出されたドライバ関数プログラム実行手段221の1のドライバ関数の処理が実行され、このドライバ関数プログラムの処理の実行時に与えられた情報と実行結果の値(関数プログラムの戻り値)とを情報として出力情報監視手段206に出力する。また、フック関数プログラム実行手段222からフック関数プログラムの戻り値を出力情報監視手段206に出力するように構成しても良い。
When the user program execution means 223 executes the processing of one hook function program of the hook function program execution means 222, the processing of one driver function of the driver function program execution means 221 called in the processing of the hook function program is executed. Then, the information given at the time of executing the processing of the driver function program and the value of the execution result (return value of the function program) are output to the output information monitoring means 206 as information. Further, the hook function
ドライバ関数プログラム実行手段221の実行結果の値と戻り値の情報は、当該ドライバ関数プログラムを呼び出したユーザプログラム実行手段223、またはフック関数プログラム実行手段222へ出力される。 Information on the result of execution and return value of the driver function program execution means 221 is output to the user program execution means 223 that called the driver function program or the hook function program execution means 222.
図4は、出力情報監視手段206、ロギング制御手段207及びロギング処理手段205から構成される関数情報判断部215の処理フローを示すフローチャートである。関数情報判断部215は、図4に示すフローチャートの処理を行って、ログ情報を固定長のデータとして循環型記憶手段202に記憶させる。
FIG. 4 is a flowchart showing a processing flow of the function information determination unit 215 including the output
ここで、ログ情報は、ログの種類を示すIDと、ログの内容を示すログ内容情報とから構成される。ログ情報を32ビットのIDと、32ビットのバイナリデータのログ内容情報とにして固定長のデータとすることによって、循環型記憶装置105へ記憶するログ情報の量が減るので、ユーザプログラム実行手段223、フック関数プログラム実行手段222、ドライバ関数プログラム実行手段221に対してログ情報を取ることによるスピードの低下を抑制することができる。
Here, the log information is composed of an ID indicating the type of log and log content information indicating the content of the log. By making log information into 32-bit ID and log content information of 32-bit binary data and making it a fixed length data, the amount of log information stored in the
図4のステップ10は、ログ情報を記録するか否かを示すロギング停止フラグがONかOFFの判断を行い、OFFであればステップ11へ進み、ONであれば関数情報判断部215の処理を終了する。
ステップ11は、ドライバ関数プログラム実行手段221における処理の結果の値(関数の戻り値)が、ロギング停止要因情報記憶手段204に記憶されている複数のロギング停止要因情報のいずれか1つと一致する否かの判断を行い、一致した場合にステップ14へ進み、一致しなかった場合にステップ12へ進む。上記判断は、停止要因情報が関数プログラムの識別子と戻り値である場合には、この識別子及び戻り値が、上記ドライバ関数プログラム実行手段221の関数プログラムが識別子及び関数の戻り値と同じときに停止要因情報と一致したと判断する。
ステップ14は、ロギング停止フラグをONにしてステップ13へ進む。
In
In
ステップ12は、循環型記憶手段202がオーバーランを起こしているか否かを判断し、オーバーランを起こしている場合にはステップ15へ進み、オーバーランを起こしていない場合にはステップ13へ進む。ここで、オーバーランとは、記憶領域を循環使用する記憶手段において、記憶情報が多くなり循環した結果、記憶済みでどこにも転送していない有効な記憶領域に新たな情報を上書きして記憶することをいう。
ステップ15は、循環型記憶手段202に記憶されるオーバーランフラグをONにしてステップ13へ進む。
In
ステップ13は、32ビットのIDと32ビットのバイナリデータの内容情報とをログ情報として循環型記憶手段202に記憶させ、関数情報判断部215の処理を終了する。
In
図5は、ログ情報書き込み手段210の処理の流れを示すフローチャートである。図5のステップ16は、ロギング停止フラグがONになっているか否かの判断を行い、ロギング停止フラグがOFFであればステップ17へ進み、ONであればステップ20へ進む。
FIG. 5 is a flowchart showing a processing flow of the log
ステップ17は、循環型記憶手段202に記憶されているオーバーランフラグがONか否かの判断を行い、オーバーランフラグがONの場合にステップ21へ進み、オーバーランフラグがOFFの場合にステップ18へ進む。
ステップ21は、オーバーラン状態であることを示すオーバーランエラーを不揮発性記憶手段209にログファイルとして書き込み、ステップ22に進む。
ステップ18は、循環型記憶手段202に記憶された予め定めた量の32ビットのIDと32ビットのバイナリデータを文字列に変換した情報とをログファイルとして不揮発性記憶手段209に記憶させ、ステップ19へ進む。
なお、ステップ17、21は、オーバーラン信号をロギング制御手段207に送信し、ロギング制御手段207がロギング処理手段205にロギング停止命令を送ることでも実現できる。
In
ステップ19は、ロギング停止要因情報記憶手段204に設定された、記憶監視手段207の実行を停止するウェイト時間まで記憶監視手段207の実行を停止(ウェイト)し、ステップ16へ進む。ユーザプログラムを実行する間にドライバ関数プログラム実行手段221を実行する回数が多い程、ログ情報が発生して循環型記憶手段202のオーバーランが発生する可能性が高くなる。ロギング停止要因情報記憶手段204のウェイト時間を調節して最適値に設定する。
In
本実施の形態1によれば、ユーザが設定したロギング停止要因情報でロギングを停止させることによって、ユーザが必要とする循環型記憶装置内のログ情報への上書を防ぐことができるので、ユーザは必要なログ情報を確実に取得することができる。 According to the first embodiment, by stopping logging with the logging stop factor information set by the user, it is possible to prevent overwriting of log information in the circular storage device required by the user. Can reliably acquire necessary log information.
また、本実施の形態1によれば、記憶領域に循環してログ情報を書き込む装置において、ユーザが設定したロギング停止要因でロギング機能を停止させることにより、ユーザが必要とする循環型記憶手段202内のログ情報への上書を防ぐことができる。また、制御処理に対してロギングによる処理速度の低下を抑制することができる。 Further, according to the first embodiment, in the device that writes log information in a circulating manner to the storage area, the logging function is stopped by the logging stop factor set by the user, so that the circulating storage means 202 required by the user is obtained. You can prevent overwriting the log information inside. In addition, a decrease in processing speed due to logging can be suppressed with respect to the control processing.
なお、本実施の形態1によれば、ロギング停止要因情報記憶手段204に設定されたウェイト時間まで記憶監視手段207の実行を停止するので、記憶監視手段207の実行による処理速度の低下を抑制できる。
According to the first embodiment, since the execution of the
実施の形態2.
実施の形態1の制御装置は、ログファイルへの書き出しを停止するウェイト時間をユーザに設定された時間とした。本実施の形態2は、ログ情報判断部231を追加し、循環型記憶手段202のログ情報記憶量の増加率からウェイト時間を設定し、制御装置の状況に応じてログファイルの書き出しによる処理速度の低下をより抑制することを特徴とする。
The control apparatus according to the first embodiment sets the wait time for stopping writing to the log file as the time set by the user. In the second embodiment, a log information determination unit 231 is added, a wait time is set from the rate of increase of the log information storage amount of the circular storage means 202, and the processing speed by writing the log file according to the status of the control device It is characterized by further suppressing the decrease in the above.
図6は、実施の形態2の制御装置を示すブロック図である。図6の中で、プログラム実行手段201、循環型記憶手段202、出力情報監視手段206、ロギング制御手段207、ロギング処理手段205及びロギング停止要因情報記憶手段204は、実施の形態1と同様であるので、異なるログ情報判断部231について説明する。ログ情報判断部231は、循環型記憶手段202の状況を監視し、ログ情報を書き込みするタイミングをはかり、ログ情報書き込み手段210にログ情報を書き込みさせる。
FIG. 6 is a block diagram illustrating a control device according to the second embodiment. In FIG. 6, the program execution means 201, the circulation type storage means 202, the output information monitoring means 206, the logging control means 207, the logging processing means 205, and the logging stop factor information storage means 204 are the same as those in the first embodiment. Therefore, the different log information determination unit 231 will be described. The log information determination unit 231 monitors the state of the circulation type storage unit 202, measures the timing for writing the log information, and causes the log
ログ情報判断部231は、循環型記憶手段202の使用率を計算し、この使用率が制御装置毎に定められた所定の使用率(閾値)以上か否かの判断を行う。
循環型記憶手段202の使用率が上記所定の使用率以上の場合に、ログ情報書き込み手段210が循環型記憶手段202に記憶された32ビットのIDと、32ビットのバイナリデータのログ内容情報を変換した文字列とをログファイルとして不揮発性記憶手段209に記憶する。
また、ログ情報判断部231は、循環型記憶手段202に記憶されたログ情報の増加率から循環型記憶手段202の使用率が閾値以上になるウエイト時間を算出し、このウエイト時間だけ記憶監視手段207及びログ情報書き込み手段210の少なくともいずれか一方の実行を停止(ウエイト)する。
The log information determination unit 231 calculates the usage rate of the circulation type storage unit 202 and determines whether or not the usage rate is equal to or higher than a predetermined usage rate (threshold value) determined for each control device.
When the usage rate of the circulation type storage unit 202 is equal to or higher than the predetermined usage rate, the log
In addition, the log information determination unit 231 calculates a wait time when the usage rate of the circulation type storage unit 202 is equal to or greater than a threshold from the increase rate of the log information stored in the circulation type storage unit 202, and the storage monitoring unit only for this wait time. The execution of at least one of 207 and log information writing means 210 is stopped (waited).
ログ情報判断部231とログ情報書き込み手段210のOS上での優先度をユーザプログラム実行手段223の優先度より高くする。この優先度の設定によって、循環型記憶手段202に記憶されたログ情報の使用率を判断するログ情報判断部231と、ログ情報をログファイルへ書き込むログ情報書き込み手段210とが優先して処理されるため、循環型記憶手段202にログ情報が溜まり過ぎ、循環型記憶手段202がオーバーランを起こす確率が少なくなる。
The priority of the log information determination unit 231 and the log
さらに詳細には、ログ情報判断部231は、以下に示す使用率算出手段232と記憶領域監視手段233とを備える。 More specifically, the log information determination unit 231 includes a usage rate calculation unit 232 and a storage area monitoring unit 233 described below.
循環型記憶手段202を循環使用しない場合には、使用率算出手段232は、循環型記憶手段202の全記憶量に対する情報記憶した割合を非循環時使用率として求める。また記憶領域監視手段233は、上記非循環時使用率が所定の使用率を超えると全ログ情報の書き込み信号を出力する。ここで所定の使用率は、入力装置106により入力され、不揮発性記憶手段209又は主記憶装置102に記憶される値である。全ログ情報の書き込み信号は、循環型記憶手段202に記憶された全てのログ情報を不揮発性記憶手段209に書き込むことを指示する命令を表す信号である。
ロギング制御手段207は、全ログ情報の書き込み信号を受けると全ログ情報の書き込み命令をロギング処理手段205に送り、この命令を受け取ったロギング処理手段205は、ログ情報書き込み手段210に不揮発性記憶手段209へ全ログ情報を書き込ませる。
When the circulation type storage unit 202 is not used in a circulating manner, the usage rate calculation unit 232 obtains a ratio of information storage with respect to the total storage amount of the circulation type storage unit 202 as a non-circulation usage rate. The storage area monitoring unit 233 outputs a write signal for all log information when the non-circular usage rate exceeds a predetermined usage rate. Here, the predetermined usage rate is a value that is input from the
When the
循環型記憶手段202を循環使用する場合には、使用率算出手段232は、循環型記憶手段202の全記憶量に対するロギング停止命令が出力された後に循環型記憶手段202に記憶した割合を循環時使用率として求める。また記憶領域監視手段233は、上記循環時使用率が所定の使用率を超えると全ログ情報の書き込み信号をロギング制御手段207へ出力する。ロギング制御手段207は、全ログ情報の書き込み信号を受けると全ログ情報の書き込み命令をロギング処理手段205に送り、ロギング処理手段205は、ログ情報書き込み手段210に不揮発性記憶手段209へ全ログ情報を書き込ませる。
When the circulation type storage unit 202 is used cyclically, the usage rate calculation unit 232 outputs the ratio stored in the circulation type storage unit 202 after the logging stop command for the total storage amount of the circulation type storage unit 202 is output. Calculate as usage rate. The storage area monitoring unit 233 outputs a write signal for all log information to the
図7は、ログ情報判断部231とログ情報書き込み手段210とが行う処理のフローチャートである。ステップ24は、ログ情報判断部231及びログ情報書き込み手段210に関する制御装置内の処理の優先度をユーザプログラム実行手段223の優先度よりも高く設定する。また、ログ情報判断部231及びログ情報書き込み手段210の優先度をプログラム実行手段201より高く設定しても良い。
FIG. 7 is a flowchart of processing performed by the log information determination unit 231 and the log
ステップ16は、主記憶装置102に格納され、ログ情報の記憶の要否を示すロギング停止フラグがONになっているか否かの判断を行い、フラグがOFFであればステップ17へ進み、ONであればステップ20へ進む。なお、ロギング停止フラグの初期値は、通常ONとする。
ステップ17は、主記憶装置102に格納され、循環型記憶手段202のオーバーランの有無を示すオーバーランフラグがONか否かの判断を行い、オーバーランフラグがONの場合にステップ21へ進み、オーバーランフラグがOFFの場合にステップ25へ進む。なお、オーバーランフラグの初期値は、通常OFFとする。
ステップ25は、循環型記憶手段202の使用率が所定の使用率(閾値)以上か否かの判断を行い、使用率が所定の使用率(閾値)以上の場合には、ステップ18へ進み、使用率が所定の使用率(閾値)未満の場合には、ステップ26へ進む。循環型記憶手段202の使用率が所定の使用率(閾値)以上となった後に、ログ情報を不揮発性記憶手段209に記憶されるログファイルへ書き込むことによって、ログファイルへの書き込み回数が減り、プログラム処理手段201及び関数情報判断部215に対してログファイルへの書き込み処理によるスピード低下を抑制することができる。
ステップ18は、循環型記憶手段202に記憶された32ビットのIDと、32ビットのバイナリデータの内容情報を文字列に変換した文字列とをログファイルに書き込み、ステップ26へ進む。
In
ステップ26は、循環型記憶手段202に記憶されているログ情報の増加率の計算を行い、ステップ27へ進む。ここでログ情報の増加率とは、増加したログ情報量(ビット数)を単位時間で除した値である。
In
ステップ27は、ステップ26において計算した、循環型記憶手段202に記憶されたログ情報の増加率から、循環型記憶装置105の使用率が所定の使用率(閾値)以上となるウエイト時間を算出し、このウエイト時間だけウエイトした後、ステップ24へ進む。ここで、ウエイト時間は、(循環型記憶装置の全記憶容量×所定の使用率(閾値)/増加率)によって計算される。
ウエイト時間を適切な値に調節することによって、ログ情報書き込み手段210の無駄な書き込み処理を無くすことができる。上記ウェイト時間の調節によって、プログラム実行手段201及び関数情報判断部215に対して書き込み処理の頻度が高いことによるスピード低下を抑制することができる。
By adjusting the wait time to an appropriate value, useless writing processing of the log
ステップ20は、循環型記憶手段202が使用されているか否かの判断を行い、使用されている場合にステップ22へ進み、使用されていない場合にステップ26へ進む。
ステップ21は、循環型記憶装置105がオーバーラン状態であることを示すオーバーランエラーをログファイルに記憶させた後、ステップ22へ進む。
In
In
ステップ22は、循環型記憶手段202に記憶された32ビットのIDと32ビットのバイナリデータの内容情報から構成されたログ情報を全て文字列に変換して、変換結果をログファイルに記憶させ、ステップ26へ進み、循環型記憶装置105内のログ情報の増加率を計算し、使用率が所定の使用率以上になる時間までログ情報判断部231、ログ情報書き込み手段210の処理をウェイトする。
本実施の形態2によれば、循環型記憶手段202のログ情報記憶量の増加率からウェイト時間を設定し、このウェイト時間までログ情報を書き込むことを停止することによって、制御装置の状況に応じてログ情報を書き込むのを停止する時間を調整できるので、ログファイルへの書き出しによる処理速度の低下をより抑制することができる。 According to the second embodiment, the wait time is set based on the increase rate of the log information storage amount of the circulation type storage unit 202, and writing of log information is stopped until this wait time, so that the state of the control device is met. Since the time to stop writing log information can be adjusted, it is possible to further suppress the decrease in processing speed due to writing to the log file.
101 中央演算処理装置、102 主記憶装置、104 不揮発性記憶装置、105 循環型記憶装置、106 入力装置、107 出力装置、201 プログラム実行手段、202 循環型記憶手段、203 ロギング停止要因情報設定手段、204 ロギング停止要因情報記憶手段、205 ロギング処理手段、206 出力情報監視手段、207 ロギング制御手段、209 不揮発性記憶手段、210 ログ情報書き込み手段、211 関数プログラム実行手段、215 関数情報判断部、216 ロギング停止要因設定記憶手段、221 ドライバ関数プログラム実行手段、222 フック関数プログラム実行手段、223 ユーザプログラム実行手段、231 ログ情報判断部、232 使用率算出手段、233 記憶領域監視手段。
DESCRIPTION OF
Claims (8)
記憶領域を循環使用して情報を記憶する循環型記憶手段、
前記プログラム実行手段のログ情報の記憶を停止する要因を設定した停止要因情報を記憶するロギング情報設定記憶手段、
前記停止要因情報と前記関数プログラムの識別子及び戻り値又は前記ログ情報との一致を判断する出力情報監視手段、
前記出力情報監視手段の判断結果によって前記ログ情報の記憶を停止するロギング停止命令を出力するロギング制御手段、
及び前記循環記憶手段に前記ログ情報を記憶させて前記ロギング停止命令を受けると前記ログ情報を記憶するのを停止させるロギング処理手段を備えたことを特徴とする制御装置。 Program execution means for executing a program including a function program;
A circulation type storage means for storing information by cyclically using a storage area;
Logging information setting storage means for storing stop factor information in which a factor for stopping storage of log information of the program execution means is set;
Output information monitoring means for determining whether the stop factor information matches the identifier and return value of the function program or the log information;
Logging control means for outputting a logging stop command for stopping storage of the log information according to a judgment result of the output information monitoring means;
And a log processing means for storing the log information in the circular storage means and stopping storing the log information upon receipt of the logging stop command.
及び前記非循環時使用率が所定の使用率を超えると全ログ情報の書き込み信号を出力する記憶領域監視手段を備え、
ロギング制御手段は、前記全ログ情報の書き込み信号を受けると全ログ情報の書き込み命令をロギング処理手段に送ることを特徴とする請求項1に記載の制御装置。 When the circulation type storage means is not used cyclically, a usage rate calculation means for obtaining a ratio of storing the effective information of the circulation type storage means with respect to the total storage amount as a non-circulation usage rate,
And storage area monitoring means for outputting a write signal of all log information when the non-circular usage rate exceeds a predetermined usage rate,
2. The control device according to claim 1, wherein the logging control unit sends a command for writing all log information to the logging processing unit when receiving the write signal for all log information.
及び前記循環時使用率が所定の使用率を超えると全ログ情報の書き込み信号を出力する記憶領域監視手段を備え、
ロギング制御手段は、前記全ログ情報の書き込み信号を受けると全ログ情報の書き込み命令をロギング処理手段に送ることを特徴とする請求項1に記載の制御装置。 When the circulation type storage means is used cyclically, the usage rate calculation means for obtaining the ratio stored in the circulation type storage means after the logging stop command for the total storage amount is output as the usage rate during circulation,
And a storage area monitoring means for outputting a write signal for all log information when the circulating usage rate exceeds a predetermined usage rate,
2. The control device according to claim 1, wherein the logging control unit sends a command for writing all log information to the logging processing unit when receiving the write signal for all log information.
記憶領域を循環使用して情報を記憶する循環型記憶手段、
プログラム実行手段のログ情報の記憶を停止する要因を設定した停止要因情報を記憶するロギング情報設定記憶手段、
前記停止要因情報と前記関数プログラムの識別子及び戻り値又は前記ログ情報との一致を判断する出力情報監視手段、
前記出力情報監視手段の判断結果によって前記ログ情報の記憶を停止するロギング停止命令を出力するロギング制御手段、
及び前記循環記憶手段に前記ログ情報を記憶させて前記ロギング停止命令を受けると前記ログ情報を記憶するのを停止させるロギング処理手段として制御装置を機能させるための制御装置用プログラム。 Program execution means for executing a program including a function program;
A circulation type storage means for storing information by cyclically using a storage area;
Logging information setting storage means for storing stop factor information in which a factor for stopping storage of log information of the program execution means is set,
Output information monitoring means for determining whether the stop factor information matches the identifier and return value of the function program or the log information;
Logging control means for outputting a logging stop command for stopping storage of the log information according to a judgment result of the output information monitoring means;
And a program for a control device for causing the control device to function as a logging processing unit for storing the log information in the circular storage unit and stopping the storage of the log information when the logging stop command is received.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2006125203A JP2007299126A (en) | 2006-04-28 | 2006-04-28 | Controller and program for controller |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2006125203A JP2007299126A (en) | 2006-04-28 | 2006-04-28 | Controller and program for controller |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2007299126A true JP2007299126A (en) | 2007-11-15 |
Family
ID=38768576
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2006125203A Pending JP2007299126A (en) | 2006-04-28 | 2006-04-28 | Controller and program for controller |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2007299126A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2010147897A (en) * | 2008-12-19 | 2010-07-01 | Fuji Xerox Co Ltd | Image processing apparatus |
WO2013001607A1 (en) * | 2011-06-28 | 2013-01-03 | 富士通株式会社 | Information processing device, management program and management method |
JP2013171431A (en) * | 2012-02-21 | 2013-09-02 | Fujitsu Telecom Networks Ltd | Log recording device, method for recording log and recording medium |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS57123462A (en) * | 1981-01-26 | 1982-07-31 | Nec Corp | Working analyzing circuit of data processor |
JPS6359640A (en) * | 1986-08-30 | 1988-03-15 | Nec Corp | Log information file control system |
JPS63316148A (en) * | 1987-06-18 | 1988-12-23 | Fujitsu Ltd | History control system |
JPH03184135A (en) * | 1989-12-13 | 1991-08-12 | Nec Software Ltd | Data processor |
JPH07219807A (en) * | 1994-02-08 | 1995-08-18 | Toshiba Corp | Programmable controller system |
JP2004038313A (en) * | 2002-06-28 | 2004-02-05 | Canon Inc | Log acquisition method, program, and storage medium |
-
2006
- 2006-04-28 JP JP2006125203A patent/JP2007299126A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS57123462A (en) * | 1981-01-26 | 1982-07-31 | Nec Corp | Working analyzing circuit of data processor |
JPS6359640A (en) * | 1986-08-30 | 1988-03-15 | Nec Corp | Log information file control system |
JPS63316148A (en) * | 1987-06-18 | 1988-12-23 | Fujitsu Ltd | History control system |
JPH03184135A (en) * | 1989-12-13 | 1991-08-12 | Nec Software Ltd | Data processor |
JPH07219807A (en) * | 1994-02-08 | 1995-08-18 | Toshiba Corp | Programmable controller system |
JP2004038313A (en) * | 2002-06-28 | 2004-02-05 | Canon Inc | Log acquisition method, program, and storage medium |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2010147897A (en) * | 2008-12-19 | 2010-07-01 | Fuji Xerox Co Ltd | Image processing apparatus |
WO2013001607A1 (en) * | 2011-06-28 | 2013-01-03 | 富士通株式会社 | Information processing device, management program and management method |
JP2013171431A (en) * | 2012-02-21 | 2013-09-02 | Fujitsu Telecom Networks Ltd | Log recording device, method for recording log and recording medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112204524B (en) | Embedded scheduling of hardware resources for hardware acceleration | |
JP3810449B2 (en) | Queue device | |
US10540219B2 (en) | Reset and error handling in application specific integrated circuits | |
US20120144094A1 (en) | Data storage apparatus and method for controlling flash memory | |
KR101017296B1 (en) | Information processing apparatus, medium recording error notification program, and error notification method | |
US20100332914A1 (en) | Dump output control apparatus and dump output control method | |
JP2007299126A (en) | Controller and program for controller | |
JP2007164421A (en) | Parallel processors, parallel processing method and parallel processing program | |
EP3736683B1 (en) | Solid-state drive and performance optimization method for solid-state drive | |
JP2013008198A (en) | Image processor, image processing control method and image processing control program | |
CN113535441B (en) | Embedded system fault diagnosis device and method | |
JP3989493B2 (en) | Queue device | |
JP3769428B2 (en) | Information processing apparatus capable of holding floating interrupt and interrupt condition change instruction execution method | |
JP2007310735A (en) | Direct memory access controller | |
JP4839759B2 (en) | MEMORY ACCESS CONTROL METHOD AND METHOD, AND PROCESSOR DEVICE | |
CN114301927B (en) | Main node selection method, device and medium in distributed system | |
JP2006040063A (en) | Image processing device and smi processing method thereof | |
JPH09167117A (en) | Microcomputer and real time system using the microcomputer | |
JP2007172519A (en) | Information processor, link management method for software module, and program | |
JPH044630B2 (en) | ||
JP5331451B2 (en) | Microcontroller | |
KR101684933B1 (en) | File transmission blocking method and computing apparatus having file transmission block function | |
JP4535663B2 (en) | State machine control method and state machine | |
JP4969054B2 (en) | Information processing device | |
JP2848099B2 (en) | Multiple drive control method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20081212 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20101014 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20110719 |
|
A02 | Decision of refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A02 Effective date: 20111115 |