JP2010026650A - Control device - Google Patents

Control device Download PDF

Info

Publication number
JP2010026650A
JP2010026650A JP2008185076A JP2008185076A JP2010026650A JP 2010026650 A JP2010026650 A JP 2010026650A JP 2008185076 A JP2008185076 A JP 2008185076A JP 2008185076 A JP2008185076 A JP 2008185076A JP 2010026650 A JP2010026650 A JP 2010026650A
Authority
JP
Japan
Prior art keywords
boot
program
read
boot program
overwriting
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
JP2008185076A
Other languages
Japanese (ja)
Inventor
Toru Otsuka
亨 大塚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP2008185076A priority Critical patent/JP2010026650A/en
Publication of JP2010026650A publication Critical patent/JP2010026650A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Stored Programmes (AREA)
  • Safety Devices In Control Systems (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To obtain a control device for preventing a situation where a system program cannot be booted due to an illegal change of data in a non-volatile memory. <P>SOLUTION: A control means which operates on the basis of a boot program is provided with: a first means for reading a first boot program from a system non-volatile memory, and for, when deciding the read first boot program is illegally changed, reading a second boot program from a backup non-volatile memory; and a second means for reading the second boot program from the backup non-volatile memory, and for, when deciding that the read second boot program is illegally changed, outputting an error. <P>COPYRIGHT: (C)2010,JPO&INPIT

Description

本発明は、不揮発性メモリにブートプログラムを記憶する制御装置に関する。   The present invention relates to a control device that stores a boot program in a nonvolatile memory.

従来、システムの起動データ記憶場所を不揮発性メモリとしている数値制御装置(以下、NC装置という)において、不揮発性メモリのウェハ製造過程で発生する結晶欠陥などにより、経時的に電荷が抜けることで不正にビット変化が発生した場合、該不揮発性メモリに記憶されたプログラムのデータが不正に変化し、システムが起動できない、あるいは起動したあとに正しい処理を実行できないという不具合が生じる。   Conventionally, in a numerical control device (hereinafter referred to as an NC device) where the startup data storage location of the system is a non-volatile memory, it is illegal due to the loss of charge over time due to crystal defects that occur during the wafer manufacturing process of the non-volatile memory. When a bit change occurs, the program data stored in the non-volatile memory changes illegally, resulting in a problem that the system cannot be started or that correct processing cannot be performed after starting.

不揮発性メモリのデータ復元方法としては、不揮発性メモリに記憶されたデータが本来意図するデータ値と異なった値になった場合、同じデータをバックアップ領域に記憶しておき、演算処理時に両者のデータ値を比較しデータの正当性を確認しながら動作する技術が開示されている(例えば、特許文献1参照)。   As a data restoration method of the nonvolatile memory, when the data stored in the nonvolatile memory is different from the originally intended data value, the same data is stored in the backup area, and both data are stored at the time of calculation processing. A technique that operates while comparing values and confirming the validity of data is disclosed (for example, see Patent Document 1).

また、不揮発性メモリに記憶されたデータの書き換えを行う際に、当該データの書き換えに先立って、書き換え対象データを複製したものをバックアップデータとして保存し、書き換え実施状況を示すフラグを用いることで、書き換えが行なわれたデータが正常に処理されたものか否かを判断し正当性を確認してから動作する方法が開示されている(例えば、特許文献2参照)。   Also, when rewriting data stored in the nonvolatile memory, prior to rewriting the data, a copy of the data to be rewritten is saved as backup data, and a flag indicating the rewrite execution status is used. A method is disclosed in which it is determined whether or not the data that has been rewritten has been processed normally and the validity is confirmed (see, for example, Patent Document 2).

特開2004−220580号公報JP 2004-220580 A 特開2007−328438号公報JP 2007-328438 A

しかしながら、上記特許文献1および2に示されるデータ復元方法は、システムに障害を及ぼすデータの変化が、システムによる不揮発性メモリ上へのデータ書き換え行為による誤作動やデータ書き換え中の電源遮断による書き換え処理異常の結果として捉えられていることから、不揮発性メモリ上で発生するユーザーパラメータなどシステム起動に影響しないデータ領域の破損に対する方策であり、システムが正常に起動することを前提とした処置であるため、ブートプログラムや該ブートプログラムによりブートされるシステムプログラムなどシステム起動に関係するデータが破損した場合の処置ができない、という問題があった。   However, in the data restoration methods disclosed in Patent Documents 1 and 2, the change in data that causes a failure in the system is caused by a malfunction due to a data rewrite action on the nonvolatile memory by the system or a rewrite process due to power interruption during data rewrite. Because it is captured as an abnormal result, it is a measure against data area corruption that does not affect system startup, such as user parameters that occur on non-volatile memory, and is based on the premise that the system starts up normally There is a problem that it is impossible to take measures when data related to system startup such as a boot program or a system program booted by the boot program is damaged.

本発明は、上記に鑑みてなされたものであって、不揮発性メモリのデータの不正な変化によりシステムプログラムがブートできなくなる事態が発生しにくい制御装置を得ることを目的とする。   The present invention has been made in view of the above, and an object of the present invention is to obtain a control device that is unlikely to cause a situation in which a system program cannot be booted due to an unauthorized change in data in a nonvolatile memory.

上述した課題を解決し、目的を達成するために、本発明は、初期化処理と、この初期化処理の実行後、システムプログラムの記憶先にジャンプするブート処理と、を含む第1のブートプログラムが記憶されるシステム用不揮発性メモリと、前記第1のブートプログラムと同一内容の第2のブートプログラムが記憶されるバックアップ用不揮発性メモリと、前記第1または第2のブートプログラムを読み出し、該読み出したブートプログラムに基づいて動作する制御手段と、を備え、前記制御手段は、前記システム用不揮発性メモリから第1のブートプログラムを読み出し、該読み出した第1のブートプログラムに対して誤り検出演算をすることによって前記読み出した第1のブートプログラムが不正に変化しているか否かを判定し、不正に変化していないと判定したとき、前記読み出した第1のブートプログラムを用いて前記初期化処理およびブート処理を行い、不正に変化していると判定したとき、前記バックアップ用不揮発性メモリから前記第2のブートプログラムを読み出す第1の手段と、前記バックアップ用不揮発性メモリから前記第2のブートプログラムを読み出した際、該読み出した第2のブートプログラムに対して誤り検出演算をすることによって前記読み出した第2のブートプログラムが不正に変化しているか否かを判定し、不正に変化していないと判定したとき、前記読み出した第2のブートプログラムを用いて前記初期化処理およびブート処理を行い、不正に変化していると判定したとき、エラーを出力する第2の手段と、を有することを特徴とする。   In order to solve the above-described problems and achieve the object, the present invention provides a first boot program including an initialization process and a boot process that jumps to a storage destination of a system program after the initialization process is executed. A system non-volatile memory in which is stored, a backup non-volatile memory in which a second boot program having the same contents as the first boot program is stored, and the first or second boot program are read, Control means for operating based on the read boot program, wherein the control means reads the first boot program from the system non-volatile memory, and performs error detection calculation on the read first boot program. To determine whether or not the read first boot program has been illegally changed. When it is determined that it has not been changed, the initialization process and the boot process are performed using the read first boot program. When the second boot program is read from the backup nonvolatile memory, the first means for reading the boot program is read out by performing an error detection operation on the read second boot program. It is determined whether or not the second boot program is illegally changed. When it is determined that the second boot program has not been illegally changed, the initialization process and the boot process are performed using the read second boot program, And a second means for outputting an error when it is determined that the change is illegal.

この発明によれば、不揮発性メモリのデータの不正な変化によりシステムプログラムがブートできなくなる事態が発生しにくい制御装置を得る、という効果を奏する。   According to the present invention, there is an effect of obtaining a control device that is less likely to cause a situation in which a system program cannot be booted due to an unauthorized change in data in a nonvolatile memory.

本発明は、ブートプログラムを不揮発性メモリに記憶する一般的な制御装置に適用できるものであるが、以下においては本発明をNC装置に適用した場合の実施の形態を図面に基づいて詳細に説明する。なお、この実施の形態によりこの発明が限定されるものではない。   The present invention can be applied to a general control device that stores a boot program in a nonvolatile memory. In the following, an embodiment when the present invention is applied to an NC device will be described in detail with reference to the drawings. To do. Note that the present invention is not limited to the embodiments.

実施の形態1.
図1は、本発明にかかるNC装置の実施の形態1の構成を示す図である。図1において、NC装置1は、HMI(Human Machine Interface)および工作機械を制御する制御手段であるCPU100と、ブートプログラムおよび該ブートプログラムにより起動される、OS、アプリケーションプログラムなど、NC装置1の動作を制御(以降、制御処理という)する基本プログラムであるシステムプログラムを含むデータを記憶する不揮発性メモリからなるフラッシュメモリであるシステム用ROM101と、バックアップとしてシステム用ROM101に記憶される前記するブートプログラムおよびシステムプログラムと同一のプログラムを記憶する不揮発性メモリからなるフラッシュメモリであるバックアップ用ROM102と、ユーザの各種パラメータを記憶する揮発性メモリからなるSRAMなどであるパラメータ格納用RAM103と、システムプログラムの展開と各種演算処理を行うワークメモリ104と、HMI用のモニター105と、工作機械上の各種I/Oと通信するためのI/Oインターフェース106と、これらのメモリ制御およびI/O制御をするためのASIC107とから構成される。
Embodiment 1 FIG.
FIG. 1 is a diagram showing a configuration of a first embodiment of an NC apparatus according to the present invention. In FIG. 1, an NC apparatus 1 is an operation of the NC apparatus 1 such as a CPU 100 which is a control means for controlling an HMI (Human Machine Interface) and a machine tool, a boot program, an OS, an application program, etc. that are started by the boot program. A system ROM 101 which is a flash memory composed of a non-volatile memory for storing data including a system program which is a basic program for controlling (hereinafter referred to as control processing), and the boot program stored in the system ROM 101 as a backup, and Consists of a backup ROM 102, which is a flash memory composed of a non-volatile memory that stores the same program as the system program, and a volatile memory that stores various user parameters. A parameter storage RAM 103 such as a RAM, a work memory 104 for performing system program development and various arithmetic processes, an HMI monitor 105, and an I / O interface 106 for communicating with various I / Os on a machine tool. And an ASIC 107 for performing memory control and I / O control.

なお、HMIの制御を、工作機械制御用CPU100とは別のHMI専用のCPUで実現するように構成してもよい。また、システム用ROM101とバックアップ用ROM102は、同一のチップ上で実現してもよいし、個別のチップとして基板上に実装し構成するようにしてもよい。さらに、バックアップ用ROM102は、バックアップ用領域として、バッテリーなどで常時バックアップされ、揮発性メモリで構成されるSRAMを用いたパラメータ格納用RAM103の一部を用いるようにしても良い。これらバックアップ用領域にいずれのデバイスを用いるかは、システムとしてのコスト、実装面積などを考慮して構成するようにすればよい。   The HMI control may be realized by a CPU dedicated to the HMI that is different from the machine tool control CPU 100. Further, the system ROM 101 and the backup ROM 102 may be realized on the same chip, or may be mounted on the substrate as individual chips. Further, the backup ROM 102 may use a part of the parameter storage RAM 103 using an SRAM that is always backed up by a battery or the like and is configured by a volatile memory as a backup area. Which device is used for the backup area may be configured in consideration of the cost of the system, the mounting area, and the like.

次に、システム用ROM101およびバックアップ用ROM102のメモリ構成を説明する。図2は、システム用ROM101およびバックアップ用ROM102のメモリ構成を説明する図である。図2において、システム用ROM101には、ブートプログラムを構成するブートデータ群200、該ブートデータ群200のチェックサム値201、システムプログラムを構成するシステムデータ群202および該システムデータ群202のチェックサム値203を記憶している。また、バックアップ用ROM102には、各データ群と同一のデータ群およびチェックサム値として、ブートデータ群207、チェックサム値208、システムデータ群209およびチェックサム値210を記憶している。   Next, the memory configurations of the system ROM 101 and the backup ROM 102 will be described. FIG. 2 is a diagram for explaining the memory configurations of the system ROM 101 and the backup ROM 102. In FIG. 2, a system ROM 101 includes a boot data group 200 constituting a boot program, a checksum value 201 of the boot data group 200, a system data group 202 constituting a system program, and a checksum value of the system data group 202. 203 is stored. The backup ROM 102 stores a boot data group 207, a checksum value 208, a system data group 209, and a checksum value 210 as the same data group and checksum value as each data group.

続いて、システム用ROM101およびバックアップ用ROM102に記憶されているブートデータ群200、207が構成するブートプログラムの主要な仕様を述べる。ブートプログラムは、CPU100に、自身および自身と同じROMに記憶されている自身に関するチェックサム値201、208をCPU100の内部レジスタに転送させ、該転送されたブートデータ群204についてチェックサム演算し、演算結果のチェックサム値206と転送されてきたチェックサム値205とを比較して誤り検出を行うブートデータチェック処理を行うよう、プログラムされている。すなわち、ブートプログラムは、不揮発性メモリに経時的に発生する電荷抜けによる不正なビット変化により、自身のデータにデータが不正に変化(以下、データ不正変化という)していないことを確認する。また、該ブートプログラムは、該ブートデータチェック処理の後、NC装置1の初期化処理を行い、該初期化処理の後、システムデータ群にCPU100の読み出し先をジャンプさせるブート処理を行うよう、プログラムされている。   Subsequently, main specifications of the boot program configured by the boot data groups 200 and 207 stored in the system ROM 101 and the backup ROM 102 will be described. The boot program causes the CPU 100 to transfer the checksum values 201 and 208 relating to itself and the memory stored in the same ROM as the CPU 100 to the internal register of the CPU 100, perform a checksum operation on the transferred boot data group 204, It is programmed to perform a boot data check process for detecting an error by comparing the resulting checksum value 206 with the transferred checksum value 205. In other words, the boot program confirms that the data has not been illegally changed in its own data (hereinafter referred to as illegal data change) due to an illegal bit change due to charge loss occurring over time in the nonvolatile memory. Further, the boot program performs initialization processing of the NC device 1 after the boot data check processing, and after the initialization processing, performs a boot processing for jumping the reading destination of the CPU 100 to the system data group. Has been.

さらに、該ブートプログラムは、第1の起動回数カウンタを用いてブート回数をカウントし、該ブート回数が所定の値に到達したか否かを判定する第1のカウント処理をブート処理直前に行い、該ブート回数が所定の回数に到達したとき、ブートデータ群207およびチェックサム値208でブートデータ群200およびチェックサム値201を上書きする第1の上書き処理を、ブート処理直前またはシステムの終了処理時のうちの予め設定されているタイミングで行うよう、プログラムされている。この上書き処理により、システム用ROMにおける電荷を再チャージし、システム用ROMにおける電荷抜けの発生を抑えることができる。ここで、第1の起動回数カウンタを設ける位置については特に限定しないが、例えばシステム用ROM101の各種データの記憶に使用されていない部分に設けるようにしてもよい。   Further, the boot program counts the number of boots using a first start count counter, and performs a first count process immediately before the boot process to determine whether the boot count has reached a predetermined value, When the number of boots reaches a predetermined number, the first overwriting process for overwriting the boot data group 200 and the checksum value 201 with the boot data group 207 and the checksum value 208 is performed immediately before the boot process or during the system termination process. Are programmed to be performed at a preset timing. By this overwriting process, the charge in the system ROM can be recharged, and the occurrence of charge loss in the system ROM can be suppressed. Here, the position where the first activation number counter is provided is not particularly limited. For example, the first activation number counter may be provided in a portion of the system ROM 101 that is not used for storing various data.

システム用ROM101およびバックアップ用ROM102に記憶されているシステムデータ群202、209が構成するシステムプログラムの主要な仕様を述べる。システムプログラムは、CPU100に、自身および自身と同じROMに記憶されている自身に関するチェックサム値203、210をワークメモリ104に転送させ、前記するブートプログラムと同様に、転送されたシステムデータ群211についてチェックサム演算し、演算結果のチェックサム値213と転送されてきたチェックサム値212とを比較して誤り検出を行うシステムデータチェック処理を行うよう、プログラムされている。該システムプログラムは、該システムデータチェック処理の後、制御処理を開始する。   The main specifications of the system program configured by the system data groups 202 and 209 stored in the system ROM 101 and the backup ROM 102 will be described. The system program causes the CPU 100 to transfer the checksum values 203 and 210 relating to itself and the memory stored in the same ROM as itself to the work memory 104, and the transferred system data group 211 in the same manner as the boot program described above. It is programmed to perform a checksum operation, and to perform a system data check process for detecting an error by comparing the checksum value 213 of the operation result with the transferred checksum value 212. The system program starts a control process after the system data check process.

さらに、該システムプログラムは、前記するブートプログラムと同様に、制御処理開始直後に、第2の起動回数カウンタを用いて制御処理開始回数をカウントし、該制御処理開始回数が所定の値に到達したか否かを判定する第2のカウント処理を行い、該制御処理開始回数が所定の回数に到達したとき、システムデータ群209およびチェックサム値210でシステムデータ群202およびチェックサム値203を上書きする第2の上書き処理を、該カウント処理の直後またはシステムの終了処理時のうちの予め設定されているタイミングで行うよう、プログラムされている。第2の起動回数カウンタを設ける位置については、前記する第1の起動回数カウンタと同様に、特に限定しない。   Further, like the boot program described above, the system program counts the number of control processing starts using the second activation number counter immediately after the start of the control processing, and the control processing start number reaches a predetermined value. A second count process is performed, and when the control process start count reaches a predetermined count, the system data group 202 and the checksum value 203 are overwritten with the system data group 209 and the checksum value 210. The second overwriting process is programmed to be performed at a preset timing immediately after the counting process or at the end of the system. The position where the second activation number counter is provided is not particularly limited as in the case of the first activation number counter described above.

次に、以上のように構成された本発明の実施の形態1のNC装置1の動作を説明する。最初に、動作の概略を説明する。図3は、NC装置1の動作の概略を説明するフローチャートである。   Next, the operation of the NC apparatus 1 according to the first embodiment of the present invention configured as described above will be described. First, an outline of the operation will be described. FIG. 3 is a flowchart for explaining an outline of the operation of the NC device 1.

図3において、電源投入後、CPU100は、システム用ROM101に記憶されているブートデータ群200またはバックアップ用ROM102に記憶されているブートデータ群207を読み出し、読み出したブートデータ群のブートプログラムに基づいて、読み出し元のブートデータ群についてチェックサム演算を実行し、データ不正変化があるか否かを確認するブートデータチェック処理を行う(ステップS301)。そして、CPU100は、データ不正変化がないことが確認されたブートデータ群のブートプログラムに基づいてNC装置1の初期化処理を行う(ステップS302)。この直後、CPU100は、ブートプログラムに基づいて、第1のカウント処理と、設定内容によっては第1の上書き処理と、を実行する。そして、CPU100は、ブートプログラムに基づいて、システムデータ群202にジャンプするブート処理を実行し、ブートプログラムからシステムプログラムに制御を移す(ステップS303)。   In FIG. 3, after the power is turned on, the CPU 100 reads the boot data group 200 stored in the system ROM 101 or the boot data group 207 stored in the backup ROM 102, and based on the boot program of the read boot data group. Then, a checksum operation is performed on the boot data group of the read source, and a boot data check process is performed to check whether there is an illegal data change (step S301). Then, the CPU 100 performs the initialization process of the NC device 1 based on the boot program of the boot data group that has been confirmed to have no unauthorized data change (step S302). Immediately after this, the CPU 100 executes a first counting process and a first overwriting process depending on the setting contents based on the boot program. Then, the CPU 100 executes boot processing for jumping to the system data group 202 based on the boot program, and transfers control from the boot program to the system program (step S303).

続いて、CPU100は、システムデータ群202またはシステムデータ群209を読み出し、読み出したシステムデータ群によるシステムプログラムに基づいて、読み出し元のシステムデータ群についてチェックサム演算を実行し、データ不正変化があるか否かを確認するシステムデータチェック処理を行う(ステップS304)。そして、CPU100は、データ不正変化がないことが確認されたシステムデータ群のシステムプログラムに基づいて、制御処理を実行開始する(ステップS305)。この直後、CPU100は、システムプログラムに基づいて、第2のカウント処理と、設定内容によっては第2の上書き処理と、を実行する。そして、NC装置1は、システム稼動状態となる(ステップS306)。   Subsequently, the CPU 100 reads the system data group 202 or the system data group 209, performs a checksum operation on the read-out system data group based on the system program based on the read system data group, and determines whether there is an illegal data change. A system data check process is performed to confirm whether or not (step S304). Then, the CPU 100 starts executing the control process based on the system program of the system data group that has been confirmed to have no unauthorized data change (step S305). Immediately after this, the CPU 100 executes a second counting process and a second overwriting process depending on the setting contents based on the system program. Then, the NC device 1 enters a system operating state (step S306).

次に、CPU100は、所定のタイミングで、制御処理の終了を開始する(ステップS307)。ここで、第1および第2の上書き処理を終了処理時に行う設定になっている場合、CPU100は、システム用ROM101に記憶されている該当データ群と該当チェックサム値とをバックアップ用ROM102に記憶されている該当データ群と該当チェックサム値とで上書きコピーする。そして、終了処理が終わると、電源off状態となる。   Next, the CPU 100 starts ending the control process at a predetermined timing (step S307). Here, when the first and second overwriting processes are set to be performed at the end process, the CPU 100 stores the corresponding data group and the corresponding checksum value stored in the system ROM 101 in the backup ROM 102. Overwrite copy with the corresponding data group and the corresponding checksum value. Then, when the termination process is finished, the power supply is turned off.

次に、図3に示したフローチャートの各動作ステップをさらに詳しく説明する。図4は、ステップS301〜303の動作を詳しく説明するフローチャートである。なお、以降の説明において、CPU100の各動作を制御するプログラムは、特に記述しない限りCPU100がその時点で読んでいるデータ群により構成されるプログラムであるとする。   Next, each operation step of the flowchart shown in FIG. 3 will be described in more detail. FIG. 4 is a flowchart for explaining in detail the operations of steps S301 to S303. In the following description, it is assumed that a program for controlling each operation of the CPU 100 is a program composed of a data group read by the CPU 100 at that time unless otherwise specified.

図4において、CPU100は、ASIC107の設定により、ブートデータ群200が記憶されている領域の先頭番地から該ブートデータ群200を読み出す。そして、CPU100は、ブートデータ群200およびチェックサム値201をCPU100の内部レジスタに転送する。そして、CPU100は、転送されたブートデータ群204についてチェックサム演算を行う(ステップS401)。そして、CPU100は、算出したチェックサム値206と内部レジスタに転送されたチェックサム値205とを比較し、一致するか否かを判定する(ステップS402)。   In FIG. 4, the CPU 100 reads the boot data group 200 from the head address of the area where the boot data group 200 is stored according to the setting of the ASIC 107. Then, the CPU 100 transfers the boot data group 200 and the checksum value 201 to the internal register of the CPU 100. Then, the CPU 100 performs a checksum operation on the transferred boot data group 204 (step S401). Then, the CPU 100 compares the calculated checksum value 206 with the checksum value 205 transferred to the internal register, and determines whether or not they match (step S402).

双方のチェックサム値が一致した場合(ステップS402、Yes)、ブートデータ群200は正常なデータである、すなわちデータ不正変化が起こっていないとし、CPU100はシステム用ROM101から転送されてきたブートデータ群204から成るブートプログラムに基づいて初期化処理を実行する(ステップS403)。双方のチェックサム値が一致しない場合(ステップS402、No)、ブートデータ群200は異常である、すなわちデータ不正変化が起こっているとし、CPU100の読み出し先がバックアップ用ROM102のブートデータ群207が記憶されている領域の先頭番地にジャンプし、CPU100は、ブートデータ群207およびチェックサム値208をCPU100の内部レジスタに転送し、転送されたブートデータ群204についてチェックサム演算を行う(ステップS404)。そして、CPU100は、算出したチェックサム値206と内部レジスタに転送されたチェックサム値205とを比較し、一致するか否かを判定する(ステップS405)。   If both checksum values match (Yes in step S402), the boot data group 200 is normal data, that is, no data illegal change has occurred, and the CPU 100 transfers the boot data group transferred from the system ROM 101. An initialization process is executed based on the boot program 204 (step S403). If both checksum values do not match (No in step S402), it is assumed that the boot data group 200 is abnormal, that is, an illegal data change has occurred, and the boot data group 207 of the backup ROM 102 stores the read destination of the CPU 100. The CPU 100 jumps to the head address of the stored area, and the CPU 100 transfers the boot data group 207 and the checksum value 208 to the internal register of the CPU 100, and performs a checksum operation on the transferred boot data group 204 (step S404). The CPU 100 compares the calculated checksum value 206 with the checksum value 205 transferred to the internal register, and determines whether or not they match (step S405).

双方のチェックサム値が一致した場合(ステップS405、Yes)、バックアップ用ROM102に記憶されているブートデータ群207は正常なデータであるとし、CPU100はバックアップ用ROM102から転送されてきたブートデータ群204から成るブートプログラムに基づいて初期化処理を実行する(ステップS403)。双方のチェックサム値が一致しない場合(ステップS405、No)、バックアップ用ROM102に記憶されているブートデータ群207も異常であるとし、CPU100は初期化処理およびブート処理を行わずに終了する(ステップS406)。このとき、モニター105にデータ値不正を示す表示を行い、ユーザに対する情報の開示を行う。   If both checksum values match (step S405, Yes), the boot data group 207 stored in the backup ROM 102 is assumed to be normal data, and the CPU 100 determines that the boot data group 204 transferred from the backup ROM 102 An initialization process is executed based on the boot program consisting of (step S403). If the two checksum values do not match (No in step S405), the boot data group 207 stored in the backup ROM 102 is also abnormal, and the CPU 100 ends without performing initialization processing and boot processing (step 405). S406). At this time, a display indicating that the data value is invalid is displayed on the monitor 105, and the information is disclosed to the user.

ステップS403においてブート処理が実行されたあと、第1のカウント処理に移行する。CPU100は、まず、第1の起動回数カウンタの値と予め設定されているブート処理の実行回数である第1の設定回数とが等しいか否か判定し(ステップS407)、第1の起動回数カウンタの値が第1の設定回数未満であるとき(ステップS407、No)、第1の起動回数カウンタの値をインクリメントし(ステップS411)、ブート処理を実行する(ステップS412)。   After the boot process is executed in step S403, the process proceeds to the first count process. First, the CPU 100 determines whether or not the value of the first activation number counter is equal to the preset first number of executions of the boot process (step S407), and the first activation number counter is determined. Is less than the first set number of times (step S407, No), the value of the first activation number counter is incremented (step S411) and the boot process is executed (step S412).

第1の起動回数カウンタの値が第1の設定回数と等しいとき(ステップS407、Yes)、CPU100は、第1の上書き処理を終了時に行う設定になっているか否かを判定し(ステップS408)、終了時に行う設定である場合(ステップS408、Yes)、第1の起動回数カウンタをクリアし(ステップS410)、ステップS412に移行する。終了時に上書き処理を行う設定になっていない場合(ステップS408、No)、CPU100は、バックアップ用ROM102に記憶されているブートデータ群207およびチェックサム値208でシステム用ROM101に記憶されているブートデータ群200およびチェックサム値201を上書きコピーし(ステップS409)、ステップS410に移行する。   When the value of the first activation number counter is equal to the first set number (step S407, Yes), the CPU 100 determines whether or not it is set to perform the first overwriting process at the end (step S408). If the setting is to be made at the end (step S408, Yes), the first activation number counter is cleared (step S410), and the process proceeds to step S412. When the setting is not made to perform the overwriting process at the end (No in step S408), the CPU 100 stores the boot data group 207 stored in the backup ROM 102 and the boot data stored in the system ROM 101 with the checksum value 208. The group 200 and the checksum value 201 are overwritten and copied (step S409), and the process proceeds to step S410.

次に、図2におけるステップS304およびステップS305に関する詳細な説明を行う。図5は、ステップS304およびステップS305の動作を詳しく説明するフローチャートである。   Next, a detailed description will be given regarding step S304 and step S305 in FIG. FIG. 5 is a flowchart for explaining in detail the operations of step S304 and step S305.

図5において、CPU100は、システム用ROM101のシステムデータ群202が記憶されている領域の先頭番地から読み出し、システムデータ群202およびチェックサム値203をASIC107経由でワークメモリ104に転送し、転送されたシステムデータ群211についてチェックサム演算を行う(ステップS501)。そして、CPU100は、算出したチェックサム値213と転送されたチェックサム値212とを比較し、一致するか否かを判定する(ステップS502)。   In FIG. 5, the CPU 100 reads from the start address of the area where the system data group 202 of the system ROM 101 is stored, and transfers the system data group 202 and the checksum value 203 to the work memory 104 via the ASIC 107. A checksum operation is performed on the system data group 211 (step S501). Then, the CPU 100 compares the calculated checksum value 213 with the transferred checksum value 212 and determines whether or not they match (step S502).

双方のチェックサム値が一致した場合(ステップS502、Yes)、システムデータ群202は正常なデータであるとし、CPU100はシステム用ROM101から転送されてきたシステムデータ群211から成るシステムプログラムに基づいて、制御処理を実行開始する(ステップS503)。双方のチェックサム値が一致しない場合(ステップS502、No)、システムデータ群202は異常であるとし、CPU100の読み出し先がバックアップ用ROM102のシステムデータ群209が記憶されている領域の先頭番地にジャンプし、CPU100は、バックアップ用ROM102に記憶されるシステムデータ群209およびチェックサム値210をASIC107経由でワークメモリ104に転送し、転送されたシステムデータ群211についてチェックサム演算を行う(ステップS504)。そして、CPU100は、算出したチェックサム値213と転送されたチェックサム値212とを比較し、一致するか否かを判定する(ステップS505)。   If both checksum values match (Yes in step S502), the system data group 202 is assumed to be normal data, and the CPU 100 is based on the system program consisting of the system data group 211 transferred from the system ROM 101. The control process starts to be executed (step S503). If the two checksum values do not match (No in step S502), it is determined that the system data group 202 is abnormal, and the CPU 100 jumps to the start address of the area where the system data group 209 of the backup ROM 102 is stored. Then, the CPU 100 transfers the system data group 209 and the checksum value 210 stored in the backup ROM 102 to the work memory 104 via the ASIC 107, and performs a checksum operation on the transferred system data group 211 (step S504). Then, the CPU 100 compares the calculated checksum value 213 with the transferred checksum value 212, and determines whether or not they match (step S505).

双方のチェックサム値が一致した場合(ステップS505、Yes)、バックアップ用ROM102に記憶されているシステムデータ群202は正常なデータであるとし、CPU100はバックアップ用ROM102から転送されてきたシステムデータ群211から成るシステムプログラムを実行する(ステップS503)。双方のチェックサム値が一致しない場合(ステップS505、No)、バックアップ用ROM102に記憶されているシステムデータ群209も異常であるとし、CPU100は処理を終了する(ステップS506)。このとき、モニター105にデータ値不正を示す表示を行い、ユーザに対する情報の開示を行う。   If both checksum values match (step S505, Yes), the system data group 202 stored in the backup ROM 102 is assumed to be normal data, and the CPU 100 transfers the system data group 211 transferred from the backup ROM 102. The system program consisting of is executed (step S503). If the two checksum values do not match (No in step S505), the system data group 209 stored in the backup ROM 102 is also abnormal, and the CPU 100 ends the process (step S506). At this time, a display indicating that the data value is invalid is displayed on the monitor 105, and the information is disclosed to the user.

ステップS503において制御処理が実行開始されたあと、第2のカウント処理に移行する。CPU100は、まず、第2の起動回数カウンタの値と予め設定されている制御処理開始回数である第2の設定回数とを比較して等しいか否かを判定し(ステップS507)、第2の起動回数カウンタの値が第2の設定回数未満であるとき(ステップS507、No)、第2の起動回数カウンタの値をインクリメントし(ステップS511)、システムが起動状態に移行する。   After the control process is started in step S503, the process proceeds to the second count process. The CPU 100 first compares the value of the second activation number counter with a second set number of times that is a preset number of control processing starts to determine whether or not they are equal to each other (step S507). When the value of the activation number counter is less than the second set number (step S507, No), the value of the second activation number counter is incremented (step S511), and the system shifts to the activation state.

第2の起動回数カウンタの値が第2の設定回数と等しいとき(ステップS507、Yes)、CPU100は、第2の上書き処理を終了処理時に行う設定になっているか否かを判定し(ステップS508)、終了処理時に行う設定である場合(ステップS508、Yes)、第2の起動回数カウンタをクリアし(ステップS510)、システムが起動状態に移行する。終了処理時に上書き処理を行う設定になっていない場合(ステップS508、No)、CPU100は、バックアップ用ROM102に記憶されているシステムデータ群209およびチェックサム値210でシステム用ROM101に記憶されているシステムデータ群202およびチェックサム値203を上書きコピーし(ステップS509)、ステップS510に移行する。   When the value of the second activation number counter is equal to the second set number (step S507, Yes), the CPU 100 determines whether or not the second overwriting process is set to be performed at the end process (step S508). ), If the setting is to be made during the termination process (step S508, Yes), the second activation number counter is cleared (step S510), and the system shifts to the activation state. When the setting is not made to perform the overwriting process at the time of the end process (step S508, No), the CPU 100 stores the system data 209 stored in the backup ROM 102 and the checksum value 210 stored in the system ROM 101. The data group 202 and the checksum value 203 are overwritten and copied (step S509), and the process proceeds to step S510.

ここで、第1および第2の上書き処理は、該当するデータを複数に分割し、一回の電源onから電源offまでの動作で分割された一部のみ上書き処理し、分割された数だけ電源onから電源offまでの動作が行われることによって該当するデータ群が完全に上書きされるようにしてもよい。   Here, in the first and second overwriting processes, the corresponding data is divided into a plurality of parts, and only a part divided by the operation from one power-on to the power-off is overwritten. The corresponding data group may be completely overwritten by performing the operation from on to power-off.

次に、図2におけるステップS307の動作を詳しく説明する。図6はステップS307の動作を詳しく説明するフローチャートである。ステップS307の動作の説明においては、m回の電源on〜電源offの動作で完全に上書きが完了するように設定されており、第1および第2の設定回数が同値に設定されており、NC装置1のシステムが稼動状態になっている時点で第1の起動回数カウンタの値と第2の起動回数カウンタの値とが同じ値をとる設定となっていることとして説明する。すなわち、第1の上書き処理と第2と上書き処理とを同時に実行するとしている。なお、図6に示す動作は、システムプログラムに基づいて行われる。   Next, the operation of step S307 in FIG. 2 will be described in detail. FIG. 6 is a flowchart for explaining in detail the operation of step S307. In the description of the operation in step S307, it is set so that the overwriting is completely completed by m times of power-on to power-off operation, the first and second set times are set to the same value, and NC It is assumed that the first activation number counter value and the second activation number counter value are set to have the same value when the system of the apparatus 1 is in an operating state. That is, the first overwriting process, the second overwriting process, and the overwriting process are executed simultaneously. The operation shown in FIG. 6 is performed based on the system program.

図6において、終了処理が開始されると、CPU100は、工作機械を正常に終了させるためのパラメータ退避など各種終了処理であるNC終了処理を実行する(ステップS601)。そして、CPU100は、終了処理時に第1または第2の上書き処理を実行する設定になっているか否かを判定し(ステップS602)、終了処理時に上書き処理する設定になっていない場合(ステップS602、No)、上書きコピーを行うことなく電源offとなる。終了時に上書き処理する設定になっている場合(ステップS602、Yes)、ステップS603に移行する。   In FIG. 6, when the termination process is started, the CPU 100 executes NC termination processes that are various termination processes such as parameter saving for normally terminating the machine tool (step S <b> 601). Then, the CPU 100 determines whether or not it is set to execute the first or second overwriting process at the end process (step S602), and when it is not set to perform the overwriting process at the end process (step S602, No), the power is turned off without overwriting copying. If the setting is such that overwriting is performed at the end (step S602, Yes), the process proceeds to step S603.

図7は、不揮発性メモリ上のデータ分割、分割サイズ、および書き換え回数カウンタレジスタを説明する図である。図7において、m個に分割される場合、700に示すように、領域がm等分されている。分割数mは、分割サイズレジスタ701に保持されるようにしておく。また、各上書きコピー処理時に分割されたシステム用ROM101のどの領域を上書きコピーするかを算出するために、書き換え回数カウンタレジスタ702を設ける。分割サイズレジスタ701および書き換え回数カウンタレジスタ702を設ける場所は特に限定しないが、たとえば前記する第1および第2の起動回数カウンタと同様に、システム用ROM101の使用されていない部分に設けるようにしてよい。書き換え回数カウンタレジスタ702の値をi(初期値はi=m)ということとする。システム用ROM101に第1および第2の起動回数カウンタ、分割サイズレジスタ701、および書き換え回数カウンタレジスタ702を設ける場合、値を以降に引き継ぐために、これらが設けられている領域は上書き処理しないようにする。   FIG. 7 is a diagram for explaining the data division, division size, and rewrite count counter register on the nonvolatile memory. In FIG. 7, when divided into m, as indicated by 700, the area is equally divided into m. The division number m is held in the division size register 701 in advance. In addition, a rewrite count counter register 702 is provided to calculate which area of the system ROM 101 divided during each overwrite copy process is to be overwritten. The location where the division size register 701 and the rewrite count counter register 702 are provided is not particularly limited. For example, like the first and second activation count counters described above, the division size register 701 and the rewrite count counter register 702 may be provided in an unused portion of the system ROM 101. . The value of the rewrite count counter register 702 is i (initial value is i = m). When the system ROM 101 is provided with the first and second activation number counters, the division size register 701, and the rewrite number counter register 702, the area in which these are provided is not overwritten in order to carry over the values thereafter. To do.

図6に戻り、終了時に上書き処理する設定になっている場合(ステップS602、Yes)、CPU100は、第1または第2の起動回数カウンタの値からmを引いた値が0以上か否かを判定する(ステップS603)。第1または第2の起動回数カウンタの値からmを引いた値が0以上である場合(ステップS603、Yes)、CPU100は上書きコピーを行うことなくシステム終了となる。第1または第2の起動回数カウンタの値からmを引いた値が0以上ではない場合(ステップS603、No)、CPU100は、書き換え回数カウンタレジスタ702の値iが0を超えるか否かをさらに判定する(ステップS604)。nが0を超えない場合(ステップS604、No)、CPU100は書き換え回数カウンタレジスタ702の値iを初期値のmとし、上書き処理を行うことなくシステム終了となる。   Returning to FIG. 6, when it is set to perform overwriting processing at the end (step S <b> 602, Yes), the CPU 100 determines whether or not the value obtained by subtracting m from the value of the first or second activation number counter is 0 or more. Determination is made (step S603). When the value obtained by subtracting m from the value of the first or second activation number counter is 0 or more (step S603, Yes), the CPU 100 terminates the system without performing overwriting copy. When the value obtained by subtracting m from the value of the first or second activation number counter is not 0 or more (step S603, No), the CPU 100 further determines whether or not the value i of the rewrite number counter register 702 exceeds 0. Determination is made (step S604). If n does not exceed 0 (No in step S604), the CPU 100 sets the value i of the rewrite count counter register 702 to the initial value m, and the system ends without performing overwriting.

iが0を超える場合(ステップS604、Yes)、CPU100はシステム用ROM101のベースアドレスからm−i分だけオフセットされた番地のm等分されたデータを上書きコピー対象とし、該当する部分のデータをバックアップ用ROM102から読み出してシステム用ROM101に上書きコピーする(ステップS606)。例えばi=mの場合、分割サイズレジスタ701で設定されたm等分設定により、システム用ROM101においてm等分に分割された領域のベースアドレスから1つ目の領域のデータが上書きコピーされることにより、システム用ROM101に再度電荷チャージが実行される。そして、CPU100は、書き換え回数カウンタレジスタ702の値iをデクリメントし(ステップS607)、システム終了となる。   When i exceeds 0 (step S604, Yes), the CPU 100 sets the data equally divided at the address offset by m−i from the base address of the system ROM 101 as an overwriting copy target, and stores the corresponding portion of data. The data is read from the backup ROM 102 and overwritten and copied to the system ROM 101 (step S606). For example, when i = m, the data in the first area is overwritten and copied from the base address of the area divided into m equal parts in the system ROM 101 by the m equal setting set in the division size register 701. As a result, the system ROM 101 is charged again. Then, the CPU 100 decrements the value i of the rewrite count counter register 702 (step S607), and the system ends.

上書きの動作は、書き換え回数カウンタレジスタの値が0になるまで繰り返されることで、m等分されたシステム用ROM101領域のデータをm回の終了処理で上書きを実施することができる。ただし、この上書き回数設定は、一回の終了処理時間に影響の出ない程度に任意に設定するものとし、特に終了処理時間に規定が無い場合には、分割サイズレジスタ701および書き換え回数カウンタレジスタ702を1に設定することにより一回の終了処理で上書き処理を完了させることができる。   The overwriting operation is repeated until the value of the rewrite count counter register becomes 0, so that the data in the system ROM 101 area divided in m can be overwritten by m completion processes. However, this overwriting count setting is arbitrarily set to such an extent that it does not affect the end processing time of one time, and when there is no specific end processing time, the division size register 701 and the rewrite count counter register 702 are set. By setting 1 to 1, the overwriting process can be completed in a single end process.

ところで、以上の説明においては、データの異常を検出する誤り検出方法にサムチェック演算を行うとして説明したが、誤り検出方法はサムチェック演算に限定しない。例えば、サムチェック演算の替わりに巡回冗長検査を行うようにしてもよい。   In the above description, it has been described that the sum check operation is performed for the error detection method for detecting data abnormality, but the error detection method is not limited to the sum check operation. For example, a cyclic redundancy check may be performed instead of the sum check operation.

このように、実施の形態1によれば、システムデータ群をブートするブートプログラムを構成するブートデータ群をシステム用ROMおよびバックアップ用ROMに記憶し、ブートプログラムは、システム用ROMに記憶されているブートデータ群が不正に変化している場合はバックアップ用ROMに記憶されているブートデータ群を用いてシステムの初期化とシステムデータのブートをできるようにしたので、ブートデータの不正な変化によりシステムプログラムがブートできなくなる事態を起こりにくくすることができる。また、システムプログラムについても、上述のブートプログラムと同様に、構成するシステムデータ群がシステム用ROMおよびバックアップ用ROMに記憶されるとともに、システム用ROMに記憶されているシステムデータ群が不正に変化している場合はバックアップ用ROMに記憶されているシステムデータ群からシステムを起動できるようにしたので、システムデータの不正な変化によりシステムが起動できなくなる事態を発生しにくくすることができる。また、ブートプログラムおよびシステムプログラムは、予め設定された回数だけブート処理およびシステム起動を行ったとき、バックアップ用ROMに記憶されている自身のデータでシステム用ROMに記憶されている自身のデータを上書き処理、すなわちシステム用ROMにおける電荷を再チャージをするようにしたので、データの不正変化の発生確率を低減することができる。また、ブートデータ群およびシステムデータ群を夫々分割し、一回の上書き処理で分割された一部を上書き処理し、複数の電源onから電源offまでの動作で全データ群の上書きを完了するようにもできるようにしたので、ブートデータ群およびシステムデータ群のデータ量が多くなっても、上書き一回当たりにかかる時間を少なくすることができ、システム終了時に上書きする場合、システム終了処理にかかる時間を短縮することができる。   Thus, according to the first embodiment, the boot data group constituting the boot program for booting the system data group is stored in the system ROM and the backup ROM, and the boot program is stored in the system ROM. If the boot data group is illegally changed, the system can be initialized and the system data booted using the boot data group stored in the backup ROM. It can make it difficult for the program to boot. As for the system program, the system data group to be configured is stored in the system ROM and the backup ROM, and the system data group stored in the system ROM is illegally changed. In this case, since the system can be started from the system data group stored in the backup ROM, it is possible to make it difficult to generate a situation where the system cannot be started due to an unauthorized change in the system data. In addition, the boot program and the system program overwrite the own data stored in the system ROM with the own data stored in the backup ROM when the boot process and the system start are performed a preset number of times. Since the processing, that is, the charge in the system ROM is recharged, it is possible to reduce the probability of occurrence of unauthorized data changes. In addition, the boot data group and the system data group are respectively divided, and a part of the divided data is overwritten by one overwriting process, and the overwriting of all the data groups is completed by an operation from a plurality of power on to power off. Even if the amount of data in the boot data group and system data group increases, the time required for overwriting once can be reduced. When overwriting at the time of system termination, the system termination process is required. Time can be shortened.

実施の形態2.
実施の形態1においては、起動回数をトリガー条件として上書き処理によって電荷再チャージを行うようにしたが、異なるさらに別の実施の形態2として、電荷再チャージのトリガー条件を累積時間としたNC装置について説明する。
Embodiment 2. FIG.
In the first embodiment, charge recharging is performed by overwriting using the number of activations as a trigger condition. However, as another different embodiment 2, an NC apparatus having a charge recharge trigger condition as an accumulation time is used. explain.

本実施の形態2のNC装置1には、第1、第2の起動回数カウンタの替わりに第1、第2の累積時間レジスタが設けられている。さらに、ブートプログラムは、ブートプログラムの上書き処理を実行したとき、第1の累積時間レジスタに処理時の時刻を書き込む。システムプログラムは、システムプログラムの上書き処理が実行されたとき、第2の累積時間レジスタに処理時の時刻を書き込む。   The NC device 1 according to the second embodiment is provided with first and second cumulative time registers instead of the first and second activation number counters. Further, when the boot program executes the boot program overwriting process, the boot program writes the processing time in the first cumulative time register. When the overwriting process of the system program is executed, the system program writes the processing time in the second cumulative time register.

図8および図9に実施の形態2のNC装置のシステム起動までの動作を説明するフローチャートを示す。図8において、ステップS801〜ステップS806の動作は、図4におけるステップS401〜ステップS406のNC装置1の動作と同様であるので、説明を省略する。ステップS803において、CPU100が初期化処理を実行すると、CPU100は、図示しないRTC(Real Time Clock)などから現在時刻を取得して第1の累積時間レジスタの値を引くことによって最後にブートデータ群の上書き処理を行ってからの累積時間を算出し、累積時間が予め設定された設定時間以上の値であるか否かを判定する処理を行う(ステップS807)。ここで、設定時間に、不揮発性メモリに電荷が印加されてからデータ不正変化発生の増加する時間を考慮して適切に設定するようにするとよい。累積時間が設定時間未満の値である場合(ステップS807、No)、ブート処理を実行する(ステップS810)。累積時間が設定時間以上の値である場合(ステップS807、Yes)、CPU100は、システム用ROM101に記憶されているブートデータ群200およびチェックサム値201を上書きコピーし(ステップS808)、改めて現在時刻を取得して取得した現在時刻で第1の累積時間レジスタを上書きし(ステップS809)、ステップS810に移行する。   FIG. 8 and FIG. 9 are flowcharts for explaining the operation until the system activation of the NC apparatus according to the second embodiment. In FIG. 8, the operations in steps S801 to S806 are the same as the operations of the NC apparatus 1 in steps S401 to S406 in FIG. In step S803, when the CPU 100 executes the initialization process, the CPU 100 finally obtains the current time from an RTC (Real Time Clock) (not shown) or the like and subtracts the value of the first cumulative time register to finally determine the boot data group. A cumulative time after the overwriting process is calculated, and a process for determining whether or not the cumulative time is equal to or greater than a preset set time is performed (step S807). Here, it is preferable that the set time is appropriately set in consideration of the time during which the occurrence of unauthorized data change occurs after the charge is applied to the nonvolatile memory. If the accumulated time is less than the set time (step S807, No), boot processing is executed (step S810). When the accumulated time is a value equal to or longer than the set time (step S807, Yes), the CPU 100 overwrites and copies the boot data group 200 and the checksum value 201 stored in the system ROM 101 (step S808), and then revises the current time. And the first accumulated time register is overwritten with the acquired current time (step S809), and the process proceeds to step S810.

図8においてブート処理が実行された後、図9のステップS901に移行する。図9におけるステップS901〜ステップS906の動作は、図5におけるステップS501〜ステップS506のNC装置1の動作と同様であるので、説明を省略する。ステップS903において制御処理を実行開始すると、CPU100は、現在時刻を取得して第2の累積時間レジスタの値を引くことによって最後にシステムデータ群の上書き処理を行ってからの累積時間を算出し、累積時間が予め設定された設定時間以上の値であるか否かを判定する処理を行う(ステップS907)。ここでの設定時間は、ステップS807において使用される設定時間と同じであっても異なっていてもかまわない。   After the boot process is executed in FIG. 8, the process proceeds to step S901 in FIG. The operations in steps S901 to S906 in FIG. 9 are the same as the operations of the NC apparatus 1 in steps S501 to S506 in FIG. When the control process is started in step S903, the CPU 100 obtains the current time and subtracts the value of the second cumulative time register to calculate the cumulative time since the system data group was last overwritten. Processing for determining whether or not the accumulated time is equal to or greater than a preset set time is performed (step S907). The set time here may be the same as or different from the set time used in step S807.

累積時間が設定時間未満の値である場合(ステップS907、No)、システムが起動される。累積時間が設定時間以上の値である場合(ステップS907、Yes)、CPU100は、システム用ROM101に記憶されているシステムデータ群202およびチェックサム値203を上書きコピーし(ステップS908)、改めて現在時刻を取得して取得した現在時刻で第2の累積時間レジスタを上書きし(ステップS909)、システムが起動される。   If the accumulated time is less than the set time (step S907, No), the system is activated. When the accumulated time is a value equal to or longer than the set time (step S907, Yes), the CPU 100 overwrites and copies the system data group 202 and the checksum value 203 stored in the system ROM 101 (step S908), and then revises the current time. And the second accumulated time register is overwritten with the acquired current time (step S909), and the system is started.

このように、実施の形態2によれば、不揮発性メモリに対して電荷を印加してからの累積時間を把握することで、ある程度予測可能なデータ不正変化の発生時間が経つ前に上書き処理を行い、データ不正変化の発生を低減することができる。   As described above, according to the second embodiment, the overwriting process is performed before the occurrence time of the data illegal change that can be predicted to some extent by grasping the accumulated time after the charge is applied to the nonvolatile memory. This can reduce the occurrence of illegal data changes.

以上のように、本発明にかかる制御装置は、不揮発性メモリにブートプログラムを記憶する制御装置に適用して好適である。   As described above, the control device according to the present invention is suitable for application to a control device that stores a boot program in a nonvolatile memory.

本発明にかかるNC装置の実施の形態1の構成を示す図である。It is a figure which shows the structure of Embodiment 1 of the NC apparatus concerning this invention. システム用ROMおよびバックアップ用ROMのメモリ構成を説明する図である。It is a figure explaining the memory structure of system ROM and backup ROM. NC装置の動作の概略を説明するフローチャートである。It is a flowchart explaining the outline of operation | movement of NC apparatus. 本発明にかかるNC装置の実施の形態1の動作を説明するフローチャートである。It is a flowchart explaining operation | movement of Embodiment 1 of NC apparatus concerning this invention. 本発明にかかるNC装置の実施の形態1の動作を説明するフローチャートである。It is a flowchart explaining operation | movement of Embodiment 1 of NC apparatus concerning this invention. ステップS307の動作を詳しく説明するフローチャートである。It is a flowchart explaining the operation | movement of step S307 in detail. 不揮発性メモリ上のデータ分割、分割サイズ、および書き換え回数カウンタレジスタを説明する図である。It is a figure explaining the data division, division size, and the rewrite frequency counter register on a non-volatile memory. 本発明にかかるNC装置の実施の形態2の動作を詳細に説明するフローチャートである。It is a flowchart explaining in detail the operation of the second embodiment of the NC device according to the present invention. 本発明にかかるNC装置の実施の形態2の動作を詳細に説明するフローチャートである。It is a flowchart explaining in detail the operation of the second embodiment of the NC device according to the present invention.

符号の説明Explanation of symbols

1 NC装置
100 CPU
101 システム用ROM
102 バックアップ用ROM
103 パラメータ格納用RAM
104 ワークメモリ
105 モニター
106 I/Oインターフェース
107 ASIC
200 ブートデータ群
201 チェックサム値
202 システムデータ群
203 チェックサム値
204 ブートデータ群
205 チェックサム値
206 チェックサム値
207 ブートデータ群
208 チェックサム値
209 システムデータ群
210 チェックサム値
211 システムデータ群
212 チェックサム値
213 チェックサム値
701 分割サイズレジスタ
702 書き換え回数カウンタレジスタ
1 NC unit 100 CPU
101 ROM for system
102 Backup ROM
103 Parameter storage RAM
104 Work memory 105 Monitor 106 I / O interface 107 ASIC
200 Boot data group 201 Checksum value 202 System data group 203 Checksum value 204 Boot data group 205 Checksum value 206 Checksum value 207 Bootdata group 208 Checksum value 209 System data group 210 Checksum value 211 System data group 212 Check Sum value 213 Check sum value 701 Division size register 702 Rewrite count counter register

Claims (9)

初期化処理と、この初期化処理の実行後、システムプログラムの記憶先にジャンプするブート処理と、を含む第1のブートプログラムが記憶されるシステム用不揮発性メモリと、
前記第1のブートプログラムと同一内容の第2のブートプログラムが記憶されるバックアップ用不揮発性メモリと、
前記第1または第2のブートプログラムを読み出し、該読み出したブートプログラムに基づいて動作する制御手段と、
を備え、
前記制御手段は、
前記システム用不揮発性メモリから第1のブートプログラムを読み出し、該読み出した第1のブートプログラムに対して誤り検出演算をすることによって前記読み出した第1のブートプログラムが不正に変化しているか否かを判定し、不正に変化していないと判定したとき、前記読み出した第1のブートプログラムを用いて前記初期化処理およびブート処理を行い、不正に変化していると判定したとき、前記バックアップ用不揮発性メモリから前記第2のブートプログラムを読み出す第1の手段と、
前記バックアップ用不揮発性メモリから前記第2のブートプログラムを読み出した際、該読み出した第2のブートプログラムに対して誤り検出演算をすることによって前記読み出した第2のブートプログラムが不正に変化しているか否かを判定し、不正に変化していないと判定したとき、前記読み出した第2のブートプログラムを用いて前記初期化処理およびブート処理を行い、不正に変化していると判定したとき、エラーを出力する第2の手段と、
を有することを特徴とする制御装置。
A non-volatile memory for a system in which a first boot program including an initialization process and a boot process that jumps to a storage destination of the system program after execution of the initialization process is stored;
A backup nonvolatile memory in which a second boot program having the same contents as the first boot program is stored;
Control means for reading the first or second boot program and operating based on the read boot program;
With
The control means includes
Whether or not the read first boot program has been illegally changed by reading the first boot program from the system non-volatile memory and performing an error detection operation on the read first boot program If it is determined that the change has not been made illegally, the initialization process and the boot process are performed using the read first boot program. First means for reading the second boot program from a nonvolatile memory;
When the second boot program is read from the backup non-volatile memory, the read second boot program is illegally changed by performing an error detection operation on the read second boot program. When it is determined that it has not changed illegally, the initialization process and the boot process are performed using the read second boot program, and when it is determined that the change has been illegally performed, A second means for outputting an error;
A control device comprising:
前記システム用不揮発性メモリには第1のシステムプログラムが記憶され、
前記バックアップ用不揮発性メモリには、前記第1のシステムプログラムと同一内容の第2のシステムプログラムが記憶され、
前記ブート処理は、前記システム用不揮発性メモリに記憶されている前記第1のシステムプログラムを読み出す処理であって、
前記制御手段は、
前記第1のシステムプログラムを読み出し、該読み出した第1のシステムプログラムに対して誤り検出演算をすることによって前記読み出した第1のシステムプログラムが不正に変化しているか否かを判定し、不正に変化していないと判定したとき、前記読み出した第1のシステムプログラムを用いて自制御装置の制御を開始し、不正に変化していると判定したとき、前記バックアップ用不揮発性メモリから前記第2のシステムプログラムを読み出す第3の手段と、
前記バックアップ用不揮発性メモリから前記第2のシステムプログラムを読み出した際、該読み出した第2のシステムプログラムに対して誤り検出演算をすることによって前記読み出した第2のシステムプログラムが不正に変化しているか否かを判定し、不正に変化していないと判定したとき、前記読み出した第2のシステムプログラムを用いて自制御装置の制御を開始し、不正に変化していると判定したとき、エラーを出力する第4の手段と、
をさらに備えることを特徴とする請求項1に記載の制御装置。
The system nonvolatile memory stores a first system program,
The backup nonvolatile memory stores a second system program having the same content as the first system program,
The boot process is a process of reading the first system program stored in the system non-volatile memory,
The control means includes
The first system program is read and an error detection calculation is performed on the read first system program to determine whether or not the read first system program has been illegally changed. When it is determined that it has not changed, control of the own control device is started using the read first system program, and when it is determined that it has been changed illegally, the second nonvolatile memory for backup is A third means for reading the system program of
When the second system program is read from the backup non-volatile memory, the read second system program is illegally changed by performing an error detection calculation on the read second system program. When it is determined whether or not it has been changed illegally, the control of the own control device is started using the read second system program, and an error is determined when it is determined that the change has been made illegally. A fourth means for outputting
The control device according to claim 1, further comprising:
前記第1および第2のブートプログラムは、所定第1の条件が成立する毎に、前記バックアップ用不揮発性メモリに記憶されている第2のブートプログラムで前記システム用不揮発性メモリに記憶されている第1のブートプログラムを上書きする第1の上書き処理を行う命令をさらに含み、
前記第1の上書き処理は、
前記ブート処理を行う前または前記第1もしくは第2のシステムプログラムが前記制御処理を終了する際に実行される、
ことを特徴とする請求項2に記載の制御装置。
The first and second boot programs are stored in the system non-volatile memory by the second boot program stored in the backup non-volatile memory every time the predetermined first condition is satisfied. An instruction for performing a first overwriting process for overwriting the first boot program;
The first overwriting process includes
Executed before the boot process or when the first or second system program ends the control process;
The control device according to claim 2.
前記第1および第2のシステムプログラムは、所定第2の条件が成立する毎に、前記バックアップ用不揮発性メモリに記憶されている第2のシステムプログラムで前記システム用不揮発性メモリに記憶されている第1のシステムプログラムを上書きする第2の上書き処理を行う命令をさらに含み、
前記第2の上書き処理は、
前記制御処理を行う前または前記制御処理を終了する際に実行される、
ことを特徴とする請求項2または3に記載の制御装置。
The first and second system programs are stored in the system non-volatile memory by the second system program stored in the backup non-volatile memory every time the predetermined second condition is satisfied. An instruction for performing a second overwriting process for overwriting the first system program;
The second overwriting process includes:
Executed before the control process or when the control process is terminated,
The control device according to claim 2 or 3, wherein
前記所定第1の条件は、前記第1の上書き処理が行われてから前記ブート処理が所定の回数実行されるかまたは所定の時間が経過するか、であることを特徴とする請求項3に記載の制御装置。   The predetermined first condition is whether the boot process is executed a predetermined number of times or a predetermined time elapses after the first overwriting process is performed. The control device described. 前記所定第2の条件は、前記第2の上書き処理が行われてから前記制御処理が所定の回数開始されるかまたは所定の時間が経過するか、であることを特徴とする請求項4に記載の制御装置。   The predetermined second condition is whether the control process is started a predetermined number of times or a predetermined time elapses after the second overwriting process is performed. The control device described. 前記第1の上書き処理は、前記第1のブートプログラムの上書き領域を複数に分割し、一回の前記ブート処理につき前記分割された一つの領域を上書きすることを特徴とする請求項3または5に記載の制御装置。   6. The first overwriting process divides an overwrite area of the first boot program into a plurality of areas, and overwrites the divided one area for one boot process. The control device described in 1. 前記第2の上書き処理は、前記第1のシステムプログラムの上書き領域を複数に分割し、一回の前記制御処理実行開始につき前記分割された1つの領域を上書きすることを特徴とする請求項4または6に記載の制御装置。   5. The second overwriting process divides an overwrite area of the first system program into a plurality of areas, and overwrites the divided one area at the start of execution of the control process once. Or the control apparatus of 6. 前記システム用不揮発性メモリは、シリコンウェハから作製された半導体メモリであって、記憶しているデータが経時的に不正に変化する可能性を有する、ことを特徴とする請求項1〜8の何れか1つに記載の制御装置。   9. The system nonvolatile memory according to claim 1, wherein the nonvolatile memory for system is a semiconductor memory manufactured from a silicon wafer, and the stored data may be illegally changed over time. The control apparatus as described in any one.
JP2008185076A 2008-07-16 2008-07-16 Control device Pending JP2010026650A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008185076A JP2010026650A (en) 2008-07-16 2008-07-16 Control device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008185076A JP2010026650A (en) 2008-07-16 2008-07-16 Control device

Publications (1)

Publication Number Publication Date
JP2010026650A true JP2010026650A (en) 2010-02-04

Family

ID=41732450

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008185076A Pending JP2010026650A (en) 2008-07-16 2008-07-16 Control device

Country Status (1)

Country Link
JP (1) JP2010026650A (en)

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011090670A (en) * 2009-09-24 2011-05-06 Terrara Code Research Institute Inc Rfid tag, tag reader/writer, data management system and data management method
JP2012068927A (en) * 2010-09-24 2012-04-05 Terrara Code Research Institute Inc Data management system, data management method, rfid tag, and tag reader/writer
CN102495590A (en) * 2011-12-20 2012-06-13 上海三一精机有限公司 Electric adjustment method of numerical control system
JP2013137732A (en) * 2011-11-30 2013-07-11 Mitsubishi Electric Corp Information processor, broadcasting receiver and software starting method
EP2733612A1 (en) 2012-11-15 2014-05-21 Mitsubishi Electric Corporation Information processing device, method, and program
JP2015008005A (en) * 2011-08-16 2015-01-15 グーグル インコーポレイテッド Secure recovery apparatus and method
JP2015046088A (en) * 2013-08-29 2015-03-12 京セラドキュメントソリューションズ株式会社 Semiconductor device
JP2015046057A (en) * 2013-08-28 2015-03-12 京セラドキュメントソリューションズ株式会社 Information processing device
US9471435B2 (en) 2012-01-05 2016-10-18 Mitsubishi Electric Corporation Information processing device, information processing method, and computer program
JP2017084208A (en) * 2015-10-30 2017-05-18 Necプラットフォームズ株式会社 Information processor, method for starting information processor, and information processor starting program
JP2021055875A (en) * 2019-09-27 2021-04-08 株式会社デンソーウェーブ Air-conditioning controller
US11822928B2 (en) 2018-10-04 2023-11-21 Canon Kabushiki Kaisha Information processing apparatus, method of controlling same, storage medium, and image forming apparatus

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0968096A (en) * 1995-08-31 1997-03-11 Denso Corp Storage device for vehicle
JPH09293026A (en) * 1996-04-26 1997-11-11 Nec Corp Redundant conversion method of device storage part and its device
JP2003316582A (en) * 2002-04-24 2003-11-07 Nec System Technologies Ltd Method and device for controlling dual bios
JP2005275697A (en) * 2004-03-24 2005-10-06 Toshiba Microelectronics Corp Microprocessor boot-up controller, controller for nonvolatile memory and information processing system
JP2008052354A (en) * 2006-08-22 2008-03-06 Giga-Byte Technology Co Ltd External basic input/output system device
JP2008084291A (en) * 2006-08-28 2008-04-10 Fujitsu Ltd Storage apparatus, control method, and control device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0968096A (en) * 1995-08-31 1997-03-11 Denso Corp Storage device for vehicle
JPH09293026A (en) * 1996-04-26 1997-11-11 Nec Corp Redundant conversion method of device storage part and its device
JP2003316582A (en) * 2002-04-24 2003-11-07 Nec System Technologies Ltd Method and device for controlling dual bios
JP2005275697A (en) * 2004-03-24 2005-10-06 Toshiba Microelectronics Corp Microprocessor boot-up controller, controller for nonvolatile memory and information processing system
JP2008052354A (en) * 2006-08-22 2008-03-06 Giga-Byte Technology Co Ltd External basic input/output system device
JP2008084291A (en) * 2006-08-28 2008-04-10 Fujitsu Ltd Storage apparatus, control method, and control device

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011090670A (en) * 2009-09-24 2011-05-06 Terrara Code Research Institute Inc Rfid tag, tag reader/writer, data management system and data management method
JP2012068927A (en) * 2010-09-24 2012-04-05 Terrara Code Research Institute Inc Data management system, data management method, rfid tag, and tag reader/writer
US9836606B2 (en) 2011-08-16 2017-12-05 Google Llc Secure recovery apparatus and method
JP2015008005A (en) * 2011-08-16 2015-01-15 グーグル インコーポレイテッド Secure recovery apparatus and method
JP2013137732A (en) * 2011-11-30 2013-07-11 Mitsubishi Electric Corp Information processor, broadcasting receiver and software starting method
CN102495590A (en) * 2011-12-20 2012-06-13 上海三一精机有限公司 Electric adjustment method of numerical control system
US9471435B2 (en) 2012-01-05 2016-10-18 Mitsubishi Electric Corporation Information processing device, information processing method, and computer program
EP2733612A1 (en) 2012-11-15 2014-05-21 Mitsubishi Electric Corporation Information processing device, method, and program
JP2015046057A (en) * 2013-08-28 2015-03-12 京セラドキュメントソリューションズ株式会社 Information processing device
JP2015046088A (en) * 2013-08-29 2015-03-12 京セラドキュメントソリューションズ株式会社 Semiconductor device
JP2017084208A (en) * 2015-10-30 2017-05-18 Necプラットフォームズ株式会社 Information processor, method for starting information processor, and information processor starting program
US11822928B2 (en) 2018-10-04 2023-11-21 Canon Kabushiki Kaisha Information processing apparatus, method of controlling same, storage medium, and image forming apparatus
JP2021055875A (en) * 2019-09-27 2021-04-08 株式会社デンソーウェーブ Air-conditioning controller
JP7380016B2 (en) 2019-09-27 2023-11-15 株式会社デンソーウェーブ air conditioning controller

Similar Documents

Publication Publication Date Title
JP2010026650A (en) Control device
TWI515660B (en) Firmware variable update method
JP5244981B2 (en) Microcomputer and operation method thereof
JP5981906B2 (en) Image forming apparatus
US20080016415A1 (en) Evaluation system and method
JP6011162B2 (en) Electronic control unit
JP5962697B2 (en) Electronic control unit
CN110221932B (en) Computer and control method thereof
JP2004046453A (en) Single chip microcomputer and boot sector switching method
JP2007058499A (en) Information processor and data writing method
JP2004338883A (en) Elevator controller
JP2010097432A (en) Ram diagnosis apparatus and program thereof
JP5579257B2 (en) Apparatus and method for restoring information in main memory
JP2006277280A (en) Computer system, its date time change method and date change method
JP2009211625A (en) Start log storage method for information processor
JP2009223714A (en) Arithmetic circuit and failure analysis method of arithmetic circuit
JP6172040B2 (en) Electronic control unit
JP2003271420A (en) Electronic control device
JP2010176201A (en) Data loss prevention device for flash memory, and data loss prevention method for flash memory
JP2009140130A (en) Data processor, and method for controlling the same
JP2011150383A (en) Firmware writing method
JP4543505B2 (en) Microcomputer control method and abnormality monitoring device
JP2011085977A (en) Signal processing apparatus
JP2013008078A (en) Field device
JP3977694B2 (en) Reset device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20110411

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20120919

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20121002

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20130212