JP7076654B1 - Programmable controller communication unit, received data storage method and program - Google Patents

Programmable controller communication unit, received data storage method and program Download PDF

Info

Publication number
JP7076654B1
JP7076654B1 JP2021557852A JP2021557852A JP7076654B1 JP 7076654 B1 JP7076654 B1 JP 7076654B1 JP 2021557852 A JP2021557852 A JP 2021557852A JP 2021557852 A JP2021557852 A JP 2021557852A JP 7076654 B1 JP7076654 B1 JP 7076654B1
Authority
JP
Japan
Prior art keywords
received data
storage means
communication
storage
stored
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
JP2021557852A
Other languages
Japanese (ja)
Other versions
JPWO2022190186A1 (en
Inventor
亮 長▲崎▼
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Application granted granted Critical
Publication of JP7076654B1 publication Critical patent/JP7076654B1/en
Publication of JPWO2022190186A1 publication Critical patent/JPWO2022190186A1/ja
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/04Programme control other than numerical control, i.e. in sequence controllers or logic controllers
    • G05B19/05Programmable logic controllers, e.g. simulating logic interconnections of signals according to ladder diagrams or function charts
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B23/00Testing or monitoring of control systems or parts thereof
    • G05B23/02Electric testing or monitoring

Abstract

プログラマブルコントローラの通信ユニット(100)は、通信装置にネットワークを介して接続される。通信ユニット(100)は、プログラマブルコントローラの第1記憶部(140)が有する記憶領域であって、通信装置に割り当てられた記憶領域に書き込むべきデータの通信装置からの受信を予め定められた周期毎に実行することで、記憶領域に記憶されるデータを通信装置と共有する通信部(120)と、通信部(120)によって受信されたデータが記憶領域に書き込まれる前に受信データとして順次格納される受信バッファ(130)と、受信バッファ(130)に格納された受信データに関する予め定められた異常を検出する検出部(150)と、検出部(150)によって異常が検出された受信データを含む複数の受信データを受信バッファ(130)から読み出して第2記憶部(170)に格納する格納部(160)と、を備える。The communication unit (100) of the programmable controller is connected to the communication device via a network. The communication unit (100) is a storage area included in the first storage unit (140) of the programmable controller, and receives data from the communication device to be written in the storage area assigned to the communication device every predetermined cycle. By executing this, the data stored in the storage area is shared with the communication device in the communication unit (120), and the data received by the communication unit (120) is sequentially stored as received data before being written in the storage area. The reception buffer (130), the detection unit (150) for detecting a predetermined abnormality regarding the reception data stored in the reception buffer (130), and the reception data in which the abnormality is detected by the detection unit (150) are included. A storage unit (160) for reading a plurality of received data from the reception buffer (130) and storing the plurality of received data in the second storage unit (170) is provided.

Description

本開示は、プログラマブルコントローラの通信ユニット、受信データ記憶方法及びプログラムに関する。 The present disclosure relates to a communication unit of a programmable controller, a received data storage method and a program.

FA(Factory Automation)の現場では、プログラマブルコントローラが他の通信装置とネットワークを介して通信することにより多数の機器を制御するシステムが構築される。この種の制御のための通信では、機器を協調制御するためにリアルタイム性が重視される。すなわち、装置同士が情報を短時間のうちに共有することを保証するために、データを共有するための通信が比較的短い周期で繰り返し実行される。このため、ネットワーク上では高速で大容量のデータが伝送される。 In the field of FA (Factory Automation), a system is constructed in which a programmable controller communicates with other communication devices via a network to control a large number of devices. In this kind of control communication, real-time performance is emphasized in order to coordinately control the devices. That is, in order to guarantee that the devices share information in a short time, communication for sharing data is repeatedly executed in a relatively short cycle. Therefore, a large amount of data is transmitted at high speed on the network.

このようなネットワークを介した通信において異常が発生したときに伝送されていたデータを確認するための技術が提案されている(例えば、特許文献1を参照)。特許文献1には、通信パケットを記憶部に保存しておき、通信の異常停止時に、記憶部に保存されている通信パケットを解析して異常停止原因を究明する技術について記載されている。 A technique for confirming the data transmitted when an abnormality occurs in communication via such a network has been proposed (see, for example, Patent Document 1). Patent Document 1 describes a technique of storing a communication packet in a storage unit and analyzing the communication packet stored in the storage unit to investigate the cause of the abnormal stoppage when the communication is abnormally stopped.

特開2016―122319号公報Japanese Unexamined Patent Publication No. 2016-1223119

しかしながら、特許文献1の技術では、通信が異常停止するまで大量の通信パケットの保存が継続されるため、異常が発生していない通常時における処理負荷が大きくなってしまう。このため、通常時におけるプログラマブルコントローラの処理能力が制限されるおそれがある。また、特許文献1の技術では、通信の停止を伴わない異常が発生した場合には、異常の発生後に新たな通信パケットを記憶部に格納するために、異常の発生時の通信パケットが削除されてしまう。このため、プログラマブルコントローラによる通信における異常の原因の究明が困難になるおそれがある。 However, in the technique of Patent Document 1, since a large amount of communication packets are continuously stored until the communication stops abnormally, the processing load in the normal time when no abnormality occurs becomes large. Therefore, the processing capacity of the programmable controller in normal times may be limited. Further, in the technique of Patent Document 1, when an abnormality that does not accompany the stop of communication occurs, a new communication packet is stored in the storage unit after the occurrence of the abnormality, so that the communication packet at the time of the occurrence of the abnormality is deleted. It ends up. Therefore, it may be difficult to investigate the cause of the abnormality in the communication by the programmable controller.

本開示は、上記の事情に鑑みてなされたものであり、プログラマブルコントローラの処理負荷を軽減しつつ、通信における異常の原因の究明を容易にすることを目的とする。 The present disclosure has been made in view of the above circumstances, and an object of the present disclosure is to facilitate the investigation of the cause of an abnormality in communication while reducing the processing load of the programmable controller.

上記目的を達成するため、本開示のプログラマブルコントローラの通信ユニットは、通信装置にネットワークを介して接続されるプログラマブルコントローラの通信ユニットであって、プログラマブルコントローラの第1記憶手段が有する第1記憶領域であって、通信装置に割り当てられた第1記憶領域に書き込むべきデータの通信装置からの受信を予め定められた周期毎に実行することで、第1記憶領域に記憶されるデータを通信装置と共有する通信手段と、通信手段によって受信されたデータが第1記憶領域に書き込まれる前に受信データとして順次格納される受信バッファと、受信バッファに格納された受信データに関する予め定められた異常を検出する検出手段と、検出手段によって異常が検出された受信データを含む複数の受信データのサイズと第2記憶手段の未使用の領域とを比較して、第2記憶手段に複数の受信データの保存が可能であると判定した場合に、複数の受信データを受信バッファから読み出して第2記憶手段に格納し、第2記憶手段に複数の受信データの保存が可能でないと判定した場合に、複数の受信データを第2記憶手段に格納しない格納手段と、を備え、格納手段は、検出手段によって検出された異常の種別を示すエラーコードに対応する受信データを保存することが予め設定されている場合に、該エラーコードを、検出手段によって異常が検出された受信データに付加して、該受信データを含む複数の受信データを第2記憶手段に格納し、エラーコードに対応する受信データを保存することが設定されていない場合には、受信データを第2記憶手段に格納しないIn order to achieve the above object, the communication unit of the programmable controller of the present disclosure is a communication unit of the programmable controller connected to the communication device via a network, and is a first storage area of the first storage means of the programmable controller. Therefore, the data stored in the first storage area is shared with the communication device by receiving the data to be written in the first storage area assigned to the communication device from the communication device at predetermined intervals. Detects a predetermined abnormality regarding the communication means to be used, the reception buffer in which the data received by the communication means is sequentially stored as reception data before being written to the first storage area, and the reception data stored in the reception buffer. The size of the plurality of received data including the received data in which the abnormality is detected by the detecting means is compared with the unused area of the second storage means, and the storage of the plurality of received data in the second storage means is performed. When it is determined that it is possible, a plurality of received data are read from the reception buffer and stored in the second storage means, and when it is determined that the second storage means cannot store the plurality of received data, a plurality of receptions are received. When the storage means is provided with a storage means that does not store the data in the second storage means, and the storage means is preset to store the received data corresponding to the error code indicating the type of the abnormality detected by the detection means. , The error code is added to the received data in which the abnormality is detected by the detecting means, a plurality of received data including the received data are stored in the second storage means, and the received data corresponding to the error code is stored. If is not set, the received data is not stored in the second storage means .

本開示によれば、検出手段が、受信バッファに格納された受信データに関する予め定められた異常を検出して、格納手段が、検出手段によって異常が検出された受信データを含む複数の受信データを受信バッファから読み出して第2記憶手段に格納する。このため、プログラマブルコントローラの処理負荷を軽減しつつ、通信における異常の原因の究明を容易にすることができる。 According to the present disclosure, the detecting means detects a predetermined abnormality regarding the received data stored in the receive buffer, and the storage means detects a plurality of received data including the received data in which the abnormality is detected by the detecting means. It is read from the receive buffer and stored in the second storage means. Therefore, it is possible to easily investigate the cause of the abnormality in communication while reducing the processing load of the programmable controller.

実施の形態に係る制御システムの構成を示す図The figure which shows the structure of the control system which concerns on embodiment 実施の形態に係るサイクリック通信について説明するための図The figure for demonstrating the cyclic communication which concerns on embodiment. 実施の形態に係るFA装置のハードウェア構成を示す図The figure which shows the hardware configuration of the FA apparatus which concerns on embodiment. 実施の形態に係る通信ユニットの機能的な構成を示す図The figure which shows the functional configuration of the communication unit which concerns on embodiment 実施の形態に係るサイクリック通信処理を示すフローチャートFlow chart showing cyclic communication processing according to the embodiment 実施の形態に係るバッファデータ保存処理を示すフローチャートA flowchart showing the buffer data storage process according to the embodiment. 実施の形態に係る設定情報の一例を示す図The figure which shows an example of the setting information which concerns on embodiment

以下、本開示の実施の形態に係るプログラマブルコントローラについて、図面を参照しつつ詳細に説明する。 Hereinafter, the programmable controller according to the embodiment of the present disclosure will be described in detail with reference to the drawings.

実施の形態.
本実施の形態に係る制御システム1000は、工場に設置されるFAシステムとしての生産システム、検査システム、加工システム、その他のシステムの一部に相当する。図1に示されるように、制御システム1000は、プログラマブルコントローラとしてのPLC(Programmable Logic Controller)10と、PLC10にネットワーク40を介して接続される通信装置21,22と、PLC10及び通信装置21,22の通信を中継するスイッチングハブ30と、を有する。本実施の形態に係るPLC10は、ネットワーク40を介した通信の異常の直前に受信したデータを退避させて事後の検証のために保存する機能を有する。
Embodiment.
The control system 1000 according to the present embodiment corresponds to a part of a production system, an inspection system, a processing system, and other systems as FA systems installed in a factory. As shown in FIG. 1, the control system 1000 includes a PLC (Programmable Logic Controller) 10 as a programmable controller, communication devices 21 and 22 connected to the PLC 10 via a network 40, and a PLC 10 and communication devices 21 and 22. It has a switching hub 30 that relays the communication of the above. The PLC 10 according to the present embodiment has a function of saving data received immediately before an abnormality in communication via the network 40 and storing the data for subsequent verification.

ネットワーク40は、フィールドネットワークに代表される産業用ネットワークである。詳細には、PLC10及び通信装置21,22をそれぞれネットワークケーブルでスイッチングハブ30に接続することにより、ネットワーク40が形成される。 The network 40 is an industrial network represented by a field network. Specifically, the network 40 is formed by connecting the PLC 10 and the communication devices 21 and 22, respectively, to the switching hub 30 with a network cable.

PLC10は、ネットワーク40を介して通信する通信ユニット100と、ユーザにより設定された制御プログラムを実行することでPLCの構成要素を制御するCPU(Central Processing Unit)ユニット101と、機器50からの信号の入力を受け付けるとともに機器50へ信号を出力するI/O(Input/Output)ユニット102と、を有する。通信ユニット100、CPUユニット101及びI/Oユニット102はそれぞれ、不図示のベースユニットに取り付けられることで、ベースユニット内のシステムバスを介して互いに信号を送受信するモジュールである。 The PLC 10 is a communication unit 100 that communicates via the network 40, a CPU (Central Processing Unit) unit 101 that controls components of the PLC by executing a control program set by the user, and signals from the device 50. It has an I / O (Input / Output) unit 102 that receives an input and outputs a signal to the device 50. The communication unit 100, the CPU unit 101, and the I / O unit 102 are modules that are attached to a base unit (not shown) to transmit and receive signals to and from each other via a system bus in the base unit.

機器50は、例えば、ラインに設置されたセンサ、アクチュエータ、ロボット、その他のFA機器である。I/Oユニット102がCPUユニット101からの指示に従って信号を入出力することにより、I/Oユニット102に接続された機器50が制御される。また、通信ユニット100がCPUユニット101からの指示に従って、PLC10と同様に構成される通信装置21と通信することにより、通信装置21に接続されている機器50が、PLC10に接続されている機器50と協調して制御される。例えば、PLC10に接続されたロボットである機器50は、通信装置21に接続されたセンサである機器50からの入力に応じて、予め制御プログラムにおいて定められた動作を実行する。制御プログラムは、ラダープログラムであってもよいし、他のプログラムであってもよい。 The device 50 is, for example, a sensor, an actuator, a robot, or other FA device installed on the line. The device 50 connected to the I / O unit 102 is controlled by the I / O unit 102 inputting / outputting a signal according to an instruction from the CPU unit 101. Further, when the communication unit 100 communicates with the communication device 21 configured in the same manner as the PLC 10 according to the instruction from the CPU unit 101, the device 50 connected to the communication device 21 is connected to the device 50. It is controlled in cooperation with. For example, the device 50, which is a robot connected to the PLC 10, executes an operation predetermined in a control program in response to an input from the device 50, which is a sensor connected to the communication device 21. The control program may be a ladder program or another program.

通信装置21は、プログラマブルコントローラである。通信装置22は、プログラマブルコントローラであってもよいし、他の装置であってもよい。 The communication device 21 is a programmable controller. The communication device 22 may be a programmable controller or another device.

図2には、通信ユニット100及び通信装置21,22による通信方式について模式的に示されている。以下では、通信ユニット100及び通信装置21,22を総称してFA装置20と適宜表記する。図2に示されるように、FA装置20はそれぞれ、共通のデータが格納されるサイクリックメモリ60を有する。サイクリックメモリ60は、通信ユニット100を有するPLC10に割り当てられた記憶領域610と、通信装置21に割り当てられた記憶領域621と、通信装置22に割り当てられた記憶領域622と、を有する。これらの記憶領域610,621,622にはそれぞれ、割り当てられた装置によって更新されるデータが格納される。例えば、記憶領域610には、通信ユニット100によって更新されるデータが格納され、記憶領域610に格納されたデータは、通信装置21,22によって更新されることはない。ただし、通信装置21,22のサイクリックメモリ60内の記憶領域610には、通信装置21,22によって通信ユニット100から受信されたデータが格納される。 FIG. 2 schematically shows a communication method by the communication unit 100 and the communication devices 21 and 22. In the following, the communication unit 100 and the communication devices 21 and 22 are collectively referred to as the FA device 20 as appropriate. As shown in FIG. 2, each FA device 20 has a cyclic memory 60 in which common data is stored. The cyclic memory 60 has a storage area 610 allocated to the PLC 10 having the communication unit 100, a storage area 621 allocated to the communication device 21, and a storage area 622 allocated to the communication device 22. Data updated by the assigned device is stored in each of these storage areas 610, 621, and 622. For example, the data stored in the storage area 610 is stored in the data updated by the communication unit 100, and the data stored in the storage area 610 is not updated by the communication devices 21 and 22. However, the data received from the communication unit 100 by the communication devices 21 and 22 is stored in the storage area 610 in the cyclic memory 60 of the communication devices 21 and 22.

通信ユニット100及び通信装置21,22は、予め定められた周期毎にサイクリックメモリ60に記憶されるデータを共有するためのサイクリック通信を実施する。詳細には、図2に示されるように、周期T1において、各FA装置20が、サイクリックメモリ60の内容を更新するためのデータを送信する。例えば、通信ユニット100が、記憶領域610の内容を更新するためのデータを通信装置21,22に送信することが、実線の矢印により示されている。同様に、通信装置21,22もそれぞれ、周期T1において、記憶領域621,622の内容を更新するためのデータを送信する。そして、周期T1の終了時刻までにサイクリックメモリ60の内容が通信ユニット100及び通信装置21,22で共有される。 The communication unit 100 and the communication devices 21 and 22 carry out cyclic communication for sharing the data stored in the cyclic memory 60 at predetermined intervals. Specifically, as shown in FIG. 2, in the cycle T1, each FA device 20 transmits data for updating the contents of the cyclic memory 60. For example, a solid arrow indicates that the communication unit 100 transmits data for updating the contents of the storage area 610 to the communication devices 21 and 22. Similarly, the communication devices 21 and 22, respectively, transmit data for updating the contents of the storage areas 621 and 622 in the cycle T1. Then, the contents of the cyclic memory 60 are shared by the communication unit 100 and the communication devices 21 and 22 by the end time of the cycle T1.

周期T1と同様の通信が、次の周期T2以降でも実施される。周期T1,T2の長さは、例えば、1マイクロ秒以下又は1ミリ秒以下である。周期T1,T2は、FA装置20がNTP(Network Time Protocol)サーバに接続されて時刻を管理することにより規定される周期であってもよいし、いずれかのFA装置20がマスタ装置としてデータを送信するたびに開始する周期であってもよい。 Communication similar to the cycle T1 is carried out in the next cycle T2 and thereafter. The length of the periods T1 and T2 is, for example, 1 microsecond or less or 1 millisecond or less. The cycles T1 and T2 may be cycles defined by the FA device 20 being connected to an NTP (Network Time Protocol) server to manage the time, or any FA device 20 may use data as a master device. It may be a cycle that starts every time transmission is performed.

FA装置20は、そのハードウェア構成として、図3に示されるように、プロセッサ201と、主記憶部202と、補助記憶部203と、入力部204と、出力部205と、通信部206と、を有する。主記憶部202、補助記憶部203、入力部204、出力部205及び通信部206はいずれも、内部バス207を介してプロセッサ201に接続される。 As its hardware configuration, the FA device 20 includes a processor 201, a main storage unit 202, an auxiliary storage unit 203, an input unit 204, an output unit 205, a communication unit 206, and the communication unit 206, as shown in FIG. Has. The main storage unit 202, the auxiliary storage unit 203, the input unit 204, the output unit 205, and the communication unit 206 are all connected to the processor 201 via the internal bus 207.

プロセッサ201は、集積回路であるCPU(Central Processing Unit)又はMPU(Micro Processing Unit)を含む。プロセッサ201は、補助記憶部203に記憶されるプログラムP1を実行することにより、FA装置20の種々の機能を実現して、後述の処理を実行する。 The processor 201 includes a CPU (Central Processing Unit) or an MPU (Micro Processing Unit) which is an integrated circuit. The processor 201 realizes various functions of the FA device 20 by executing the program P1 stored in the auxiliary storage unit 203, and executes the processing described later.

主記憶部202は、RAM(Random Access Memory)を含む。主記憶部202には、補助記憶部203からプログラムP1がロードされる。そして、主記憶部202は、プロセッサ201の作業領域として用いられる。 The main storage unit 202 includes a RAM (Random Access Memory). The program P1 is loaded into the main storage unit 202 from the auxiliary storage unit 203. The main storage unit 202 is used as a working area of the processor 201.

補助記憶部203は、EEPROM(Electrically Erasable Programmable Read-Only Memory)に代表される不揮発性メモリを含む。補助記憶部203は、プログラムP1の他に、プロセッサ201の処理に用いられる種々のデータを記憶する。補助記憶部203は、プロセッサ201の指示に従って、プロセッサ201によって利用されるデータをプロセッサ201に供給し、プロセッサ201から供給されたデータを記憶する。 The auxiliary storage unit 203 includes a non-volatile memory represented by an EEPROM (Electrically Erasable Programmable Read-Only Memory). The auxiliary storage unit 203 stores various data used for processing of the processor 201 in addition to the program P1. The auxiliary storage unit 203 supplies the data used by the processor 201 to the processor 201 according to the instruction of the processor 201, and stores the data supplied from the processor 201.

入力部204は、入力キー、ボタン及びスイッチに代表される入力デバイスを含む。入力部204は、FA装置20のユーザによって入力された情報を取得して、取得した情報をプロセッサ201に通知する。 The input unit 204 includes an input device represented by an input key, a button and a switch. The input unit 204 acquires the information input by the user of the FA device 20, and notifies the processor 201 of the acquired information.

出力部205は、LED(Light Emitting Diode)及びスピーカに代表される出力デバイスを含む。出力部205は、プロセッサ201の指示に従って、種々の情報をユーザに提示する。 The output unit 205 includes an output device typified by an LED (Light Emitting Diode) and a speaker. The output unit 205 presents various information to the user according to the instruction of the processor 201.

通信部206は、外部の装置と通信するためのネットワークインタフェース回路を含む。通信部206は、外部から信号を受信して、この信号により示されるデータをプロセッサ201へ出力する。また、通信部206は、プロセッサ201から出力されたデータを示す信号を外部の装置へ送信する。 The communication unit 206 includes a network interface circuit for communicating with an external device. The communication unit 206 receives a signal from the outside and outputs the data indicated by this signal to the processor 201. Further, the communication unit 206 transmits a signal indicating the data output from the processor 201 to an external device.

図3に示されるハードウェア構成が協働することで、通信ユニット100は、種々の機能を発揮する。詳細には、通信ユニット100は、図4に示されるように、その機能として、通信ユニット100の構成要素を制御する制御部110と、ネットワーク40を介して通信する通信部120と、通信部120によって受信されたデータが一時的に格納される受信バッファ130と、サイクリックメモリ60に相当する第1記憶部140と、受信バッファ130に格納されている受信データに関する異常を検出する検出部150と、異常が検出された受信データを含む複数の受信データを受信バッファ130から読み出して第2記憶部170に格納する格納部160と、受信データを保存するための第2記憶部170と、を有する。 By cooperating with the hardware configurations shown in FIG. 3, the communication unit 100 exhibits various functions. Specifically, as shown in FIG. 4, the communication unit 100 has, as its functions, a control unit 110 that controls the components of the communication unit 100, a communication unit 120 that communicates via the network 40, and a communication unit 120. A receive buffer 130 in which the data received by the user is temporarily stored, a first storage unit 140 corresponding to the cyclic memory 60, and a detection unit 150 for detecting an abnormality in the received data stored in the receive buffer 130. It has a storage unit 160 for reading a plurality of received data including received data in which an abnormality has been detected from the reception buffer 130 and storing the received data in the second storage unit 170, and a second storage unit 170 for storing the received data. ..

制御部110は、主としてプロセッサ201によって実現される。また、通信部120は、主として通信部206によって実現される。通信部120は、通信装置21,22との通信を予め定められた周期毎に実行することで、サイクリックメモリ60としての第1記憶部140の記憶領域610,621,622に記憶されるデータを通信装置21,22と共有する。詳細には、通信部120は、通信装置21,22に割り当てられた記憶領域621,622に書き込むべきデータの受信と、PLC10に割り当てられた記憶領域610に格納されているデータの送信と、を含む通信装置21,22とのサイクリック通信を実行する。通信部120は、通信ユニット100において、通信装置に割り当てられた記憶領域に書き込むべきデータの通信装置からの受信を予め定められた周期毎に実行することで、当該記憶領域に記憶されるデータを通信装置と共有する通信手段の一例に相当する。 The control unit 110 is mainly realized by the processor 201. Further, the communication unit 120 is mainly realized by the communication unit 206. The communication unit 120 executes communication with the communication devices 21 and 22 at predetermined intervals, so that the data stored in the storage area 610, 621, 622 of the first storage unit 140 as the cyclic memory 60. Is shared with the communication devices 21 and 22. Specifically, the communication unit 120 receives data to be written in the storage areas 621 and 622 allocated to the communication devices 21 and 22, and transmits data stored in the storage area 610 allocated to the PLC 10. Executes cyclic communication with the including communication devices 21 and 22. The communication unit 120 receives data from the communication device to be written in the storage area assigned to the communication device in the communication unit 100 at predetermined intervals, so that the data stored in the storage area can be stored. It corresponds to an example of a communication means shared with a communication device.

受信バッファ130は、主として主記憶部202によって実現されるFIFO(First In, First Out)バッファである。受信バッファ130には、通信部120によって受信されたデータが順次格納される。そして、受信バッファ130に格納されたデータが制御部110によって順次読み出されて、サイクリック通信のデータが第1記憶部140に格納される。すなわち、受信バッファ130には、通信部120によって受信されたデータが、記憶領域621,622に書き込まれる前に受信データとして順次格納される。 The receive buffer 130 is a FIFO (First In, First Out) buffer mainly realized by the main storage unit 202. The data received by the communication unit 120 is sequentially stored in the reception buffer 130. Then, the data stored in the reception buffer 130 is sequentially read out by the control unit 110, and the cyclic communication data is stored in the first storage unit 140. That is, the data received by the communication unit 120 is sequentially stored in the reception buffer 130 as received data before being written in the storage areas 621 and 622.

第1記憶部140は、主として主記憶部202によって実現される。第1記憶部140は、プログラマブルコントローラの第1記憶手段の一例に相当する。 The first storage unit 140 is mainly realized by the main storage unit 202. The first storage unit 140 corresponds to an example of the first storage means of the programmable controller.

検出部150は、主としてプロセッサ201によって実現される。検出部150は、受信バッファ130に格納されているデータを監視して、当該データに関する異常を検出する。検出部150によって検出される異常は、ユーザによって事前に想定される通常の運用から逸脱した状態として予め定められた異常であって、例えば、データ自体に異常があること、及び、同一のデータを2回受信したことを含む。データ自体の異常は、例えば、周期T1に対応する識別子が付されたデータを周期T2で受信したこと、及び、データに含まれるチェックサムにより誤り検出がなされたことを含む。また、検出部150によって検出される異常は、通信の一時的な高負荷による通信異常のような、その後の自動復旧が可能な異常を含んでもよい。検出部150は、通信ユニット100において、受信バッファに格納された受信データに関する予め定められた異常を検出する検出手段の一例に相当する。 The detection unit 150 is mainly realized by the processor 201. The detection unit 150 monitors the data stored in the receive buffer 130 and detects an abnormality related to the data. The abnormality detected by the detection unit 150 is an abnormality that is predetermined as a state deviating from the normal operation assumed in advance by the user, for example, that the data itself has an abnormality and that the same data is detected. Including that it was received twice. The abnormality of the data itself includes, for example, that the data with the identifier corresponding to the cycle T1 is received in the cycle T2, and that the error is detected by the checksum included in the data. Further, the abnormality detected by the detection unit 150 may include an abnormality capable of automatic recovery thereafter, such as a communication abnormality due to a temporary high load of communication. The detection unit 150 corresponds to an example of a detection means for detecting a predetermined abnormality regarding the reception data stored in the reception buffer in the communication unit 100.

格納部160は、主としてプロセッサ201によって実現される。格納部160は、検出部150から異常を検出したことの通知を受けたときに、異常が検出された受信データを含む一連の受信データを受信バッファ130から読み出して、第2記憶部170に格納する。詳細には、格納部160は、異常が検出された受信データの記憶位置を示す位置情報を検出部150から受け取って、当該受信データと、その前に受信されて受信バッファ130に格納された複数の受信データを読み出す。格納部160によって読み出される受信データの数は、予め定められた固定のパケット数であってもよいし、予め定められた容量に収まる最大のパケット数であってもよい。例えば、受信バッファ130は、アドレスの値が小さい順にパケットが格納されるリングバッファであって、格納部160は、異常な受信データの受信バッファ130におけるアドレスを検出部150から取得して、当該アドレスまでの連続する10個のパケットを読み出す。 The storage unit 160 is mainly realized by the processor 201. When the storage unit 160 receives a notification from the detection unit 150 that an abnormality has been detected, the storage unit 160 reads a series of received data including the received data in which the abnormality is detected from the reception buffer 130 and stores the data in the second storage unit 170. do. Specifically, the storage unit 160 receives the position information indicating the storage position of the received data in which the abnormality is detected from the detection unit 150, and the received data and a plurality of received data previously received and stored in the reception buffer 130. Read the received data of. The number of received data read by the storage unit 160 may be a predetermined fixed number of packets, or may be a maximum number of packets that can be accommodated in a predetermined capacity. For example, the reception buffer 130 is a ring buffer in which packets are stored in ascending order of the address value, and the storage unit 160 acquires the address in the reception buffer 130 of abnormal received data from the detection unit 150 and the address. Read up to 10 consecutive packets.

そして、格納部160は、読み出した受信データをそれぞれ、当該受信データの送信元としての通信装置21,22に対応する第2記憶部170の記憶領域171,172に格納する。詳細には、格納部160は、受信データに含まれる、送信元を示す送信元情報を参照して、送信元情報に対応する記憶領域に受信データを格納する。送信元情報は、例えば、局番又はIP(Internet Protocol)アドレスである。また、格納部160は、第2記憶部170に格納する受信データに、異常の種別を示すエラーコードを付加する。格納部160は、通信ユニット100において、検出手段によって異常が検出された受信データを含む複数の受信データを受信バッファから読み出して第2記憶手段に格納する格納手段の一例に相当する。 Then, the storage unit 160 stores the read received data in the storage areas 171 and 172 of the second storage unit 170 corresponding to the communication devices 21 and 22 as the transmission source of the received data, respectively. Specifically, the storage unit 160 refers to the source information indicating the source included in the received data, and stores the received data in the storage area corresponding to the source information. The source information is, for example, a station code or an IP (Internet Protocol) address. Further, the storage unit 160 adds an error code indicating the type of abnormality to the received data stored in the second storage unit 170. The storage unit 160 corresponds to an example of the storage means in the communication unit 100, which reads a plurality of received data including the received data for which an abnormality is detected by the detection means from the reception buffer and stores the data in the second storage means.

第2記憶部170は、主として主記憶部202及び補助記憶部203の少なくとも一方によって実現される。第2記憶部170は、通信装置21に対応する記憶領域171と、通信装置22に対応する記憶領域172と、を有する。図4には、異常が検出された受信データD9、及び、受信データD9より前に通信部120によって受信されて受信バッファ130に格納された受信データD1~D8のうち、通信装置21から送信された受信データD1,D3,D4,D8,D9が、記憶領域171に保存され、通信装置22から送信された受信データD2,D5,D6,D7が、記憶領域172に保存されることが示されている。また、記憶領域171には、受信データD9に関する異常の種別を示すエラーコードE1が格納されることが示されている。第2記憶部170は、通信ユニット100において、格納手段によって受信データが格納される第2記憶手段の一例に相当する。 The second storage unit 170 is mainly realized by at least one of the main storage unit 202 and the auxiliary storage unit 203. The second storage unit 170 has a storage area 171 corresponding to the communication device 21 and a storage area 172 corresponding to the communication device 22. In FIG. 4, among the received data D9 in which an abnormality is detected and the received data D1 to D8 received by the communication unit 120 before the received data D9 and stored in the receive buffer 130, they are transmitted from the communication device 21. It is shown that the received data D1, D3, D4, D8, D9 are stored in the storage area 171 and the received data D2, D5, D6, D7 transmitted from the communication device 22 are stored in the storage area 172. ing. Further, it is shown that the storage area 171 stores the error code E1 indicating the type of abnormality related to the received data D9. The second storage unit 170 corresponds to an example of the second storage means in which the received data is stored by the storage means in the communication unit 100.

続いて、通信ユニット100によって実行されるサイクリック通信処理及びバッファデータ保存処理について、図5~7を参照して説明する。図5に示されるサイクリック通信処理は、CPUユニット101からの指示により開始する。 Subsequently, the cyclic communication process and the buffer data storage process executed by the communication unit 100 will be described with reference to FIGS. 5 to 7. The cyclic communication process shown in FIG. 5 is started by an instruction from the CPU unit 101.

サイクリック通信処理では、通信部120が、第1記憶部140に書き込むべきデータを通信装置21,22から受信する(ステップS11)。具体的には、予め定められた一の周期において、通信部120は、記憶領域621,622の内容を共有するために通信装置21,22それぞれから送信されたデータを受信する。 In the cyclic communication process, the communication unit 120 receives data to be written in the first storage unit 140 from the communication devices 21 and 22 (step S11). Specifically, in one predetermined cycle, the communication unit 120 receives data transmitted from each of the communication devices 21 and 22 in order to share the contents of the storage areas 621 and 622.

次に、通信部120は、ステップS1で受信した一又は複数のデータを、受信した順で受信バッファ130に格納する(ステップS12)。ここで、受信バッファ130に空き容量がなければ、最も古いデータから順に上書きされる。 Next, the communication unit 120 stores one or more data received in step S1 in the reception buffer 130 in the order of reception (step S12). Here, if there is no free space in the receive buffer 130, the oldest data is overwritten in order.

次に、制御部110は、第1記憶部140の記憶領域610に格納されているデータを読み出して、通信部120に、読み出したデータを通信装置21,22へ送信させる(ステップS13)。これにより、PLC10に割り当てられた記憶領域610のデータが各FA装置20で共有される。 Next, the control unit 110 reads the data stored in the storage area 610 of the first storage unit 140, and causes the communication unit 120 to transmit the read data to the communication devices 21 and 22 (step S13). As a result, the data of the storage area 610 allocated to the PLC 10 is shared by each FA device 20.

次に、制御部110は、受信バッファ130からデータを読み出して第1記憶部140に格納する(ステップS14)。具体的には、制御部110は、通信装置21,22から受信したデータに含まれる、記憶領域621,622に書き込むべきデータ値と、データ値を書き込むべき記憶領域621,622の位置と、を参照して、当該位置にデータ値を書き込む。例えば、データ値は、WORD値であって、位置は、記憶領域621,622内のWORD単位のアドレスである。これにより、記憶領域621,622のデータが各FA装置で共有される。 Next, the control unit 110 reads data from the reception buffer 130 and stores it in the first storage unit 140 (step S14). Specifically, the control unit 110 determines the data value to be written in the storage areas 621 and 622 included in the data received from the communication devices 21 and 22 and the position of the storage area 621 and 622 to write the data value. Refer to it and write the data value at the relevant position. For example, the data value is a WORD value and the location is a WORD unit address within the storage areas 621,622. As a result, the data in the storage areas 621 and 622 are shared by each FA device.

その後、通信ユニット100は、ステップS11以降の処理を繰り返す。これにより、データの共有が周期的に実行されることとなる。 After that, the communication unit 100 repeats the processes after step S11. As a result, data sharing will be executed periodically.

図6には、受信バッファ130のデータを事後の検証に備えて保存するためのバッファデータ保存処理の流れが示されている。バッファデータ保存処理は、サイクリック通信処理と同時に開始して、サイクリック通信処理とは並列に実行される。 FIG. 6 shows the flow of the buffer data storage process for storing the data in the receive buffer 130 for the subsequent verification. The buffer data storage process is started at the same time as the cyclic communication process and is executed in parallel with the cyclic communication process.

バッファデータ保存処理では、検出部150が、受信データに関する異常を検出したか否かを判定する(ステップS21)。具体的には、検出部150が、受信バッファ130に格納されている受信バッファのうちの、異常の有無の判定を未だ実行していない受信バッファに対して、予め定められた判定処理を施すことで、異常の有無を判定する。 In the buffer data storage process, the detection unit 150 determines whether or not an abnormality related to the received data has been detected (step S21). Specifically, the detection unit 150 performs a predetermined determination process on a receive buffer stored in the receive buffer 130 that has not yet been determined for the presence or absence of an abnormality. Then, the presence or absence of abnormality is determined.

異常を検出していないと判定された場合(ステップS21;No)、通信ユニット100は、ステップS21の判定を繰り返す。一方、異常を検出したと判定された場合(ステップS21;Yes)、検出部150は、検出した異常の種別を示すエラーコードを発行する(ステップS22)。エラーコードは、図7に例示されるような、エラー内容に対応して予め定められた識別子である。エラーコードが発行されて、後述するようにユーザに提供されれば、ユーザは、当該エラーコードを確認することで、どのような異常が発生したか概要を確認することができる。 If it is determined that no abnormality has been detected (step S21; No), the communication unit 100 repeats the determination in step S21. On the other hand, when it is determined that an abnormality has been detected (step S21; Yes), the detection unit 150 issues an error code indicating the type of the detected abnormality (step S22). The error code is a predetermined identifier corresponding to the error content as illustrated in FIG. 7. If an error code is issued and provided to the user as described later, the user can confirm an outline of what kind of abnormality has occurred by confirming the error code.

次に、格納部160は、ステップS22で発行されたエラーコードに対応する受信データを保存すべきことがユーザにより設定されているか否かを判定する(ステップS23)。具体的には、格納部160は、図7に例示される設定情報を参照する。この設定情報は、異常の種別を示すエラーコードと、当該種別の異常の概要を示すエラー内容と、当該種別の異常が発生したときの受信データを第2記憶部170に保存すべきか否かを示すパラメータと、を関連付けたテーブルデータである。設定情報は、通信ユニット100の補助記憶部203に予め格納される。設定情報のパラメータは、通信ユニット100の工場出荷時にファームウェアにおいて初期値が予め設定された上で、ユーザによって任意に変更される。図7に示される「ON」のパラメータは、受信データを保存すべきことを示し、「OFF」のパラメータは、受信データを保存しないことを示す。 Next, the storage unit 160 determines whether or not the user has set that the received data corresponding to the error code issued in step S22 should be stored (step S23). Specifically, the storage unit 160 refers to the setting information exemplified in FIG. 7. This setting information indicates whether or not the error code indicating the type of abnormality, the error content indicating the outline of the abnormality of the type, and the received data when the abnormality of the type occurs should be saved in the second storage unit 170. It is the table data associated with the indicated parameters. The setting information is stored in advance in the auxiliary storage unit 203 of the communication unit 100. The parameters of the setting information are arbitrarily changed by the user after the initial values are set in advance in the firmware at the time of shipment from the factory of the communication unit 100. The "ON" parameter shown in FIG. 7 indicates that the received data should be saved, and the "OFF" parameter indicates that the received data should not be saved.

受信データを保存すべきことが設定されていないと判定した場合(ステップS23;No)、通信ユニット100は、ステップS21以降の処理を繰り返す。一方、受信データを保存すべきことが設定されていると判定した場合(ステップS23;Yes)、格納部160は、第2記憶部170に受信データの保存が可能か否かを判定する(ステップS24)。具体的には、格納部160は、異常が検出された受信データを含む複数の保存対象の受信データのサイズと、第2記憶部170の未使用メモリ領域とを比較することで、第2記憶部170に十分な空き領域が存在するか否かを確認する。 When it is determined that the reception data should not be saved (step S23; No), the communication unit 100 repeats the processes after step S21. On the other hand, when it is determined that the reception data should be stored (step S23; Yes), the storage unit 160 determines whether or not the reception data can be stored in the second storage unit 170 (step). S24). Specifically, the storage unit 160 compares the size of a plurality of received data to be stored including the received data in which an abnormality is detected with the unused memory area of the second storage unit 170, thereby storing the second storage unit 160. It is confirmed whether or not there is sufficient free space in the unit 170.

受信データの保存が可能でないと判定した場合(ステップS24;No)、通信ユニット100は、ステップS21以降の処理を繰り返す。一方、受信データの保存が可能であると判定した場合(ステップS24;Yes)、格納部160は、送信元ごとに受信データを格納するための記憶領域を確保する(ステップS25)。これにより、記憶領域171,172が形成される。具体的には、格納部160は、受信データそれぞれの送信元情報を参照して、送信元ごとに受信データの総容量を算出し、算出した総容量を格納可能な記憶領域を確保する。 When it is determined that the received data cannot be saved (step S24; No), the communication unit 100 repeats the processes after step S21. On the other hand, when it is determined that the received data can be stored (step S24; Yes), the storage unit 160 secures a storage area for storing the received data for each transmission source (step S25). As a result, storage areas 171 and 172 are formed. Specifically, the storage unit 160 refers to the source information of each received data, calculates the total capacity of the received data for each source, and secures a storage area capable of storing the calculated total capacity.

次に、格納部160は、保存対象の受信データそれぞれの送信元情報を参照することで、当該受信データが、通信装置21からのデータか、通信装置22からのデータかを特定し、当該受信データの格納先となる記憶領域を特定する(ステップS26)。 Next, the storage unit 160 identifies whether the received data is the data from the communication device 21 or the data from the communication device 22 by referring to the source information of each of the received data to be stored, and the reception unit 160 determines whether the received data is the data from the communication device 22 or the data from the communication device 22. A storage area for storing data is specified (step S26).

次に、格納部160は、受信バッファ130から受信データを読み出してコピーし、コピーした受信データにエラーコードを付与して第2記憶領域に格納する(ステップS27)。具体的には、格納部160は、エラーコードを、異常が検出された受信データとともに記憶領域171又は記憶領域172に格納する。ただし、格納部160は、記憶領域171,172双方にエラーコードを格納してもよいし、保存対象の複数の受信データそれぞれにエラーコードを付与してもよい。 Next, the storage unit 160 reads the received data from the reception buffer 130, copies the received data, assigns an error code to the copied received data, and stores the copied data in the second storage area (step S27). Specifically, the storage unit 160 stores the error code in the storage area 171 or the storage area 172 together with the received data in which the abnormality is detected. However, the storage unit 160 may store the error code in both the storage areas 171 and 172, or may assign an error code to each of the plurality of received data to be stored.

その後、通信ユニット100は、ステップS21以降の処理を繰り返す。これにより、通信ユニット100は、通信に異常が発生するたびに受信データを保存することとなる。 After that, the communication unit 100 repeats the processes after step S21. As a result, the communication unit 100 saves the received data every time an abnormality occurs in the communication.

以上、説明したように、本実施の形態によれば、検出部150が、受信バッファ130に格納された受信データに関する予め定められた異常を検出して、格納部160が、検出部150によって異常が検出された受信データを含む複数の受信データを受信バッファ130から読み出して第2記憶部170に格納する。このため、通常時において受信データを第2記憶部170に格納することによる処理負荷の発生を回避することができる。また、受信バッファ130とは異なる第2記憶部170に、異常が検出された受信データが格納され、その後に受信されたデータは、受信バッファ130に格納されてから第1記憶部140に格納されるため、第2記憶部に格納された受信データを削除することなく事後の検証のために残すことができる。したがって、PLC10の処理負荷を軽減しつつ、通信の停止を伴わない異常が生じたときに伝送されたデータを記録して、通信における異常の原因の究明を容易にすることができる。 As described above, according to the present embodiment, the detection unit 150 detects a predetermined abnormality regarding the received data stored in the reception buffer 130, and the storage unit 160 causes the abnormality by the detection unit 150. A plurality of received data including the received data in which is detected is read from the receive buffer 130 and stored in the second storage unit 170. Therefore, it is possible to avoid the occurrence of a processing load due to storing the received data in the second storage unit 170 in the normal time. Further, the received data in which an abnormality is detected is stored in the second storage unit 170, which is different from the reception buffer 130, and the data received thereafter is stored in the reception buffer 130 and then stored in the first storage unit 140. Therefore, the received data stored in the second storage unit can be left for subsequent verification without being deleted. Therefore, while reducing the processing load of the PLC 10, it is possible to record the transmitted data when an abnormality without stopping the communication occurs, and to facilitate the investigation of the cause of the abnormality in the communication.

また、格納部160は、検出部150によって異常が検出された受信データと、当該受信データより前に通信部120によって受信された他の受信データと、を含む複数の受信データを受信バッファから読み出して第2記憶部170に格納する。すなわち、異常な受信データとその前の正常な受信データとが、複製されて第2記憶部170に格納される。ユーザは、事後の検証において、第2記憶部170に保存されている正常な受信データと異常な受信データとを比較することで、どのように異常な状態へ遷移していったのかを解析することができる。具体的には、ユーザが使用するエンジニアリングツールから、CPUユニット101を介して第2記憶部170の情報が要求されたときに、制御部110が、第2記憶部170の情報を読み出してユーザに提供することで、ユーザは、通信異常の発生時の受信データを解析することができる。 Further, the storage unit 160 reads a plurality of received data including the received data for which an abnormality is detected by the detection unit 150 and other received data received by the communication unit 120 before the received data from the reception buffer. Is stored in the second storage unit 170. That is, the abnormal received data and the normal received data before that are duplicated and stored in the second storage unit 170. In the subsequent verification, the user analyzes how the transition to the abnormal state is performed by comparing the normal received data stored in the second storage unit 170 with the abnormal received data. be able to. Specifically, when the engineering tool used by the user requests the information of the second storage unit 170 via the CPU unit 101, the control unit 110 reads the information of the second storage unit 170 and asks the user. By providing it, the user can analyze the received data when a communication abnormality occurs.

また、格納部160は、検出部150による検出対象である複数の種別の異常からユーザによって予め指定された指定種別の異常が検出部150によって検出された場合に、指定種別の異常が検出された受信データを含む複数の受信データを第2記憶部170に格納し、指定種別とは異なる種別の異常が検出部150によって検出された場合には、受信データを第2記憶部170に格納しない。このため、ユーザが保存することを要望しない種別の異常に関する受信データが第2記憶部170に格納されることがなく、第2記憶部170の容量を有効に活用することができる。また、受信データを保存すべき異常の種別をユーザが任意に選択することができるため、利便性を向上させることができる。 Further, in the storage unit 160, when the detection unit 150 detects an abnormality of a specified type specified in advance by the user from a plurality of types of abnormalities to be detected by the detection unit 150, the abnormality of the specified type is detected. A plurality of received data including the received data are stored in the second storage unit 170, and when an abnormality of a type different from the designated type is detected by the detection unit 150, the received data is not stored in the second storage unit 170. Therefore, the received data regarding the type of abnormality that the user does not want to save is not stored in the second storage unit 170, and the capacity of the second storage unit 170 can be effectively utilized. Further, since the user can arbitrarily select the type of abnormality for which the received data should be saved, the convenience can be improved.

また、通信ユニット100は、2つの通信装置21,22に接続され、格納部160は、受信バッファ130から読み出した複数の受信データをそれぞれ、第2記憶部170が有する記憶領域171,172のうちの、当該受信データを送信した通信装置に対応する記憶領域に格納する。このため、通信装置21,22のうちの特定の装置からの受信データの解析を容易にすることができる。 Further, the communication unit 100 is connected to two communication devices 21 and 22, and the storage unit 160 stores a plurality of received data read from the reception buffer 130 in the storage areas 171 and 172 of the second storage unit 170, respectively. The received data is stored in the storage area corresponding to the communication device that transmitted the data. Therefore, it is possible to easily analyze the received data from a specific device among the communication devices 21 and 22.

以上、本開示の実施の形態について説明したが、本開示は上記実施の形態によって限定されるものではない。 Although the embodiments of the present disclosure have been described above, the present disclosure is not limited to the above embodiments.

例えば、PLC10が、ビルディングブロック方式のプログラマブルコントローラである例を説明したが、これには限定されない。PLC10は、CPUユニット101及び通信ユニット100の機能を有する1つの装置として一体的に構成されてもよい。すなわち、通信ユニット100は、通信ユニット100とは異なる機能を併せ持つプログラマブルコントローラの一部として実現されてもよい。また、PLC10の通信ユニット100が2つの通信装置21,22に接続される例について説明したが、接続される通信装置の数は、1つでもよいし、3つ以上でもよい。 For example, an example in which the PLC10 is a building block type programmable controller has been described, but the present invention is not limited thereto. The PLC 10 may be integrally configured as one device having the functions of the CPU unit 101 and the communication unit 100. That is, the communication unit 100 may be realized as a part of a programmable controller having a function different from that of the communication unit 100. Further, although an example in which the communication unit 100 of the PLC 10 is connected to two communication devices 21 and 22 has been described, the number of connected communication devices may be one or three or more.

また、サイクリック通信の一の周期の終了時刻が、次の周期の開始時刻に等しい例について説明したが、これには限定されない。例えば、サイクリック通信と、IP通信に代表される他の方式に従う通信と、が交互に周期的に実行されてもよい。 Further, an example in which the end time of one cycle of cyclic communication is equal to the start time of the next cycle has been described, but the present invention is not limited thereto. For example, cyclic communication and communication according to another method typified by IP communication may be executed alternately and periodically.

また、通信ユニット100が、サイクリックメモリ60としての第1記憶部140を有する例について説明したが、CPUユニット101が第1記憶部140を有してもよい。また、通信ユニット100の格納部160は、外部の記憶装置に受信データを格納してもよい。さらに、第1記憶部140及び第2記憶部170は、単一の記憶装置に形成された異なる記憶領域であってもよい。また、第2記憶部170に受信データを格納可能な空き領域がないときに、格納部160が、受信データを格納しない例について説明したが、これには限定されない。格納部160は、空き領域がない場合に、第2記憶部170に格納された最も古い受信データから順に新たな受信データを上書きしてもよい。 Further, although the example in which the communication unit 100 has the first storage unit 140 as the cyclic memory 60 has been described, the CPU unit 101 may have the first storage unit 140. Further, the storage unit 160 of the communication unit 100 may store the received data in an external storage device. Further, the first storage unit 140 and the second storage unit 170 may be different storage areas formed in a single storage device. Further, an example in which the storage unit 160 does not store the received data when the second storage unit 170 does not have a free area capable of storing the received data has been described, but the present invention is not limited to this. When there is no free area, the storage unit 160 may overwrite new reception data in order from the oldest reception data stored in the second storage unit 170.

また、通信ユニット100の機能は、専用のハードウェアによっても、また、通常のコンピュータシステムによっても実現することができる。 Further, the function of the communication unit 100 can be realized by dedicated hardware or by a normal computer system.

例えば、プロセッサ201によって実行されるプログラムP1を、コンピュータ読み取り可能な非一時的な記録媒体に格納して配布し、そのプログラムP1をコンピュータにインストールすることにより、上述の処理を実行する装置を構成することができる。このような記録媒体としては、例えばフレキシブルディスク、CD-ROM(Compact Disc Read-Only Memory)、DVD(Digital Versatile Disc)、MO(Magneto-Optical Disc)が考えられる。 For example, the program P1 executed by the processor 201 is stored in a non-temporary recording medium readable by a computer and distributed, and the program P1 is installed in the computer to configure a device for executing the above-mentioned processing. be able to. As such a recording medium, for example, a flexible disc, a CD-ROM (Compact Disc Read-Only Memory), a DVD (Digital Versatile Disc), and an MO (Magneto-Optical Disc) can be considered.

また、プログラムP1をインターネットに代表される通信ネットワーク上のサーバ装置が有するディスク装置に格納しておき、例えば、搬送波に重畳させて、コンピュータにダウンロードするようにしてもよい。 Further, the program P1 may be stored in a disk device of a server device on a communication network represented by the Internet, superimposed on a carrier wave, and downloaded to a computer, for example.

また、通信ネットワークを介してプログラムP1を転送しながら起動実行することによっても、上述の処理を達成することができる。 Further, the above-mentioned processing can also be achieved by starting and executing the program P1 while transferring it via the communication network.

さらに、プログラムP1の全部又は一部をサーバ装置上で実行させ、その処理に関する情報をコンピュータが通信ネットワークを介して送受信しながらプログラムを実行することによっても、上述の処理を達成することができる。 Further, the above-mentioned processing can also be achieved by executing all or a part of the program P1 on the server device and executing the program while the computer sends and receives information about the processing via the communication network.

なお、上述の機能を、OS(Operating System)が分担して実現する場合又はOSとアプリケーションとの協働により実現する場合等には、OS以外の部分のみを媒体に格納して配布してもよく、また、コンピュータにダウンロードしてもよい。 If the above-mentioned functions are shared by the OS (Operating System) or realized by collaboration between the OS and the application, only the parts other than the OS may be stored and distributed in the medium. Well, you may also download it to your computer.

また、通信ユニット100の機能を実現する手段は、ソフトウェアに限られず、その一部又は全部を、回路を含む専用のハードウェアによって実現してもよい。 Further, the means for realizing the function of the communication unit 100 is not limited to software, and a part or all thereof may be realized by dedicated hardware including a circuit.

本開示は、本開示の広義の精神と範囲を逸脱することなく、様々な実施の形態及び変形が可能とされるものである。また、上述した実施の形態は、本開示を説明するためのものであり、本開示の範囲を限定するものではない。つまり、本開示の範囲は、実施の形態ではなく、請求の範囲によって示される。そして、請求の範囲内及びそれと同等の開示の意義の範囲内で施される様々な変形が、本開示の範囲内とみなされる。 The present disclosure allows for various embodiments and variations without departing from the broad spirit and scope of the present disclosure. Moreover, the above-described embodiment is for explaining the present disclosure, and does not limit the scope of the present disclosure. That is, the scope of the present disclosure is indicated by the scope of claims, not the embodiments. And, various modifications made within the scope of the claims and within the scope of the equivalent disclosure are considered to be within the scope of the present disclosure.

本開示は、プログラマブルコントローラによる通信において異常が発生したときのデータの保存に適している。 The present disclosure is suitable for storing data when an abnormality occurs in communication by a programmable controller.

1000 制御システム、 10 PLC、 100 通信ユニット、 101 CPUユニット、 102 I/Oユニット、 110 制御部、 120 通信部、 130 受信バッファ、 140 第1記憶部、 150 検出部、 160 格納部、 170 第2記憶部、 171,172 記憶領域、 20 FA装置、 21,22 通信装置、 201 プロセッサ、 202 主記憶部、 203 補助記憶部、 204 入力部、 205 出力部、 206 通信部、 207 内部バス、 30 スイッチングハブ、 40 ネットワーク、 50 機器、 60 サイクリックメモリ、 610,621,622 記憶領域、 D1~D9 受信データ、 E1 エラーコード、 P1 プログラム、 T1,T2 周期。 1000 control system, 10 PLC, 100 communication unit, 101 CPU unit, 102 I / O unit, 110 control unit, 120 communication unit, 130 receive buffer, 140 first storage unit, 150 detector unit, 160 storage unit, 170 second unit. Storage, 171,172 storage area, 20 FA device, 21,22 communication device, 201 processor, 202 main storage, 203 auxiliary storage, 204 input, 205 output, 206 communication, 207 internal bus, 30 switching Hub, 40 networks, 50 devices, 60 cyclic memory, 610,621,622 storage area, D1 to D9 received data, E1 error code, P1 program, T1, T2 cycle.

Claims (6)

通信装置にネットワークを介して接続されるプログラマブルコントローラの通信ユニットであって、
前記プログラマブルコントローラの第1記憶手段が有する第1記憶領域であって、前記通信装置に割り当てられた前記第1記憶領域に書き込むべきデータの前記通信装置からの受信を予め定められた周期毎に実行することで、前記第1記憶領域に記憶されるデータを前記通信装置と共有する通信手段と、
前記通信手段によって受信されたデータが前記第1記憶領域に書き込まれる前に受信データとして順次格納される受信バッファと、
前記受信バッファに格納された前記受信データに関する予め定められた異常を検出する検出手段と、
前記検出手段によって異常が検出された前記受信データを含む複数の前記受信データのサイズと第2記憶手段の未使用の領域とを比較して、前記第2記憶手段に複数の前記受信データの保存が可能であると判定した場合に、複数の前記受信データを前記受信バッファから読み出して前記第2記憶手段に格納し、前記第2記憶手段に複数の前記受信データの保存が可能でないと判定した場合に、複数の前記受信データを前記第2記憶手段に格納しない格納手段と、
を備え
前記格納手段は、前記検出手段によって検出された異常の種別を示すエラーコードに対応する前記受信データを保存することが予め設定されている場合に、該エラーコードを、前記検出手段によって異常が検出された前記受信データに付加して、該受信データを含む複数の前記受信データを前記第2記憶手段に格納し、前記エラーコードに対応する前記受信データを保存することが設定されていない場合には、前記受信データを前記第2記憶手段に格納しない、
プログラマブルコントローラの通信ユニット。
A communication unit of a programmable controller connected to a communication device via a network.
A first storage area of the first storage means of the programmable controller, and reception of data to be written in the first storage area assigned to the communication device from the communication device is executed at predetermined intervals. By doing so, a communication means for sharing the data stored in the first storage area with the communication device, and
A receive buffer in which data received by the communication means is sequentially stored as received data before being written to the first storage area.
A detection means for detecting a predetermined abnormality regarding the received data stored in the receive buffer, and
The size of the plurality of received data including the received data in which an abnormality is detected by the detecting means is compared with an unused area of the second storage means, and the plurality of received data are stored in the second storage means. When it is determined that it is possible, the plurality of received data are read from the received buffer and stored in the second storage means, and it is determined that the plurality of received data cannot be stored in the second storage means. In some cases, a storage means that does not store the plurality of received data in the second storage means, and a storage means.
Equipped with
When the storage means is preset to store the received data corresponding to the error code indicating the type of the abnormality detected by the detection means, the detection means detects the error code. When it is not set to store a plurality of the received data including the received data in the second storage means in addition to the received data and save the received data corresponding to the error code. Does not store the received data in the second storage means,
Programmable controller communication unit.
前記格納手段は、前記検出手段によって異常が検出された前記受信データと、該受信データより前に前記通信手段によって受信された他の前記受信データと、を含む複数の前記受信データを前記受信バッファから読み出して前記第2記憶手段に格納する、
請求項1に記載のプログラマブルコントローラの通信ユニット。
The storage means stores a plurality of the received data including the received data in which an abnormality is detected by the detecting means and other received data received by the communication means before the received data in the receiving buffer. Read from and store in the second storage means,
The communication unit of the programmable controller according to claim 1.
前記格納手段は、前記検出手段による検出対象である複数の種別の異常からユーザによって予め指定された指定種別の異常が前記検出手段によって検出された場合に、前記指定種別の異常が検出された前記受信データを含む複数の前記受信データを前記第2記憶手段に格納し、前記指定種別とは異なる種別の異常が前記検出手段によって検出された場合には、前記受信データを前記第2記憶手段に格納しない、
請求項1又は2に記載のプログラマブルコントローラの通信ユニット。
In the storage means, when an abnormality of a designated type designated in advance by a user is detected by the detection means from a plurality of types of abnormalities to be detected by the detection means, the abnormality of the designated type is detected. A plurality of the received data including the received data are stored in the second storage means, and when an abnormality of a type different from the designated type is detected by the detection means, the received data is stored in the second storage means. Do not store
The communication unit of the programmable controller according to claim 1 or 2 .
複数の前記通信装置にネットワークを介して接続されるプログラマブルコントローラの通信ユニットであって、
前記格納手段は、前記受信バッファから読み出した複数の前記受信データをそれぞれ、前記第2記憶手段が有する複数の第2記憶領域のうちの、該受信データを送信した前記通信装置に対応する前記第2記憶領域に格納する、
請求項1からのいずれか一項に記載のプログラマブルコントローラの通信ユニット。
A communication unit of a programmable controller connected to a plurality of the communication devices via a network.
The storage means corresponds to the communication device that has transmitted the received data in the plurality of second storage areas of the second storage means, each of the plurality of received data read from the reception buffer. 2 Store in storage area,
The communication unit of the programmable controller according to any one of claims 1 to 3 .
通信装置に接続されるプログラマブルコントローラの通信ユニットによって実行される受信データ記憶方法であって、
通信手段が、前記プログラマブルコントローラの第1記憶手段が有する記憶領域であって、前記通信装置に割り当てられた前記記憶領域に書き込むべきデータの前記通信装置からの受信を予め定められた周期毎に実行し、
受信バッファが、前記通信手段によって受信されたデータを前記記憶領域に書き込まれる前に受信データとして順次記憶し、
検出手段が、前記受信バッファに記憶された前記受信データに関する予め定められた異常を検出し、
格納手段が、前記検出手段によって検出された異常の種別を示すエラーコードに対応する前記受信データを保存することが予め設定され、前記検出手段によって異常が検出された前記受信データを含む複数の前記受信データのサイズと第2記憶手段の未使用の領域とを比較して、前記第2記憶手段に複数の前記受信データの保存が可能であると判定した場合に、複数の前記受信データを前記受信バッファから読み出して前記第2記憶手段に記憶させ、前記エラーコードに対応する前記受信データを保存することが設定されていない場合、又は前記第2記憶手段に複数の前記受信データの保存が可能でないと判定した場合に、複数の前記受信データを前記第2記憶手段に記憶させない、
ことを含む受信データ記憶方法。
A method of storing received data executed by the communication unit of a programmable controller connected to a communication device.
The communication means is a storage area possessed by the first storage means of the programmable controller, and reception of data to be written in the storage area assigned to the communication device from the communication device is executed at predetermined intervals. death,
The receive buffer sequentially stores the data received by the communication means as received data before being written to the storage area.
The detection means detects a predetermined abnormality regarding the received data stored in the receive buffer, and detects the abnormality.
The storage means is preset to store the received data corresponding to the error code indicating the type of the abnormality detected by the detecting means, and the plurality of the received data including the received data in which the abnormality is detected by the detecting means. When the size of the received data is compared with the unused area of the second storage means and it is determined that the second storage means can store the plurality of received data, the plurality of received data are stored in the second storage means. When it is not set to read from the reception buffer and store it in the second storage means and store the received data corresponding to the error code, or the second storage means can store a plurality of the received data. If it is determined that the data is not, the second storage means does not store the plurality of received data.
Including received data storage method.
通信装置に接続されるコンピュータに、
前記コンピュータの第1記憶手段が有する記憶領域であって、前記通信装置に割り当てられた前記記憶領域に書き込むべきデータの前記通信装置からの受信を予め定められた周期毎に実行し、
受信したデータを前記記憶領域に書き込む前に受信データとして受信バッファに順次格納し、
前記受信バッファに格納された前記受信データに関する予め定められた異常を検出し、
検出された異常の種別を示すエラーコードに対応する前記受信データを保存することが予め設定され、異常が検出された前記受信データを含む複数の前記受信データのサイズと第2記憶手段の未使用の領域とを比較して、前記第2記憶手段に複数の前記受信データの保存が可能であると判定した場合に、前記エラーコードに対応する前記受信データを保存することが設定されていない場合、又は複数の前記受信データを前記受信バッファから読み出して前記第2記憶手段に格納し、前記第2記憶手段に複数の前記受信データの保存が可能でないと判定した場合に、複数の前記受信データを前記第2記憶手段に格納しない、
ことを実行させるためのプログラム。
To the computer connected to the communication device
It is a storage area possessed by the first storage means of the computer, and data to be written in the storage area assigned to the communication device is received from the communication device at predetermined intervals.
Before writing the received data to the storage area, the received data is sequentially stored in the receive buffer as received data.
Detects a predetermined abnormality related to the received data stored in the receive buffer, and detects it.
It is preset to store the received data corresponding to the error code indicating the type of the detected abnormality, and the size of the plurality of received data including the received data in which the abnormality is detected and the unused of the second storage means. When it is determined that the second storage means can store a plurality of the received data in comparison with the area of the above, the case where the storage of the received data corresponding to the error code is not set. Or, when the plurality of received data are read from the received buffer and stored in the second storage means, and it is determined that the plurality of received data cannot be stored in the second storage means, the plurality of received data Is not stored in the second storage means,
A program to do that.
JP2021557852A 2021-03-09 2021-03-09 Programmable controller communication unit, received data storage method and program Active JP7076654B1 (en)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2021/009136 WO2022190186A1 (en) 2021-03-09 2021-03-09 Communication unit of programmable controller, received data storage method, and program

Publications (2)

Publication Number Publication Date
JP7076654B1 true JP7076654B1 (en) 2022-05-27
JPWO2022190186A1 JPWO2022190186A1 (en) 2022-09-15

Family

ID=81753598

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2021557852A Active JP7076654B1 (en) 2021-03-09 2021-03-09 Programmable controller communication unit, received data storage method and program

Country Status (2)

Country Link
JP (1) JP7076654B1 (en)
WO (1) WO2022190186A1 (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH06324916A (en) * 1993-05-10 1994-11-25 Hokuriku Nippon Denki Software Kk Fault information logging system
JPH10301815A (en) * 1997-04-24 1998-11-13 Mitsubishi Electric Corp Fault information logging device
WO2010109584A1 (en) * 2009-03-23 2010-09-30 三菱電機株式会社 A/d converter and programmable controller system
WO2011021505A1 (en) * 2009-08-18 2011-02-24 三菱電機株式会社 Communication system and communication apparatus status determining method
JP2012252636A (en) * 2011-06-06 2012-12-20 Fuji Electric Co Ltd Trace information management device, trace information management method, and trace information management program
JP2015115842A (en) * 2013-12-12 2015-06-22 富士通株式会社 Packet storage method, packet storage program, and packet storage device
JP2020013527A (en) * 2018-10-23 2020-01-23 株式会社キーエンス Programmable logic controller and program formation assistance device
WO2020031260A1 (en) * 2018-08-07 2020-02-13 三菱電機株式会社 Control apparatus, control system, notification method, and program
JP2020150485A (en) * 2019-03-15 2020-09-17 オムロン株式会社 Control system, device and control method
JP6836692B1 (en) * 2019-12-25 2021-03-03 三菱電機株式会社 Data collection management device and data collection system

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH06324916A (en) * 1993-05-10 1994-11-25 Hokuriku Nippon Denki Software Kk Fault information logging system
JPH10301815A (en) * 1997-04-24 1998-11-13 Mitsubishi Electric Corp Fault information logging device
WO2010109584A1 (en) * 2009-03-23 2010-09-30 三菱電機株式会社 A/d converter and programmable controller system
WO2011021505A1 (en) * 2009-08-18 2011-02-24 三菱電機株式会社 Communication system and communication apparatus status determining method
JP2012252636A (en) * 2011-06-06 2012-12-20 Fuji Electric Co Ltd Trace information management device, trace information management method, and trace information management program
JP2015115842A (en) * 2013-12-12 2015-06-22 富士通株式会社 Packet storage method, packet storage program, and packet storage device
WO2020031260A1 (en) * 2018-08-07 2020-02-13 三菱電機株式会社 Control apparatus, control system, notification method, and program
JP2020013527A (en) * 2018-10-23 2020-01-23 株式会社キーエンス Programmable logic controller and program formation assistance device
JP2020150485A (en) * 2019-03-15 2020-09-17 オムロン株式会社 Control system, device and control method
JP6836692B1 (en) * 2019-12-25 2021-03-03 三菱電機株式会社 Data collection management device and data collection system

Also Published As

Publication number Publication date
JPWO2022190186A1 (en) 2022-09-15
WO2022190186A1 (en) 2022-09-15

Similar Documents

Publication Publication Date Title
EP2937751B1 (en) Control device and operation method for control device
US8457003B2 (en) Controller that instructs data to be held when a network abnormality is detected
JP4888718B2 (en) Distributed control system
JP6717026B2 (en) Control device, relay device, control device control method, relay device control method, control program, and recording medium
US10429813B2 (en) Communication system, communication device, and communication program
US10877803B2 (en) Control apparatus, control method and non-transitory storage medium
US20130318260A1 (en) Data transfer device
JP6477555B2 (en) RELAY DEVICE, RELAY DEVICE CONTROL METHOD, CONTROL PROGRAM, AND RECORDING MEDIUM
CN110161984B (en) Control device, control system, control method, and storage medium
JP6896195B1 (en) Control device and image recording method
EP3489777B1 (en) Control device, control method, and program
CN111095138B (en) Control device, control method for control device, information processing program, and recording medium
JP7076654B1 (en) Programmable controller communication unit, received data storage method and program
CN110278716B (en) PLC, network unit, CPU unit, and data transfer method
WO2019150970A1 (en) Control device, monitoring method, and monitoring program
JP6686521B2 (en) Control system and control method
US11215974B2 (en) Factory automation (FA) system, controller, and control method
US20230152783A1 (en) Control system, industrial device, control method, and program
CN113169908B (en) Line monitoring device and network switch
JP6409520B2 (en) Control system and relay device
WO2021199192A1 (en) Control device and logging method
JP6126259B1 (en) Monitoring device, monitoring method, and program
JP2006276981A (en) Transmitter, its program, and recording medium
CN116909678A (en) Implementation method and system of containerized PLC and management server
JP2021061554A (en) Data conversion device

Legal Events

Date Code Title Description
A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20210928

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20210928

A871 Explanation of circumstances concerning accelerated examination

Free format text: JAPANESE INTERMEDIATE CODE: A871

Effective date: 20210928

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20211221

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20220203

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20220517

R150 Certificate of patent or registration of utility model

Ref document number: 7076654

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150