JP6113374B1 - Programmable logic controller - Google Patents

Programmable logic controller Download PDF

Info

Publication number
JP6113374B1
JP6113374B1 JP2016559470A JP2016559470A JP6113374B1 JP 6113374 B1 JP6113374 B1 JP 6113374B1 JP 2016559470 A JP2016559470 A JP 2016559470A JP 2016559470 A JP2016559470 A JP 2016559470A JP 6113374 B1 JP6113374 B1 JP 6113374B1
Authority
JP
Japan
Prior art keywords
memory
nonvolatile memory
volatile memory
data
microprocessor
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2016559470A
Other languages
Japanese (ja)
Other versions
JPWO2017122332A1 (en
Inventor
匠 河野
匠 河野
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
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
Application granted granted Critical
Publication of JP6113374B1 publication Critical patent/JP6113374B1/en
Publication of JPWO2017122332A1 publication Critical patent/JPWO2017122332A1/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/16Protection against loss of memory contents

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)
  • Programmable Controllers (AREA)
  • Memory System (AREA)

Abstract

データを記憶する揮発性メモリ(5)と、データを記憶する不揮発性メモリ(6)と、データを揮発性メモリまたは不揮発性メモリに書き込む制御部(1)と、制御部から不揮発性メモリへの書き込み回数を検知する書き込み回数検知回路(3)と、制御部からのデータの書き込み先を揮発性メモリまたは不揮発性メモリのいずれかに切り替えるアクセス先メモリ切り替え回路(4)と、を備え、アクセス先メモリ切り替え回路は、書き込み回数が計測時間内に閾値を超えた場合は、データの書き込み先を不揮発性メモリから揮発性メモリに切り替え、制御部は、アクセス先メモリ切り替え回路がデータの書き込み先を不揮発性メモリから揮発性メモリに切り替えた後に、揮発性メモリに書き込まれたデータを不揮発性メモリへ書き込む。A volatile memory (5) for storing data, a non-volatile memory (6) for storing data, a control unit (1) for writing data to the volatile memory or the non-volatile memory, and a control unit to the non-volatile memory A write frequency detection circuit (3) for detecting the write frequency, and an access destination memory switching circuit (4) for switching a data write destination from the control unit to either a volatile memory or a nonvolatile memory. The memory switching circuit switches the data write destination from the non-volatile memory to the volatile memory when the number of write times exceeds the threshold within the measurement time, and the control unit switches the data write destination to the non-volatile memory. After switching from the volatile memory to the volatile memory, the data written to the volatile memory is written to the nonvolatile memory.

Description

本発明は、シーケンス制御を実行するプログラマブルロジックコントローラに関する。   The present invention relates to a programmable logic controller that executes sequence control.

近年のプログラマブルロジックコントローラにおいては、データ保持用メモリのためのバッテリの交換にかかるメンテナンス工数を削減するといった理由により、バッテリレス化の要望が高まっている。   In recent programmable logic controllers, there is an increasing demand for a battery-less system for the purpose of reducing maintenance man-hours required for replacing a battery for a data holding memory.

バッテリレス化を実現するためには、バッテリを用いてデータを保持していたSRAM(Static Random Access Memory)といった揮発性メモリを不揮発性メモリに変更する必要がある。しかし、強誘電体メモリといった安価な不揮発性メモリには、書き込み回数の上限値がある。プログラマブルロジックコントローラのような工業用機器は長期間使用されるため、このような不揮発性メモリを使用した場合、使用期間内に不揮発性メモリの書き込み回数の上限値を上回る書き込みが発生する可能性がある。   In order to realize battery-less operation, it is necessary to change a volatile memory such as an SRAM (Static Random Access Memory) that holds data using a battery to a nonvolatile memory. However, an inexpensive nonvolatile memory such as a ferroelectric memory has an upper limit value of the number of times of writing. Since industrial devices such as programmable logic controllers are used for a long period of time, when such a nonvolatile memory is used, there is a possibility that writing exceeding the upper limit of the number of times of writing to the nonvolatile memory may occur within the usage period. is there.

この問題に対して、不揮発性メモリの書き換え保証回数内で書き換え頻度を変更する技術が、特許文献1に提案されている。特許文献1においては、CPU(Central Processing Unit)が不揮発性メモリの書き換え回数をカウントし、書き換え回数が所定値以上であると判断すると、不揮発性メモリへの書き換え頻度を変更している。   For this problem, Patent Document 1 proposes a technique for changing the rewrite frequency within the guaranteed number of rewrites of the nonvolatile memory. In Patent Document 1, a CPU (Central Processing Unit) counts the number of times of rewriting of the nonvolatile memory, and if it is determined that the number of times of rewriting is equal to or greater than a predetermined value, the frequency of rewriting to the nonvolatile memory is changed.

特開2012−226575号公報JP 2012-226575 A

しかしながら、特許文献1の技術によれば、不揮発性メモリへの書き換えの回数が所定値以上になると、CPUが不揮発性メモリへの書き換え頻度を低減して調整しているため、メモリへの書き込み速度が低下するという問題点がある。   However, according to the technique of Patent Document 1, when the number of rewrites to the nonvolatile memory exceeds a predetermined value, the CPU adjusts by reducing the rewrite frequency to the nonvolatile memory. There is a problem that it decreases.

本発明は、上記に鑑みてなされたものであって、メモリへの書き込み速度に影響を与えずに、不揮発性メモリの書き込み回数を低減し、揮発性メモリのためのバッテリを不要にすることが可能なプログラマブルロジックコントローラを得ることを目的とする。   The present invention has been made in view of the above, and it is possible to reduce the number of times of writing to the nonvolatile memory without affecting the writing speed to the memory, and to eliminate the need for a battery for the volatile memory. The object is to obtain a programmable logic controller.

上述した課題を解決し、目的を達成するために、本発明は、データを記憶する揮発性メモリと、データを記憶する不揮発性メモリと、データを揮発性メモリまたは不揮発性メモリに書き込む制御部と、制御部から不揮発性メモリへの書き込み回数を検知する書き込み回数検知回路と、制御部からのデータの書き込み先を揮発性メモリまたは不揮発性メモリのいずれかに切り替えるアクセス先メモリ切り替え回路と、を備える。本発明は、アクセス先メモリ切り替え回路は、書き込み回数が計測時間内に閾値を超えた場合は、データの書き込み先を不揮発性メモリから揮発性メモリに切り替え、制御部は、アクセス先メモリ切り替え回路がデータの書き込み先を不揮発性メモリから揮発性メモリに切り替えた後に、揮発性メモリに書き込まれたデータを不揮発性メモリへ書き込むことを特徴とする。   In order to solve the above-described problems and achieve the object, the present invention includes a volatile memory that stores data, a nonvolatile memory that stores data, and a control unit that writes data to the volatile memory or the nonvolatile memory. A write number detection circuit for detecting the number of writes from the control unit to the non-volatile memory, and an access destination memory switching circuit for switching a data write destination from the control unit to either the volatile memory or the non-volatile memory. . In the present invention, the access destination memory switching circuit switches the data writing destination from the nonvolatile memory to the volatile memory when the number of times of writing exceeds the threshold value within the measurement time, and the control unit After the data write destination is switched from the nonvolatile memory to the volatile memory, the data written to the volatile memory is written to the nonvolatile memory.

本発明にかかるプログラマブルロジックコントローラは、メモリへの書き込み速度に影響を与えずに、不揮発性メモリの書き込み回数を低減し、揮発性メモリのためのバッテリを不要にすることが可能になるという効果を奏する。   The programmable logic controller according to the present invention has the effect of reducing the number of times of writing to the nonvolatile memory without affecting the writing speed to the memory and making it unnecessary to use a battery for the volatile memory. Play.

本発明の実施の形態1にかかるプログラマブルロジックコントローラの構成を示す図The figure which shows the structure of the programmable logic controller concerning Embodiment 1 of this invention. 実施の形態1にかかるマイクロプロセッサー、書き込み回数検知回路およびアクセス先メモリ切り替え回路の動作を説明する通信タイムチャートCommunication time chart explaining operations of the microprocessor, the write count detection circuit, and the access destination memory switching circuit according to the first embodiment 実施の形態1にかかるマイクロプロセッサーが不揮発性メモリの書き込み回数の閾値を変更するためのフローチャート10 is a flowchart for the microprocessor according to the first embodiment to change the threshold of the number of times of writing to the nonvolatile memory.

以下に、本発明の実施の形態にかかるプログラマブルロジックコントローラを図面に基づいて詳細に説明する。なお、この実施の形態によりこの発明が限定されるものではない。   Below, the programmable logic controller concerning an embodiment of the invention is explained in detail based on a drawing. Note that the present invention is not limited to the embodiments.

実施の形態1.
図1は、本発明の実施の形態1にかかるプログラマブルロジックコントローラ100の構成を示す図である。
Embodiment 1 FIG.
FIG. 1 is a diagram showing a configuration of a programmable logic controller 100 according to the first embodiment of the present invention.

プログラマブルロジックコントローラ100は、指令を行う入力機器またはシーケンス制御の対象となる出力機器である外部機器50に接続されている。外部機器50は、デバイスとも呼ばれ、複数存在してよいが、図1では簡単のため1つにしてある。   The programmable logic controller 100 is connected to an external device 50 that is an input device that issues a command or an output device that is a target of sequence control. The external device 50 is also called a device, and a plurality of external devices 50 may exist, but in FIG.

プログラマブルロジックコントローラ100は、演算処理を実行する制御部であるマイクロプロセッサー1と、マイクロプロセッサー1のワークエリアとなる記憶領域であるRAM(Random Access Memory)7と、外部機器50から取得したデータを記憶する揮発性メモリ5と、外部機器50から取得したデータを記憶する不揮発性メモリ6と、マイクロプロセッサー1から不揮発性メモリ6への書き込み回数を検知する書き込み回数検知回路3と、マイクロプロセッサー1からのアクセス先を切り替えるアクセス先メモリ切り替え回路4と、を備える。なお、RAM7はマイクロプロセッサー1に設けられてもかまわない。   The programmable logic controller 100 stores a microprocessor 1 that is a control unit that executes arithmetic processing, a RAM (Random Access Memory) 7 that is a storage area that is a work area of the microprocessor 1, and data acquired from the external device 50. The volatile memory 5 that stores the data acquired from the external device 50, the write count detection circuit 3 that detects the number of writes from the microprocessor 1 to the nonvolatile memory 6, and the microprocessor 1 And an access destination memory switching circuit 4 for switching the access destination. The RAM 7 may be provided in the microprocessor 1.

マイクロプロセッサー1とアクセス先メモリ切り替え回路4とはバス71で接続されている。アクセス先メモリ切り替え回路4と揮発性メモリ5とはバス72で接続されている。アクセス先メモリ切り替え回路4と不揮発性メモリ6とはバス73で接続されている。バス71と書き込み回数検知回路3とは制御線8で接続されている。書き込み回数検知回路3とアクセス先メモリ切り替え回路4とは制御線9で接続されている。マイクロプロセッサー1とアクセス先メモリ切り替え回路4とは制御線10で接続されている。   The microprocessor 1 and the access destination memory switching circuit 4 are connected by a bus 71. The access destination memory switching circuit 4 and the volatile memory 5 are connected by a bus 72. The access destination memory switching circuit 4 and the nonvolatile memory 6 are connected by a bus 73. The bus 71 and the write count detection circuit 3 are connected by a control line 8. The write count detection circuit 3 and the access destination memory switching circuit 4 are connected by a control line 9. The microprocessor 1 and the access destination memory switching circuit 4 are connected by a control line 10.

アクセス先メモリ切り替え回路4は、マイクロプロセッサー1からのデータの書き込み先を揮発性メモリ5または不揮発性メモリ6のいずれかに切り替える。マイクロプロセッサー1からのデータの書き込み先のアクセス先メモリ切り替え回路4による切り替えは、マイクロプロセッサー1からの書き込みデータの信号の宛先のアドレスを揮発性メモリ5宛または不揮発性メモリ6宛のいずれかに設定するといった手段でもよい。或いは、アクセス先メモリ切り替え回路4がバス71をバス72またはバス73のいずれか一方としか接続しないスイッチング処理を実行することにより、マイクロプロセッサー1からのデータの書き込み先および読み出し元を揮発性メモリ5または不揮発性メモリ6のいずれかに切り替えるようにしてもよい。揮発性メモリ5は、アクセス先メモリ切り替え回路4によってマイクロプロセッサー1からのデータの書き込み先に切り替えられたときに、データの書き込み先の記憶領域となるデータ保持エリア51を備える。   The access destination memory switching circuit 4 switches the data write destination from the microprocessor 1 to either the volatile memory 5 or the nonvolatile memory 6. The switching by the access destination memory switching circuit 4 to which the data from the microprocessor 1 is written is set to either the volatile memory 5 address or the nonvolatile memory 6 address of the write data signal from the microprocessor 1. It may be a means of doing. Alternatively, the access destination memory switching circuit 4 executes a switching process in which the bus 71 is connected to only one of the bus 72 and the bus 73, whereby the data write destination and the read source from the microprocessor 1 are set to the volatile memory 5. Alternatively, it may be switched to any one of the nonvolatile memories 6. The volatile memory 5 includes a data holding area 51 serving as a storage area to which data is written when the access destination memory switching circuit 4 switches to a data writing destination from the microprocessor 1.

マイクロプロセッサー1は、ファームウェアおよびOS(Operating System)を記憶する記憶手段であるROM(Read Only Memory)2を備えている。このファームウェアには、不揮発性メモリ6への書き込み回数の閾値と、不揮発性メモリ6への書き込み回数が当該閾値を超えるか否かを判定する期間である計測時間と、が設定されている。計測時間は、プログラマブルロジックコントローラ100の電源がオンになってから予め定められた期間である。上記閾値および計測時間は、不揮発性メモリ6への書き込み可能な回数の最初の上限値N0と、プログラマブルロジックコントローラ100の最初の保証期間T0とに基づいて、最初の保証期間T0内に書き込み回数が最初の上限値N0を超えないような安全側の条件として予め求めておき、上記ファームウェアに設定しておく。不揮発性メモリ6への書き込み可能な回数の最初の上限値N0は、不揮発性メモリ6が書き込みデータの信頼性を保証できる範囲内の書き込み回数として与えられている。また、最初の保証期間T0は、プログラマブルロジックコントローラ100の製造日情報および製品保証期限日とから与えられる場合もある。The microprocessor 1 includes a ROM (Read Only Memory) 2 that is a storage unit that stores firmware and an OS (Operating System). In this firmware, a threshold value of the number of times of writing to the nonvolatile memory 6 and a measurement time which is a period for determining whether or not the number of times of writing to the nonvolatile memory 6 exceeds the threshold value are set. The measurement time is a predetermined period after the programmable logic controller 100 is turned on. The threshold value and the measurement time are within the first guarantee period T 0 based on the first upper limit value N 0 of the number of times that data can be written to the nonvolatile memory 6 and the first guarantee period T 0 of the programmable logic controller 100. determined in advance as a safety side conditions such as the number of times of writing does not exceed the first upper limit value N 0, it is set to the firmware. The initial upper limit value N 0 of the number of times that data can be written to the nonvolatile memory 6 is given as the number of times of writing within a range in which the nonvolatile memory 6 can guarantee the reliability of the write data. The initial warranty period T 0 may be given from the manufacturing date information of the programmable logic controller 100 and the product warranty expiration date.

書き込み回数検知回路3は、制御線8を介してマイクロプロセッサー1によるバス71を介した不揮発性メモリ6への書き込みを検知するインタフェースを備えており、不揮発性メモリ6への書き込み回数をカウントすることができる。具体的には、書き込み回数検知回路3は、アクセス先メモリ切り替え回路4によりマイクロプロセッサー1からのアクセス先が不揮発性メモリ6に切り替えられている状態での、マイクロプロセッサー1による不揮発性メモリ6への書き込みを検知する。書き込み回数検知回路3は、さらに、内部にタイマを有している。書き込み回数検知回路3は、このタイマを用いて、上記計測時間内における不揮発性メモリ6への書き込み回数を検知することができる。   The write count detection circuit 3 includes an interface for detecting a write to the nonvolatile memory 6 via the bus 71 by the microprocessor 1 via the control line 8 and counts the number of writes to the nonvolatile memory 6. Can do. Specifically, the write count detection circuit 3 is connected to the nonvolatile memory 6 by the microprocessor 1 when the access destination from the microprocessor 1 is switched to the nonvolatile memory 6 by the access destination memory switching circuit 4. Detect writing. The write count detection circuit 3 further has a timer inside. The write count detection circuit 3 can detect the number of writes to the nonvolatile memory 6 within the measurement time using the timer.

書き込み回数検知回路3は、上記計測時間内に上記閾値以上の不揮発性メモリ6への書き込み回数を検知すると、高速なメモリアクセスが発生していると判断して、制御線9を介してアクセス先メモリ切り替え回路4にマイクロプロセッサー1からの書き込み先を切り替えることを指示するアクセス先切り替え信号を送信する。アクセス先切り替え信号を受信したアクセス先メモリ切り替え回路4は、マイクロプロセッサー1からのデータの書き込み先および読み出し元を不揮発性メモリ6から揮発性メモリ5に切り替える。なお、マイクロプロセッサー1もアクセス先切り替え信号を制御線10を介して送信することによりアクセス先メモリ切り替え回路4を制御することが可能であり、マイクロプロセッサー1の書き込み先を揮発性メモリ5または不揮発性メモリ6のいずれかに切り替えることが可能である。   When the number of write detection circuit 3 detects the number of writes to the nonvolatile memory 6 that is equal to or greater than the threshold value within the measurement time, the write number detection circuit 3 determines that a high-speed memory access has occurred, An access destination switching signal for instructing the memory switching circuit 4 to switch the write destination from the microprocessor 1 is transmitted. The access destination memory switching circuit 4 that has received the access destination switching signal switches the data write destination and read source from the microprocessor 1 from the nonvolatile memory 6 to the volatile memory 5. The microprocessor 1 can also control the access destination memory switching circuit 4 by transmitting an access destination switching signal via the control line 10, and the write destination of the microprocessor 1 can be set to the volatile memory 5 or the nonvolatile memory. Switching to one of the memories 6 is possible.

書き込み回数検知回路3およびアクセス先メモリ切り替え回路4は、単一回路、複合回路、プログラム化したプロセッサー、並列プログラム化したプロセッサー、ASIC(Application Specific Integrated Circuit)、FPGA(Field Programmable Gate Array)、またはこれらを組み合わせたハードウェアで構成される。書き込み回数検知回路3およびアクセス先メモリ切り替え回路4の機能それぞれを処理回路で実現してもよいし、両者の機能をまとめて処理回路で実現してもよい。   The write count detection circuit 3 and the access destination memory switching circuit 4 are a single circuit, a composite circuit, a programmed processor, a parallel programmed processor, an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or these Consists of hardware that combines. The functions of the write count detection circuit 3 and the access destination memory switching circuit 4 may be realized by a processing circuit, or the functions of both may be realized by a processing circuit.

図2は、実施の形態1にかかるマイクロプロセッサー1、書き込み回数検知回路3およびアクセス先メモリ切り替え回路4の動作を説明する通信タイムチャートである。   FIG. 2 is a communication time chart for explaining operations of the microprocessor 1, the write count detection circuit 3, and the access destination memory switching circuit 4 according to the first embodiment.

プログラマブルロジックコントローラ100の電源がオンにされると、初期処理として、マイクロプロセッサー1は、ファームウェアを実行することにより書き込み回数の閾値を書き込み回数検知回路3に設定する(ステップS1)。さらに、マイクロプロセッサー1は、ファームウェアから読み取った計測時間を書き込み回数検知回路3に設定する(ステップS2)。また、プログラマブルロジックコントローラ100の電源がオンにされると、書き込み回数検知回路3は、タイマを起動させて電源がオンになってからの時間の計測を開始する。   When the power of the programmable logic controller 100 is turned on, as an initial process, the microprocessor 1 sets a threshold for the number of writings in the writing number detection circuit 3 by executing firmware (step S1). Furthermore, the microprocessor 1 sets the measurement time read from the firmware in the write count detection circuit 3 (step S2). When the power of the programmable logic controller 100 is turned on, the write count detection circuit 3 starts a timer and starts measuring the time after the power is turned on.

書き込み回数の閾値および計測時間が設定された書き込み回数検知回路3は、マイクロプロセッサー1のアクセス先を不揮発性メモリ6に設定するようにアクセス先メモリ切り替え回路4に命じる(ステップS3)。これにより、マイクロプロセッサー1のメモリアクセス開始時のアクセス先、すなわちデータの書き込み先および読み出し元は、不揮発性メモリ6に設定される。そして、書き込み回数検知回路3は、タイマ起動後の不揮発性メモリ6への書き込み動作を制御線8を介して検知して書き込み回数の記録を開始する(ステップS4)。不揮発性メモリ6へ書き込まれるデータは、プログラマブルロジックコントローラ100に接続された外部機器50の制御または監視のためのデータであり、頻繁に書き換えられることが想定される。   The write count detection circuit 3 in which the write count threshold and measurement time are set instructs the access destination memory switching circuit 4 to set the access destination of the microprocessor 1 in the nonvolatile memory 6 (step S3). As a result, the access destination when the memory access of the microprocessor 1 is started, that is, the data write destination and the read source are set in the nonvolatile memory 6. Then, the write count detection circuit 3 detects the write operation to the nonvolatile memory 6 after starting the timer through the control line 8 and starts recording the write count (step S4). The data written to the nonvolatile memory 6 is data for controlling or monitoring the external device 50 connected to the programmable logic controller 100 and is assumed to be frequently rewritten.

その後、タイマの計測した時間が設定された計測時間を経た時点で、書き込み回数検知回路3は、不揮発性メモリ6への計測時間内の書き込み回数と閾値とを比較する(ステップS5)。不揮発性メモリ6への書き込み回数が閾値を超えた場合は、書き込み回数検知回路3はアクセス先切り替え信号を送信し、アクセス先メモリ切り替え回路4にマイクロプロセッサー1のアクセス先を不揮発性メモリ6から揮発性メモリ5に切り替えさせる(ステップS6)。その後、マイクロプロセッサー1からの外部機器50のデータは、揮発性メモリ5のデータ保持エリア51に書き込まれる。   Thereafter, when the time measured by the timer has passed the set measurement time, the write count detection circuit 3 compares the write count within the measurement time to the nonvolatile memory 6 with a threshold value (step S5). When the number of writes to the nonvolatile memory 6 exceeds the threshold value, the write number detection circuit 3 transmits an access destination switching signal, and the access destination of the microprocessor 1 is volatilized from the nonvolatile memory 6 to the access destination memory switching circuit 4. The memory 5 is switched (step S6). Thereafter, the data of the external device 50 from the microprocessor 1 is written into the data holding area 51 of the volatile memory 5.

ステップS6を経て、データ保持エリア51にデータが書き込まれた後、予め定めたタイミングで、データ保持エリア51に書き込まれたデータを不揮発性メモリ6へ書き移す。具体的には、ステップS6の切り替えが生じてから予め定めたタイミングで、マイクロプロセッサー1は、データ保持エリア51に書き込まれたデータをRAM7に読み出し、制御線10を介してアクセス先メモリ切り替え回路4にマイクロプロセッサー1のアクセス先を揮発性メモリ5から不揮発性メモリ6に切り替えさせる(ステップS7)。そして、マイクロプロセッサー1はデータ保持エリア51から読み出したデータを不揮発性メモリ6に書き込む。このとき、データ保持エリア51に書き込まれたデータを纏めて不揮発性メモリ6に書き込む。データ保持エリア51から読み出したデータを不揮発性メモリ6に書き込むと、マイクロプロセッサー1は、制御線10を介してアクセス先メモリ切り替え回路4にマイクロプロセッサー1のアクセス先を不揮発性メモリ6から揮発性メモリ5に戻すように切り替えさせる(ステップS8)。   After the data is written in the data holding area 51 through step S6, the data written in the data holding area 51 is transferred to the nonvolatile memory 6 at a predetermined timing. Specifically, the microprocessor 1 reads out the data written in the data holding area 51 to the RAM 7 at a predetermined timing after the switching in step S 6 occurs, and accesses the access destination memory switching circuit 4 via the control line 10. The access destination of the microprocessor 1 is switched from the volatile memory 5 to the nonvolatile memory 6 (step S7). Then, the microprocessor 1 writes the data read from the data holding area 51 into the nonvolatile memory 6. At this time, the data written in the data holding area 51 is collectively written in the nonvolatile memory 6. When the data read from the data holding area 51 is written into the nonvolatile memory 6, the microprocessor 1 transfers the access destination of the microprocessor 1 from the nonvolatile memory 6 to the volatile memory via the control line 10. It is switched to return to 5 (step S8).

上記したデータの書き移し動作、すなわちステップS7およびS8は繰り返し実行される。すなわち、ステップS8の切り替えが生じてから予め定めたタイミングで、マイクロプロセッサー1は、再度ステップS7を実行する。マイクロプロセッサー1によるステップS7およびS8の繰り返しは、定期的に実行してもよい。プログラマブルロジックコントローラ100は、ラダープログラムといったユーザプログラムをスキャンタイムの間に1回実行し、これを反復的に繰り返す。従って、ステップS7およびS8を定期的に実行する具体例としては、スキャンタイムとスキャンタイムとの間であるシステム処理中のタイミングで実行する。このように、データの書き移し動作をスキャンタイム中のメモリアクセスとは独立して実行させることで、マイクロプロセッサー1のメモリアクセス速度の低下を回避することができる。ただし、データの書き移し動作は、他のタイミングで実行してもかまわない。   The above-described data transfer operation, that is, steps S7 and S8 are repeatedly executed. That is, the microprocessor 1 executes step S7 again at a predetermined timing after the switching of step S8 occurs. The repetition of steps S7 and S8 by the microprocessor 1 may be executed periodically. The programmable logic controller 100 executes a user program such as a ladder program once during a scan time, and repeats this repeatedly. Therefore, as a specific example in which steps S7 and S8 are periodically executed, they are executed at a timing during system processing that is between the scan times. As described above, by performing the data transfer operation independently of the memory access during the scan time, it is possible to avoid a decrease in the memory access speed of the microprocessor 1. However, the data transfer operation may be executed at another timing.

上記したように、データ保持エリア51に書き込まれたデータを纏めて不揮発性メモリ6に書き込むことにより、揮発性メモリ5を用いないで、不揮発性メモリ6に全てデータを書き込んでいった場合に比べて、不揮発性メモリ6への書き込み回数を大幅に削減することが可能となる。すなわち、マイクロプロセッサー1からのデータ書き込み速度は維持したまま、ステップS6以降の不揮発性メモリ6への書き込み頻度を低減させることが可能になる。なお、ステップS5で不揮発性メモリ6への書き込み回数が閾値を超えない場合は、ステップS6からS8は実行されない。   As described above, the data written in the data holding area 51 is collectively written in the nonvolatile memory 6, so that all the data is written in the nonvolatile memory 6 without using the volatile memory 5. Thus, the number of times of writing to the nonvolatile memory 6 can be greatly reduced. That is, it is possible to reduce the frequency of writing to the nonvolatile memory 6 after step S6 while maintaining the data writing speed from the microprocessor 1. Note that if the number of writes to the nonvolatile memory 6 does not exceed the threshold value in step S5, steps S6 to S8 are not executed.

その後、プログラマブルロジックコントローラ100が電源オフの指示を受けると、マイクロプロセッサー1は、書き込み回数検知回路3に電源がオフになることを通知する(ステップS9)。通知を受けた書き込み回数検知回路3は、タイマ起動後の不揮発性メモリ6への書き込みの総回数およびタイマで測定したプログラマブルロジックコントローラ100の電源がオンになってからの稼働時間をマイクロプロセッサー1に送信する(ステップS10)。マイクロプロセッサー1は、受信した不揮発性メモリ6への書き込みの稼働時間内の総回数および稼働時間をROM2或いは不揮発性メモリ6に記録する。その後、プログラマブルロジックコントローラ100の電源はオフされる。なお、プログラマブルロジックコントローラ100が電源オフの指示を受けない場合であっても、ステップS10は一定時間毎に実行されてもよい。この場合は、ステップS9を除いたステップS1からステップS10までの処理が一定時間毎に実行されることになる。   Thereafter, when the programmable logic controller 100 receives a power-off instruction, the microprocessor 1 notifies the write count detection circuit 3 that the power is turned off (step S9). Receiving the notification, the write count detection circuit 3 gives the microprocessor 1 the total number of writes to the non-volatile memory 6 after the timer is started and the operation time measured by the timer after the programmable logic controller 100 is turned on. Transmit (step S10). The microprocessor 1 records in the ROM 2 or the nonvolatile memory 6 the total number and operating time within the operating time of writing to the nonvolatile memory 6 received. Thereafter, the power supply of the programmable logic controller 100 is turned off. Even if the programmable logic controller 100 does not receive a power-off instruction, step S10 may be executed at regular intervals. In this case, the processing from step S1 to step S10 excluding step S9 is executed at regular intervals.

以上説明したように、実施の形態1にかかるプログラマブルロジックコントローラ100においては、マイクロプロセッサー1から高速なデータの書き込みが発生した場合は、揮発性メモリ5に一旦データを書き込んで、その後、揮発性メモリ5に書き込まれたデータは、纏めて不揮発性メモリ6へ書き込む。これにより、マイクロプロセッサー1からメモリへの書き込み性能に影響を与えずに、不揮発性メモリ6への書き込み回数を低減することが可能になる。それと共に、プログラマブルロジックコントローラ100の電源がオフになった時に揮発性メモリ5の記憶を保持させるためのバッテリも不要となる。すなわち、記憶データの保証とバッテリレス化の両立が可能になる。また、マイクロプロセッサー1とは別に、書き込み回数検知回路3およびアクセス先メモリ切り替え回路4を設けるので、マイクロプロセッサー1の処理負担の増大も回避できる。   As described above, in the programmable logic controller 100 according to the first embodiment, when high-speed data is written from the microprocessor 1, data is once written in the volatile memory 5 and then the volatile memory is written. The data written in 5 is collectively written in the nonvolatile memory 6. As a result, the number of times of writing to the nonvolatile memory 6 can be reduced without affecting the writing performance from the microprocessor 1 to the memory. At the same time, a battery for holding the storage in the volatile memory 5 when the power source of the programmable logic controller 100 is turned off becomes unnecessary. In other words, both storage data guarantee and battery-less can be achieved. In addition to the microprocessor 1, since the write count detection circuit 3 and the access destination memory switching circuit 4 are provided, an increase in processing load on the microprocessor 1 can be avoided.

図3は、実施の形態1にかかるマイクロプロセッサー1が不揮発性メモリ6の書き込み回数の閾値を変更するためのフローチャートである。上記したように不揮発性メモリ6への書き込みの総回数および稼働時間が記録された後に、ROM2に記憶されたファームウェアをマイクロプロセッサー1が実行することにより、図3のフローチャートは実行される。   FIG. 3 is a flowchart for the microprocessor 1 according to the first embodiment to change the threshold of the number of times of writing in the nonvolatile memory 6. After the total number of writes to the nonvolatile memory 6 and the operation time are recorded as described above, the microprocessor 1 executes the firmware stored in the ROM 2, whereby the flowchart of FIG. 3 is executed.

まず、マイクロプロセッサー1は、図2のステップS10で受信して記録された稼働時間とプログラマブルロジックコントローラ100の現在の残存保証期間Tn(n=0,1,2,・・・)とから、新たな残存保証期間Tn+1を求める(ステップS11)。現在の残存保証期間Tnは、記録された稼働時間の始点でプログラマブルロジックコントローラ100の動作が保証される期間であって、図3のフローチャートを最初に実行する場合は、プログラマブルロジックコントローラ100の最初の保証期間T0となる。従って、新たな残存保証期間Tn+1は、現在の残存保証期間TnからステップS10で受信して記録した稼働時間を減じた値となる。First, the microprocessor 1 calculates from the operation time received and recorded in step S10 of FIG. 2 and the current remaining guarantee period T n (n = 0, 1, 2,...) Of the programmable logic controller 100. A new remaining guarantee period T n + 1 is obtained (step S11). The current remaining guarantee period Tn is a period during which the operation of the programmable logic controller 100 is guaranteed at the start point of the recorded operation time. When the flowchart of FIG. The warranty period T 0 is reached. Accordingly, the new remaining guarantee period T n + 1 is a value obtained by subtracting the operation time received and recorded in step S10 from the current remaining guarantee period T n .

ステップS11の後、マイクロプロセッサー1は、不揮発性メモリ6の書き込み回数の閾値の前回の設定から定めた期間が経過しているか否かを判定する(ステップS12)。この定めた期間は、具体的には、計測時間より長い期間であって、年単位の期間を用いることができる。不揮発性メモリ6の書き込み回数の閾値の前回の設定から定めた期間が経過していない場合(ステップS12:No)は終了である。   After step S11, the microprocessor 1 determines whether or not a predetermined period has elapsed since the previous setting of the threshold value for the number of times of writing in the nonvolatile memory 6 (step S12). Specifically, the determined period is a period longer than the measurement time, and an annual period can be used. If the predetermined period has not elapsed since the previous setting of the threshold value of the number of times of writing in the nonvolatile memory 6 (step S12: No), the processing is completed.

不揮発性メモリ6の書き込み回数の閾値の前回の設定から定めた期間が経過している場合(ステップS12:Yes)は、マイクロプロセッサー1は、不揮発性メモリ6へ書き込み可能な回数の新たな上限値Nn+1(n=0,1,2,・・・)を求める(ステップS13)。具体的には、不揮発性メモリ6の書き込み回数の現在の上限値Nnから図2のステップS10で受信して記録した稼働時間内の不揮発性メモリ6への書き込みの総回数を減じることにより不揮発性メモリ6へ書き込み可能な回数の新たな上限値Nn+1を求めることができる。図3のフローチャートを最初に実行する場合の不揮発性メモリ6の書き込み回数の現在の上限値Nnは、最初の上限値N0となる。If the predetermined period has elapsed since the previous setting of the threshold value of the number of times of writing in the nonvolatile memory 6 (step S12: Yes), the microprocessor 1 sets a new upper limit value of the number of times that data can be written to the nonvolatile memory 6. N n + 1 (n = 0, 1, 2,...) Is obtained (step S13). Specifically, the nonvolatile memory 6 is reduced by subtracting the total number of writes to the nonvolatile memory 6 within the operating time received and recorded in step S10 of FIG. 2 from the current upper limit value N n of the number of writes of the nonvolatile memory 6. A new upper limit value N n + 1 of the number of times that data can be written to the volatile memory 6 can be obtained. The current upper limit value N n of the number of writes in the nonvolatile memory 6 when the flowchart of FIG. 3 is executed first is the first upper limit value N 0 .

そして、マイクロプロセッサー1は、ステップS11で求めた新たな残存保証期間Tn+1と、ステップS13で求めた不揮発性メモリ6へ書き込み可能な回数の新たな上限値Nn+1と、に基づいて、不揮発性メモリ6への書き込み回数の新たな閾値を求めて、閾値を変更する(ステップS14)。新たな閾値は、不揮発性メモリ6への書き込み可能な回数の新たな上限値Nn+1を新たな残存保証期間Tn+1で割った値に計測時間を乗じた数値といった値を参考にして、新たな残存保証期間Tn+1内に書き込み回数が新たな上限値Nn+1を超えないような安全側の条件として求める。Then, the microprocessor 1 is based on the new remaining guarantee period T n + 1 obtained in step S11 and the new upper limit value N n + 1 of the number of times of writing to the nonvolatile memory 6 obtained in step S13. Thus, a new threshold value for the number of times of writing to the nonvolatile memory 6 is obtained and the threshold value is changed (step S14). The new threshold value is referred to a value such as a value obtained by multiplying a new upper limit value N n + 1 of the number of writable times in the nonvolatile memory 6 by a new remaining guarantee period T n + 1 and a measurement time. Thus, it is obtained as a condition on the safe side so that the number of writes does not exceed the new upper limit value N n + 1 within the new remaining guarantee period T n + 1 .

以上説明した、図3のフローチャートは、マイクロプロセッサー1が不揮発性メモリ6への書き込みの総回数および稼働時間を記録した後であって、プログラマブルロジックコントローラ100の電源が実際にオフにされるまでの間に実行されてもよいし、プログラマブルロジックコントローラ100の電源が再度オンにされた直後に実行されてもよい。なお、上述したようにステップS10が一定時間毎に実行される場合は、プログラマブルロジックコントローラ100の電源がオフにされるまでの間に図3のフローチャートも一定時間毎に実行される。   The flowchart of FIG. 3 described above is after the microprocessor 1 has recorded the total number of times of writing to the nonvolatile memory 6 and the operation time until the power of the programmable logic controller 100 is actually turned off. It may be executed in between or immediately after the power supply of the programmable logic controller 100 is turned on again. As described above, when step S10 is executed at regular intervals, the flowchart of FIG. 3 is also executed at regular intervals until the power of the programmable logic controller 100 is turned off.

プログラマブルロジックコントローラ100の電源が再度オンされると、それから電源がオフされるまでの次の稼働時間においては、ステップS14で求めた新たな閾値を用いて、図2で説明した動作が再度実行される。その後、図3のフローチャートも再度実行される。このように、図2および図3の動作は交互に実行される。したがって、プログラマブルロジックコントローラ100の電源がオフにされるまでの間に図3のフローチャートが一定時間毎に実行される場合は、その都度その後に実行される図2で説明した動作においては、直前のステップS14で求めた新たな閾値が用いられる。このようにして、図2および図3の動作は、プログラマブルロジックコントローラ100の電源がオンとなる毎に、または一定時間毎に繰り返し実行される。なお、ステップS14では、新たな残存保証期間Tn+1と不揮発性メモリ6へ書き込み可能な回数の新たな上限値Nn+1とに基づいて、閾値に加えて計測時間も変更してかまわない。When the power of the programmable logic controller 100 is turned on again, the operation described with reference to FIG. 2 is performed again using the new threshold value obtained in step S14 in the next operation time until the power is turned off. The Thereafter, the flowchart of FIG. 3 is also executed again. In this way, the operations of FIGS. 2 and 3 are performed alternately. Therefore, when the flowchart of FIG. 3 is executed at regular intervals until the power of the programmable logic controller 100 is turned off, the operation described with reference to FIG. The new threshold obtained in step S14 is used. In this manner, the operations of FIGS. 2 and 3 are repeatedly executed every time the power source of the programmable logic controller 100 is turned on or every predetermined time. In step S14, the measurement time may be changed in addition to the threshold value based on the new remaining guarantee period T n + 1 and the new upper limit value N n + 1 of the number of times the data can be written to the nonvolatile memory 6. Absent.

図3のフローチャートを実行することにより、図2のステップS10で受信して記録した稼働時間に対する不揮発性メモリ6への書き込みの総回数の割合が、現在の残存保証期間Tnに対する書き込み回数の現在の上限値Nnの割合に比べて小さい場合は、ステップS14で新たな閾値を前より大きな値に変更することで、揮発性メモリ5への切り替え条件を緩和することが可能となる。これにより、厳しい閾値により揮発性メモリ5への切り替えが頻繁に発生することを防ぐことができる。By executing the flowchart in FIG. 3, the ratio of the total number of writes to nonvolatile memory 6 for operating time recorded is received by the step S10 in FIG. 2, the current write count for the current remaining warranty period T n When the ratio is smaller than the ratio of the upper limit value N n , the switching condition to the volatile memory 5 can be relaxed by changing the new threshold value to a larger value than before in step S14. This can prevent frequent switching to the volatile memory 5 due to a strict threshold.

以上の実施の形態に示した構成は、本発明の内容の一例を示すものであり、別の公知の技術と組み合わせることも可能であるし、本発明の要旨を逸脱しない範囲で、構成の一部を省略、変更することも可能である。   The configuration described in the above embodiment shows an example of the contents of the present invention, and can be combined with another known technique, and can be combined with other configurations without departing from the gist of the present invention. It is also possible to omit or change the part.

1 マイクロプロセッサー、2 ROM、3 書き込み回数検知回路、4 アクセス先メモリ切り替え回路、5 揮発性メモリ、6 不揮発性メモリ、7 RAM、8,9,10 制御線、50 外部機器、71,72,73 バス、100 プログラマブルロジックコントローラ。   1 Microprocessor, 2 ROM, 3 Write count detection circuit, 4 Access destination memory switching circuit, 5 Volatile memory, 6 Non-volatile memory, 7 RAM, 8, 9, 10 Control line, 50 External device, 71, 72, 73 Bus, 100 Programmable logic controller.

Claims (2)

データを記憶する揮発性メモリと、
前記データを記憶する不揮発性メモリと、
前記データを前記揮発性メモリまたは前記不揮発性メモリに書き込む制御部と、
前記制御部から前記不揮発性メモリへの書き込み回数を検知する書き込み回数検知回路と、
前記制御部からの前記データの書き込み先を前記揮発性メモリまたは前記不揮発性メモリのいずれかに切り替えるアクセス先メモリ切り替え回路と、
を備え、
前記アクセス先メモリ切り替え回路は、前記書き込み回数が計測時間内に閾値を超えた場合は、前記データの書き込み先を前記不揮発性メモリから前記揮発性メモリに切り替え、前記制御部は、前記アクセス先メモリ切り替え回路が前記データの書き込み先を前記不揮発性メモリから前記揮発性メモリに切り替えた後に、前記揮発性メモリに書き込まれた前記データを前記不揮発性メモリへ書き込み、稼働時間と、前記稼働時間の始点で動作が保証される期間と、前記稼働時間内の前記不揮発性メモリへの書き込みの総回数とに基づいて、次の稼働時間における前記閾値を変更する
ことを特徴とするプログラマブルロジックコントローラ。
Volatile memory for storing data;
A non-volatile memory for storing the data;
A control unit for writing the data to the volatile memory or the nonvolatile memory;
A writing number detection circuit for detecting the number of writings from the control unit to the nonvolatile memory;
An access destination memory switching circuit that switches the write destination of the data from the control unit to either the volatile memory or the nonvolatile memory;
With
The access destination memory switching circuit switches the data write destination from the nonvolatile memory to the volatile memory when the number of times of writing exceeds a threshold value within a measurement time, and the control unit After the switching circuit switches the data write destination from the nonvolatile memory to the volatile memory, the data written to the volatile memory is written to the nonvolatile memory, the operation time, and the start point of the operation time The threshold value in the next operation time is changed based on a period during which the operation is guaranteed at and the total number of writes to the nonvolatile memory within the operation time.
前記制御部は、前記計測時間より長い期間を経た後に、前記閾値を変更する
ことを特徴とする請求項に記載のプログラマブルロジックコントローラ。
The programmable logic controller according to claim 1 , wherein the control unit changes the threshold value after a period longer than the measurement time.
JP2016559470A 2016-01-14 2016-01-14 Programmable logic controller Expired - Fee Related JP6113374B1 (en)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2016/051037 WO2017122332A1 (en) 2016-01-14 2016-01-14 Programmable logic controller

Publications (2)

Publication Number Publication Date
JP6113374B1 true JP6113374B1 (en) 2017-04-12
JPWO2017122332A1 JPWO2017122332A1 (en) 2018-01-18

Family

ID=58666767

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2016559470A Expired - Fee Related JP6113374B1 (en) 2016-01-14 2016-01-14 Programmable logic controller

Country Status (2)

Country Link
JP (1) JP6113374B1 (en)
WO (1) WO2017122332A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10514858B2 (en) 2017-08-30 2019-12-24 Fujitsu Limited Information processing apparatus, computer-readable recording medium, and information processing method

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023162544A1 (en) * 2022-02-24 2023-08-31 株式会社デンソートリム Engine control device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0675836A (en) * 1992-08-25 1994-03-18 Nippon Densan Corp Auxiliary storage device
JPH10154005A (en) * 1996-11-25 1998-06-09 Meidensha Corp Input/output control system for programmable controller
JP2013182505A (en) * 2012-03-02 2013-09-12 Toshiba Corp Storage system and driving method thereof

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012226575A (en) * 2011-04-20 2012-11-15 Mitsubishi Electric Corp Method for storing data in non-volatile memory and control device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0675836A (en) * 1992-08-25 1994-03-18 Nippon Densan Corp Auxiliary storage device
JPH10154005A (en) * 1996-11-25 1998-06-09 Meidensha Corp Input/output control system for programmable controller
JP2013182505A (en) * 2012-03-02 2013-09-12 Toshiba Corp Storage system and driving method thereof

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10514858B2 (en) 2017-08-30 2019-12-24 Fujitsu Limited Information processing apparatus, computer-readable recording medium, and information processing method

Also Published As

Publication number Publication date
JPWO2017122332A1 (en) 2018-01-18
WO2017122332A1 (en) 2017-07-20

Similar Documents

Publication Publication Date Title
WO2017054487A1 (en) Power-down protection method and apparatus, and electronic device
US8683249B2 (en) Switching a processor and memory to a power saving mode when waiting to access a second slower non-volatile memory on-demand
JP5981906B2 (en) Image forming apparatus
JP6113374B1 (en) Programmable logic controller
JP7095566B2 (en) Memory controller and flash memory system equipped with it
US20210096770A1 (en) Memory system, memory system control method, and information processing system
JP2010204851A (en) Storage device and information processing apparatus
US10915257B2 (en) Semiconductor device and semiconductor system
JP6148129B2 (en) Information processing apparatus, firmware update method, and firmware update program
JP5875558B2 (en) Information processing device
JP5915740B2 (en) Programmable controller and power-off countermeasure method
JP6672623B2 (en) Control system and its control device
JP5450352B2 (en) Power supply monitoring apparatus and information processing apparatus
JP6123282B2 (en) Programmable controller and power-off countermeasure method
JP2009230425A (en) Information processor
JP7007223B2 (en) Control device and abnormality detection method
KR20180039802A (en) Data storage device and operating method thereof
JP2008096381A (en) Data recorder
JP2005078489A (en) Microcontroller and its control method
US20230335198A1 (en) Semiconductor device
JP2013171600A (en) Nonvolatile memory device
WO2018186453A1 (en) Nonvolatile memory with increased number of usable times
JP2014071834A (en) Communication device and program
JP6079915B2 (en) Programmable controller and power-off countermeasure method
JP2014229116A (en) Programmable controller and method for coping with power disconnection

Legal Events

Date Code Title Description
TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20170214

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20170314

R150 Certificate of patent or registration of utility model

Ref document number: 6113374

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees