JP6214476B2 - I / O control device - Google Patents

I / O control device Download PDF

Info

Publication number
JP6214476B2
JP6214476B2 JP2014124115A JP2014124115A JP6214476B2 JP 6214476 B2 JP6214476 B2 JP 6214476B2 JP 2014124115 A JP2014124115 A JP 2014124115A JP 2014124115 A JP2014124115 A JP 2014124115A JP 6214476 B2 JP6214476 B2 JP 6214476B2
Authority
JP
Japan
Prior art keywords
data
transmission
reception
control device
cpu
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.)
Active
Application number
JP2014124115A
Other languages
Japanese (ja)
Other versions
JP2016004409A (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
Priority to JP2014124115A priority Critical patent/JP6214476B2/en
Publication of JP2016004409A publication Critical patent/JP2016004409A/en
Application granted granted Critical
Publication of JP6214476B2 publication Critical patent/JP6214476B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Techniques For Improving Reliability Of Storages (AREA)

Description

この発明は、制御目標値を演算する上位制御装置と、制御対象となる制御機器との間にあって、これらの装置との間の入出力制御を司るものであり、かつ、上位制御装置の演算処理の負荷軽減のためにマイクロコンピュータ(以下、単にマイコンと称する)が搭載されているI/O(Input/Output)制御装置に係り、特には、マイコンが備えるRAM,EEPROM等のメモリに格納されるデータのデータ化けの検出を強化して、データ化けによる誤出力を未然に防止するための技術に関するものである。   The present invention is between a host control device that calculates a control target value and a control device to be controlled, and controls input / output between these devices, and arithmetic processing of the host control device The present invention relates to an I / O (Input / Output) control device in which a microcomputer (hereinafter simply referred to as a microcomputer) is mounted to reduce the load on the memory, and in particular, is stored in a memory such as a RAM or an EEPROM provided in the microcomputer. The present invention relates to a technique for enhancing detection of data corruption and preventing erroneous output due to data corruption.

マイコンに設けられたメモリに格納されるデータがノイズなどの影響により変質する、いわゆるデータ化けによる誤出力を未然に防止する上で、従来技術では、CPUの外部バスを介してメモリが外付けして接続されている場合、この外付けされたメモリに対して予めエラー検出用の2つのバンクを予め設定しておき、各バンクに同じデータを格納した後、各々の上記バンクからデータを読み出し、両データを比較することでメモリのデータ化けの有無を検出している(例えば、下記の特許文献1参照)。   In order to prevent erroneous output due to so-called data corruption, the data stored in the memory provided in the microcomputer is altered by the influence of noise, etc., in the prior art, the memory is externally connected via the CPU external bus. In this case, two banks for error detection are set in advance for the external memory, and after storing the same data in each bank, the data is read from each bank, The presence or absence of garbled data in the memory is detected by comparing both data (for example, see Patent Document 1 below).

特開平1−291346号公報JP-A-1-291346

上記の特許文献1記載のような従来のマイコン周辺に配備されたメモリのエラー検出においては、エラー検出対象となるメモリがマイコンの外部に搭載されていることが条件となる。   In the conventional error detection of the memory provided around the microcomputer as described in Patent Document 1, it is necessary that the memory to be subjected to error detection is mounted outside the microcomputer.

近年のマイコンにおいては、集積度向上によりマイコン内部にRAM,EEPROMなどのメモリが搭載され、高機能化/高速化を目的にRAMを使用した一時的なバッファが至るところに実装されている。これらのメモリに格納されたデータのエラー検出においては、従来技術のように、マイコン外部にエラー検出用の回路を設けるだけでは十分に対処できない問題点があった。   In recent microcomputers, memories such as RAM and EEPROM are mounted in the microcomputer due to the improvement in integration degree, and temporary buffers using RAM are mounted everywhere for the purpose of higher functionality / high speed. In the error detection of the data stored in these memories, there is a problem that cannot be sufficiently dealt with by providing an error detection circuit outside the microcomputer as in the prior art.

この発明は、上記のような課題を解決するためになされたもので、マイコン外部に搭載されたRAM,EEPROMなどのメモリだけに限らず、マイコンに内蔵されているRAM,EEPROMなどのメモリについても、エラー検出を可能とすることで、ECC(Error Correction Control)等のエラー検出機能を備えた特殊なマイコンを使用しなくても、高いエラー検出が可能で、データ化けによる誤出力を未然に防止してシステムへの悪影響を防ぐことができるI/O制御装置の提供を目的としている。   The present invention has been made to solve the above-described problems, and is not limited to memories such as RAM and EEPROM mounted outside the microcomputer, but also about memories such as RAM and EEPROM built in the microcomputer. By enabling error detection, high error detection is possible without using a special microcomputer with error detection function such as ECC (Error Correction Control), and erroneous output due to data corruption is prevented. An object of the present invention is to provide an I / O control device that can prevent adverse effects on the system.

この発明は、上記の課題を解決するためになされたもので、制御目標値を演算する上位制御装置と、制御対象となる制御機器との間にあって、これらの装置との間の入出力制御を司るものであり、かつ、上記上位制御装置の演算処理の負荷軽減のためにマイクロコンピュータが搭載されているI/O制御装置において、次の構成を採用している。   The present invention has been made to solve the above-described problems, and is provided between a host control device that calculates a control target value and a control device to be controlled, and performs input / output control between these devices. In the I / O control device on which the microcomputer is mounted in order to reduce the calculation processing load of the host control device, the following configuration is adopted.

すなわち、この発明では、上記マイクロコンピュータは、CPUと、このCPUによる演算処理用のデータを格納する内蔵のメモリとを備え、上記メモリはデータ化けが無い限り実質的に同じデータを格納する2つのバンクを有する一方、各々の上記バンクから読み出されるデータをそれぞれ送信データとして格納する二重化された送信バッファと、上記制御機器へのデータ送信時、または上記上位制御装置へのデータ送信時に各々の上記送信バッファに格納されている上記送信データを読み出して比較する比較器と、を備えたことを特徴としている。   That is, in the present invention, the microcomputer includes a CPU and a built-in memory for storing data for arithmetic processing by the CPU, and the memory stores two substantially the same data as long as there is no garbled data. While having a bank, a duplexed transmission buffer for storing data read from each bank as transmission data, and each transmission at the time of data transmission to the control device or data transmission to the host controller And a comparator for reading and comparing the transmission data stored in the buffer.

この発明によれば、マイコンにRAM,EEPROMなどのメモリが内蔵されている場合であっても、メモリに確保された2つのバンクに格納されているデータを二重化された送信バッファのそれぞれに転送し、両送信バッファに格納されたデータ同士を比較器で比較し、両データの一致/不一致を判定することでデータ化けの有無を検出することができる。このため、ECC(Error Correction Control)等のエラー検出機能を備えた特殊なマイコンを使用しなくても、高いエラー検出が可能であり、データ化けによる不正なデータが出力されるのを未然に防止してシステムへの悪影響を防ぐことが可能となる。   According to the present invention, even if the microcomputer has a built-in memory such as RAM or EEPROM, the data stored in the two banks secured in the memory is transferred to each of the duplexed transmission buffers. The presence or absence of data corruption can be detected by comparing the data stored in both transmission buffers with a comparator and determining whether the two data match or not. For this reason, high error detection is possible without using a special microcomputer equipped with an error detection function such as ECC (Error Correction Control), and illegal data due to garbled data is prevented from being output in advance. As a result, adverse effects on the system can be prevented.

この発明の実施の形態1におけるI/O制御装置を備えたシステム全体の構成を示すブロック図である。It is a block diagram which shows the structure of the whole system provided with the I / O control apparatus in Embodiment 1 of this invention. I/O制御装置が備えるアナログ出力回路の構成の詳細を示すブロック図である。It is a block diagram which shows the detail of a structure of the analog output circuit with which an I / O control apparatus is provided. I/O制御装置が備えるアナログ入力回路の構成の詳細を示すブロック図である。It is a block diagram which shows the detail of a structure of the analog input circuit with which an I / O control apparatus is provided. I/O制御装置が備える通信入出力回路の構成の詳細を示すブロック図である。It is a block diagram which shows the detail of a structure of the communication input / output circuit with which an I / O control apparatus is provided. 図2のアナログ出力回路に対するCPUの制御処理を示すフローチャートである。It is a flowchart which shows the control processing of CPU with respect to the analog output circuit of FIG. 図3のアナログ入力回路に対するCPUの制御処理を示すフローチャートである。It is a flowchart which shows the control processing of CPU with respect to the analog input circuit of FIG. 図4の通信入出力回路に対するCPUの制御処理を示すフローチャートである。It is a flowchart which shows the control processing of CPU with respect to the communication input / output circuit of FIG.

実施の形態1.
図1は、この発明の実施の形態1におけるI/O制御装置を備えたシステム全体の構成を示すブロック図である。
Embodiment 1 FIG.
FIG. 1 is a block diagram showing the configuration of the entire system including an I / O control device according to Embodiment 1 of the present invention.

この実施の形態1のI/O制御装置1は、例えば発電プラントシステムなどに適用されるものであって、制御目標値を演算する上位制御装置2と、制御対象となるポンプやバルブ等の各種の制御機器3との間にあって、これらの装置2、3との間の入出力制御を司るものであり、上位制御装置2の演算処理の負荷軽減のためにマイコン12を備えるとともに、アナログ出力回路13、アナログ入力回路14、および通信入出力回路15が設けられている。   The I / O control device 1 according to the first embodiment is applied to, for example, a power plant system and the like, and includes a host control device 2 that calculates a control target value, and various types of pumps and valves to be controlled. The control device 3 controls input / output between these devices 2 and 3, and includes a microcomputer 12 for reducing the processing load of the host control device 2, and an analog output circuit 13, an analog input circuit 14, and a communication input / output circuit 15 are provided.

そして、通信入出力回路15が上位制御装置2とデジタルの通信ラインを介して接続され、また、アナログ出力回路13とアナログ入力回路14がアナログの制御信号線を介して制御機器3に接続されている。マイコン12は、上位制御装置2から通信ラインを介して送信される指令に従って制御機器3への出力信号を制御し、また、制御機器3からの入力信号の状態を読み取り、通信ラインを介して上位制御装置2にデータを送信する。   The communication input / output circuit 15 is connected to the host control device 2 via a digital communication line, and the analog output circuit 13 and the analog input circuit 14 are connected to the control device 3 via an analog control signal line. Yes. The microcomputer 12 controls the output signal to the control device 3 in accordance with a command transmitted from the host control device 2 via the communication line, reads the state of the input signal from the control device 3, and receives the host signal via the communication line. Data is transmitted to the control device 2.

マイコン12は、CPU21と、このCPU21による演算処理用のデータを格納するRAM22と、演算制御用のプログラムを格納するEEPROM23から構成されている。そして、マイコン12内部のRAM22とEEPROM23のデータ化けを検出するために、各メモリ22、23は、データ化けが無い限り実質的に同じデータを格納する2つのバンクを有する。   The microcomputer 12 includes a CPU 21, a RAM 22 that stores data for arithmetic processing by the CPU 21, and an EEPROM 23 that stores a program for arithmetic control. In order to detect data corruption in the RAM 22 and the EEPROM 23 in the microcomputer 12, each of the memories 22 and 23 has two banks for storing substantially the same data as long as there is no data corruption.

すなわち、EEPROM23には、2のバンク23A、23Bが確保されており、各バンク23A、23Bには、データ化けが無い限り実質的には内容が同一のプログラムAとプログラムBとが別々にインストールされている。そして、CPU21は、EEPROM23の各バンク23A、23Bに別々にインストールされたプログラムAとプログラムBに基づいて、アナログ出力回路13やアナログ入力回路14に入出力するデータと、通信入出力回路15に入出力するデータを別々に演算処理する。   That is, two banks 23A and 23B are secured in the EEPROM 23, and programs A and B having substantially the same contents are separately installed in each bank 23A and 23B unless there is garbled data. ing. Then, the CPU 21 inputs / outputs data to / from the analog output circuit 13 and the analog input circuit 14 and the communication input / output circuit 15 based on the programs A and B installed separately in the banks 23A and 23B of the EEPROM 23. The output data is processed separately.

また、RAM22には、CPU21がプログラムAとプログラムBに基づいて演算処理するデータをそれぞれ格納する2つのバンク22A、22Bが確保されており、各バンク22A、22Bは、アドレスにより区分けして使用し、同じアドレスをプログラムAとプログラムBに基づいて処理されたデータの双方が共用しないように設定している。   In addition, the RAM 22 has two banks 22A and 22B for storing data to be processed by the CPU 21 based on the programs A and B. The banks 22A and 22B are used by being divided according to addresses. The same address is set so that both the data processed based on the program A and the program B are not shared.

図2は、I/O制御装置1が備えるアナログ出力回路13の構成の詳細を示すブロック図である。   FIG. 2 is a block diagram showing details of the configuration of the analog output circuit 13 provided in the I / O control device 1.

このアナログ出力回路13は、プログラムAにより処理されたデータを送信データとして格納する2つの送信バッファ30A、31A、およびプログラムBにより処理されたデータを送信データとして格納する2つの送信バッファ30B、31Bを備えている。   The analog output circuit 13 includes two transmission buffers 30A and 31A that store data processed by the program A as transmission data, and two transmission buffers 30B and 31B that store data processed by the program B as transmission data. I have.

プログラムA、Bに関してそれぞれ2つの送信バッファ30A、31A、および30B、31Bを設けているのは、例えば一方の送信バッファ30A、30Bから送信データを読み出しているときには、他方の送信バッファ31A、31BにCPU21で処理された送信データを書き込むようにして、データ送信処理速度およびデータのエラー検出処理速度を高めるためである。   The two transmission buffers 30A, 31A and 30B, 31B are provided for the programs A and B, respectively. For example, when transmission data is read from one transmission buffer 30A, 30B, the other transmission buffers 31A, 31B are provided. This is to increase the data transmission processing speed and the data error detection processing speed by writing the transmission data processed by the CPU 21.

なお、上記の4つの送信バッファ30A、31A、30B、31Bの内、送信バッファ30Aと30B、あるいは送信バッファ31Aと31Bが特許請求の範囲における二重化された送信バッファに対応している。   Of the four transmission buffers 30A, 31A, 30B, and 31B, the transmission buffers 30A and 30B or the transmission buffers 31A and 31B correspond to the duplexed transmission buffers in the claims.

プログラムAにより処理されたデータを格納する2つの送信バッファ30A、31Aと、プログラムBにより処理されたデータを格納する2つの送信バッファ30B、31Bには、それぞれ個別に選択器33A、33Bが設けられている。   The two transmission buffers 30A and 31A for storing the data processed by the program A and the two transmission buffers 30B and 31B for storing the data processed by the program B are provided with selectors 33A and 33B, respectively. ing.

各選択器33A、33Bは、後述の動作中バンクレジスタ37からの送信バンク切替信号Rに応じて、いずれか一方の送信バッファを選択する。すなわち、ここでは、送信バンク切替信号RがR=0ならば、プログラムAに関する一方の送信バッファ30AとプログラムBに関する一方の送信バッファ30Bを共に選択し、また、送信バンク切替信号RがR=1ならばプログラムAに関する他方の送信バッファ31AとプログラムBに関する他方の送信バッファ31Bを共に選択する。   Each of the selectors 33A and 33B selects one of the transmission buffers according to a transmission bank switching signal R from an operating bank register 37 described later. That is, here, if the transmission bank switching signal R is R = 0, one transmission buffer 30A related to the program A and one transmission buffer 30B related to the program B are both selected, and the transmission bank switching signal R is R = 1. Then, the other transmission buffer 31A related to the program A and the other transmission buffer 31B related to the program B are both selected.

比較器34は、後述のDAC(Digital to Analog Converter)アクセスコントローラ38からの要求により、送信データの読み取りが要求されると、これに応じて選択器33A、33Bで選択された送信バッファ30A、30B、または31A、31Bから読み出された送信データを比較する。両送信データの値が一致すると、DACアクセスコントローラ38に送信データを出力する。両送信データの値が一致しないときには、データ化けが生じているものと判断してエラー修復処理に移行する。   When the comparator 34 is requested to read transmission data in response to a request from a DAC (Digital to Analog Converter) access controller 38, which will be described later, the transmission buffer 30A, 30B selected by the selectors 33A, 33B according to this request. Or the transmission data read from 31A and 31B is compared. When the values of both transmission data match, the transmission data is output to the DAC access controller 38. If the values of the two transmission data do not match, it is determined that the data is garbled and the process proceeds to error recovery processing.

また、このアナログ出力回路13には、プログラムAに関する送信バンク切替レジスタ35A、プログラムBに関する送信バンク切替レジスタ35B、およびこれらの両レジスタ35A、35Bの値を比較する比較器36が設けられている。   The analog output circuit 13 is provided with a transmission bank switching register 35A for program A, a transmission bank switching register 35B for program B, and a comparator 36 for comparing the values of both registers 35A and 35B.

各送信バンク切替レジスタ35A、35Bは、プログラムA、Bに基づくCPU21からの指示により各々の送信バッファ30A、31A、および30B、31Bへの送信データの格納終了を示す情報(フラグF)を登録する。   Each transmission bank switching register 35A, 35B registers information (flag F) indicating the end of storage of transmission data in each transmission buffer 30A, 31A and 30B, 31B according to an instruction from the CPU 21 based on the programs A, B. .

すなわち、プログラムAに関する送信バンク切替レジスタ35Aは、プログラムAに関する2つの送信バッファ30A、31Aの内、一方の送信バッファ30Aへの送信データの書き込みが終了したときに、その旨を示すフラグF=0を、また他方の送信バッファ31Aへの送信データの書き込みが終了したときにその旨を示すフラグF=1を登録する。同様に、プログラムBに関する送信バンク切替レジスタ35Bは、プログラムBに関する2つの送信バッファ30B、31Bの内、一方の送信バッファ30Bへの送信データの書き込みが終了したときに、その旨を示すフラグF=0を、また他方の送信バッファ31Bへの送信データの書き込みが終了したときにその旨を示すフラグF=1を登録する。   That is, the transmission bank switching register 35A relating to the program A, when writing of transmission data to one transmission buffer 30A out of the two transmission buffers 30A and 31A relating to the program A is completed, indicates that the flag F = 0. When the transmission data writing to the other transmission buffer 31A is completed, a flag F = 1 indicating that is registered. Similarly, the transmission bank switching register 35B for the program B, when the transmission data writing to one transmission buffer 30B of the two transmission buffers 30B and 31B for the program B is completed, indicates a flag F = 0 is registered, and when the writing of transmission data to the other transmission buffer 31B is completed, a flag F = 1 indicating that is registered.

比較器36は、両送信バンク切替レジスタ35A、35Bに登録されたフラグFの値が一致したときには、DACアクセスコントローラ38に対して、選択器33A、33Bの選択切り替えを要求する送信バンク切替要求を出力する。   When the value of the flag F registered in both the transmission bank switching registers 35A and 35B matches, the comparator 36 issues a transmission bank switching request for requesting the DAC access controller 38 to switch the selection of the selectors 33A and 33B. Output.

DACアクセスコントローラ38は、比較器34から出力される送信データをアナログ信号出力に変換し、また、比較器36からの送信バンク切替要求を受けると、これに応じて、このバンク切替要求を動作中バンクレジスタ37に通知する。   The DAC access controller 38 converts the transmission data output from the comparator 34 into an analog signal output. When receiving a transmission bank switching request from the comparator 36, the DAC access controller 38 is operating the bank switching request accordingly. The bank register 37 is notified.

動作中バンクレジスタ37は、DACアクセスコントローラ38からのバンク切替要求を受けると、選択器33A、33Bに対して選択器33A、33Bを切り替える送信バンク切替信号Rを生成するとともに、その送信バンク切替信号Rの値を登録する。   When receiving the bank switching request from the DAC access controller 38, the operating bank register 37 generates a transmission bank switching signal R for switching the selectors 33A and 33B to the selectors 33A and 33B, and the transmission bank switching signal. Register the value of R.

図3は、I/O制御装置1が備えるアナログ入力回路14の構成の詳細を示すブロック図である。   FIG. 3 is a block diagram showing details of the configuration of the analog input circuit 14 provided in the I / O control device 1.

このアナログ入力回路14は、後述のADC(Analog to Digital Converter)アクセスコントローラ46からの受信データを格納する2つの受信バッファ40、41を備えており、プログラムAおよびプログラムBに基づくCPU21の制御により、各々の受信バッファ40、41からそれぞれ受信データを読み出すことが可能である。   The analog input circuit 14 includes two reception buffers 40 and 41 for storing reception data from an ADC (Analog to Digital Converter) access controller 46 described later. Under the control of the CPU 21 based on the programs A and B, The received data can be read from each of the reception buffers 40 and 41.

なお、2つの受信バッファ40、41を設けているのは、次の理由による。すなわち、制御機器3からアナログ入力回路14に入力されるアナログ信号の受信周期と、CPU21がプログラムA、Bで処理する演算周期とは非同期である。したがって、例えば、一方の受信バッファ40にADCアクセスコントローラ46からの受信データを書き込んでいるときには、プログラムAおよびプログラムBに基づくCPU21の制御により他方の受信バッファ41から受信データを読み出すようにして、データ受信処理速度、およびデータのエラー検出処理速度を高めるためである。   The two reception buffers 40 and 41 are provided for the following reason. That is, the reception cycle of the analog signal input from the control device 3 to the analog input circuit 14 and the calculation cycle processed by the CPU 21 with the programs A and B are asynchronous. Therefore, for example, when the reception data from the ADC access controller 46 is written in one reception buffer 40, the reception data is read from the other reception buffer 41 under the control of the CPU 21 based on the program A and the program B. This is to increase the reception processing speed and the data error detection processing speed.

選択器43は、後述の動作中バンクレジスタ44からの受信バンク切替信号Lに応じて、いずれか一方の受信バッファ40または41を選択する。この場合、受信バンク切替信号LがL=0ならば、選択器43は一方の受信バッファ40を選択し、受信バンク切替信号LがL=1ならば、選択器43は他方の受信バッファ41を選択する。   The selector 43 selects one of the reception buffers 40 or 41 in response to a reception bank switching signal L from an operating bank register 44 described later. In this case, if the reception bank switching signal L is L = 0, the selector 43 selects one reception buffer 40, and if the reception bank switching signal L is L = 1, the selector 43 selects the other reception buffer 41. select.

受信バンク切替レジスタ45は、いずれか一方の受信バッファへの受信データの格納が終了した時点で、当該受信バッファから最新の受信データを読み出すために、プログラムAに基づいてCPU21から与えられる受信バンク切替要求(フラグM)を登録するとともに、その受信バンク切替要求MをADCアクセスコントローラ46に送出する。   The reception bank switching register 45 receives the reception bank switching given from the CPU 21 based on the program A in order to read out the latest reception data from the reception buffer when the reception data has been stored in one of the reception buffers. A request (flag M) is registered and the reception bank switching request M is sent to the ADC access controller 46.

ADCアクセスコントローラ46は、制御機器3から送られてくるアナログ信号を受信データとしてデジタル変換し、また、受信バンク切替レジスタ45からの送信バンク切替要求Mを受けると、これに応じて、この受信バンク切替要求Mを動作中バンクレジスタ44に通知する。   The ADC access controller 46 digitally converts the analog signal sent from the control device 3 as received data, and upon receiving a transmission bank switching request M from the receiving bank switching register 45, in response to this, The switching request M is notified to the operating bank register 44.

動作中バンクレジスタ44は、ADCアクセスコントローラ46からの受信バンク切替要求Mを受けると、選択器43に対して受信バッファ40、41の選択を切り替える受信バンク切替信号Lを生成するとともに、その受信バンク切替信号Lの値を登録する。   Upon receipt of the reception bank switching request M from the ADC access controller 46, the operating bank register 44 generates a reception bank switching signal L for switching the selection of the reception buffers 40 and 41 to the selector 43, and the reception bank The value of the switching signal L is registered.

なお、上記の受信バンク切替レジスタ45と動作中バンクレジスタ44とが特許請求の範囲(請求項2)におけるバンク切替手段に対応している。   The reception bank switching register 45 and the operating bank register 44 correspond to the bank switching means in the claims (Claim 2).

図4は、I/O制御装置が備える通信入出力回路15の構成の詳細を示すブロック図である。   FIG. 4 is a block diagram showing details of the configuration of the communication input / output circuit 15 included in the I / O control device.

通信入出力回路15の通信コントローラ58は、上位制御装置2との通信処理として送信/受信処理を行うものであり、その構成については、図3に示したアナログ出力回路13と、図4に示したアナログ入力回路14とを組み合わせた構成となっているので、ここでは詳しい説明は省略する。   The communication controller 58 of the communication input / output circuit 15 performs transmission / reception processing as communication processing with the host control device 2, and the configuration thereof is shown in FIG. 3 and the analog output circuit 13 shown in FIG. 4. Since the analog input circuit 14 is combined, detailed description is omitted here.

次に動作について説明する。
先ず、図2のアナログ出力回路13に対するCPU21の制御処理について、図5に示すフローチャートを参照して説明する。なお、以下において、符号Sは各処理ステップを意味する。
Next, the operation will be described.
First, control processing of the CPU 21 for the analog output circuit 13 of FIG. 2 will be described with reference to a flowchart shown in FIG. In the following, the symbol S means each processing step.

CPU21は、ここではプログラムAに基づく制御処理と、プログラムBに基づく制御処理を同時に並列処理できる構成ではないので、プログラムAに基づく制御処理を実行した後に、プログラムBに基づく制御処理を実行する。   Here, the CPU 21 is not configured so that the control process based on the program A and the control process based on the program B can be performed in parallel at the same time. Therefore, after executing the control process based on the program A, the CPU 21 executes the control process based on the program B.

そこで、先ず、プログラムAに基づく処理として、動作中バンクレジスタ37に現在登録されている送信バンク切替信号Rの値を読み込み(S11)、各選択器33A、33Bが送信バッファ30A、31A、30B、31Bのいずれを選択している状態かを判断する(S12)。   Therefore, first, as processing based on the program A, the value of the transmission bank switching signal R currently registered in the operating bank register 37 is read (S11), and the selectors 33A and 33B transmit the transmission buffers 30A, 31A, 30B, It is determined which of 31B is selected (S12).

ここで、送信バンク切替信号Rの値がR=0ならば、各選択器33A、33Bが送信バッファ30A、30Bを選択している。したがって、送信バッファ30AからプログラムAで演算処理された送信データが読み出されている状態なので、CPU21は、他方の送信バッファ31AにプログラムAで演算処理したデータを送信データとして書き込む(S13)。そして、送信バッファ31Aへの送信データの書き込みが終了すると、プログラムAに関する送信バンク切替レジスタ35Aに対してデータ書き込み終了を示すフラグF=1を登録する(S14)。   Here, if the value of the transmission bank switching signal R is R = 0, the selectors 33A and 33B select the transmission buffers 30A and 30B. Therefore, since the transmission data calculated by the program A is being read from the transmission buffer 30A, the CPU 21 writes the data calculated by the program A as transmission data in the other transmission buffer 31A (S13). When the transmission data writing to the transmission buffer 31A is completed, a flag F = 1 indicating the completion of data writing is registered in the transmission bank switching register 35A related to the program A (S14).

一方、先のS12で送信バンク切替信号Rの値がR=1ならば、各選択器33A、33Bが送信バッファ31A、31Bを選択している。したがって、送信バッファ31AからプログラムAで演算処理された送信データが読み出されている状態なので、CPU21は、他方の送信バッファ30AにプログラムAで演算処理したデータを送信データとして書き込む(S15)。そして、送信バッファ30Aへの送信データの書き込みが終了すると、プログラムAに関する送信バンク切替レジスタ35Aに対してデータ書き込み終了を示すフラグF=0を登録する(S16)。   On the other hand, if the value of the transmission bank switching signal R is R = 1 in the previous S12, the selectors 33A and 33B select the transmission buffers 31A and 31B. Therefore, since the transmission data calculated by the program A is being read from the transmission buffer 31A, the CPU 21 writes the data calculated by the program A as transmission data in the other transmission buffer 30A (S15). When the writing of transmission data to the transmission buffer 30A is completed, a flag F = 0 indicating the completion of data writing is registered in the transmission bank switching register 35A for the program A (S16).

こうして、プログラムAに基づく送信バッファ31Aまたは30Aへの送信データの書き込み処理が終了すると、CPU21は、次にプログラムBに基づく処理に移行する。   Thus, when the transmission data writing process to the transmission buffer 31A or 30A based on the program A is completed, the CPU 21 proceeds to a process based on the program B next.

このプログラムBに基づく処理も、プログラムAに基づく処理と基本的に同じであり、CPU21は、動作中バンクレジスタ37に現在登録されている送信バンク切替信号Rの値を読み込み(S17)、各選択器33A、33Bが送信バッファ30A、31A、30B、31Bのいずれを選択している状態かを判断する(S18)。   The processing based on the program B is basically the same as the processing based on the program A, and the CPU 21 reads the value of the transmission bank switching signal R currently registered in the operating bank register 37 (S17), and selects each selection. It is determined which of the transmission buffers 30A, 31A, 30B, and 31B is selected by the devices 33A and 33B (S18).

ここで、送信バンク切替信号Rの値がR=0ならば、各選択器33A、33Bが送信バッファ30A、30Bを選択しており、送信バッファ30Bから送信データが読み出されている状態なので、CPU21は、他方の送信バッファ31BにプログラムBで演算処理したデータを送信データとして書き込む(S19)。そして、送信バッファ31Bへの送信データの書き込みが終了すると、プログラムBに関する送信バンク切替レジスタ35Bに対してデータ書き込み終了を示すフラグF=1を登録する(S20)。   Here, if the value of the transmission bank switching signal R is R = 0, the selectors 33A and 33B have selected the transmission buffers 30A and 30B, and the transmission data has been read from the transmission buffer 30B. The CPU 21 writes the data calculated by the program B in the other transmission buffer 31B as transmission data (S19). When the writing of the transmission data to the transmission buffer 31B is completed, a flag F = 1 indicating the completion of data writing is registered in the transmission bank switching register 35B for the program B (S20).

一方、先のS18で送信バンク切替信号Rの値がR=1ならば、各選択器33A、33Bが送信バッファ31A、31Bを選択しており、送信バッファ31Bから送信データが読み出されている状態なので、CPU21は、他方の送信バッファ30BにプログラムBで演算処理したデータを送信データとして書き込む(S21)。そして、送信バッファ30Bへの送信データの書き込みが終了すると、プログラムBに関する送信バンク切替レジスタ35Bに対してデータ書き込み終了を示すフラグF=0を登録する(S22)。   On the other hand, if the value of the transmission bank switching signal R is R = 1 in the previous S18, the selectors 33A and 33B select the transmission buffers 31A and 31B, and the transmission data is read from the transmission buffer 31B. Since it is in the state, the CPU 21 writes the data processed by the program B as transmission data in the other transmission buffer 30B (S21). When the transmission data writing to the transmission buffer 30B is completed, a flag F = 0 indicating the completion of data writing is registered in the transmission bank switching register 35B related to the program B (S22).

比較器36は、送信バンク切替レジスタ35A、35Bに登録された各々のフラグFが一致しているかどうかを判定する。   The comparator 36 determines whether or not the flags F registered in the transmission bank switching registers 35A and 35B match.

ここで、フラグFが共にF=1で一致する場合には、プログラムAとプログラムBに基づく各々の送信データの送信バッファ31A、31Bへの書き込みが共に終了したことを示しているので、各送信バッファ31A、31Bに書き込まれた送信データを共に読み出して比較すべく、比較器36は、DACアクセスコントローラ38に対して送信バンク切替要求を出力する。これに応じて、DACアクセスコントローラ38は、送信バンク切替要求を動作中バンクレジスタ37に通知するので、動作中バンクレジスタ37は、送信バンク切替信号Rの値を切り替える。すなわち、現在の送信バンク切替信号Rの値がR=0である場合は、送信バンク切替要求に応じてR=1に切り替える。また、動作中バンクレジスタ37は、この切り換わった送信バンク切替信号R=1を登録する。   Here, when both flags F coincide with F = 1, it indicates that the writing of the transmission data based on the program A and the program B to the transmission buffers 31A and 31B is completed. The comparator 36 outputs a transmission bank switching request to the DAC access controller 38 in order to read and compare the transmission data written in the buffers 31A and 31B together. In response to this, the DAC access controller 38 notifies the operating bank register 37 of the transmission bank switching request, so that the operating bank register 37 switches the value of the transmission bank switching signal R. That is, when the value of the current transmission bank switching signal R is R = 0, the transmission bank switching signal R is switched to R = 1 in response to the transmission bank switching request. In addition, the operating bank register 37 registers the switched transmission bank switching signal R = 1.

これにより、選択器33A、33Bで送信バッファ31A、31Bが選択されるため、各送信バッファ31A、31Bに書き込まれた送信データが共に読み出されて比較器34で比較される。この比較の結果、両送信データの値が一致すると、データ化けは無いと判断して、DACアクセスコントローラ38に送信データを出力する。これに対して、両送信データの値が一致しないときには、データ化けが発生しているものと判断し、不正な送信データを出力せずに、エラー修復処理に移行する。   As a result, the transmission buffers 31A and 31B are selected by the selectors 33A and 33B, so that the transmission data written in the transmission buffers 31A and 31B are read together and compared by the comparator 34. If the values of the two transmission data match as a result of this comparison, it is determined that there is no data corruption, and the transmission data is output to the DAC access controller 38. On the other hand, when the values of the two transmission data do not match, it is determined that data corruption has occurred, and the process proceeds to error recovery processing without outputting illegal transmission data.

一方、送信バンク切替レジスタ35A、35Bに登録されたフラグFが共にF=0で一致する場合には、プログラムAとプログラムBに基づく各送信データの送信バッファ30A、30Bへの書き込みが共に終了したことを示しているので、比較器36は、DACアクセスコントローラ38に対して、送信バンク切替要求を出力する。これに応じて、DACアクセスコントローラ38は、この送信バンク切替要求を動作中バンクレジスタ37に通知するので、動作中バンクレジスタ37は、送信バンク切替信号Rの値を切り替える。すなわち、現在の送信バンク切替信号Rの値がR=1である場合にはR=0に切り替える。また、動作中バンクレジスタ37は、この切り換わった送信バンク切替信号Rの値(R=0)を登録する。   On the other hand, when the flags F registered in the transmission bank switching registers 35A and 35B coincide with each other when F = 0, writing of the transmission data to the transmission buffers 30A and 30B based on the programs A and B is completed. Therefore, the comparator 36 outputs a transmission bank switching request to the DAC access controller 38. In response to this, the DAC access controller 38 notifies the operating bank register 37 of this transmission bank switching request, so that the operating bank register 37 switches the value of the transmission bank switching signal R. That is, when the current value of the transmission bank switching signal R is R = 1, the value is switched to R = 0. Further, the operating bank register 37 registers the value (R = 0) of the switched transmission bank switching signal R.

これにより、選択器33A、33Bで送信バッファ30A、30Bが選択されるため、各送信バッファ30A、30Bに書き込まれた送信データが共に読み出されて比較器34で比較される。この比較の結果、両送信データの値が一致すると、データ化けは無いと判断して、DACアクセスコントローラ38に送信データを出力する。これに対して、両送信データの値が一致しないときには、データ化けが発生しているものと判断し、不正な送信データを出力せずに、エラー修復処理に移行する。   As a result, the transmission buffers 30A and 30B are selected by the selectors 33A and 33B, so that the transmission data written in the transmission buffers 30A and 30B are read together and compared by the comparator 34. If the values of the two transmission data match as a result of this comparison, it is determined that there is no data corruption, and the transmission data is output to the DAC access controller 38. On the other hand, when the values of the two transmission data do not match, it is determined that data corruption has occurred, and the process proceeds to error recovery processing without outputting illegal transmission data.

このように、RAM22のバンク22A、22B、もしくはEEPROM23のバンク23A、23Bに記憶されているデータやプログラムにデータ化けが発生している場合、比較器34で比較される両送信データの値が一致しなくなるので、DACアクセスコントローラ38が不正なデータをアナログに変換して制御機器3に出力という不具合を事前に防ぐことができる。   As described above, when data corruption occurs in the data or program stored in the banks 22A and 22B of the RAM 22 or the banks 23A and 23B of the EEPROM 23, the values of both transmission data compared by the comparator 34 are equal to each other. Therefore, it is possible to prevent the DAC access controller 38 from converting the illegal data into analog data and outputting the data to the control device 3 in advance.

次に、図3のアナログ入力回路14に対するCPU21の制御処理について、図6に示すフローチャートを参照して説明する。   Next, the control processing of the CPU 21 for the analog input circuit 14 of FIG. 3 will be described with reference to the flowchart shown in FIG.

図5について説明した場合と同様、CPU21は、プログラムAに基づく制御処理を実行した後に、プログラムBに基づく制御処理を実行する。   As in the case described with reference to FIG. 5, the CPU 21 executes the control process based on the program B after executing the control process based on the program A.

そこで、先ず、プログラムAに基づく処理として、動作中バンクレジスタ44に現在登録されている受信バンク切替信号Lの値を読み込み(S31)、選択器43が受信バッファ40、41のいずれを選択している状態かを判断する(S32)。   Therefore, first, as a process based on the program A, the value of the reception bank switching signal L currently registered in the operating bank register 44 is read (S31), and the selector 43 selects any of the reception buffers 40 and 41. It is judged whether it is in a state (S32).

ここで、受信バンク切替信号LがL=0の場合には、選択器43が受信バッファ40を選択しており、この受信バッファ40が受信データの書き込み可能状態に、他方の受信バッファ41が受信データの読み出し可能状態になっている。   Here, when the reception bank switching signal L is L = 0, the selector 43 has selected the reception buffer 40, the reception buffer 40 is ready to write received data, and the other reception buffer 41 receives the data. Data can be read.

そこで、CPU21は、受信バッファ40へのデータ書き込みが終了した時点でこの最新の受信データをプログラムAに基づいて読み出すべく、他方の受信バッファ41を書き込み状態にするための受信バンク切替要求(フラグM=1)を受信バンク切替レジスタ45に与える(S33)。これに応じて、受信バンク切替レジスタ45は、この受信バンク切替要求(フラグM=1)を登録するとともに、ADCアクセスコントローラ46に転送する。これに応じて、ADCアクセスコントローラ46は、この受信バンク切替要求(フラグM=1)を動作中バンクレジスタ37に通知する。   Therefore, the CPU 21 reads the latest received data based on the program A at the time when the data writing to the receiving buffer 40 is completed, so that the receiving bank switching request (flag M for setting the other receiving buffer 41 to the writing state). = 1) is given to the reception bank switching register 45 (S33). In response to this, the reception bank switching register 45 registers this reception bank switching request (flag M = 1) and transfers it to the ADC access controller 46. In response to this, the ADC access controller 46 notifies the operating bank register 37 of this reception bank switching request (flag M = 1).

また、CPU21は、動作中バンクレジスタ44に登録されている受信バンク切替信号Lの値を読み(S34)、この受信バンク切替信号Lの値がL=0ならば受信バッファ40への受信データの書き込みが未だ終了していないので、受信データの書き込みを継続する(S35)。   Further, the CPU 21 reads the value of the reception bank switching signal L registered in the operating bank register 44 (S34). If the value of the reception bank switching signal L is L = 0, the reception data of the reception data to the reception buffer 40 is read. Since the writing has not been completed yet, the writing of the received data is continued (S35).

受信バッファ40への受信データの書き込みが終了すれば、CPU21は、動作中バンクレジスタ44に対して、ADCアクセスコントローラ46からの受信バンク切替要求(フラグM=1)を受け入れるように指令するので、動作中バンクレジスタ44は、受信バンク切替信号Lの値をL=0からL=1に切り替える。また、動作中バンクレジスタ44は、この受信バンク切替信号の値L=1を登録する。   When the writing of the reception data to the reception buffer 40 is completed, the CPU 21 instructs the operating bank register 44 to accept the reception bank switching request (flag M = 1) from the ADC access controller 46. The operating bank register 44 switches the value of the reception bank switching signal L from L = 0 to L = 1. The operating bank register 44 registers the value L = 1 of the reception bank switching signal.

これにより、選択器43によって他方の受信バッファ41が選択されるので、この時点で、この受信バッファ41が受信データの書き込み可能状態に、他方の受信バッファ40が受信データの読み出し可能状態に切り替わるため、CPU21は、プログラムAに基づいて他方の受信バッファ40から受信データを読み出す(S36)。   As a result, the other receiving buffer 41 is selected by the selector 43. At this time, the receiving buffer 41 is switched to a state in which received data can be written, and the other receiving buffer 40 is switched to a state in which received data can be read. The CPU 21 reads the received data from the other receiving buffer 40 based on the program A (S36).

先のS32で受信バンク切替信号Lの値がL=1ならば、選択器43が受信バッファ41を選択しており、この受信バッファ41が受信データの書き込み可能状態に、他方の受信バッファ40が受信データの読み出し可能状態になっている。   If the value of the reception bank switching signal L is L = 1 in the previous S32, the selector 43 has selected the reception buffer 41, the reception buffer 41 is in a state in which reception data can be written, and the other reception buffer 40 has Received data can be read.

そこで、CPU21は、受信バッファ41へのデータ書き込みが終了した時点で、この最新の受信データをプログラムAに基づいて読み出すべく、一方の受信バッファ40を書き込み状態にするための受信バンク切替要求(フラグM=0)を受信バンク切替レジスタ45に与える(S37)。これに応じて、受信バンク切替レジスタ45は、この受信バンク切替要求(フラグM=0)を登録するとともに、ADCアクセスコントローラ46に転送する。これに応じて、ADCアクセスコントローラ46は、この受信バンク切替要求(フラグM=0)を動作中バンクレジスタ37に通知する。   Therefore, when the data writing to the receiving buffer 41 is completed, the CPU 21 reads a reception bank switching request (flag) for setting one receiving buffer 40 in a writing state so as to read out the latest received data based on the program A. M = 0) is given to the reception bank switching register 45 (S37). In response to this, the reception bank switching register 45 registers this reception bank switching request (flag M = 0) and transfers it to the ADC access controller 46. In response to this, the ADC access controller 46 notifies the operating bank register 37 of this reception bank switching request (flag M = 0).

また、CPU21は、動作中バンクレジスタ44に登録されている受信バンク切替信号Lの値を読み(S38)、この受信バンク切替信号Lの値がL=1ならば受信バッファ41への受信データの書き込みが未だ終了していないので、受信データの書き込みを継続する(S39)。   Further, the CPU 21 reads the value of the reception bank switching signal L registered in the operating bank register 44 (S38). If the value of the reception bank switching signal L is L = 1, the received data of the reception data to the reception buffer 41 is read. Since the writing has not been completed yet, the writing of the received data is continued (S39).

受信バッファ41への受信データの書き込みが終了すれば、CPU21は、動作中バンクレジスタ44に対して、ADCアクセスコントローラ46からの受信バンク切替要求(フラグM=0)を受け入れるように指令するので、動作中バンクレジスタ44は、受信バンク切替信号Lの値をL=1からL=0に切り替える。また、動作中バンクレジスタ44は、この受信バンク切替信号L=0を登録する。   When the reception data is completely written to the reception buffer 41, the CPU 21 instructs the operating bank register 44 to accept the reception bank switching request (flag M = 0) from the ADC access controller 46. The operating bank register 44 switches the value of the reception bank switching signal L from L = 1 to L = 0. The operating bank register 44 registers the reception bank switching signal L = 0.

これにより、選択器43によって一方の受信バッファ40が選択されるので、この時点で、この受信バッファ40が受信データの書き込み可能状態に、他方の受信バッファ41が受信データの読み出し可能状態に切り替わるため、CPU21は、プログラムAに基づいて他方の受信バッファ41から受信データを読み出す(S40)。   As a result, one of the reception buffers 40 is selected by the selector 43. At this point, the reception buffer 40 is switched to a state in which reception data can be written, and the other reception buffer 41 is switched to a state in which reception data can be read. The CPU 21 reads the received data from the other receiving buffer 41 based on the program A (S40).

このようにして、プログラムAに基づく受信バッファ40または41からの受信データの読み出し処理が終了すると、CPU21は、次にプログラムBに基づく処理に移行する。   In this way, when the read processing of the reception data from the reception buffer 40 or 41 based on the program A is completed, the CPU 21 proceeds to the processing based on the program B next.

このプログラムBに基づく処理において、CPU21は、動作中バンクレジスタ44に現在登録されている受信バンク切替信号Lの値を読み込み(S41)、選択器43が受信バッファ40、41のいずれを選択している状態かを判断する(S42)。   In the processing based on the program B, the CPU 21 reads the value of the reception bank switching signal L currently registered in the operating bank register 44 (S41), and the selector 43 selects any of the reception buffers 40 and 41. It is judged whether it is in a state (S42).

このとき、先のプログラムAに基づくS33〜S35の処理によって、既に受信バンク切替信号LがL=1となっている場合には、選択器43が受信バッファ41を選択している。したがって、この受信バッファ41が受信データの書き込み可能状態に、他方の受信バッファ40が受信データの読み出し可能状態になっているので、CPU21は、プログラムBに基づいて他方の受信バッファ40から最新の受信データを読み出す(S43)。   At this time, if the reception bank switching signal L is already L = 1 by the processing of S33 to S35 based on the previous program A, the selector 43 selects the reception buffer 41. Therefore, since the reception buffer 41 is in a state in which reception data can be written and the other reception buffer 40 is in a state in which reception data can be read, the CPU 21 receives the latest reception from the other reception buffer 40 based on the program B. Data is read out (S43).

また、先のプログラムAに基づくS37〜S39の処理によって、既に受信バンク切替信号LがL=0となっている場合には、選択器43が受信バッファ40を選択している。したがって、この受信バッファ40が受信データの書き込み可能状態に、他方の受信バッファ41が受信データの読み出し可能状態になっているので、CPU21は、プログラムBに基づいて他方の受信バッファ41から最新の受信データを読み出す(S44)。   If the reception bank switching signal L is already L = 0 by the processing of S37 to S39 based on the previous program A, the selector 43 selects the reception buffer 40. Therefore, since the reception buffer 40 is in a state in which reception data can be written and the other reception buffer 41 is in a state in which reception data can be read, the CPU 21 receives the latest reception from the other reception buffer 41 based on the program B. Data is read out (S44).

こうして、CPU21は、同一の受信バッファ40または41から読み出した受信データについてプログラムAおよびプログラムBに基づいて演算処理を行うが、このとき、受信データのいずれかにデータ化けが生じていた場合、あるいはEEPROM23のバンク23A、23Bに記憶されているプログラムA、Bのいずれかにデータ化けが生じていた場合には、RAM22のバンク22A、22Bに記憶されるデータもデータ化けしたデータとなるので、アナログ出力回路13の比較器34で比較される際に、送信データが不一致となる。したがって、CPU21が不正な受信データやプログラムに基づいて演算処理を行って、その結果を制御機器3にアナログ出力するのを事前に防ぐことができる。   In this way, the CPU 21 performs arithmetic processing on the received data read from the same reception buffer 40 or 41 based on the programs A and B. At this time, if any of the received data is garbled, or If any of the programs A and B stored in the banks 23A and 23B of the EEPROM 23 is garbled, the data stored in the banks 22A and 22B of the RAM 22 is also garbled data. When compared by the comparator 34 of the output circuit 13, the transmission data does not match. Therefore, it is possible to prevent the CPU 21 from performing arithmetic processing based on illegal received data or a program and outputting the result to the control device 3 in advance.

次に、図4の通信入出力回路15に対するCPU21の制御処理について、図7に示すフローチャートを参照して説明する。   Next, control processing of the CPU 21 for the communication input / output circuit 15 of FIG. 4 will be described with reference to the flowchart shown in FIG.

上位制御装置2に対する送信処理については、アナログ出力回路13による制御機器3への送信処理と基本的に同じであり、プログラムAに基づく制御処理を実行した後に、プログラムBに基づく制御処理を実行する(S51〜S57、S60〜S63、S66〜S68、S71、S72)。   The transmission process for the host controller 2 is basically the same as the transmission process to the control device 3 by the analog output circuit 13, and after executing the control process based on the program A, the control process based on the program B is executed. (S51-S57, S60-S63, S66-S68, S71, S72).

したがって、RAM22もしくはEEPROM23のデータ化けが発生したことにより通信出力演算結果に影響が発生するような場合には、比較器54がプログラムAとプログラムBの通信出力データの不一致を検出することにより、データ化けを事前に検出することができるので、通信コントローラ58が不正なデータを上位制御装置2に送信するのを未然に防止することができる。   Therefore, if the data output in the RAM 22 or the EEPROM 23 is garbled and the communication output calculation result is affected, the comparator 54 detects the inconsistency between the communication output data of the program A and the program B. Since the ghost can be detected in advance, it is possible to prevent the communication controller 58 from transmitting illegal data to the host controller 2 in advance.

上位制御装置2に対する受信処理については、アナログ入力回路14による制御機器3からの受信処理と基本的に同じであり、この場合もプログラムAに基づく制御処理を実行した後に、プログラムBに基づく制御処理を実行する(S51、S58、S59、S64、S65、S66、S69、S70、S72、S73)。   The reception process for the host controller 2 is basically the same as the reception process from the control device 3 by the analog input circuit 14. In this case as well, the control process based on the program B is executed after the control process based on the program A is executed. (S51, S58, S59, S64, S65, S66, S69, S70, S72, S73).

したがって、CPU21は、同一の受信バッファ60または61から読み出した受信データについてプログラムAおよびプログラムBに基づいて演算処理を行うが、このとき、受信データのいずれかにデータ化けが生じていた場合、あるいはEEPROM23のバンク23A、23Bに記憶されているプログラムA、Bのいずれかにデータ化けが生じていた場合には、RAM22のバンク22A、22Bに記憶されるデータもデータ化けしたデータとなるので、比較器54で比較される際に、送信データが不一致となる。したがって、通信コントローラ58が不正なデータを上位制御装置2との間で受信したり送信したりするのを事前に防ぐことができる。   Therefore, the CPU 21 performs arithmetic processing on the received data read from the same receiving buffer 60 or 61 based on the program A and the program B. At this time, if any of the received data is garbled, or If any of the programs A and B stored in the banks 23A and 23B of the EEPROM 23 is garbled, the data stored in the banks 22A and 22B of the RAM 22 is also garbled. When the data is compared by the device 54, the transmission data does not match. Therefore, it is possible to prevent the communication controller 58 from receiving or transmitting illegal data with the host controller 2 in advance.

なお、この発明は、上記の実施の形態1の構成のみに限定されるものではなく、この発明の趣旨を逸脱しない範囲内において、実施の形態1の構成の一部に変形を加えたり、一部の構成を省略することが可能である。   The present invention is not limited only to the configuration of the first embodiment described above, and a part of the configuration of the first embodiment may be modified or changed within a range not departing from the gist of the present invention. The configuration of the part can be omitted.

1 I/O制御装置、2 上位制御装置、3 制御機器、12 マイコン、
13 アナログ出力回路、14 アナログ入力回路、15 通信入出力回路、
21 CPU、22 RAM、23 EEPROM、
30A,30B,31A,31B 送信バッファ、33A,33B 選択器、
34 比較器、35A,35B 送信バンク切替レジスタ、36 比較器、
37 動作中バンクレジスタ、38 DACアクセスコントローラ、
40,41 受信バッファ、43 選択器、44 動作中バンクレジスタ、
45 受信バンク切替レジスタ、46 ADCアクセスコントローラ、
50A,50B,51A,51B 送信バッファ、53A,53B 選択器、
54 比較器、55A,55B 送信バンク切替レジスタ、56 比較器、
57 動作中バンクレジスタ、58 通信コントローラ、60,61 受信バッファ、
62 選択器、63 受信バンク切替レジスタ。
1 I / O control device, 2 host control device, 3 control device, 12 microcomputer,
13 Analog output circuit, 14 Analog input circuit, 15 Communication input / output circuit,
21 CPU, 22 RAM, 23 EEPROM,
30A, 30B, 31A, 31B transmission buffer, 33A, 33B selector,
34 comparator, 35A, 35B transmission bank switching register, 36 comparator,
37 Bank register in operation, 38 DAC access controller,
40, 41 receive buffer, 43 selector, 44 bank register in operation,
45 Receive bank switching register, 46 ADC access controller,
50A, 50B, 51A, 51B transmission buffer, 53A, 53B selector,
54 comparator, 55A, 55B transmission bank switching register, 56 comparator,
57 Bank register in operation, 58 Communication controller, 60, 61 Receive buffer,
62 Selector, 63 Receive bank switching register.

Claims (2)

制御目標値を演算する上位制御装置と、制御対象となる制御機器との間にあって、これらの装置との間の入出力制御を司るものであり、かつ、上記上位制御装置の演算処理の負荷軽減のためにマイクロコンピュータが搭載されているI/O制御装置において、
上記マイクロコンピュータは、CPUと、このCPUによる演算処理用のデータを格納する内蔵のメモリとを備え、上記メモリはデータ化けが無い限り実質的に同じデータを格納する2つのバンクを有する一方、各々の上記バンクから読み出されるデータをそれぞれ送信データとして格納する二重化された送信バッファと、上記制御機器へのデータ送信時、または上記上位制御装置へのデータ送信時に各々の上記送信バッファに格納されている上記送信データを読み出して比較する比較器と、を備えたことを特徴とするI/O制御装置。
Reduces the processing load of the host control device between the host control device that calculates the control target value and the control device to be controlled and controls input / output between these devices. In an I / O control device equipped with a microcomputer for
The microcomputer includes a CPU and a built-in memory for storing data for arithmetic processing by the CPU, and the memory has two banks for storing substantially the same data as long as there is no data corruption, Are stored in each transmission buffer when data is transmitted to the control device or when data is transmitted to the host controller. An I / O control device comprising: a comparator that reads and compares the transmission data.
上記制御機器または上記上位制御装置から受信された受信データを格納する二重化された受信バッファと、これらの上記受信バッファの一方をデータ書込用に、他方を上記CPUへのデータ読出用として選択する選択器と、
この選択器でデータ書込用として選択されたいずれか一方の上記受信バッファに上記受信データが格納された時点で、この受信バッファを上記CPUへのデータ読出用に、他方の上記受信バッファを上記データ書込用に強制的に切り替える受信バンク切替信号を出力するバンク切替手段と、を備えたことを特徴とする請求項1に記載のI/O制御装置。
A duplex reception buffer for storing reception data received from the control device or the host controller, and one of the reception buffers is selected for data writing and the other is selected for data reading to the CPU. A selector,
When the reception data is stored in one of the reception buffers selected for data writing by the selector, the reception buffer is used for data reading to the CPU, and the other reception buffer is used for the data reading. 2. The I / O control device according to claim 1, further comprising bank switching means for outputting a reception bank switching signal forcibly switching for data writing.
JP2014124115A 2014-06-17 2014-06-17 I / O control device Active JP6214476B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2014124115A JP6214476B2 (en) 2014-06-17 2014-06-17 I / O control device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2014124115A JP6214476B2 (en) 2014-06-17 2014-06-17 I / O control device

Publications (2)

Publication Number Publication Date
JP2016004409A JP2016004409A (en) 2016-01-12
JP6214476B2 true JP6214476B2 (en) 2017-10-18

Family

ID=55223646

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2014124115A Active JP6214476B2 (en) 2014-06-17 2014-06-17 I / O control device

Country Status (1)

Country Link
JP (1) JP6214476B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP7224237B2 (en) * 2019-05-08 2023-02-17 三菱電機株式会社 I/O controller

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS61233857A (en) * 1985-04-08 1986-10-18 Mitsubishi Electric Corp Data transfer equipment
JPH05341918A (en) * 1992-05-12 1993-12-24 Internatl Business Mach Corp <Ibm> Connector for constituting duplex disk storage device system
JP2001290710A (en) * 2000-04-10 2001-10-19 Toshiba Corp Device for detecting data error
JP2007148779A (en) * 2005-11-28 2007-06-14 Renesas Technology Corp Microcontroller and ram

Also Published As

Publication number Publication date
JP2016004409A (en) 2016-01-12

Similar Documents

Publication Publication Date Title
US7706900B2 (en) Control apparatus with fast I/O function, and control method for control data thereof
US8234463B2 (en) Data processing apparatus, memory controller, and access control method of memory controller
US10365979B2 (en) Lockstepped CPU selection based on failure status
US9575692B2 (en) Cache control device having fault-tolerant function and method of operating the same
TWI416406B (en) Microprocessor, and methods for initializing a microprocessor
JP2007148779A (en) Microcontroller and ram
JP6214476B2 (en) I / O control device
WO2009098737A1 (en) External device access apparatus, its controlling method and system lsi
KR102307955B1 (en) Determining match between data values stored by several arrays
JP2014016925A (en) Information processing system, data switching method and program
US8447932B2 (en) Recover store data merging
US8924625B2 (en) Method and system of reducing number of comparators in address range overlap detection at a computing system
CN116802635A (en) BIOS update for electronic device
JP2016122338A (en) Error correction apparatus
JP2020184184A (en) I/o control device
JP6358122B2 (en) Microcomputer
US8484437B2 (en) Data processing apparatus using pre-fetched data
US20130227343A1 (en) Circuits and Methods for Replacing Defective Instructions
JP2014186664A (en) Arithmetic unit and error processing method
JP6626216B2 (en) controller
JP7312127B2 (en) Control device
JP5435647B2 (en) Computer system, memory initialization method, and program
JP3097672B2 (en) Memory control circuit
JP6645467B2 (en) Microcomputer
US20130205048A1 (en) Information processing apparatus and control method thereof

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20161213

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20170731

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: 20170822

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20170919

R150 Certificate of patent or registration of utility model

Ref document number: 6214476

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250