JP5549556B2 - Data collection system, data collection system abnormality factor determination method - Google Patents

Data collection system, data collection system abnormality factor determination method Download PDF

Info

Publication number
JP5549556B2
JP5549556B2 JP2010255759A JP2010255759A JP5549556B2 JP 5549556 B2 JP5549556 B2 JP 5549556B2 JP 2010255759 A JP2010255759 A JP 2010255759A JP 2010255759 A JP2010255759 A JP 2010255759A JP 5549556 B2 JP5549556 B2 JP 5549556B2
Authority
JP
Japan
Prior art keywords
database
sql
processing group
programmable controller
plc
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
JP2010255759A
Other languages
Japanese (ja)
Other versions
JP2012108642A (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.)
Fuji Electric Co Ltd
Original Assignee
Fuji Electric Co Ltd
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 Fuji Electric Co Ltd filed Critical Fuji Electric Co Ltd
Priority to JP2010255759A priority Critical patent/JP5549556B2/en
Publication of JP2012108642A publication Critical patent/JP2012108642A/en
Application granted granted Critical
Publication of JP5549556B2 publication Critical patent/JP5549556B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Testing And Monitoring For Control Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Programmable Controllers (AREA)

Description

プログラマブルコントローラ(PLC)等の制御装置が収集した所定のデータをデータベースに保存するデータ収集システムに関する。   The present invention relates to a data collection system that stores predetermined data collected by a control device such as a programmable controller (PLC) in a database.

ネットワークなどの通信路を介してPLCとデータベースとを接続し、PLCが収集したデータをデータベースに送信して管理するデータ収集管理システムが、従来から知られている。   2. Description of the Related Art Conventionally, a data collection management system that connects a PLC and a database via a communication path such as a network and transmits and manages data collected by the PLC to the database is known.

例えば、特許文献1(特開2003−114908号公報)に記載された発明は、PLCと上位コンピュータ間にデータ収集装置が接続され、該データ収集装置が上位コンピュータからネットワークを介してデータ収集の指示を受信し、この指示に従ってPLC内部のデータを収集して上位コンピュータへ送信するよう構成されている。   For example, in the invention described in Patent Document 1 (Japanese Patent Application Laid-Open No. 2003-114908), a data collection device is connected between a PLC and a host computer, and the data collection device instructs the data collection from the host computer via a network. Is received, data in the PLC is collected and transmitted to the host computer in accordance with this instruction.

また、特許文献2(特開2007−219920号公報)に記載された発明は、PLCと上位コンピュータ間にデータ収集装置が接続され、上位コンピュータがデータ収集装置から得た設定ファイルと記録データファイルとに基づいたSQL構文を生成し、このSQL構文を用いてデータベースにデータを記録するよう構成されている。   In the invention described in Patent Document 2 (Japanese Patent Application Laid-Open No. 2007-219920), a data collection device is connected between a PLC and a host computer, and a setting file and a recording data file obtained from the data collection device by the host computer Is generated, and data is recorded in the database using the SQL syntax.

一般にSQL構文を用いてデータベースをアクセスするよう構成されたシステムでは、SQL構文などを授受する通信路(上位コンピュータとデータベース間)で通信異常が発生したとき、誤ったデータがデータベースに反映されるのを防ぐためロールバック処理が行われている。   In general, in a system configured to access a database using SQL syntax, when a communication error occurs in a communication path (between the host computer and the database) that exchanges SQL syntax, the wrong data is reflected in the database. Rollback processing is performed to prevent this.

特開2003−114908号公報JP 2003-114908 A 特開2007−219920号公報JP 2007-219920 A

しかしながら、上位コンピュータがデータベースをアクセスしている最中にデータベースの電源が遮断され接続異常(通信異常)が発生した場合、データベースにどこまでのデータが反映されたか不明になるとともにロールバックも行われず、データベースの電源が復旧された後、電源遮断前後でのデータの連続性を保つことが困難となる。   However, when the database is turned off while the host computer is accessing the database and a connection error (communication error) occurs, it is unclear how much data has been reflected in the database, and no rollback is performed. After the database power is restored, it becomes difficult to maintain data continuity before and after the power is shut off.

本発明はこのようなことを鑑みて考案されたものであり、その目的はデータベースの電源遮断による接続異常が発生した場合においても、電源遮断前後でのデータの連続性を保って通信することが可能なデータ収集システム、データ収集システムの異常要因判定方法を提供することにある。   The present invention has been devised in view of the above, and its purpose is to perform communication while maintaining continuity of data before and after power-off even when a connection abnormality occurs due to power-off of the database. It is an object of the present invention to provide a possible data collection system and a method for determining an abnormality factor of the data collection system.

上記のような課題を解決するために、本発明は以下のように構成される。
請求項1に係る発明は、プログラマブルコントローラと該プログラマブルコントローラが得た所定のデータを保存するデータベースとが通信路を介して接続されたデータ収集システムであって、プログラマブルコントローラは、通信路を介して、データベースをアクセスするSQL文を複数含むSQL処理群をデータベースに送信するSQL送信部と、SQL処理群を送信した際にデータベースの無応答による通信異常の発生により、SQL処理群を所定の記憶手段に退避するバッファ処理部と、通信異常が復旧されたとき、データベースが備える受信バッファに保持されたSQL処理群を獲得するコマンドをデータベースに送信するコマンド送信部と、を備え、データベースは、コマンド送信部により送信されたコマンドを受信した際、受信バッファがSQL処理群を未保持のとき、この未保持を示すエンプティデータをプログラマブルコントローラに送信する復帰応答部を備え、プログラマブルコントローラは、データベースからエンプティデータを受信すると、所定の記憶手段に退避されたSQL処理群をデータベースに送信する異常復帰処理部をさらに備えるよう構成する。
In order to solve the above-described problems, the present invention is configured as follows.
The invention according to claim 1 is a data collection system in which a programmable controller and a database for storing predetermined data obtained by the programmable controller are connected via a communication path, and the programmable controller is connected via the communication path. A SQL transmitting unit that transmits a SQL processing group including a plurality of SQL statements for accessing the database to the database, and a predetermined storage means that stores the SQL processing group due to occurrence of a communication abnormality due to no response of the database when the SQL processing group is transmitted. And a command transmission unit for transmitting a command for acquiring an SQL processing group held in a reception buffer included in the database to the database when the communication abnormality is recovered. When a command sent by the When the buffer does not hold the SQL processing group, the buffer is provided with a return response unit that transmits empty data indicating non-holding to the programmable controller. When the programmable controller receives empty data from the database, the programmable controller is saved in a predetermined storage unit. An abnormality recovery processing unit that transmits the SQL processing group to the database is further provided.

請求項2に係る発明は、プログラマブルコントローラと該プログラマブルコントローラが得た所定のデータを保存するデータベースとが通信路を介して接続されたデータ収集システムであって、プログラマブルコントローラは、通信路を介して、データベースをアクセスするSQL文を複数含むSQL処理群をデータベースに送信するSQL送信部と、SQL処理群を送信した際にデータベースの無応答による通信異常の発生により、SQL文およびSQL処理群それぞれを所定の記憶手段に退避するバッファ処理部と、通信異常が復旧されたとき、データベースが備える受信バッファに保持されたSQL処理群を獲得するコマンドをデータベースに送信するコマンド送信部と、を備え、データベースは、コマンド送信部により送信されたコマンドを受信した際、受信バッファがSQL処理群を未保持のとき、この未保持を示すエンプティデータをプログラマブルコントローラに送信し、受信バッファがSQL処理群を保持しているとき、この保持されたSQL処理群をプログラマブルコントローラに送信する復帰応答部を備え、プログラマブルコントローラは、データベースからエンプティデータを受信すると、所定の記憶手段に退避されたSQL処理群をデータベースに送信し、データベースからSQL処理群を受信すると、この獲得したSQL処理群に含まれるSQL文に続く差分のSQL文を記憶手段に退避されたSQL文から抽出して送信する異常復帰処理部をさらに備えるよう構成する。   The invention according to claim 2 is a data collection system in which a programmable controller and a database for storing predetermined data obtained by the programmable controller are connected via a communication path, and the programmable controller is connected via the communication path. A SQL sending unit for sending a SQL processing group including a plurality of SQL statements for accessing the database to the database, and an SQL statement and a SQL processing group due to the occurrence of a communication error due to no response of the database when the SQL processing group is sent. A buffer processing unit that saves data in a predetermined storage unit; and a command transmission unit that transmits a command for acquiring an SQL processing group held in a reception buffer included in the database to the database when a communication abnormality is recovered. The command sent by the command sending unit When the reception buffer does not hold the SQL processing group, it sends empty data indicating this non-holding to the programmable controller, and when the reception buffer holds the SQL processing group, the held SQL When the programmable controller receives empty data from the database, the programmable controller transmits the SQL processing group saved in a predetermined storage means to the database, and receives the SQL processing group from the database. Then, an abnormality recovery processing unit is further provided that extracts and transmits a difference SQL sentence following the SQL sentence included in the acquired SQL processing group from the SQL sentence saved in the storage unit.

請求項3に係る発明は、プログラマブルコントローラと該プログラマブルコントローラが得た所定のデータを保存するデータベースとが通信路を介して接続されたデータ収集システムの異常要因判定方法であって、プログラマブルコントローラは、データベースをアクセスするSQL文を複数含むSQL処理群を、通信路を介してデータベースに送信し、この送信の際にデータベースの無応答による通信異常が発生した後、通信異常が復旧すると、データベースに送信し受信されたSQL処理群をデータベースから獲得するコマンドをデータベースに送信し、データベースは、コマンドを受信した際、自身が備える受信バッファがSQL処理群を未保持のとき、この未保持を示すエンプティデータをプログラマブルコントローラに送信し、受信バッファがSQL処理群を保持しているとき、この保持されたSQL処理群をプログラマブルコントローラに送信し、プログラマブルコントローラは、データベースからエンプティデータを受信するとデータベースの電源の遮断による異常と判定し、データベースからSQL処理群を受信すると通信路の断線による異常と判定するよう構成する。   The invention according to claim 3 is an abnormality factor determination method for a data collection system in which a programmable controller and a database that stores predetermined data obtained by the programmable controller are connected via a communication path, and the programmable controller includes: A SQL processing group including a plurality of SQL statements for accessing the database is transmitted to the database via the communication path. After the communication abnormality due to the non-response of the database occurs at the time of transmission, the communication is restored to the database. Then, a command for acquiring the received SQL processing group from the database is transmitted to the database, and when the database receives the command, when the reception buffer included in the database does not hold the SQL processing group, the empty data indicating this non-holding Is sent to the programmable controller and received When the buffer holds the SQL processing group, the held SQL processing group is transmitted to the programmable controller. When the programmable controller receives empty data from the database, the programmable controller determines that there is an abnormality caused by shutting down the database power supply. When the SQL processing group is received, it is determined that the abnormality is caused by the disconnection of the communication path.

本発明のPLCは、データベースをアクセスするSQL文を複数含むSQL処理群をデータベースに送信する機能を有し、このSQL処理群を送信した際にデータベースの無応答による通信異常が発生すると、個々のSQL文およびSQL処理群を記憶手段に退避する。この後、PLCは、通信異常が復旧されたとき、データベースの受信バッファに保持されたSQL処理群を獲得するコマンドをデータベースに送信する。   The PLC of the present invention has a function of transmitting a SQL processing group including a plurality of SQL statements for accessing the database to the database, and when a communication abnormality occurs due to no response of the database when the SQL processing group is transmitted, The SQL statement and the SQL processing group are saved in the storage unit. Thereafter, when the communication abnormality is recovered, the PLC transmits a command for acquiring the SQL processing group held in the reception buffer of the database to the database.

一方、データベースは、PLCによって送信されたコマンドを受信した際、受信バッファがSQL処理群を未保持のとき、この未保持を示すエンプティデータをPLCに送信し、受信バッファがSQL処理群を保持しているとき、この保持されたSQL処理群をプログラマブルコントローラに送信する。   On the other hand, when the database receives a command transmitted by the PLC, if the reception buffer does not hold the SQL processing group, the database transmits empty data indicating that this is not held to the PLC, and the reception buffer holds the SQL processing group. If this is the case, the stored SQL processing group is transmitted to the programmable controller.

そして、PLCは、データベースからエンプティデータを受信すると、記憶手段に退避したSQL処理群をデータベースに送信し、データベースからSQL処理群を受信すると、この獲得したSQL処理群に含まれるSQL文に続く差分のSQL文を、記憶手段に退避したSQL文から抽出して送信する。   When the PLC receives empty data from the database, the PLC transmits the SQL processing group saved in the storage means to the database. When the PLC receives the SQL processing group from the database, the difference following the SQL statement included in the acquired SQL processing group. The SQL sentence is extracted from the SQL sentence saved in the storage means and transmitted.

このようにすることにより、本発明はPLCがデータベースをアクセスしている最中にデータベースの電源が遮断され接続異常(通信異常)が発生した場合でも、電源遮断前後でのデータの連続性を保つことができる。また、データベースの電源遮断以外の通信異常については、データベースに到達していない構文から再送信するようにしたので、構文を再送信する時間が削減される。   By doing so, the present invention maintains the continuity of data before and after power-off even when the database is shut down and a connection error (communication error) occurs while the PLC is accessing the database. be able to. In addition, since communication errors other than the database power-off are retransmitted from the syntax that has not reached the database, the time for retransmitting the syntax is reduced.

本発明のデータベースアクセスシステムの一実施形態を示すシステム構成図The system block diagram which shows one Embodiment of the database access system of this invention 図1に係るプログラマブルコントローラおよびデータベースの一例を示す内部構成図The internal block diagram which shows an example of the programmable controller and database which concern on FIG. SQL構文によるデータベースアクセス手順を示す説明図Explanatory drawing which shows the database access procedure by SQL syntax 図1に係るPLCがSQL構文を生成しデータベースに送信する処理を示す説明図Explanatory drawing which shows the process which PLC which concerns on FIG. 1 produces | generates SQL syntax, and transmits to a database 図1に係るPLCがデータベースをアクセスする通信手順を示す説明図Explanatory drawing which shows the communication procedure in which the PLC which concerns on FIG. 1 accesses a database 図1に係るPLCがデータベースをアクセスした際の構文異常によるロールバック処理を示す説明図Explanatory drawing which shows the rollback process by the syntax abnormality when PLC which concerns on FIG. 1 accesses a database 本発明に係るバッファ処理部の動作の一例を示す説明図Explanatory drawing which shows an example of operation | movement of the buffer process part which concerns on this invention 本発明に係る通信異常が復旧されたときの動作の一例を示す説明図Explanatory drawing which shows an example of operation | movement when the communication abnormality based on this invention is recovered | restored 本発明に係るデータベースの電源遮断による通信異常復帰時の処理を示す説明図Explanatory drawing which shows the process at the time of communication abnormality return by the power supply shutdown of the database which concerns on this invention 本発明に係るデータベースの通信路の異状による通信異常復帰時の処理を示す説明図Explanatory drawing which shows the process at the time of communication abnormality return by abnormality of the communication path of the database which concerns on this invention

以下、本発明の一実施形態について、図面を参照しながら説明する。
図1は、本発明に係るデータベースアクセスシステムの一実施形態を説明する構成図である。図1に示すように、このシステムは、データベース200がプログラマブルコントローラ(以下、PLCという)100,110,120とネットワークなどの通信路300を介して接続されている。PLC100,110,120はそれぞれ外部機器30,31,32に接続されるとともにコンパクトフラッシュ(登録商標)などの記憶媒体をアクセスする機能を有する。以下、PLCに係る構成はPLC100,PLC110,PLC120それぞれ同じなので、以降の説明はPLC100の説明とし、PLC110、PLC120の説明は省略する。
Hereinafter, an embodiment of the present invention will be described with reference to the drawings.
FIG. 1 is a configuration diagram illustrating an embodiment of a database access system according to the present invention. As shown in FIG. 1, in this system, a database 200 is connected to programmable controllers (hereinafter referred to as PLCs) 100, 110, 120 via a communication path 300 such as a network. The PLCs 100, 110, 120 are connected to the external devices 30, 31, 32, respectively, and have a function of accessing a storage medium such as a compact flash (registered trademark). In the following, since the configuration related to the PLC is the same for each of the PLC 100, the PLC 110, and the PLC 120, the following description is the description of the PLC 100, and the description of the PLC 110 and the PLC 120 is omitted.

PLC100はネットワークなどの通信路300を介してデータベース200に接続され、シーケンス制御プログラムを実行しながら該PLC100に接続された外部機器(制御対象機器,センサ等)との間で制御のための情報の伝送を行いつつ、データベース200との間で情報の送受を行う。データベース200側では、PLC100から上がってくるデータ(センサで検出したデータや、外部機器30の稼動状態等のデータなど)を受信して保存し、各種の管理、そして受信したデータをユーザが加工できるようになっている。   The PLC 100 is connected to the database 200 via a communication path 300 such as a network, and executes information for control with external devices (control target devices, sensors, etc.) connected to the PLC 100 while executing a sequence control program. Information is transmitted to and received from the database 200 while performing transmission. On the database 200 side, data received from the PLC 100 (data detected by a sensor, data such as the operating status of the external device 30) is received and stored, and various types of management and the received data can be processed by the user. It is like that.

図2はPLC100およびデータベース200の内部構成図である。PLC100は中央演算部109(CPU)、プログラムメモリ(FLASH)101、作業メモリ(RAM(Random Access Memory))102、コンパクトフラッシュ(登録商標)などの記憶媒体をアクセスするCFインタフェース部104、データベース200と通信する通信部107、通信データを保持するデータメモリ(RAM(Random Access Memory))108、入出力部106などを有し、それらが内部バス103により接続されている。   FIG. 2 is an internal configuration diagram of the PLC 100 and the database 200. The PLC 100 includes a central processing unit 109 (CPU), a program memory (FLASH) 101, a working memory (RAM (Random Access Memory)) 102, a CF interface unit 104 for accessing a storage medium such as a compact flash (registered trademark), a database 200, A communication unit 107 that communicates, a data memory (RAM (Random Access Memory)) 108 that stores communication data, an input / output unit 106, and the like are connected via an internal bus 103.

中央演算部109はシーケンスプログラム実行部109a、SQL送信部109b、バッファ処理部109c、コマンド送信部109d、異常復帰処理部109eを備えている。PLC100はシーケンスプログラム実行部109aがプログラムメモリ101に保持されたシーケンス制御プログラムを実行することにより入出力部106を介して外部機器30を制御するよう構成されている。なお、SQL送信部109b、バッファ処理部109c、コマンド送信部109d、異常復帰処理部109eについては、後にその動作を詳述する。   The central processing unit 109 includes a sequence program execution unit 109a, an SQL transmission unit 109b, a buffer processing unit 109c, a command transmission unit 109d, and an abnormality recovery processing unit 109e. The PLC 100 is configured to control the external device 30 via the input / output unit 106 when the sequence program execution unit 109 a executes a sequence control program held in the program memory 101. The operation of the SQL transmission unit 109b, the buffer processing unit 109c, the command transmission unit 109d, and the abnormality recovery processing unit 109e will be described in detail later.

データベース200は、PLC100と通信する通信部201、通信部201が受信した受信データを保持する受信バッファ202、送信データを保持する送信バッファ203、通信部201を介して受信された構文(SQL構文、またはSQL電文ともいう)に従って所定の処理を実行するSQL実行部204、通信異常が復帰したときに復帰処理を実行する復帰応答部205、データベース化されたデータを記憶する記憶部206を備えている。   The database 200 includes a communication unit 201 that communicates with the PLC 100, a reception buffer 202 that holds reception data received by the communication unit 201, a transmission buffer 203 that holds transmission data, and a syntax received via the communication unit 201 (SQL syntax, Or a SQL execution unit 204 that executes a predetermined process according to a message), a return response unit 205 that executes a return process when a communication error is recovered, and a storage unit 206 that stores data stored in a database. .

図3は構文によるデータベースアクセス手順を示す説明図である。PLC100がデータベース200をアクセスする基本的な手順は、例えば図3に示すようにデータベース接続要求から始まり、続いて、いくつかのデータベース操作処理(処理1〜処理3)、データベースにデータを反映させるcommit(処理4)、そしてコネクション切断といった一連の構文をデータベースに送信することにより実行される。本発明ではこの一連の構文をまとめたもの、すなわちPLC100がデータベースをアクセスするための一連の構文の集まりを「処理単位」として定義している。PLC100は、この処理単位を基本としてデータベースにアクセスする。   FIG. 3 is an explanatory diagram showing a database access procedure by syntax. The basic procedure for the PLC 100 to access the database 200 starts with a database connection request, for example, as shown in FIG. 3, followed by several database operation processes (process 1 to process 3), and a commit that reflects the data in the database. (Processing 4) and a series of syntaxes such as connection disconnection are transmitted to the database. In the present invention, a series of syntaxes, that is, a series of syntaxes for the PLC 100 to access a database is defined as a “processing unit”. The PLC 100 accesses the database based on this processing unit.

図4は、本発明に係るPLC100が構文を生成しデータベースに送信する処理(SQL送信部109b)を示す説明図である。PLC100は、電源オンまたはリセットスタート後、イニシャル処理S1にてデータベース200のテーブル名や項目名、そして構文のテンプレートデータなどをコンパクトフラッシュ(登録商標)などから読み出しておく。イニシャル処理S1を終えたPLC100は以降運用状態となり、PLC100に接続されたセンサによって検出されたデータや外部機器30の稼動状態等のデータなどを収集する(データ収集処理S2)。この収集処理は、例えば生産システムであれば一日単位、もしくは1時間単位など、所定の時間毎にデータを蓄積するよう行っても良い。   FIG. 4 is an explanatory diagram showing processing (SQL transmission unit 109b) in which the PLC 100 according to the present invention generates syntax and transmits it to the database. After power-on or reset start, the PLC 100 reads the table name, item name, syntax template data, and the like of the database 200 from the compact flash (registered trademark) or the like in the initial process S1. After completing the initial process S1, the PLC 100 is in an operating state and collects data detected by a sensor connected to the PLC 100, data such as the operating state of the external device 30, and the like (data collection process S2). For example, in the case of a production system, this collection processing may be performed so as to accumulate data every predetermined time, such as one day or one hour.

続いて、収集したデータを構文で送信するために加工・編集・圧縮などの処理を行い(データ処理S3)、このデータ処理されたデータをSQLテンプレートに組み込んで(SQL文生成処理S4)データベース200に送信する(データ送信処理S5)。   Subsequently, processing such as processing, editing, and compression is performed in order to transmit the collected data in syntax (data processing S3), and the data processed is incorporated into an SQL template (SQL sentence generation processing S4). (Data transmission processing S5).

データベース200はPLC100によって送信されたSQLデータを受信し、受信の完了をPLC100に伝える(データ受信処理S6)。このとき、データ送信処理S5は前述説明したように複数の構文(DB接続要求〜コネクション切断)を一連の処理とした処理単位で通信を行っている。データベース200はこの処理単位毎に応答を返しており、PLC100はこの応答を受信するとその都度そのときの通信処理を完了する。   The database 200 receives the SQL data transmitted by the PLC 100 and notifies the PLC 100 of the completion of reception (data reception process S6). At this time, in the data transmission process S5, as described above, communication is performed in units of processing in which a plurality of syntaxes (DB connection request to connection disconnection) is a series of processes. The database 200 returns a response for each processing unit, and the PLC 100 completes the communication processing at that time each time the response is received.

図5はPLC100がデータベース200を処理単位にてアクセスする際、正常に通信が行われたときの処理を示す説明図である。図5の左部分に処理ステップを示しこの処理ステップに従い動作を説明する。ステップS10において、PLC100はデータベースとコネクションを確立するために接続要求を送信する。データベース200は接続要求を受信すると接続許可をPLC100に応答する。PLC100は予め設定された時間以内に接続許可が受信されることを監視しており、監視時間以内に接続許可が受信されればコネクションを確立する。PLC100は監視時間以内にデータベースから接続許可を受信しないと接続要求をリトライし、コネクションが確立されるまでリトライを繰り返す。   FIG. 5 is an explanatory diagram showing processing when communication is normally performed when the PLC 100 accesses the database 200 in units of processing. Processing steps are shown in the left part of FIG. 5 and the operation will be described according to these processing steps. In step S10, the PLC 100 transmits a connection request to establish a connection with the database. When the database 200 receives the connection request, it returns a connection permission to the PLC 100. The PLC 100 monitors that the connection permission is received within a preset time, and establishes a connection if the connection permission is received within the monitoring time. If the connection is not received from the database within the monitoring time, the PLC 100 retries the connection request and repeats the retry until the connection is established.

処理はステップS11に移行しPLC100は、insert(データ追加)やupdate(データの変更)などのデータベースに所定の操作を要求する処理要求を送信し、ステップS12にて処理要求を受信したデータベース200は処理要求に対する応答を送信し、PLC100はその応答を受信する。   The process proceeds to step S11, and the PLC 100 transmits a processing request for requesting a predetermined operation to a database such as insert (data addition) or update (data change), and the database 200 that has received the processing request in step S12 A response to the processing request is transmitted, and the PLC 100 receives the response.

続いて、処理はステップS13に移行し、PLC100は処理単位の構文を全て送信したか否かをチェックする。全ての構文が送信されてないとき、処理はステップS11に戻り、処理単位の構文を全て送信するまで、ステップS11〜ステップS13を繰り返す。同様、データベース200はステップS13にて全ての構文を受信するまでその構文を受信する毎に応答を返す。   Subsequently, the process proceeds to step S13, and the PLC 100 checks whether or not all the syntax of the processing unit has been transmitted. When all the syntaxes are not transmitted, the process returns to step S11, and steps S11 to S13 are repeated until all the syntaxes of the processing unit are transmitted. Similarly, the database 200 returns a response every time it receives the syntax until it receives all the syntaxes in step S13.

続いてステップS14においてPLC100は、データベースのアクセスを確定(終了)させるコミット(commit)要求を送信する。データベース200はコミット(commit)要求を受信するとステップS15にてその応答(処理確定)を返信し、PLC100はこの処理確定を受信することにより一連の構文がデータベース200に正常に伝達されたと判断する。この後、処理はステップS16に移行しPLC100およびデータベース200はそれぞれコネクションを切断する。   In step S14, the PLC 100 transmits a commit request for confirming (ending) access to the database. When receiving the commit request, the database 200 returns a response (process confirmation) in step S15, and the PLC 100 determines that a series of syntaxes has been normally transmitted to the database 200 by receiving this process confirmation. Thereafter, the process proceeds to step S16, and the PLC 100 and the database 200 each disconnect the connection.

図6はPLC100がデータベース200をアクセスする際、処理単位に含まれる構文に、例えばテーブル名が存在しないなどの構文異常があったときの処理を示す説明図である。図5同様の左部分に処理ステップを示しこの処理ステップに従い動作を説明する。ステップS20は前述ステップS10の動きと同様である。   FIG. 6 is an explanatory diagram showing processing when the PLC 100 accesses the database 200 and the syntax included in the processing unit has a syntax abnormality such as a table name does not exist. The processing steps are shown in the left part as in FIG. 5, and the operation will be described according to these processing steps. Step S20 is the same as the movement of step S10 described above.

ステップS21においてPLC100は、処理要求を送信する。このとき通信路の不具合などにより通信異常が発生しデータベース200が異常な構文を受信すると、データベース200はステップS22にて異常な構文を受信したことを示す異常応答を送信する。同ステップS22にてPLC100はデータベース200から異常応答を受信する。処理はステップS23に移り、PLC100はデータベース200が異常な構文を受信したか否かを異常応答の内容から判定する。異常応答の内容が構文異常でないときは処理はS21に戻る。異常応答の内容が構文異常であったとき、処理はステップS24に移り、PLC100はデータベース200のデータを異常前のデータに戻すためロールバック要求を送信し、データベース100はロールバック要求を受信する。処理はステップS25に移り、データベース200はロールバック要求に対応するロールバック処理を行い、この処理が完了するとロールバック処理完了をPLC100に送信する。PLC100はステップS25にてロールバック処理完了を受信する。この後、PLC100およびデータベース200それぞれはステップS26にてコネクションを切断する。   In step S21, the PLC 100 transmits a processing request. At this time, when a communication error occurs due to a communication path failure or the like and the database 200 receives an abnormal syntax, the database 200 transmits an abnormal response indicating that the abnormal syntax has been received in step S22. In step S22, the PLC 100 receives an abnormal response from the database 200. The process moves to step S23, and the PLC 100 determines whether or not the database 200 has received an abnormal syntax from the content of the abnormal response. If the content of the abnormal response is not a syntax abnormality, the process returns to S21. If the content of the abnormal response is a syntax error, the process proceeds to step S24, where the PLC 100 transmits a rollback request to return the data in the database 200 to the data before the abnormality, and the database 100 receives the rollback request. The process moves to step S25, and the database 200 performs a rollback process corresponding to the rollback request. When this process is completed, the completion of the rollback process is transmitted to the PLC 100. The PLC 100 receives the completion of the rollback process in step S25. Thereafter, each of the PLC 100 and the database 200 disconnects the connection in step S26.

図7は通信路の断線やデータベースの電源遮断による通信異常が発生した場合のPLC100およびデータベース200の処理を説明する図である。本発明はこの処理に特徴点がある。   FIG. 7 is a diagram for explaining processing of the PLC 100 and the database 200 when a communication abnormality occurs due to a disconnection of a communication path or a power supply cut off of the database. The present invention is characterized by this process.

上述同様、図の左部分に処理ステップを示しこの処理ステップに従い動作を説明する。ステップS30は前述ステップS10の動きと同様であり、ステップS31は前述ステップS11の動きと同様である。   As described above, the processing steps are shown in the left part of the figure, and the operation will be described according to these processing steps. Step S30 is the same as the movement of step S10, and step S31 is the same as the movement of step S11.

ステップS31にてデータベース200はPLC100から処理要求を受信し、ステップS32にてその応答を送信している。このとき、通信異常が発生し、データベース200の応答がPLC100に受信されないとき、すなわち、PLC100から見てデータベース200が無応答のときには、PLC100はステップ33にて処理要求を再送信する。この再送信に対しても、データベース200から応答を受信できないとき、処理はステップ34に移行し、PLC100は作業メモリ102などの内部記憶領域、もしくはコンパクトフラッシュ(登録商標)などの外部記憶領域に、送信した処理単位を退避するとともに、処理単位を構成する構文を1文単位で退避する。ここで、処理単位の退避領域を第1の退避領域と定義し、1文単位の退避領域を第2の退避領域として定義する。すなわち、処理単位と1文単位はそれぞれ別々に用意された退避領域に退避される。   In step S31, the database 200 receives the processing request from the PLC 100, and transmits the response in step S32. At this time, when a communication error occurs and the response of the database 200 is not received by the PLC 100, that is, when the database 200 is not responding when viewed from the PLC 100, the PLC 100 retransmits the processing request at step 33. When a response cannot be received from the database 200 even for this retransmission, the process proceeds to step 34, and the PLC 100 is stored in an internal storage area such as the working memory 102 or an external storage area such as a compact flash (registered trademark). The transmitted processing unit is saved, and the syntax constituting the processing unit is saved in units of one sentence. Here, the save area in units of processing is defined as a first save area, and the save area in one sentence is defined as a second save area. That is, the processing unit and one sentence unit are saved in the save areas prepared separately.

そして、PLC100は退避する1文単位の構文の個数を記録するために、初期値をゼロとして作業メモリに割付けたカウンタ(不図示)をカウントアップする。このカウントアップの処理は、後述通信異常から復帰したときの復帰処理にて、退避された1文単位の構文の個数を把握するために行う処理である。なお、処理単位は1つしか退避されないので、処理単位の退避個数をカウントする必要はない。   Then, the PLC 100 counts up a counter (not shown) assigned to the work memory with the initial value set to zero in order to record the number of syntaxes of one sentence unit to be saved. This count-up process is a process performed in order to grasp the number of syntaxes saved in units of one sentence in a return process when returning from a communication error described later. Since only one processing unit is saved, there is no need to count the number of saved processing units.

処理はステップS35に移り、PLC100は処理単位内の構文を全て送信したならば処理を終え、未送信の構文があればステップS31に戻る。上記ステップS30〜ステップS35に係るPLC100の処理はバッファ処理部109cにて実行される。   The process proceeds to step S35, and the PLC 100 ends the process if all the syntaxes in the processing unit are transmitted, and returns to step S31 if there is an untransmitted syntax. The processing of the PLC 100 according to the above steps S30 to S35 is executed by the buffer processing unit 109c.

図8は、図7で説明した通信異常が発生した後に、その通信異常が復帰されたときのPLC100およびデータベース200の処理を説明する図である。
上述同様、図の左部分に処理ステップを示しこの処理ステップに従い動作を説明する。PLC100は上述図7のように通信異常が発生し各種構文を退避した後、データベース200とのコネクションが再び確立されると、ステップS40に先立ちデータベースの受信バッファからデータ(PLC100が送信した処理単位など)を獲得するデータ獲得コマンドを送信する。この処理はコマンド送信部109dにて実行される。データベース200は、PLC100から送信されたデータ獲得コマンドに応答して、受信バッファに保持されたデータ(処理単位など)をPLC100に送信する。この処理は復帰応答部205にて実行される。そして、PLC100は、データベース200から送信されたデータ(処理単位など)を受信する。このようにして、PLC100は、データベース200の受信バッファ領域に保持されたデータ(処理単位など)を獲得する。
FIG. 8 is a diagram illustrating processing of the PLC 100 and the database 200 when the communication abnormality described in FIG. 7 occurs and the communication abnormality is recovered.
As described above, processing steps are shown in the left part of the figure, and the operation will be described according to these processing steps. When the PLC 100 re-establishes a connection with the database 200 after a communication error occurs and various syntaxes are saved as shown in FIG. 7, the data (such as the processing unit transmitted by the PLC 100) is received from the database reception buffer prior to step S40. ) To acquire a data acquisition command. This process is executed by the command transmission unit 109d. In response to the data acquisition command transmitted from the PLC 100, the database 200 transmits data (such as a processing unit) held in the reception buffer to the PLC 100. This process is executed by the return response unit 205. Then, the PLC 100 receives data (such as a processing unit) transmitted from the database 200. In this way, the PLC 100 acquires data (such as a processing unit) held in the reception buffer area of the database 200.

この結果、データベース200から処理単位に含まれる構文や処理単位そのものを獲得できた場合、PLC100は通信路300の断線と判定し、前述退避した1文単位の構文を再送信する(ステップS40,41)。データベース200はPLC100によって送信された構文を受信すると、その応答を送信し、PLC100はこの応答を受信する(ステップS41,42)。   As a result, when the syntax included in the processing unit or the processing unit itself can be acquired from the database 200, the PLC 100 determines that the communication path 300 is disconnected, and retransmits the saved syntax of one sentence unit (steps S40 and 41). ). When the database 200 receives the syntax transmitted by the PLC 100, the database 200 transmits the response, and the PLC 100 receives this response (steps S41 and S42).

処理はステップS43に移り、PLC100は前述のカウンタをデクリメントし、処理はS44に移り、デクリメントしたカウンタの値がゼロか否かを判定し、ゼロであれば処理を終了し、ゼロでなければステップS41に戻る。このようにして、PLC100はカウンタがゼロになるまで退避した構文を順次送信する。また、図5におけるコミット送信時、あるいは図6におけるロールバック送信時などに通信異常が発生したときも、その構文が退避されるので、どのような構文を送信しようとも、通信異常の前後で処理が継続される。上記ステップS40〜ステップS44に係る処理は異常復帰処理部109eにて実行される。   The process moves to step S43, and the PLC 100 decrements the counter, and the process moves to S44 to determine whether or not the decremented counter value is zero. Return to S41. In this way, the PLC 100 sequentially transmits the saved syntax until the counter reaches zero. Also, when a communication error occurs at the time of commit transmission in FIG. 5 or at the time of rollback transmission in FIG. 6, the syntax is saved, so no matter what syntax is sent, processing is performed before and after the communication error. Will continue. The processes according to steps S40 to S44 are executed by the abnormality recovery processing unit 109e.

ここで、データベース200の電源断により通信異常が発生し、復旧したときの動きを図9を参照しながら説明する。図9において、PLC100は処理1(接続要求)、処理2(insert)、処理3(update)、処理4(insert)、処理5(commit)の5つ構文を処理単位としてデータベース200に送信し、処理3までは正常にデータベース200に受信されたが、処理4(insert)の送信時に通信異常(データベース電源断)が発生したものとして説明する。   Here, the operation when the communication abnormality occurs due to the power failure of the database 200 and is restored will be described with reference to FIG. In FIG. 9, the PLC 100 transmits five syntaxes of processing 1 (connection request), processing 2 (insert), processing 3 (update), processing 4 (insert), and processing 5 (commit) to the database 200 as processing units, The processing up to processing 3 has been normally received by the database 200, but it will be described that a communication abnormality (database power interruption) has occurred during transmission of processing 4 (insert).

このとき、PLC100は通信異常から復帰したときの再送信に備えて、処理単位および通信異常が発生した後の構文(処理4と処理5の構文)、すなわち、PLC100が構文を送信し、データベースからの応答が得られなかった構文それぞれを、退避領域に退避する。   At this time, in preparation for re-transmission when the PLC 100 recovers from the communication abnormality, the processing unit and the syntax after the occurrence of the communication abnormality (the syntax of the processing 4 and the processing 5), that is, the PLC 100 transmits the syntax, and from the database. Each syntax for which no response is obtained is saved in the save area.

通信異常が復旧してPLC100とデータベース200のコネクションが確立されると、PLC100はデータベースの受信バッファからデータを獲得するデータ獲得コマンドを送信する。データベース200は電源がオフからオンになって起動されたため、その受信バッファにはPLC100が送信した処理単位が無い状態である。このためデータベース200は受信バッファが空である応答(エンプティデータ)をPLC100に送信する。PLC100はデータベースの受信バッファが空であることを示す応答(エンプティデータ)を受信すると、データベースの電源断による通信異常と判断し、処理単位を再送信するとともに、退避した1文単位の構文(処理4と処理5の構文)および処理単位を削除する。   When the communication abnormality is recovered and the connection between the PLC 100 and the database 200 is established, the PLC 100 transmits a data acquisition command for acquiring data from the reception buffer of the database. Since the database 200 was started with the power turned on, the reception buffer is in a state where there is no processing unit transmitted by the PLC 100. Therefore, the database 200 transmits a response (empty data) that the reception buffer is empty to the PLC 100. When the PLC 100 receives a response (empty data) indicating that the reception buffer of the database is empty, the PLC 100 determines that the communication is abnormal due to the power failure of the database, retransmits the processing unit, and saves the syntax (processing of one sentence unit) 4 and the syntax of processing 5) and processing units are deleted.

図10はデータベース200の通信路300の断線により通信異常が発生し、断線が復旧したときの動きを説明する図である。図10において、PLC100は処理1(接続要求)、処理2(insert)、処理3(update)、処理4(insert)、処理5(commit)の5つ構文を処理単位としてデータベース200に送信し、処理3までは正常にデータベース200に受信されたが、処理4(insert)の送信時に通信路300断線などの通信異常が発生したものとして説明する。   FIG. 10 is a diagram for explaining the operation when a communication abnormality occurs due to the disconnection of the communication path 300 in the database 200 and the disconnection is restored. In FIG. 10, the PLC 100 transmits five syntaxes of processing 1 (connection request), processing 2 (insert), processing 3 (update), processing 4 (insert), and processing 5 (commit) as processing units to the database 200, The processing up to processing 3 has been normally received by the database 200, but it will be assumed that a communication abnormality such as disconnection of the communication path 300 has occurred during transmission of processing 4 (insert).

このとき、PLC100は通信異常から復帰したときの再送信に備えて、処理単位および通信異常が発生した後の構文(処理4と処理5の構文、すなわち構文を送信したがデータベースから応答を受信できなかった構文)それぞれを、退避領域に退避する。通信異常が復旧してPLC100とデータベース200のコネクションが確立されると、PLC100はデータベースの受信バッファからデータを獲得するデータ獲得コマンドを送信する。データベース200の受信バッファにはPLC100が送信した処理単位が途中まで受信されている状態である。すなわち、処理2(insert)、処理3(update)までが受信バッファの保持された状態である。このためデータベース200は受信バッファに保持された各種処理要求をPLC100に送信する。この処理要求を受信したPLC100は、通信路300の断線による通信異常と判断し、未送信として退避した1文単位の構文を順次送信する。そして、PLC100は1文単位での構文(各種処理要求)を全て送信し終わると、退避した1文単位の構文(処理4と処理5の構文)および処理単位を削除する。   At this time, in preparation for re-transmission when the PLC 100 recovers from the communication abnormality, the processing unit and the syntax after the communication abnormality has occurred (the syntax of the processing 4 and processing 5, that is, the syntax has been transmitted but the response can be received from the database). Each syntax that was not) is saved in the save area. When the communication abnormality is recovered and the connection between the PLC 100 and the database 200 is established, the PLC 100 transmits a data acquisition command for acquiring data from the reception buffer of the database. The reception buffer of the database 200 is in a state where the processing unit transmitted by the PLC 100 is received halfway. That is, the process up to process 2 (insert) and process 3 (update) is a state in which the reception buffer is held. Therefore, the database 200 transmits various processing requests held in the reception buffer to the PLC 100. Receiving this processing request, the PLC 100 determines that there is a communication abnormality due to the disconnection of the communication path 300, and sequentially transmits the syntax of one sentence unit saved as untransmitted. When the PLC 100 finishes sending all the syntax (various processing requests) in units of one sentence, it deletes the saved single-syntax unit syntax (processing 4 and processing 5 syntax) and processing unit.

すなわち、本発明のPLCは、SQL処理群を送信した際に通信異常が発生すると、SQL処理群およびSQL処理群に含まれる個々のSQL文を記憶手段に退避する。この通信異常が復旧後、PLCはデータベースに受信されたデータを獲得するコマンドをデータベースに送信する。このコマンドを受信したデータベースは、自身の受信バッファにSQL処理群が保持されてないときエンプティデータを送信し、SQL処理群が保持されているときはSQL処理群をPLCに送信する。PLCはエンプティデータを受信すればSQL処理群を再送信し、SQL処理群を受信すれば受信したSQL処理群に含まれるSQL文に続く差分のSQL文を記憶手段に退避したSQL分から抽出して送信する。   That is, the PLC according to the present invention saves the SQL processing group and the individual SQL statements included in the SQL processing group in the storage means when a communication error occurs when the SQL processing group is transmitted. After the communication abnormality is recovered, the PLC transmits a command for acquiring the data received in the database to the database. The database that has received this command transmits empty data when the SQL processing group is not held in its own reception buffer, and transmits the SQL processing group to the PLC when the SQL processing group is held. When the PLC receives empty data, it retransmits the SQL processing group, and when it receives the SQL processing group, it extracts the SQL statement of the difference following the SQL statement included in the received SQL processing group from the saved SQL portion. Send.

以上、説明したように、本発明は通信異常の復旧時にデータベースの受信バッファを参照し、データベースの受信バッファにPLCが送信した構文が保持されていれば通信路の断線などの異常による通信異常であったと判定し、データベースの受信バッファに構文が無いときにはデータベースの電源遮断による通信異常と判定するよう構成した。   As described above, the present invention refers to the database reception buffer when the communication abnormality is recovered, and if the syntax transmitted by the PLC is held in the database reception buffer, the communication abnormality is caused by an abnormality such as disconnection of the communication path. When there is no syntax in the reception buffer of the database, it is determined that the communication is abnormal due to the power-off of the database.

また、本発明のPLCは通信路の断線などによる通信異常が発生したと判定した場合、データベースに到達していない構文から再送信するように構成し、さらに、データベースの電源遮断による通信異常が発生したと判定した場合には、処理単位を再送信するように構成した。このようにすることにより、本発明はPLCやコンピュータがデータベースをアクセスしている最中にデータベースの電源が遮断され接続異常(通信異常)が発生した場合でも、電源遮断前後でのデータの連続性を保つことができる。また、データベースの電源遮断以外の通信異常に対してはデータベースに到達していない構文から再送信するようにしたので、構文を再送信する時間が削減される。この削減時間は、処理単位における構文の数が多ければ多いほどその効果が大きい。   In addition, the PLC of the present invention is configured to re-transmit from a syntax that has not reached the database when it is determined that a communication abnormality has occurred due to a disconnection of the communication path, and further, a communication abnormality has occurred due to the power interruption of the database. If it is determined that the processing unit has been determined, the processing unit is retransmitted. By doing so, the present invention enables the continuity of data before and after power-off even when the database is shut down and a connection error (communication error) occurs while the PLC or computer is accessing the database. Can keep. In addition, for communication abnormalities other than the power shutdown of the database, the syntax that has not reached the database is retransmitted, so the time for retransmitting the syntax is reduced. The effect of this reduction time increases as the number of syntaxes in the processing unit increases.

1…データベースアクセスシステム
100,110,120…プログラマブルコントローラ、200…データベース(サーバ)、300…通信路、30,31,32…外部機器
101…プログラムメモリ、102…作業メモリ、103…内部バス、104…CF(コンパクトフラッシュ)インタフェース、106入出力部、107…通信部、108…データメモリ、109…中央演算部、109a…シーケンスプログラム実行部、109b…SQL送信部、109c…バッファ処理部、109d…コマンド送信部、109e…異常復帰処理部
201…通信部、202…受信バッファ、203…送信バッファ、204…SQL実行部、205…復帰応答部、206…記憶部(データベース)
DESCRIPTION OF SYMBOLS 1 ... Database access system 100,110,120 ... Programmable controller, 200 ... Database (server), 300 ... Communication path, 30, 31, 32 ... External apparatus 101 ... Program memory, 102 ... Work memory, 103 ... Internal bus, 104 ... CF (compact flash) interface, 106 input / output unit, 107 ... communication unit, 108 ... data memory, 109 ... central processing unit, 109a ... sequence program execution unit, 109b ... SQL transmission unit, 109c ... buffer processing unit, 109d ... Command transmission unit 109e ... Abnormal recovery processing unit 201 ... Communication unit 202 ... Reception buffer 203 ... Transmission buffer 204 ... SQL execution unit 205 ... Return response unit 206 ... Storage unit (database)

Claims (3)

プログラマブルコントローラと該プログラマブルコントローラが得た所定のデータを保存するデータベースとが通信路を介して接続されたデータ収集システムであって、
前記プログラマブルコントローラは、
前記通信路を介して、前記データベースをアクセスするSQL文を複数含むSQL処理群を前記データベースに送信するSQL送信部と、
前記SQL処理群を送信した際に前記データベースの無応答による通信異常の発生により、前記SQL処理群を所定の記憶手段に退避するバッファ処理部と、
前記通信異常が復旧されたとき、前記データベースが備える受信バッファに保持された前記SQL処理群を獲得するコマンドを前記データベースに送信するコマンド送信部と、を備え、
前記データベースは、
前記コマンド送信部により送信されたコマンドを受信した際、前記受信バッファが前記SQL処理群を未保持のとき、この未保持を示すエンプティデータを前記プログラマブルコントローラに送信する復帰応答部を備え、
前記プログラマブルコントローラは、
前記データベースから前記エンプティデータを受信すると、前記所定の記憶手段に退避されたSQL処理群を前記データベースに送信する異常復帰処理部をさらに備えることを特徴とするデータ収集システム。
A data collection system in which a programmable controller and a database for storing predetermined data obtained by the programmable controller are connected via a communication path,
The programmable controller is
An SQL transmitter that transmits an SQL processing group including a plurality of SQL statements for accessing the database to the database via the communication path;
A buffer processing unit that saves the SQL processing group in a predetermined storage unit due to the occurrence of a communication error due to a non-response of the database when the SQL processing group is transmitted;
A command transmission unit that transmits, to the database, a command for acquiring the SQL processing group held in the reception buffer included in the database when the communication abnormality is recovered;
The database is
When the command transmitted by the command transmission unit is received, when the reception buffer does not retain the SQL processing group, a return response unit that transmits empty data indicating the retention to the programmable controller is provided.
The programmable controller is
The data collection system further comprising: an abnormality recovery processing unit that transmits the SQL processing group saved in the predetermined storage unit to the database when the empty data is received from the database.
プログラマブルコントローラと該プログラマブルコントローラが得た所定のデータを保存するデータベースとが通信路を介して接続されたデータ収集システムであって、
前記プログラマブルコントローラは、
前記通信路を介して、前記データベースをアクセスするSQL文を複数含むSQL処理群を前記データベースに送信するSQL送信部と、
前記SQL処理群を送信した際に前記データベースの無応答による通信異常の発生により、前記SQL文および前記SQL処理群それぞれを所定の記憶手段に退避するバッファ処理部と、
前記通信異常が復旧されたとき、前記データベースが備える受信バッファに保持された前記SQL処理群を獲得するコマンドを前記データベースに送信するコマンド送信部と、を備え、
前記データベースは、
前記コマンド送信部により送信されたコマンドを受信した際、前記受信バッファが前記SQL処理群を未保持のとき、この未保持を示すエンプティデータを前記プログラマブルコントローラに送信し、前記受信バッファが前記SQL処理群を保持しているとき、この保持された前記SQL処理群を前記プログラマブルコントローラに送信する復帰応答部を備え、
前記プログラマブルコントローラは、
前記データベースから前記エンプティデータを受信すると、前記所定の記憶手段に退避されたSQL処理群を前記データベースに送信し、前記データベースから前記SQL処理群を受信すると、この獲得したSQL処理群に含まれるSQL文に続く差分のSQL文を前記記憶手段に退避されたSQL文から抽出して送信する異常復帰処理部をさらに備えることを特徴とするデータ収集システム。
A data collection system in which a programmable controller and a database for storing predetermined data obtained by the programmable controller are connected via a communication path,
The programmable controller is
An SQL transmitter that transmits an SQL processing group including a plurality of SQL statements for accessing the database to the database via the communication path;
A buffer processing unit that saves each of the SQL statement and the SQL processing group in a predetermined storage unit due to the occurrence of a communication abnormality due to no response of the database when the SQL processing group is transmitted;
A command transmission unit that transmits to the database a command for acquiring the SQL processing group held in the reception buffer included in the database when the communication abnormality is recovered;
The database is
When the command transmitted by the command transmission unit is received, if the reception buffer does not hold the SQL processing group, empty data indicating this holding is transmitted to the programmable controller, and the reception buffer performs the SQL processing. When holding a group, comprising a return response unit that transmits the held SQL processing group to the programmable controller,
The programmable controller is
When the empty data is received from the database, the SQL processing group saved in the predetermined storage means is transmitted to the database. When the SQL processing group is received from the database, the SQL processing group includes the acquired SQL processing group. A data collection system further comprising: an abnormal recovery processing unit that extracts and transmits a differential SQL sentence following the sentence from the SQL sentence saved in the storage unit.
プログラマブルコントローラと該プログラマブルコントローラが得た所定のデータを保存するデータベースとが通信路を介して接続されたデータ収集システムの異常要因判定方法であって、
前記プログラマブルコントローラは、
前記データベースをアクセスするSQL文を複数含むSQL処理群を、前記通信路を介して前記データベースに送信し、この送信の際に前記データベースの無応答による通信異常が発生した後、前記通信異常が復旧すると、前記データベースに送信し受信された前記SQL処理群を前記データベースから獲得するコマンドを前記データベースに送信し、
前記データベースは、
前記コマンドを受信した際、自身が備える受信バッファが前記SQL処理群を未保持のとき、この未保持を示すエンプティデータを前記プログラマブルコントローラに送信し、前記受信バッファが前記SQL処理群を保持しているとき、この保持された前記SQL処理群を前記プログラマブルコントローラに送信し、
前記プログラマブルコントローラは、
前記データベースから前記エンプティデータを受信すると前記データベースの電源の遮断による異常と判定し、前記データベースから前記SQL処理群を受信すると前記通信路の断線による異常と判定することを特徴とするデータ収集システムの異常要因判定方法。

An abnormality factor determination method for a data collection system in which a programmable controller and a database for storing predetermined data obtained by the programmable controller are connected via a communication path,
The programmable controller is
A SQL processing group including a plurality of SQL statements for accessing the database is transmitted to the database via the communication path, and after the communication abnormality due to no response of the database occurs at the time of transmission, the communication abnormality is recovered. Then, a command for acquiring the SQL processing group transmitted and received to the database from the database is transmitted to the database,
The database is
When the command is received, when the reception buffer included in the command does not hold the SQL processing group, empty data indicating the holding is transmitted to the programmable controller, and the reception buffer holds the SQL processing group. The stored SQL processing group is sent to the programmable controller,
The programmable controller is
A data collection system characterized in that when the empty data is received from the database, it is determined that there is an abnormality due to power-off of the database, and when the SQL processing group is received from the database, it is determined that there is an abnormality due to disconnection of the communication path. Abnormal cause judgment method.

JP2010255759A 2010-11-16 2010-11-16 Data collection system, data collection system abnormality factor determination method Active JP5549556B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2010255759A JP5549556B2 (en) 2010-11-16 2010-11-16 Data collection system, data collection system abnormality factor determination method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2010255759A JP5549556B2 (en) 2010-11-16 2010-11-16 Data collection system, data collection system abnormality factor determination method

Publications (2)

Publication Number Publication Date
JP2012108642A JP2012108642A (en) 2012-06-07
JP5549556B2 true JP5549556B2 (en) 2014-07-16

Family

ID=46494205

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2010255759A Active JP5549556B2 (en) 2010-11-16 2010-11-16 Data collection system, data collection system abnormality factor determination method

Country Status (1)

Country Link
JP (1) JP5549556B2 (en)

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6065008B2 (en) * 2012-06-22 2017-01-25 オムロン株式会社 Control device
JP6175759B2 (en) * 2012-11-14 2017-08-09 オムロン株式会社 Controller, control system, program, and information processing apparatus
JP6201298B2 (en) * 2012-11-14 2017-09-27 オムロン株式会社 Controller and program
JP6171387B2 (en) 2013-02-15 2017-08-02 オムロン株式会社 Controller, information processing apparatus and program
JP6171386B2 (en) * 2013-02-15 2017-08-02 オムロン株式会社 Controller, information processing apparatus and program
JP6064749B2 (en) * 2013-03-29 2017-01-25 オムロン株式会社 Controller and program
JP5512051B1 (en) * 2013-04-10 2014-06-04 三菱電機株式会社 Numerical control device, information linkage system, and information linkage program
US9841744B2 (en) 2013-05-17 2017-12-12 Mitsubishi Electric Corporation Programmable controller, peripheral device thereof, and table data access program of programmable controller
JP2016194808A (en) * 2015-03-31 2016-11-17 オムロン株式会社 Programmable logic controller, data collection device, database access method and database access program
JP7017881B2 (en) * 2017-04-27 2022-02-09 横河電機株式会社 Data collection system, data server and data collection method
DE102018003324A1 (en) 2017-04-27 2018-10-31 Yokogawa Electric Corporation Data collection device, data collection system, data server, data collection method and non-transitory computer readable storage medium
JP7331507B2 (en) 2019-07-08 2023-08-23 オムロン株式会社 Controller, control system and control method

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6938091B2 (en) * 2002-03-08 2005-08-30 Hewlett-Packard Development Company, L.P. Static end to end retransmit apparatus and method
JP2003280963A (en) * 2002-03-22 2003-10-03 Ricoh Co Ltd Document management system, restoration method, program for performing restoration, and recording medium with program recorded thereon
US7346905B2 (en) * 2003-06-10 2008-03-18 International Business Machines Corporation Apparatus and method for maintaining resource integrity without a unified transaction manager in a software environment
DE102006046643A1 (en) * 2006-09-29 2008-04-03 Phoenix Contact Gmbh & Co. Kg Programmable logic controller with integrated database driver
JP2010198581A (en) * 2009-02-27 2010-09-09 Hitachi Ltd Database managing method, database managing system, and database managing program

Also Published As

Publication number Publication date
JP2012108642A (en) 2012-06-07

Similar Documents

Publication Publication Date Title
JP5549556B2 (en) Data collection system, data collection system abnormality factor determination method
US9141336B2 (en) Data transfer device
US20140032173A1 (en) Information processing apparatus, and monitoring method
CN112130881A (en) Firmware remote upgrading method and device
CN105159795A (en) Data synchronization method, apparatus and system
CN102521059A (en) On-board data management system self fault-tolerance method
EP3031172B1 (en) Managing data feeds
US11930292B2 (en) Device state monitoring method and apparatus
JP5366184B2 (en) Data storage system and data storage method
KR101207944B1 (en) Lossless method of sequence of event for plant
CN113190385A (en) Data synchronization method for master and standby machines of station application server
WO2015117395A1 (en) Communication exception processing method and network element device
CN104158843A (en) Storage unit invalidation detecting method and device for distributed file storage system
JP2007233891A (en) Plant monitoring and control apparatus
JP2014225179A (en) Log acquisition device, log acquisition method, and log acquisition program
JP3779121B2 (en) Data transmission system
TW201308946A (en) Method for resuming downloading data from interruptive-point
JP2015057685A (en) Monitoring system
CN113965447B (en) Online cloud diagnosis method, device, system, equipment and storage medium
JP6064749B2 (en) Controller and program
JP5509651B2 (en) Log collection device, log collection method, program
JP2010062861A (en) Ring type network system and method for restoring same
CN110865988A (en) Data transmission method and device, robot and storage medium
JP2007272328A (en) Computer system
CN113682964B (en) Equipment parameter management and recovery method, platform, device, crane and system

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20131011

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20140410

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20140505

R150 Certificate of patent or registration of utility model

Ref document number: 5549556

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

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