JP2021125218A - Programmable logic controller and analyzer - Google Patents

Programmable logic controller and analyzer Download PDF

Info

Publication number
JP2021125218A
JP2021125218A JP2020161926A JP2020161926A JP2021125218A JP 2021125218 A JP2021125218 A JP 2021125218A JP 2020161926 A JP2020161926 A JP 2020161926A JP 2020161926 A JP2020161926 A JP 2020161926A JP 2021125218 A JP2021125218 A JP 2021125218A
Authority
JP
Japan
Prior art keywords
time
data
series data
collected
programmable logic
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2020161926A
Other languages
Japanese (ja)
Inventor
哲也 宮坂
Tetsuya Miyasaka
哲也 宮坂
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.)
Keyence Corp
Original Assignee
Keyence 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 Keyence Corp filed Critical Keyence Corp
Priority to US17/126,209 priority Critical patent/US11982987B2/en
Priority to CN202110127485.0A priority patent/CN113204203A/en
Publication of JP2021125218A publication Critical patent/JP2021125218A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Programmable Controllers (AREA)

Abstract

To provide a system capable of analysing characteristics such as the periodicity and continuity of data related to each device for classification and efficiently specifying an abnormal device.SOLUTION: A programmable logic controller collects data held in a collection target device among a plurality of devices in accordance with predetermined collection settings for each scan cycle of a user program, classifies each device into any of a plurality of types based on characteristics of time-series data of each device, and determines a detection algorithm when specifying an abnormal device in accordance with the time-series data of the device collected by collection means and the type of the device classified by classification means. Moreover, in accordance with the type of the device classified by the classification means, the time-series data of the device collected by the collection means is analyzed by use of a parameter determined for the device by determination means to specify the abnormal device.SELECTED DRAWING: Figure 6

Description

本発明はプログラマブルロジックコントローラ、及び分析装置に関する。 The present invention relates to a programmable logic controller and an analyzer.

プログラマブル・ロジック・コントローラ(PLC)はファクトリーオートメーションにおいて製造機器や搬送装置、検査装置などの産業機械を制御するコントローラである(特許文献1、2)。PLCはプログラマーによって作成されるラダープログラムなどのユーザプログラムを実行することで様々な拡張ユニットや被制御機器などを制御する。 A programmable logic controller (PLC) is a controller that controls industrial machines such as manufacturing equipment, transfer equipment, and inspection equipment in factory automation (Patent Documents 1 and 2). The PLC controls various expansion units and controlled devices by executing a user program such as a ladder program created by a programmer.

特許第5661222号公報Japanese Patent No. 5661222 特開2018−097662号公報JP-A-2018-097662

ところで、PLCの動作やPLCによって制御される産業機械の動作を監視するために、PLCが保持しているデータを収集して活用することが望まれている。PLCは、基本ユニット(CPUユニット)とそれに接続される拡張ユニットとを有している。基本ユニットは、ラダープログラムなどのユーザプログラムを実行することで拡張ユニットを制御する。拡張ユニットは基本ユニットからの命令にしたがって産業機械を制御し、制御結果を基本ユニットに返す。 By the way, in order to monitor the operation of the PLC and the operation of the industrial machine controlled by the PLC, it is desired to collect and utilize the data held by the PLC. The PLC has a basic unit (CPU unit) and an expansion unit connected to the basic unit (CPU unit). The basic unit controls the expansion unit by executing a user program such as a ladder program. The expansion unit controls the industrial machine according to the command from the basic unit and returns the control result to the basic unit.

また、これらの制御結果等のデータはトラブル解析や品質管理のために使用される。従って、これらのデータを蓄積して分析し、復旧のために早期に解析結果を得ることが要求されている。しかし、PLCに関連する全てのデバイスのデータを記録する場合は膨大なデータを記憶することになり、さらに異常デバイスを特定するためにはこれらの膨大なデータ(全デバイス)を解析する必要があるため時間を要する作業となる。 なお、従来では、特定のデバイスを分析対象として分析して自動的に異常判定を行い、使用する分析手法も予めデータに合った分析手法を用意して判定を行っていた。特定のデバイスを選択したり、分析手法を決定するには経験や知識も必要となる。従って、膨大なデータを好適に記憶することに加えて、十分な専門的な知識や経験を必要とすることなく、各デバイスに関連する膨大なデータの中から効率よく異常デバイスを特定する仕組みが望まれている。 In addition, data such as these control results are used for trouble analysis and quality control. Therefore, it is required to accumulate and analyze these data and obtain the analysis results at an early stage for recovery. However, when recording the data of all devices related to PLC, a huge amount of data is stored, and it is necessary to analyze these huge amounts of data (all devices) in order to identify the abnormal device. Therefore, it is a time-consuming work. In the past, an abnormality was automatically determined by analyzing a specific device as an analysis target, and an analysis method suitable for the data was prepared in advance for the analysis method to be used. Experience and knowledge are also required to select a specific device and determine the analysis method. Therefore, in addition to appropriately storing a huge amount of data, there is a mechanism to efficiently identify an abnormal device from the huge amount of data related to each device without requiring sufficient specialized knowledge and experience. It is desired.

そこで、本発明は上記問題に鑑み、各デバイスに関連するデータの周期性や連続性などの特徴を分析して分類し、効率よく異常デバイスを特定することを目的とする。 Therefore, in view of the above problems, it is an object of the present invention to analyze and classify features such as periodicity and continuity of data related to each device, and to efficiently identify an abnormal device.

本発明は、例えば、プログラマブルロジックコントローラであって、
ユーザプログラムを繰り返し実行する実行エンジンと、
前記ユーザプログラムに従って前記実行エンジンによりアクセスされるデータを記憶する記憶領域である複数のデバイスを有するデバイスメモリと、
前記ユーザプログラムの実行周期ごとに所定の収集設定に従って前記複数のデバイスのうち収集対象のデバイスで保持されているデータを収集する収集手段と、
前記収集手段によって収集された各デバイスの時系列データの特徴に基づいて、各デバイスを複数の類型のいずれかにそれぞれ分類する分類手段と、
各デバイスについて前記収集手段によって収集されたデバイスの時系列データ及び前記分類手段により当該デバイスが分類された類型に従って、当該デバイスを異常デバイスとして特定する際の検知アルゴリズムを決定する決定手段と、
前記収集手段によって収集されたデバイスの時系列データを、前記分類手段によって当該デバイスが分類された類型に従い、当該デバイスに対して前記決定手段によって決定された検知アルゴリズムを用いて分析することで異常デバイスを特定する特定手段と
を備えることを特徴とする。
The present invention is, for example, a programmable logic controller.
An execution engine that repeatedly executes the user program,
A device memory having a plurality of devices, which is a storage area for storing data accessed by the execution engine according to the user program, and
A collection means for collecting data held by the device to be collected among the plurality of devices according to a predetermined collection setting for each execution cycle of the user program.
A classification means for classifying each device into one of a plurality of types based on the characteristics of the time series data of each device collected by the collection means.
For each device, a determination means for determining a detection algorithm for identifying the device as an abnormal device according to the time series data of the device collected by the collection means and the type in which the device is classified by the classification means.
Anomalous devices are analyzed by analyzing the time-series data of the devices collected by the collecting means according to the type in which the devices are classified by the classification means using the detection algorithm determined by the determining means for the devices. It is characterized by having a specific means for specifying the above.

また、本発明は、例えば、ユーザプログラムを繰り返し実行する実行エンジンと、前記ユーザプログラムに従って前記実行エンジンによりアクセスされるデータを記憶する記憶領域である複数のデバイスを有するデバイスメモリと、前記ユーザプログラムのスキャン周期ごとに所定の収集設定に従って前記複数のデバイスのうち収集対象のデバイスで保持されているデータを収集する収集手段とを備えるプログラマブルロジックコントローラと通信可能に接続された分析装置であって、
前記収集手段によって収集された各デバイスの時系列データを前記プログラマブルロジックコントローラから取得する取得手段と、
前記収集手段によって取得された各デバイスの時系列データの特徴に基づいて、各デバイスを複数の類型のいずれかにそれぞれ分類する分類手段と、
各デバイスについて前記収集手段によって収集されたデバイスの時系列データ及び前記分類手段により当該デバイスが分類された類型に従って、当該デバイスを異常デバイスとして特定する際の検知アルゴリズムを決定する決定手段と、
前記収集手段によって収集されたデバイスの時系列データを、前記分類手段によって当該デバイスが分類された類型に従い、当該デバイスに対して前記決定手段によって決定された検知アルゴリズムを用いて分析することで異常デバイスを特定する特定手段と、
前記特定手段による特定結果を出力する出力手段と
を備えることを特徴とする。
Further, the present invention includes, for example, a device memory having an execution engine that repeatedly executes a user program, a device memory having a plurality of devices that are storage areas for storing data accessed by the execution engine according to the user program, and the user program. An analyzer that is communicably connected to a programmable logic controller that includes a collection means that collects data held by the device to be collected among the plurality of devices according to a predetermined collection setting for each scan cycle.
An acquisition means for acquiring time-series data of each device collected by the collection means from the programmable logic controller, and
A classification means for classifying each device into one of a plurality of types based on the characteristics of the time series data of each device acquired by the collection means.
For each device, a determination means for determining a detection algorithm for identifying the device as an abnormal device according to the time series data of the device collected by the collection means and the type in which the device is classified by the classification means.
Anomalous devices are analyzed by analyzing the time-series data of the devices collected by the collecting means according to the type in which the devices are classified by the classification means using the detection algorithm determined by the determining means for the devices. With specific means to identify
It is characterized by including an output means for outputting a specific result by the specific means.

本発明によれば、各デバイスに関連するデータの周期性や連続性などの特徴を分析して分類し、効率よく異常デバイスを特定することができる。 According to the present invention, it is possible to analyze and classify features such as periodicity and continuity of data related to each device, and efficiently identify an abnormal device.

PLCシステムを示す図Diagram showing PLC system PCを説明する図Diagram explaining a PC PCを説明する図Diagram explaining a PC PLCを説明する図Diagram illustrating PLC 基本ユニットを説明する図Diagram explaining the basic unit データ活用ユニットを説明する図Diagram explaining the data utilization unit 拡張ユニットを説明する図Diagram illustrating an expansion unit データレコードのフォーマットを説明する図Diagram illustrating the format of a data record 転送タイミングを説明する図The figure explaining the transfer timing 情報圧縮を説明する図Diagram illustrating information compression 全体フローを示すフローチャートFlowchart showing the overall flow 収集データの分類を示す図Diagram showing the classification of collected data 分類の処理手順を示すフローチャートFlowchart showing classification processing procedure 分類の処理手順を示すフローチャートFlowchart showing classification processing procedure データの型を示す図Diagram showing data type 学習フェーズの処理手順を示すフローチャートFlowchart showing the processing procedure of the learning phase 推定フェーズの処理手順を示すフローチャートFlowchart showing the processing procedure of the estimation phase 異常の判断手法を説明する図Diagram explaining the abnormality judgment method 特定結果の表示例を示す図Diagram showing a display example of a specific result 収集データの変形例を示す図Diagram showing a modified example of collected data 監視開始信号を出力する処理手順を示すフローチャートFlowchart showing the processing procedure to output the monitoring start signal 追加学習の処理手順を示すフローチャートFlowchart showing the processing procedure of additional learning

以下、添付図面を参照して実施形態が詳しく説明される。尚、以下の実施形態は特許請求の範囲に係る発明を限定するものではなく、また実施形態で説明されている特徴の組み合わせの全てが発明に必須のものとは限らない。実施形態で説明されている複数の特徴のうち二つ以上の特徴が任意に組み合わされてもよい。また、同一又は同様の構成には同一の参照番号が付され、重複した説明は省略される。同一又は類似の要素を示す参照符号の末尾には小文字のアルファベットが付与されることがある。複数の要素に共通する事項が説明される場合、小文字のアルファベットが省略される。 Hereinafter, embodiments will be described in detail with reference to the accompanying drawings. It should be noted that the following embodiments do not limit the invention according to the claims, and not all combinations of features described in the embodiments are essential to the invention. Two or more of the plurality of features described in the embodiments may be arbitrarily combined. In addition, the same or similar configuration is given the same reference number, and duplicate explanations are omitted. A lowercase alphabet may be added to the end of the reference code indicating the same or similar elements. Lowercase alphabets are omitted when explaining things that are common to multiple elements.

<第1の実施形態>
<システム構成>
以下では、本発明の第1の実施形態について説明する。はじめにプログラマブルロジックコントローラ(PLC、単にプログラマブルコントローラと呼ばれてもよい)を当業者にとってよりよく理解できるようにするために、一般的なPLCの構成とその動作について説明する。
<First Embodiment>
<System configuration>
Hereinafter, the first embodiment of the present invention will be described. First, a general PLC configuration and its operation will be described so that a person skilled in the art can better understand a programmable logic controller (PLC, which may be simply referred to as a programmable controller).

図1は、本発明の実施の形態によるプログラマブル・ロジック・コントローラシステムの一構成例を示す概念図である。図1が示すように、このシステムは、ラダープログラムなどのユーザプログラムの編集を行うためのPC2aと、工場等に設置される各種制御装置を統括的に制御するためのPLC(プログラマブルロジックコントローラ)1とを備えている。PCはパーソナルコンピュータの略称である。ユーザプログラムは、ラダー言語やSFC(シーケンシャルファンクションチャート)などのフローチャート形式のモーションプログラムなどのグラフィカルプログラミング言語を用いて作成されてもよいし、C言語などの高級プログラミング言語を用いて作成されてもよい。以下では、説明の便宜上、ユーザプログラムはラダープログラムとする。PLC1は、CPUが内蔵された基本ユニット3と、1つ乃至複数の拡張ユニット4を備えている。基本ユニット3に対して1つ乃至複数の拡張ユニット4が着脱可能となっている。 FIG. 1 is a conceptual diagram showing a configuration example of a programmable logic controller system according to an embodiment of the present invention. As shown in FIG. 1, this system is a PLC (programmable logic controller) 1 for comprehensively controlling a PC2a for editing a user program such as a ladder program and various control devices installed in a factory or the like. And have. PC is an abbreviation for personal computer. The user program may be created using a graphical programming language such as a ladder language or a flowchart-type motion program such as SFC (sequential function chart), or may be created using a high-level programming language such as C language. .. In the following, for convenience of explanation, the user program will be a ladder program. The PLC 1 includes a basic unit 3 having a built-in CPU and one or more expansion units 4. One or more expansion units 4 can be attached to and detached from the basic unit 3.

基本ユニット(CPUユニットとも称する)3は、表示部5及び操作部6を備えている。表示部5は、基本ユニット3に取り付けられている各拡張ユニット4の動作状況などを表示することができる。操作部6の操作内容に応じて表示部5は表示内容を切り替える。表示部5は、通常、PLC1内のデバイスの現在値(デバイス値)やPLC1内で生じたエラー情報などを表示する。ここでデバイスとは、基本ユニット3や拡張ユニット4に含まれる種々のデバイス(リレー、タイマー、カウンタなど)を含むものであり、デバイス値(デバイスデータ)を格納するために設けられたメモリ上の領域を指すものでもあり、デバイスメモリと呼ばれてもよい。なお、当該デバイスメモリは不揮発性メモリであり、書き換え可能な不揮発性ROMで構成されてもよく、揮発性RAM等をバッテリーバックアップ等により不揮発性を実現してもよい。ROMはリードオンリーメモリの略称である。RAMはランダムアクセスメモリの略称である。デバイス値とは、入力機器からの入力状態、出力機器への出力状態及びユーザプログラム上で設定される内部リレー(補助リレー)、タイマー、カウンタ、データメモリ等の状態を示す情報である。デバイス値の型にはビット型とワード型等がある。ビットデバイスは1ビットのデバイス値、例えば、0/1、ON/OFF、H/L等を記憶する。ワードデバイスは1ワードのデバイス値を記憶する。以下で詳細に説明されるデータ活用プログラムの収集対象としては、デバイスとして変数が指定されてもよい。変数も情報を保持する保持手段であり、ユーザプログラムに従って実行エンジンによりアクセスされるものである。したがって、以下の説明においてデバイスは変数も指すものである。なお、デバイスを保持するメモリはデバイスメモリと呼ばれてもよい。また、収集されたデータを保持するメモリはデータメモリと呼ばれてもよい。 The basic unit (also referred to as a CPU unit) 3 includes a display unit 5 and an operation unit 6. The display unit 5 can display the operating status of each expansion unit 4 attached to the basic unit 3. The display unit 5 switches the display content according to the operation content of the operation unit 6. The display unit 5 usually displays the current value (device value) of the device in PLC1, error information generated in PLC1, and the like. Here, the device includes various devices (relays, timers, counters, etc.) included in the basic unit 3 and the expansion unit 4, and is on a memory provided for storing device values (device data). It also refers to an area and may be called a device memory. The device memory is a non-volatile memory and may be composed of a rewritable non-volatile ROM, or the volatile RAM or the like may be made non-volatile by battery backup or the like. ROM is an abbreviation for read-only memory. RAM is an abbreviation for random access memory. The device value is information indicating an input state from an input device, an output state to an output device, and a state of an internal relay (auxiliary relay), a timer, a counter, a data memory, etc. set on a user program. The device value type includes a bit type and a word type. The bit device stores 1-bit device values such as 0/1, ON / OFF, H / L, and the like. The word device stores the device value of one word. A variable may be specified as a device as a collection target of the data utilization program described in detail below. Variables are also holding means for holding information and are accessed by the execution engine according to the user program. Therefore, in the following description, device also refers to a variable. The memory that holds the device may be called a device memory. Further, the memory that holds the collected data may be called a data memory.

拡張ユニット4は、PLC1の機能を拡張するために用意されている。各拡張ユニット4には、その拡張ユニット4の機能に対応するフィールドデバイス(被制御装置)10が接続されることがあり、これにより、各フィールドデバイス10が拡張ユニット4を介して基本ユニット3に接続される。フィールドデバイス10は、センサやカメラなどの入力機器であってもよいし、アクチュエータなどの出力機器であってもよい。また、一つの拡張ユニット4に対して複数のフィールドデバイスが接続されてもよい。 The expansion unit 4 is prepared to expand the function of the PLC1. A field device (controlled device) 10 corresponding to the function of the expansion unit 4 may be connected to each expansion unit 4, whereby each field device 10 is connected to the basic unit 3 via the expansion unit 4. Be connected. The field device 10 may be an input device such as a sensor or a camera, or an output device such as an actuator. Further, a plurality of field devices may be connected to one expansion unit 4.

例えば、拡張ユニット4bはモータ(フィールドデバイス10)を駆動してワークの位置決めを行う位置決めユニットであってもよいし、カウンタユニットであってもよい。カウンタユニットは手動パルサなどのエンコーダ(フィールドデバイス10)からの信号をカウントする。 For example, the expansion unit 4b may be a positioning unit that drives a motor (field device 10) to position the work, or may be a counter unit. The counter unit counts signals from an encoder (field device 10) such as a manual pulsar.

拡張ユニット4aは、例えば、基本ユニット3や拡張ユニット4bから収集対象データを収集し、フローなどのユーザプログラム(データ活用プログラム)を実行することで収集対象データにデータ処理を施して表示対象データを作成し、ダッシュボードを表示部7又はPC2に表示するための表示データ(ソースデータ)を作成するデータ活用ユニットである。本実施形態では、拡張ユニット4aが各デバイスのデータを収集する例について説明するが、当該収集部については基本ユニット3に設けられてもよく、或いは、他の拡張ユニットに設けられてもよい。また、拡張ユニット4aは、収集したデータを基本ユニット3からの指示や所定のタイミングに従って分析を行う分析装置として機能することも可能である。なお、本実施形態では、拡張ユニット4aが分析装置として動作する例について説明するが、本発明を限定する意図はなく、基本ユニット3が分析装置として機能してもよく、PC2a、2bなどの外部装置が分析装置として機能してもよい。以下で説明されるフロー(フロープログラム)はデータ活用プログラムの一例に過ぎない。基本ユニット3はCPUユニットと呼ばれることもある。なお、PLC1とPC2とを含むシステムはプログラマブルロジックコントローラシステムと呼ばれてもよい。 The expansion unit 4a collects data to be collected from the basic unit 3 and the expansion unit 4b, and executes a user program (data utilization program) such as a flow to process the data to be collected and display the data to be displayed. This is a data utilization unit that creates and creates display data (source data) for displaying the dashboard on the display unit 7 or the PC 2. In the present embodiment, an example in which the expansion unit 4a collects data of each device will be described, but the collecting unit may be provided in the basic unit 3 or may be provided in another expansion unit. Further, the expansion unit 4a can also function as an analyzer that analyzes the collected data according to an instruction from the basic unit 3 or a predetermined timing. In the present embodiment, an example in which the expansion unit 4a operates as an analyzer will be described, but there is no intention of limiting the present invention, and the basic unit 3 may function as an analyzer, and external devices such as PC2a and 2b may be used. The device may function as an analyzer. The flow (flow program) described below is just an example of a data utilization program. The basic unit 3 is sometimes called a CPU unit. The system including PLC1 and PC2 may be called a programmable logic controller system.

PC2aは主にプログラマーによって操作されるコンピュータである。一方、PC2bは主に現場担当者によって操作されるコンピュータである。PC2aはプログラム作成支援装置(設定装置)と呼ばれてもよい。PC2は、例えば、携帯可能なノートタイプやタブレットタイプのパーソナルコンピュータ又はスマートフォンであって、表示部7及び操作部8を備えている外部コンピュータである。外部コンピュータとは、PLC1の外部にあるコンピュータである。PLC1を制御するためのユーザプログラムの一例であるラダープログラムは、PC2aを用いて作成される。その作成されたラダープログラムは、PC2a内でニモニックコードに変換される。PC2は、USB(Universal Serial Bus)ケーブルなどの通信ケーブル9を介してPLC1の基本ユニット3に接続される。例えば、PC2aは、ニモニックコードに変換されたラダープログラムを基本ユニット3に送る。基本ユニット3はラダープログラムをマシンコードに変換し、基本ユニット3に備えられたメモリ内に記憶する。なお、ここではニモニックコードが基本ユニット3に送信されているが、本発明はこれに限られない。例えば、PC2aは、ニモニックコードを中間コードに変換し、中間コードを基本ユニット3に送信してもよい。 PC2a is a computer mainly operated by a programmer. On the other hand, PC2b is a computer mainly operated by a person in charge at the site. PC2a may be called a program creation support device (setting device). The PC 2 is, for example, a portable notebook type or tablet type personal computer or smartphone, and is an external computer including a display unit 7 and an operation unit 8. The external computer is a computer outside the PLC1. A ladder program, which is an example of a user program for controlling PLC1, is created using PC2a. The created ladder program is converted into a mnemonic code in PC2a. The PC 2 is connected to the basic unit 3 of the PLC 1 via a communication cable 9 such as a USB (Universal Serial Bus) cable. For example, PC2a sends a ladder program converted into a mnemonic code to the basic unit 3. The basic unit 3 converts the ladder program into machine code and stores it in the memory provided in the basic unit 3. Although the mnemonic code is transmitted to the basic unit 3 here, the present invention is not limited to this. For example, the PC 2a may convert the mnemonic code into an intermediate code and transmit the intermediate code to the basic unit 3.

なお、図1には示していないが、PC2の操作部8には、PC2に接続されたマウスなどのポインティングデバイスが含まれていてもよい。また、PC2は、USBケーブル以外の他の通信ケーブル9を介して、PLC1の基本ユニット3に対して着脱可能に接続されるような構成であってもよい。また、PC2は、通信ケーブル9を介さず、PLC1の基本ユニット3に対して無線通信によって接続されてもよい。 Although not shown in FIG. 1, the operation unit 8 of the PC 2 may include a pointing device such as a mouse connected to the PC 2. Further, the PC 2 may be configured to be detachably connected to the basic unit 3 of the PLC 1 via a communication cable 9 other than the USB cable. Further, the PC 2 may be connected to the basic unit 3 of the PLC 1 by wireless communication without using the communication cable 9.

<プログラム作成支援装置>
図2はPC2aの電気的構成について説明するためのブロック図である。図2が示すように、PC2aは、CPU11a、表示部7a、操作部8a、記憶装置12a及び通信部13aを備えている。表示部7a、操作部8a、記憶装置12a及び通信部13aは、それぞれCPU11aに対して電気的に接続されている。記憶装置12aはRAMやROM、HDD、SSDを含み、さらに着脱可能なメモリカードを含んでもよい。CPUは中央演算処理装置の略称である。HDDはハードディスクドライブの略称である。SSDはソリッドステートドライブの略称である。
<Program creation support device>
FIG. 2 is a block diagram for explaining the electrical configuration of the PC 2a. As shown in FIG. 2, the PC 2a includes a CPU 11a, a display unit 7a, an operation unit 8a, a storage device 12a, and a communication unit 13a. The display unit 7a, the operation unit 8a, the storage device 12a, and the communication unit 13a are each electrically connected to the CPU 11a. The storage device 12a includes a RAM, a ROM, an HDD, and an SSD, and may further include a removable memory card. CPU is an abbreviation for central processing unit. HDD is an abbreviation for hard disk drive. SSD is an abbreviation for solid state drive.

PC2aのユーザは記憶装置12aに記憶されているプロジェクト編集プログラム14aをCPU11aに実行させて、操作部8aを通じてプロジェクトデータ15を編集する。CPU11aがプロジェクト編集プログラム14aを実行することで、プロジェクト作成部16とプロジェクト転送部17が実現される。プロジェクト作成部16はユーザ入力にしたがってプロジェクトデータ15を作成する。プロジェクト転送部17はプロジェクトデータ15をPLC1に転送する。プロジェクトデータ15は、一つ以上のユーザプログラム(例:ラダープログラム、制御プログラム、モーションプログラム、データ活用プログラム)と、基本ユニット3や拡張ユニット4の構成情報、基本ユニット3や拡張ユニット4に備えられた特定機能の設定情報などを含む。構成情報は、基本ユニット3に対する複数の拡張ユニット4の接続位置やデバイスの割り当て情報を含む。基本ユニット3に備えられた機能(例:データ収集機能、通信機能、位置決め機能)を示す情報、拡張ユニット4の機能(例:通信機能、位置決め機能、撮影機能)などを示す情報を含んでいてもよい。特定機能の設定情報は、基本ユニット3に備えられた機能(例:データ収集機能、通信機能、位置決め機能)に関する設定情報、例えば、データ収集機能であれば、データ収集条件やデータ収集対象の設定情報を含み、拡張ユニット4の機能(例:通信機能、位置決め機能、データ活用機能、撮影機能)に関する設定情報等を含む。ここで、プロジェクトデータ15の編集には、プロジェクトデータ15の作成及び変更(再編集)が含まれる。ユーザは、必要に応じて記憶装置12aに記憶されているプロジェクトデータ15を読み出し、そのプロジェクトデータ15を、プロジェクト編集プログラム14aを用いて変更することができる。通信部13aは、通信ケーブル9aを介して基本ユニット3と通信する。プロジェクト転送部17は通信部13aを介してプロジェクトデータを基本ユニット3に転送する。通信部13aは、通信ケーブル9bを介して拡張ユニット4aと通信する。 The user of the PC 2a causes the CPU 11a to execute the project editing program 14a stored in the storage device 12a, and edits the project data 15 through the operation unit 8a. When the CPU 11a executes the project editing program 14a, the project creation unit 16 and the project transfer unit 17 are realized. The project creation unit 16 creates the project data 15 according to the user input. The project transfer unit 17 transfers the project data 15 to the PLC1. The project data 15 is provided in one or more user programs (eg, ladder program, control program, motion program, data utilization program), configuration information of the basic unit 3 and the expansion unit 4, and the basic unit 3 and the expansion unit 4. Includes setting information for specific functions. The configuration information includes connection positions of a plurality of expansion units 4 with respect to the basic unit 3 and device allocation information. It includes information indicating the functions provided in the basic unit 3 (example: data collection function, communication function, positioning function), information indicating the functions of the expansion unit 4 (example: communication function, positioning function, shooting function), and the like. May be good. The setting information of the specific function is the setting information related to the functions (eg, data collection function, communication function, positioning function) provided in the basic unit 3, for example, in the case of the data collection function, the data collection condition and the setting of the data collection target. It includes information, and includes setting information related to the functions of the expansion unit 4 (eg, communication function, positioning function, data utilization function, shooting function). Here, the editing of the project data 15 includes the creation and modification (re-editing) of the project data 15. The user can read the project data 15 stored in the storage device 12a as needed, and change the project data 15 by using the project editing program 14a. The communication unit 13a communicates with the basic unit 3 via the communication cable 9a. The project transfer unit 17 transfers the project data to the basic unit 3 via the communication unit 13a. The communication unit 13a communicates with the expansion unit 4a via the communication cable 9b.

<ダッシュボードの表示に使用されるPC>
図3はPC2bの電気的構成について説明するためのブロック図である。図3が示すように、PC2bは、CPU11b、表示部7b、操作部8b、記憶装置12b及び通信部13bを備えている。表示部7b、操作部8b、記憶装置12b及び通信部13bは、それぞれCPU11bに対して電気的に接続されている。記憶装置12bはRAMやROM、HDD、SSDを含み、さらに着脱可能なメモリカードを含んでもよい。
<PC used to display the dashboard>
FIG. 3 is a block diagram for explaining the electrical configuration of the PC 2b. As shown in FIG. 3, the PC 2b includes a CPU 11b, a display unit 7b, an operation unit 8b, a storage device 12b, and a communication unit 13b. The display unit 7b, the operation unit 8b, the storage device 12b, and the communication unit 13b are each electrically connected to the CPU 11b. The storage device 12b includes a RAM, a ROM, an HDD, and an SSD, and may further include a removable memory card.

CPU11bはWebブラウザプログラム14dを実行することでWebブラウザ18を実現する。Webブラウザ18は、通信部13bを介して、拡張ユニット4aによって提供されるデータ活用アプリケーションの設定ページにアクセスしたり、ダッシュボードのページにアクセスしたりする。またCPU11bは、拡張ユニット4aから送信された異常発生時の特定結果(判定結果)を示す画面情報に従って、当該特定結果を表示部7bに表示する。 The CPU 11b realizes the Web browser 18 by executing the Web browser program 14d. The Web browser 18 accesses the setting page of the data utilization application provided by the expansion unit 4a or the dashboard page via the communication unit 13b. Further, the CPU 11b displays the specific result on the display unit 7b according to the screen information indicating the specific result (determination result) when the abnormality occurs, which is transmitted from the expansion unit 4a.

<PLC>
図4はPLC1の電気的構成について説明するためのブロック図である。図4が示すように、基本ユニット3は、CPU31、表示部5、操作部6、記憶装置32、通信部33、及びメモリカード44を備えている。表示部5、操作部6、記憶装置32、及び通信部33は、それぞれCPU31に電気的に接続されている。記憶装置32は、RAMやROM などを含んでもよい。記憶装置32はデバイス部34やプロジェクト記憶部35、第一バッファ37aなどの複数の記憶領域を有している。デバイス部34はビットデバイスやワードデバイスなどを有し、各デバイスはデバイス値を記憶するもので、デバイスメモリに相当する。プロジェクト記憶部35は、PC2aから入力されたプロジェクトデータを記憶する。第一バッファ37aには、スキャン周期ごとにデバイス部34から収集対象のデバイス値(時系列データ)が格納される。第一バッファについての詳細は図5を用いて後述する。メモリカード44には保存条件が成立した場合に、第一バッファ37aに格納された各デバイスからの制御データである時系列データが記憶される。このように時系列データがメモリカード44へ一旦保持されることにより、例えば分類対象や特定対象のデータを後に外部装置等で検証することも可能であり、重要な最新データをログ情報として保持することができる。また、本発明においては基本的にPLC1に関わる全デバイスのデータを収集するため、収集データは膨大であり、処理対象のデータを別メモリへ保持することにより処理負荷を低減する効果も期待でき、更には、収集処理と収集データに関する処理(分類処理や特定処理)とを並行して実行することを容易にすることもできる。ここで、保存条件とは、PLCに異常が発生した場合や、ユーザにより予め保存トリガとなるデバイスを指定しておき当該デバイスに所定の変化があった場合や、ユーザによる分析命令があった場合、定期的に監視する監視周期が経過した場合、基本ユニット3に接続される拡張ユニットから分析命令が発せられた場合などに成立するものである。保存条件は、ユーザにより予め設定され、プロジェクトデータの一部として基本ユニット3の記憶装置32に記憶されていてもよい。保存条件が成立したことをCPU31が検知すると、CPU31が第一バッファ37aに格納されているデバイス値をSDカード等のメモリカード44へ保存するように命令を発するとともに、拡張ユニット4aに対して、分析対象となるデータが保存されたことを通知する。基本ユニット3用の制御プログラムは、プロジェクトデータの一部としてプロジェクト記憶部35に記憶される。基本ユニット3用の制御プログラムはプロジェクト記憶部35とは別に、または、プロジェクト記憶部35に加え、記憶装置32に記憶されてもよい。図4が示すように基本ユニット3と拡張ユニット4とは通信バスの一種である拡張バス90を介して接続されている。なお、図4では拡張バス90に関する通信回路がCPU31に実装されているが、通信部33の一部として実装されてもよい。通信部33はネットワーク通信回路を有してもよい。CPU31は通信部33を介してプロジェクトデータをPC2aから受信する。
<PLC>
FIG. 4 is a block diagram for explaining the electrical configuration of PLC1. As shown in FIG. 4, the basic unit 3 includes a CPU 31, a display unit 5, an operation unit 6, a storage device 32, a communication unit 33, and a memory card 44. The display unit 5, the operation unit 6, the storage device 32, and the communication unit 33 are each electrically connected to the CPU 31. The storage device 32 may include a RAM, a ROM, and the like. The storage device 32 has a plurality of storage areas such as a device unit 34, a project storage unit 35, and a first buffer 37a. The device unit 34 includes a bit device, a word device, and the like, and each device stores a device value and corresponds to a device memory. The project storage unit 35 stores the project data input from the PC 2a. The device value (time series data) to be collected from the device unit 34 is stored in the first buffer 37a for each scan cycle. Details of the first buffer will be described later with reference to FIG. When the storage condition is satisfied, the memory card 44 stores time-series data, which is control data from each device, stored in the first buffer 37a. By temporarily holding the time-series data in the memory card 44 in this way, for example, it is possible to verify the data of the classification target or the specific target later with an external device or the like, and hold the important latest data as log information. be able to. Further, in the present invention, since the data of all the devices related to PLC1 is basically collected, the collected data is enormous, and the effect of reducing the processing load can be expected by holding the data to be processed in another memory. Furthermore, it is also possible to facilitate the parallel execution of the collection process and the process related to the collected data (classification process and specific process). Here, the storage condition is when an abnormality occurs in the PLC, when a device to be a storage trigger is specified in advance by the user and a predetermined change is made in the device, or when an analysis command is given by the user. This is established when the monitoring cycle for periodic monitoring has elapsed, or when an analysis command is issued from the expansion unit connected to the basic unit 3. The storage conditions may be preset by the user and stored in the storage device 32 of the basic unit 3 as a part of the project data. When the CPU 31 detects that the storage condition is satisfied, the CPU 31 issues a command to save the device value stored in the first buffer 37a to a memory card 44 such as an SD card, and the expansion unit 4a is instructed to save the device value. Notify that the data to be analyzed has been saved. The control program for the basic unit 3 is stored in the project storage unit 35 as a part of the project data. The control program for the basic unit 3 may be stored in the storage device 32 separately from the project storage unit 35 or in addition to the project storage unit 35. As shown in FIG. 4, the basic unit 3 and the expansion unit 4 are connected via an expansion bus 90, which is a type of communication bus. Although the communication circuit related to the expansion bus 90 is mounted on the CPU 31 in FIG. 4, it may be mounted as a part of the communication unit 33. The communication unit 33 may have a network communication circuit. The CPU 31 receives the project data from the PC 2a via the communication unit 33.

ここで、拡張バス90について、補足説明する。この拡張バス90は、入出力リフレッシュに使用される通信バスである。入出力リフレッシュとは、ラダープログラムを繰り返し実行する際に、各一回の実行前に入出力の値を取り込み、取り込んだ入出力の値に基づいてラダープログラムを実行するもので、一回の実行中は入出力の値が変化しても取り込まないための処理である。入出力リフレッシュにより取り込まれた値は、各入出力に対応するデバイスのデバイス値としてデバイスメモリに記憶される。入出力リフレッシュにより、基本ユニット3と拡張ユニット4との間でデバイス値の送受がなされ、デバイスメモリの対応するデバイスのデバイス値が更新される。入出力リフレッシュは、ラダープログラムが一回実行されるスキャン周期ごとに(つまり、一スキャンごとに)、実行される。なお、一つのスキャン周期は、入出力リフレッシュの実行期間と、ラダープログラムの実行期間と、エンド処理の実行期間とを含む。 Here, the expansion bus 90 will be supplementarily described. The expansion bus 90 is a communication bus used for input / output refresh. I / O refresh is to capture the input / output values before each execution when repeatedly executing the ladder program, and execute the ladder program based on the captured input / output values. The inside is a process to prevent the input even if the input / output value changes. The value taken in by the input / output refresh is stored in the device memory as the device value of the device corresponding to each input / output. By the input / output refresh, the device value is sent and received between the basic unit 3 and the expansion unit 4, and the device value of the corresponding device in the device memory is updated. The input / output refresh is executed every scan cycle in which the ladder program is executed once (that is, every scan). Note that one scan cycle includes an I / O refresh execution period, a ladder program execution period, and an end processing execution period.

拡張ユニット4はCPU41とメモリ42を備えている。さらに、拡張ユニット4aには、当該拡張ユニット4aに着脱可能な、各デバイスからの制御データである時系列データを格納するメモリカード(例えば、SDカード)を備えていてもよい。 拡張ユニット4bのCPU41bは、デバイスに格納された基本ユニット3からの指示(デバイス値)にしたがってフィールドデバイス10を制御する。また、CPU41bは、フィールドデバイス10の制御結果をバッファメモリとよばれるデバイスに格納する。デバイスに格納された制御結果は入出力リフレッシュによって基本ユニット3に転送される。また、デバイスに格納されている制御結果は、基本ユニット3からの読み出し命令にしたがって、入出力リフレッシュとは異なるタイミングであっても、基本ユニット3に転送される。メモリ42はRAMやROMなどを含む。とりわけ、RAMにはバッファメモリとして使用される記憶領域が確保されている。メモリ42は、フィールドデバイス10によって取得されたデータ(例:デバイス値や静止画データ、動画データ)を一時的に保持するバッファを有してもよい。 The expansion unit 4 includes a CPU 41 and a memory 42. Further, the expansion unit 4a may be provided with a memory card (for example, an SD card) that can be attached to and detached from the expansion unit 4a and stores time-series data that is control data from each device. The CPU 41b of the expansion unit 4b controls the field device 10 according to an instruction (device value) from the basic unit 3 stored in the device. Further, the CPU 41b stores the control result of the field device 10 in a device called a buffer memory. The control result stored in the device is transferred to the basic unit 3 by input / output refresh. Further, the control result stored in the device is transferred to the basic unit 3 according to the read instruction from the basic unit 3 even at a timing different from the input / output refresh. The memory 42 includes a RAM, a ROM, and the like. In particular, the RAM has a storage area used as a buffer memory. The memory 42 may have a buffer that temporarily holds data (eg, device value, still image data, moving image data) acquired by the field device 10.

データ活用ユニットとして機能する拡張ユニット4aのCPU41aは、通信部43とケーブル9bを介してPC2bと通信する。データ活用ユニットは、データ活用アプリケーションを実行する拡張ユニットである。データ活用アプリケーションは、基本ユニット3備えられたメモリカード44または拡張ユニット4aに備えられたメモリカードに保存された制御データ(時系列データ)を収集したり、データ処理したりするフローと、収集されたデータに関連する処理を行うフローと、それらフローの実行結果を表示するダッシュボードや、それらフローの結果を外部に送信する送信部とを含む。なお、データ活用アプリケーションは、異常デバイス分析時においてメモリカード44への保存命令を発することなく、上述したような保存条件が満たされた場合に保存されるデータを参照し、メモリカード44に保存されているデータを使って分析を行う。 The CPU 41a of the expansion unit 4a that functions as a data utilization unit communicates with the PC 2b via the communication unit 43 and the cable 9b. A data utilization unit is an expansion unit that executes a data utilization application. The data utilization application is collected with a flow of collecting and processing control data (time series data) stored in the memory card 44 provided in the basic unit 3 or the memory card provided in the expansion unit 4a. It includes a flow that performs processing related to the data, a dashboard that displays the execution result of those flows, and a transmitter that sends the result of those flows to the outside. The data utilization application refers to the data to be saved when the above-mentioned storage conditions are satisfied without issuing a save command to the memory card 44 at the time of abnormal device analysis, and is saved in the memory card 44. Analyze using the data you have.

なお、制御データを収集する機能は、データ活用アプリケーション以外のユーザプログラムによって実現されてもよい。また、収集されたデータに関連する処理を行う機能には、プログラマブルロジックコントローラの異常時において異常デバイスを特定する特定機能や、正常時の時系列データとの乖離を分析し、いつもと違うデバイス値を検証する分析機能、定期的に上記分析を行う監視機能が含まれる。フローはデータを収集する演算ブロック、データ処理を実行する演算ブロック、及び、表示データを作成する演算ブロックなどを有してもよい。ダッシュボードは、グラフ表示部品や数値表示部品などを有する。これらの表示部品は、HTMLデータ、CSSデータ及びJavaScript(登録商標)コードなどにより実現されてもよい。なお、HTMLデータ、CSSデータ及びJavaScript(登録商標)コードの集合体はWebアプリケーションと呼ばれてもよい。本実施形態で、フローはフローテンプレートにより実現される。フローテンプレートは予めアプリケーションごとに用意されており、ユーザにより指定されたフローテンプレートパラメータが設定される一つ以上の演算ブロックを有している。ダッシュボードもテンプレートにより実現される。ダッシュボードテンプレートは、ユーザにより指定されたダッシュボードテンプレートパラメータが設定される一つ以上の表示部品を有している。ダッシュボードテンプレートパラメータは、例えば、ダッシュボードの名称、デバイス名、数値、ユニット変数名など多種多様な情報である。ユニット変数とは、拡張ユニット4aがフローの実行結果を保持するための変数である。 The function of collecting control data may be realized by a user program other than the data utilization application. In addition, the functions related to the collected data include a specific function to identify the abnormal device when the programmable logic controller is abnormal, and a device value different from usual by analyzing the deviation from the time series data at the normal time. It includes an analysis function to verify the above and a monitoring function to perform the above analysis on a regular basis. The flow may have an arithmetic block for collecting data, an arithmetic block for executing data processing, an arithmetic block for creating display data, and the like. The dashboard has graph display parts, numerical display parts, and the like. These display components may be realized by HTML data, CSS data, Javascript® code, and the like. The collection of HTML data, CSS data, and Javascript (registered trademark) code may be referred to as a Web application. In this embodiment, the flow is realized by the flow template. The flow template is prepared in advance for each application, and has one or more calculation blocks in which the flow template parameters specified by the user are set. The dashboard is also realized by the template. The dashboard template has one or more display components to which the dashboard template parameters specified by the user are set. Dashboard template parameters are a wide variety of information, such as dashboard names, device names, numbers, and unit variable names. The unit variable is a variable for the expansion unit 4a to hold the execution result of the flow.

<基本ユニットのCPUにより実現される機能>
図5はデータ活用に関してCPU31により実現される機能を示している。実行エンジン51は、実行周期であるスキャン周期ごとにユーザプログラムを繰り返し実行する。実行エンジン51は、CPU31の外部に設けられたASIC又はFPGAなどにより実現されてもよい。ASICは特定用途集積回路の略称である。FPGAはフィールドプログラマブルゲートアレイの略称である。これらの専用回路は、CPUとプログラムとの組み合わせよりも、特定のデータ処理を高速に実行できることが多い。収集部52aは、実行周期であるスキャン周期ごとにデバイス部34から収集対象のデバイス値を収集してデータレコードを作成して第一バッファ37aに格納する。なお、実行エンジンがユーザプログラムとしてラダープログラムを実行する場合は、ラダープログラムのスキャン周期が実行周期に相当し、実行エンジンがユーザプログラムとしてモーションプログラムを実行する場合は、モーションプログラムの制御周期が実行周期に相当する。ラダープログラムのスキャン周期ごとにデバイス値を収集する場合は、スキャン周期のうちエンド処理の期間においてデバイス部34から収集対象のデバイス値を収集してデータレコードを作成して第一バッファ37aに格納してもよい。なお、エンド処理の期間でデータを収集することは必須ではなく、実行エンジン51で実行されるユーザプログラムにデータを収集するための記述(トリガ命令などのプログラムコード)が含まれていてもよい。ただし、エンド処理によってデータを収集するケースでは、ユーザプログラムの変更が不要であるといったメリットがある。収集周期は、ユーザにより設定され、プロジェクトデータの一部として転送され、基本ユニット3の記憶装置32に収集設定36aとして記憶されている。収集設定36aには、収集周期の他に、収集対象となるデバイスなどが含まれる。なお、収集周期は実行周期であるスキャン周期やモーションプログラムの制御周期とは異なる周期であってもよい。この場合、収集設定36aにより指定された収集周期毎に、デバイス部から収集対象のデバイス値を収集してデータレコードを作成して第一バッファ37aに格納してもよい。ここで、基本ユニット3は、データの収集時において、自デバイスによって又は拡張ユニット4aによって各デバイス値の周期性や連続性などの特徴を分析し、分析結果に応じてデバイスを分類してもよい。一方、データの収集時においてはこのような分析を行うことなく、所定数のスキャン周期の時系列データが収集されたタイミングや異常発生時等にデータを分析する必要があるタイミングで自デバイスによって又は拡張ユニット4aによって行ってもよい。
<Functions realized by the CPU of the basic unit>
FIG. 5 shows a function realized by the CPU 31 regarding data utilization. The execution engine 51 repeatedly executes the user program at each scan cycle, which is the execution cycle. The execution engine 51 may be realized by an ASIC or FPGA provided outside the CPU 31. ASIC is an abbreviation for a special purpose integrated circuit. FPGA is an abbreviation for field programmable gate array. These dedicated circuits can often execute specific data processing at a higher speed than a combination of a CPU and a program. The collection unit 52a collects device values to be collected from the device unit 34 for each scan cycle, which is an execution cycle, creates a data record, and stores the data record in the first buffer 37a. When the execution engine executes the ladder program as a user program, the scan cycle of the ladder program corresponds to the execution cycle, and when the execution engine executes the motion program as the user program, the control cycle of the motion program is the execution cycle. Corresponds to. When collecting device values for each scan cycle of the ladder program, the device values to be collected are collected from the device unit 34 during the end processing period of the scan cycle, a data record is created, and the data record is stored in the first buffer 37a. You may. It is not essential to collect data during the end processing period, and the user program executed by the execution engine 51 may include a description (program code such as a trigger instruction) for collecting data. However, in the case of collecting data by end processing, there is an advantage that the user program does not need to be changed. The collection cycle is set by the user, transferred as a part of the project data, and stored in the storage device 32 of the basic unit 3 as the collection setting 36a. The collection setting 36a includes a device to be collected and the like in addition to the collection cycle. The collection cycle may be different from the scan cycle, which is the execution cycle, or the control cycle of the motion program. In this case, the device value to be collected may be collected from the device unit to create a data record and stored in the first buffer 37a at each collection cycle specified by the collection setting 36a. Here, the basic unit 3 may analyze features such as periodicity and continuity of each device value by its own device or by the expansion unit 4a at the time of data collection, and classify the devices according to the analysis result. .. On the other hand, at the time of data collection, without performing such analysis, the own device or at the timing when it is necessary to analyze the data at the timing when time series data of a predetermined number of scan cycles are collected or when an abnormality occurs. This may be done by the expansion unit 4a.

第一バッファ37aを設けることで、実行エンジン51は、収集や転送処理によるスキャンタイムの伸びなどの影響を受けにくくなる。収集対象のデバイス値は、収集設定36aにより指定されている。収集設定36aは、PC2a又は拡張ユニット4aによって基本ユニット3に格納されうる。転送部53aは、第一バッファ37aに格納された一つ以上のデータレコードを、基本ユニット3に設けられたメモリカード44に記憶させ、メモリカード44に保存されたデータレコードを拡張ユニット4aに転送する。なお、転送部53aは、拡張バス90における通信トラフィックが空いているときに、転送処理を実行するが、データレコードを拡張ユニット4aに送信するための専用の拡張バスが設けられていてもよい。 By providing the first buffer 37a, the execution engine 51 is less likely to be affected by an increase in scan time due to collection and transfer processing. The device value to be collected is specified by the collection setting 36a. The collection setting 36a may be stored in the basic unit 3 by the PC 2a or the expansion unit 4a. The transfer unit 53a stores one or more data records stored in the first buffer 37a in the memory card 44 provided in the basic unit 3, and transfers the data records stored in the memory card 44 to the expansion unit 4a. do. The transfer unit 53a executes the transfer process when the communication traffic on the expansion bus 90 is free, but a dedicated expansion bus for transmitting the data record to the expansion unit 4a may be provided.

或いは転送部53aは、第一バッファ37aに格納された一つ以上のデータレコードを拡張バス90を介して、拡張ユニット4aに転送し、転送されたデータはその後拡張ユニット4aに設けられたメモリカードに格納されてもよい。この場合、データレコードを拡張ユニット4aに送信するための専用の拡張バスが設けられるのが好ましい。上述したように、メモリカード44には保存条件が成立した場合にのみデータレコードが保存される。従って、不要なデータを拡張ユニット4aへ転送する必要がないため、通信トラフィックの軽量化を実現することができる。 Alternatively, the transfer unit 53a transfers one or more data records stored in the first buffer 37a to the expansion unit 4a via the expansion bus 90, and the transferred data is then transferred to the memory card provided in the expansion unit 4a. It may be stored in. In this case, it is preferable to provide a dedicated expansion bus for transmitting the data record to the expansion unit 4a. As described above, the data record is stored in the memory card 44 only when the storage condition is satisfied. Therefore, since it is not necessary to transfer unnecessary data to the expansion unit 4a, it is possible to reduce the weight of communication traffic.

実行エンジン51aが入出力リフレッシュを実行している期間や、ユーザプログラムに記述された読み出し命令にしたがって拡張ユニット4のバッファメモリからデータを読み出している期間を避けて、転送処理が実行されてもよい。なお、拡張バス90の通信トラフィックは監視部54aによって監視されている。データレコードの転送時間を短縮するために、圧縮エンジン55aが複数のデータレコードを圧縮してもよい。なお、圧縮エンジン55aはCPU31により実現される必要は無く、ASIC又はFPGAなどにより実現されてもよい。このように、第一バッファ37aを採用することで、転送処理とユーザプログラムを非同期で実行することが可能となる。 The transfer process may be executed while avoiding the period during which the execution engine 51a is executing the input / output refresh and the period during which the data is read from the buffer memory of the expansion unit 4 according to the read instruction described in the user program. .. The communication traffic of the expansion bus 90 is monitored by the monitoring unit 54a. The compression engine 55a may compress a plurality of data records in order to reduce the transfer time of the data records. The compression engine 55a does not have to be realized by the CPU 31, and may be realized by an ASIC, FPGA, or the like. By adopting the first buffer 37a in this way, it is possible to execute the transfer process and the user program asynchronously.

<データ活用ユニットの機能>
図6は拡張ユニット4aのCPU41aによって実現される機能を説明する図である。
<Function of data utilization unit>
FIG. 6 is a diagram illustrating a function realized by the CPU 41a of the expansion unit 4a.

収集部52cは、収集設定39に従って基本ユニット3の第一バッファからデータを収集(取得)する機能である。収集設定39は、ユーザにより設定され、プロジェクトデータの一部として転送され、拡張ユニット4aのメモリ42aに記憶される。収集部52cは、CPU41aがユーザプログラムなどの制御プログラムを実行することで実現されうる。収集部52cは、収集設定39により指定されたデバイス値を基本ユニット3が収集して拡張ユニット4aの第二バッファ37bに転送するよう基本ユニット3を設定する。なお、収集部52cは、収集設定39に含まれている基本ユニット3の収集設定36aを基本ユニット3の記憶装置32に書き込んでもよい。収集部52cとデータ処理部73とは基本的に非同期で動作できることが望ましい。これを実現するためにバッファが設けられてもよい。なお、ここでは、基本ユニット3がデバイス値を収集して一旦バッファに格納し、その後、所定のタイミングで拡張ユニット4aの収集部52cが収集する実施例について説明している。しかし、本発明はこれに限定されず、拡張ユニット4a等の分析ユニットがデバイス値を直接取得し、拡張ユニット4aに設けられたメモリに当該デバイス値を保存してもよい。 The collection unit 52c is a function of collecting (acquiring) data from the first buffer of the basic unit 3 according to the collection setting 39. The collection setting 39 is set by the user, transferred as a part of the project data, and stored in the memory 42a of the expansion unit 4a. The collecting unit 52c can be realized by the CPU 41a executing a control program such as a user program. The collection unit 52c sets the basic unit 3 so that the basic unit 3 collects the device value specified by the collection setting 39 and transfers it to the second buffer 37b of the expansion unit 4a. The collection unit 52c may write the collection setting 36a of the basic unit 3 included in the collection setting 39 to the storage device 32 of the basic unit 3. It is desirable that the collection unit 52c and the data processing unit 73 can basically operate asynchronously. A buffer may be provided to achieve this. Here, an embodiment in which the basic unit 3 collects the device values, temporarily stores them in the buffer, and then the collection unit 52c of the expansion unit 4a collects them at a predetermined timing is described. However, the present invention is not limited to this, and an analysis unit such as the expansion unit 4a may directly acquire the device value and store the device value in the memory provided in the expansion unit 4a.

収集部52cは、収集設定39により指定されたデバイス値を拡張ユニット4bが収集して拡張ユニット4aの第三バッファ37cに転送するよう拡張ユニット4bを設定してもよい。第二バッファ37b及び第三バッファ37cを設けることで、データ処理部73の処理負荷が変動しても、データを取りこぼさず収集できるようになる。収集部52cは、収集設定39に含まれている拡張ユニット4bの収集設定36b(図7)を拡張ユニット4bのメモリ42bに書き込んでもよい。なお、これらの設定機能は設定部71によって実現されてもよい。設定部71は、PC2a又はPC2bから収集設定39、処理設定61、表示設定62を受信してメモリ42aに書き込む。処理設定61は、データ処理部73により収集データに対して実行されるデータ処理を定義する情報とフロー(プログラム)を含む。表示設定62は、Webサーバ70を通じてWebブラウザ18にデータ処理結果を提供するダッシュボードのテンプレート(HTMLデータ、CSS、JavaScript(登録商標)のコードなど)を含む。 The collection unit 52c may set the expansion unit 4b so that the expansion unit 4b collects the device value specified by the collection setting 39 and transfers it to the third buffer 37c of the expansion unit 4a. By providing the second buffer 37b and the third buffer 37c, even if the processing load of the data processing unit 73 fluctuates, data can be collected without being missed. The collection unit 52c may write the collection setting 36b (FIG. 7) of the expansion unit 4b included in the collection setting 39 to the memory 42b of the expansion unit 4b. Note that these setting functions may be realized by the setting unit 71. The setting unit 71 receives the collection setting 39, the processing setting 61, and the display setting 62 from the PC 2a or the PC 2b and writes them to the memory 42a. The processing setting 61 includes information and a flow (program) that defines the data processing executed for the collected data by the data processing unit 73. The display setting 62 includes a template of a dashboard (HTML data, CSS, Javascript (registered trademark) code, etc.) that provides the data processing result to the Web browser 18 through the Web server 70.

さらに、拡張ユニット4aのCPU41aは、分類部76、決定部77、特定部78、及び送信部79を機能構成として実現する。分類部76は、収集部52cによって基本ユニット3の第一バッファから収集(取得)された各デバイスの時系列データの特徴を分析し、当該特徴に基づいて時系列データを分類する。分類の手法については、図12を用いて後述する。なお、分類部76は、任意のタイミングで分類処理を実行するものであるが、基本的にはシステムの運用が開始されたタイミングやユーザからの指示を受け付けたタイミングで分類処理を実行する。決定部77は、分類部76によって分類された時系列データに従って、異常デバイスを特定する際のパラメータを決定し、メモリ42aに格納する。パラメータの決定処理については後述する。決定部77は、分類部76によって分類処理が実行されると、パラメータの決定処理を行い、同一のデバイスについて既にパラメータが決定されている場合には当該パラメータを更新する。更新する際には、上書きにより更新してもよいし、平均値をとるなど2つのパラメータから新たなパラメータを決定するようにしてもよい。また、デバイスごとに更新時の処理を決定するようにしてもよい。このように、分類部76及び決定部77は、収集したデータを分析して正常時のデータがどのようなものであるかを学習する学習フェーズにおいて機能する処理部であり、異常デバイスを推定する際のパラメータを決定する。一方、特定部78は、異常デバイスを推定する推定フェーズで機能する処理部である。特定部78は、決定されたパラメータを用いて、収集部52cによって収集された各デバイスの時系列データから異常デバイスを特定する。特定処理の詳細については後述する。ここで、異常デバイスとは、正常時とは異なるデータが保持されているデバイスメモリの記憶領域を示す。特定部78による異常デバイスの推定は、プログラマブルロジックコントローラの運用中に異常が発生した場合や、定期的に、或いはユーザからの監視指示に基づいて開始してもよい。また、ユーザにより予め設定された保存条件が満たされた場合に、開始してもよい。 Further, the CPU 41a of the expansion unit 4a realizes the classification unit 76, the determination unit 77, the specific unit 78, and the transmission unit 79 as functional configurations. The classification unit 76 analyzes the characteristics of the time series data of each device collected (acquired) from the first buffer of the basic unit 3 by the collection unit 52c, and classifies the time series data based on the characteristics. The classification method will be described later with reference to FIG. The classification unit 76 executes the classification process at an arbitrary timing, but basically, the classification process is executed at the timing when the system operation is started or the timing when the instruction from the user is received. The determination unit 77 determines the parameters for identifying the abnormal device according to the time series data classified by the classification unit 76, and stores the parameters in the memory 42a. The parameter determination process will be described later. When the classification process is executed by the classification unit 76, the determination unit 77 performs the parameter determination process and updates the parameter if the parameter has already been determined for the same device. When updating, it may be updated by overwriting, or a new parameter may be determined from two parameters such as taking an average value. Further, the processing at the time of updating may be determined for each device. In this way, the classification unit 76 and the determination unit 77 are processing units that function in the learning phase of analyzing the collected data and learning what the normal data looks like, and estimate the abnormal device. Determine the parameters at the time. On the other hand, the specific unit 78 is a processing unit that functions in the estimation phase for estimating an abnormal device. The identification unit 78 identifies an abnormal device from the time series data of each device collected by the collection unit 52c using the determined parameters. Details of the specific processing will be described later. Here, the abnormal device indicates a storage area of a device memory in which data different from that in the normal state is held. The estimation of the abnormal device by the specific unit 78 may be started when an abnormality occurs during the operation of the programmable logic controller, periodically, or based on a monitoring instruction from the user. Further, it may be started when the storage conditions set in advance by the user are satisfied.

生成部74は、ダッシュボードの表示部品を定義する表示設定62にしたがって、ダッシュボードのテンプレートにデータ処理結果を代入することで、ダッシュボードの表示データを作成する。また、生成部74は、特定部78による異常デバイスの特定結果に基づいて、当該特定結果を表示するための表示データ(画面情報)を作成する。表示データは、例えば、HTMLデータや画像データ、CSS(カスケーディングスタイルシート)、JavaScript(登録商標)のコードなどであってもよい。表示部品としては、例えば、円グラフ部品、棒グラフ部品、折れ線グラフ部品、数値表示部品などが含まれる。Webサーバ70は、Webブラウザ18によりダッシュボードのWebページにアクセスがあると、ダッシュボードの表示データをWebブラウザ18に送信する。Webブラウザ18が表示データを受信してダッシュボードを表示する。また、送信部79は、生成部74によって生成された表示データを外部装置に送信する。送信する際の通信回線、通信手法については特に限定はしない。また、無線接続であっても、有線接続であってもよい。 The generation unit 74 creates the display data of the dashboard by substituting the data processing result into the template of the dashboard according to the display setting 62 that defines the display components of the dashboard. In addition, the generation unit 74 creates display data (screen information) for displaying the specific result based on the specific result of the abnormal device by the specific unit 78. The display data may be, for example, HTML data, image data, CSS (cascading style sheet), Javascript (registered trademark) code, or the like. Display parts include, for example, pie chart parts, bar graph parts, line graph parts, numerical display parts, and the like. When the Web server 70 accesses the Web page of the dashboard by the Web browser 18, the Web server 70 transmits the display data of the dashboard to the Web browser 18. The Web browser 18 receives the display data and displays the dashboard. Further, the transmission unit 79 transmits the display data generated by the generation unit 74 to the external device. The communication line and communication method for transmission are not particularly limited. Further, it may be a wireless connection or a wired connection.

なお、複数のデータ活用アプリケーションが提供されることがある。この場合、データ活用アプリケーションごとに必要とするデータと読み出しタイミングが異なることがあり、データ活用アプリケーションごとにサブバッファがメモリ42aに確保されてもよい。収集部52cは、第二バッファ37bに格納されたデータレコードを読み出し、第一データ活用アプリケーション用のデータを第一サブバッファ38aに格納する。収集部52cは、第二バッファ37bに格納されたデータレコードを読み出し、第二データ活用アプリケーション用のデータを第二サブバッファ38bに格納する。なお、収集部52cは、第三バッファ37cに格納されたデータレコードを読み出し、第一データ活用アプリケーション用のデータを第一サブバッファ38aに格納してもよい。収集部52cは、第三バッファ37cに格納されたデータレコードを読み出し、第二データ活用アプリケーション用のデータを第二サブバッファ38bに格納してもよい。データ処理部73は、第一データ活用アプリケーションにしたがってデータを第一サブバッファ38aから読み出してデータ処理を実行し、処理結果を生成する。データ処理部73は、第二データ活用アプリケーションにしたがってデータを第二サブバッファ38bから読み出してデータ処理を実行し、処理結果を生成する。解凍エンジン75は、基本ユニット3の圧縮エンジン55a及び拡張ユニット4bの圧縮エンジン55bと対を成す機能である。解凍エンジン75は、基本ユニット3により圧縮されて転送されてきたデータを解凍して第二バッファ37bに格納する。解凍エンジン75は、拡張ユニット4bにより圧縮されて転送されてきたデータを解凍して第三バッファ37cに格納する。これにより拡張バス90の通信トラフィックの混雑が緩和されるようになろう。解凍エンジン75はASIC又はFPGAなどにより実現されてもよい。このように基本ユニット3及び拡張ユニット4a、4bとの間のデータの伝送は拡張バス90を介して実行される。 In addition, multiple data utilization applications may be provided. In this case, the data required for each data utilization application and the read timing may differ, and a subbuffer may be secured in the memory 42a for each data utilization application. The collecting unit 52c reads the data record stored in the second buffer 37b and stores the data for the first data utilization application in the first subbuffer 38a. The collecting unit 52c reads the data record stored in the second buffer 37b and stores the data for the second data utilization application in the second subbuffer 38b. The collecting unit 52c may read the data record stored in the third buffer 37c and store the data for the first data utilization application in the first subbuffer 38a. The collecting unit 52c may read the data record stored in the third buffer 37c and store the data for the second data utilization application in the second subbuffer 38b. The data processing unit 73 reads data from the first subbuffer 38a according to the first data utilization application, executes data processing, and generates a processing result. The data processing unit 73 reads data from the second subbuffer 38b according to the second data utilization application, executes data processing, and generates a processing result. The decompression engine 75 is a function of pairing with the compression engine 55a of the basic unit 3 and the compression engine 55b of the expansion unit 4b. The decompression engine 75 decompresses the data compressed and transferred by the basic unit 3 and stores it in the second buffer 37b. The decompression engine 75 decompresses the data compressed and transferred by the expansion unit 4b and stores it in the third buffer 37c. This will alleviate the congestion of communication traffic on the expansion bus 90. The defrosting engine 75 may be realized by ASIC, FPGA, or the like. In this way, data transmission between the basic unit 3 and the expansion units 4a and 4b is executed via the expansion bus 90.

データ活用アプリケーションごとに必要となるデータが複数である場合がある。その場合、各スキャンで収集されたデータの塊をバッファに維持したままサブバッファに必要な複数のデータを格納することもある。さらに、サブバッファにデータを分配する場合にも、各レコードにタイムスタンプ等が付与されもよい。図16が示すように、第二バッファ37b(第三バッファ37cであってもよい)は、収集されたデータの塊を保持している。一つのレコードはスキャン番号と、タイマーの値(タイムスタンプ)と、収集されたデータを含む。この例で、収集されたデータは、リレーRL1〜RL3、デバイスDev1、Dev2を含む。第一データ活用アプリケーション1601は、収集されたデータのうち、リレーRL1〜RL3を必要とする。したがって、スキャン番号、タイマーの値、リレーRL1〜RL3が第二バッファ37bから読み出されて、第一サブバッファ38aに格納される。第一データ活用アプリケーション1601は、第一サブバッファ38aからスキャン番号、タイマーの値、リレーRL1〜RL3を読み出して表示画面(ソースデータ)を作成する。第二データ活用アプリケーション1602は、収集されたデータのうち、リレーRL3、デバイスDev1、Dev2を必要とする。したがって、スキャン番号、タイマーの値、リレーRL3、デバイスDev1、Dev2が第二バッファ37bから読み出されて、第二サブバッファ38bに格納される。第二データ活用アプリケーション1602は、第二サブバッファ38bからスキャン番号、タイマーの値、リレーRL3、デバイスDev1、Dev2を読み出して表示画面(ソースデータ)を作成する。このようにサブバッファを活用することで、元のデータを変更することなくバッファ内に維持することが可能となる。バッファ内に保持された元のデータは他の目的で利用可能となる。 Data utilization There may be multiple data required for each application. In that case, a plurality of necessary data may be stored in the subbuffer while maintaining the chunk of data collected in each scan in the buffer. Further, when data is distributed to the subbuffer, a time stamp or the like may be added to each record. As shown in FIG. 16, the second buffer 37b (which may be the third buffer 37c) holds a chunk of collected data. One record contains the scan number, the timer value (timestamp), and the collected data. In this example, the collected data includes relays RL1 to RL3, devices Dev1 and Dev2. The first data utilization application 1601 requires relays RL1 to RL3 among the collected data. Therefore, the scan number, the timer value, and the relays RL1 to RL3 are read from the second buffer 37b and stored in the first subbuffer 38a. The first data utilization application 1601 reads out the scan number, the timer value, and the relays RL1 to RL3 from the first subbuffer 38a to create a display screen (source data). The second data utilization application 1602 requires relays RL3, devices Dev1 and Dev2 among the collected data. Therefore, the scan number, the timer value, the relay RL3, the devices Dev1 and Dev2 are read from the second buffer 37b and stored in the second subbuffer 38b. The second data utilization application 1602 reads out the scan number, the timer value, the relay RL3, the devices Dev1 and the Dev2 from the second subbuffer 38b, and creates a display screen (source data). By utilizing the subbuffer in this way, it is possible to maintain the original data in the buffer without changing it. The original data held in the buffer can be used for other purposes.

<データ活用に関連する拡張ユニット4bの機能>
図7は拡張ユニット4bのCPU41bによって実現される機能を説明する図である。
<Functions of expansion unit 4b related to data utilization>
FIG. 7 is a diagram illustrating a function realized by the CPU 41b of the expansion unit 4b.

実行エンジン51bは拡張ユニット4bの基本機能(モーションユニットであればモーションフローの実行など)を実行する。収集部52bは、収集設定36により指定されたデータを、収集設定36により指定されたタイミングでデバイス部34bから収集して第四バッファ37dに格納する。転送部53bは、収集設定36により指定されたタイミング、又は、拡張ユニット4aにより転送要求が受信されたタイミングで、第四バッファ37dに格納されているデータレコードを読み出して、拡張バス90を介して、拡張ユニット4aの第三バッファ37cに転送する。なお、監視部54により監視される拡張バス90の通信トラフィックが少ないタイミングに、転送部53bがデータレコードの転送を実行してもよい。圧縮エンジン55bは、収集設定36にしたがってデータレコードを圧縮する。つまり、転送部53bは、圧縮エンジン55bにより情報圧縮されたデータレコードを拡張ユニット4aに転送してもよい。圧縮エンジン55bは、CPU41bにより実現されてもよいが、高速処理の観点やCPU41bの処理負荷の軽減の観点から、ASIC又はFPGAにより実現されてもよい。 The execution engine 51b executes the basic functions of the expansion unit 4b (in the case of a motion unit, execution of a motion flow, etc.). The collection unit 52b collects the data specified by the collection setting 36 from the device unit 34b at the timing specified by the collection setting 36 and stores it in the fourth buffer 37d. The transfer unit 53b reads the data record stored in the fourth buffer 37d at the timing specified by the collection setting 36 or the timing when the transfer request is received by the expansion unit 4a, and reads the data record stored in the fourth buffer 37d via the expansion bus 90. , Transfer to the third buffer 37c of the expansion unit 4a. The transfer unit 53b may transfer the data record at a timing when the communication traffic of the expansion bus 90 monitored by the monitoring unit 54 is small. The compression engine 55b compresses the data record according to the collection setting 36. That is, the transfer unit 53b may transfer the data record information-compressed by the compression engine 55b to the expansion unit 4a. The compression engine 55b may be realized by the CPU 41b, but may be realized by an ASIC or an FPGA from the viewpoint of high-speed processing and reduction of the processing load of the CPU 41b.

<データレコードの例>
図8は収集部52aによって第一バッファ37aに書き込まれるデータレコード91を示している。複数のデータレコード91は時系列データの一例である。この例で、収集部52aは一スキャン周期ごとに、Dev0、Dev1、Dev10というデバイス名のデバイス値をデバイス部34aから収集し、収集カウント及びタイマーから取得された時刻情報を付加して一つのデータレコードを作成し、第一バッファ37aに格納する。なお、収集対象は、拡張ユニット4bに割り当てられたバッファメモリ又はデバイスに格納されたデータであってもよい。この例で第一バッファ37aはFIFO(先入先出)タイプのバッファである。収集カウントは、一つのデータレコードを収集するたびに1ずつカウントアップされるカウンタのカウント値である。収集カウントはシーケンシャルに付与される番号であるため、データレコードの抜けや圧縮を検出することに役立つ。
<Example of data record>
FIG. 8 shows a data record 91 written to the first buffer 37a by the collecting unit 52a. The plurality of data records 91 are examples of time series data. In this example, the collection unit 52a collects the device values of the device names Dev0, Dev1, and Dev10 from the device unit 34a for each scan cycle, and adds the collection count and the time information acquired from the timer to one data. A record is created and stored in the first buffer 37a. The collection target may be data stored in the buffer memory or device allocated to the expansion unit 4b. In this example, the first buffer 37a is a FIFO (first in, first out) type buffer. The collection count is a count value of a counter that is counted up by 1 each time one data record is collected. Since the collection count is a sequential number, it is useful for detecting missing or compressed data records.

タイムスタンプなどの時刻情報は、例えば、基本ユニット3で取得されたデータと、拡張ユニット4bで取得されたデータとを対比可能にダッシュボードに表示する際に役立つ。一般に、基本ユニット3における収集タイミングと拡張ユニット4bにおける収集タイミングとは一致しない。そのため、基本ユニット3の動作と拡張ユニット4bの動作とを比較するためには、基本ユニット3のデータと、拡張ユニット4bのデータとを紐付けるための情報が必要となる。一般に、基本ユニット3と、拡張ユニット4a、4bとはユニット間同期などによって時刻情報を同期できる。したがって、基本ユニット3と拡張ユニット4bはそれぞれデータレコードを収集したときの時刻情報をデータレコードに付与することで、データ処理部73は、異なるユニットで取得された複数のデータレコードを時間軸上で整列させることができる。 Time information such as a time stamp is useful, for example, when displaying the data acquired by the basic unit 3 and the data acquired by the expansion unit 4b on the dashboard so as to be comparable. Generally, the collection timing in the basic unit 3 and the collection timing in the expansion unit 4b do not match. Therefore, in order to compare the operation of the basic unit 3 with the operation of the expansion unit 4b, information for associating the data of the basic unit 3 with the data of the expansion unit 4b is required. Generally, the time information can be synchronized between the basic unit 3 and the expansion units 4a and 4b by synchronization between units or the like. Therefore, the basic unit 3 and the expansion unit 4b each add the time information when the data records are collected to the data records, so that the data processing unit 73 transfers a plurality of data records acquired by different units on the time axis. Can be aligned.

<転送のタイミング>
図9はデータレコードの転送タイミングを説明する図である。図9が示すようにPLC1は、入出力のリフレッシュ、ユーザプログラムの実行及びエンド処理を繰り返し実行する。スキャン周期の伸びを低減するために、転送処理は、入出力のリフレッシュの期間を避けて実行される。同様に、スキャン周期の伸びを低減するために、転送処理は、UREAD及びUWRITの実行期間を避けて実行される。UREADは拡張ユニット4に割り当てられているバッファメモリからデータを読み出す命令であり、ユーザプログラム中に記述される。そのため、基本ユニット3は、ユーザプログラムの実行期間中に、UREADにしたがって拡張ユニット4にアクセスしてバッファメモリからデータを取得する。UWRITは、拡張ユニット4に割り当てられているバッファメモリにデータを書き込む命令であり、ユーザプログラム中に記述される。基本ユニット3は、ユーザプログラムの実行期間中に、UWRITにしたがって拡張ユニット4にアクセスしてバッファメモリにデータを書き込む。
<Transfer timing>
FIG. 9 is a diagram for explaining the transfer timing of the data record. As shown in FIG. 9, the PLC1 repeatedly executes input / output refresh, user program execution, and end processing. In order to reduce the extension of the scan cycle, the transfer process is executed avoiding the input / output refresh period. Similarly, in order to reduce the elongation of the scan cycle, the transfer process is executed avoiding the execution period of UREAD and UWRIT. UREAD is an instruction to read data from the buffer memory allocated to the expansion unit 4, and is described in the user program. Therefore, the basic unit 3 accesses the expansion unit 4 according to UREAD and acquires data from the buffer memory during the execution period of the user program. UWRIT is an instruction to write data to the buffer memory allocated to the expansion unit 4, and is described in the user program. The basic unit 3 accesses the expansion unit 4 according to UWRIT and writes data to the buffer memory during the execution period of the user program.

図9が示すように、入出力のリフレッシュ、UREAD及びUWRITを除いた残りの転送可能期間において、転送処理は、拡張バス90で実行される。例えば、収集設定36aによって5個のデータレコードずつ転送処理を実行することが設定されていたと仮定する。この場合、転送部53aは、第一バッファ37aに5個のデータレコードの蓄積が完了した後であって、最初の転送可能期間又は拡張ユニット4aによって転送要求を受信したタイミングで、転送処理を実行する。 As shown in FIG. 9, the transfer process is performed on the expansion bus 90 during the remaining transferable period excluding I / O refresh, UREAD and UWRIT. For example, it is assumed that the collection setting 36a is set to execute the transfer process for each of five data records. In this case, the transfer unit 53a executes the transfer process after the accumulation of five data records in the first buffer 37a is completed and at the timing when the transfer request is received by the first transferable period or the expansion unit 4a. do.

<情報の圧縮>
図10はデータレコードの情報圧縮を説明する図である。データレコード群92aは情報圧縮前のデータレコードを示している。なお、前回のスキャン周期から変化があった値は網掛け表示している。ここでは収集対象として四つのリレーデバイスRL1,RL2,RL3,RL4が指定されている。また、収集カウントとしてスキャン番号が採用されている。カウンタは、タイマーなどにより取得される時刻情報(例:あるリレーがONになってからOFFになるまでの時間間隔を示す数値)であってもよい。データレコード群92aにおいてスキャン番号"1"のデータレコードと、スキャン番号"2"のデータレコードとの間ではリレーデバイスの変化点が存在しない。つまり、スキャン番号"2"のデータレコードは圧縮(廃棄または削除)可能である。しかし、スキャン番号"3"のデータレコードのリレーデバイスRL1とスキャン番号"1"のデータレコードのリレーデバイスRL1とが異なっている。このように、スキャン番号"3"は変化点を有しているため、スキャン番号"3"のデータレコードは圧縮されない。スキャン番号"3"のデータレコードと、スキャン番号"4"のデータレコードとの間ではリレーデバイスの変化点が存在しないため、スキャン番号"4"のデータレコードは圧縮可能である。同様に、スキャン番号"5"のデータレコードと、スキャン番号"6"のデータレコードとの間ではリレーデバイスの変化点が存在しないため、スキャン番号"6"のデータレコードは圧縮可能である。このような変化点に着目した情報圧縮を実行することで、圧縮されたデータレコード群92bが実現される。圧縮されたデータレコード群92bを構成する各データレコードは変化点を有している。このように、本実施形態では、1以上のデバイスのグループ(RL1〜RL4)において、前回のスキャン周期において収集した値と、今回のスキャン周期において収集した値とが収集対象のグループの全てのデバイスで変化していなければ、今回のスキャン周期において収集した値を削除して、収集する時系列データを圧縮する。なお、ここでは、一群で管理する実施例について説明したが、本発明を限定する意図はなく、グルーピングせずに、個々のデバイスに関してON/OFFを判定してデータを圧縮してもよい。また、ON/OFFのビット形式ではないデータ(アナログ値)の場合は、デバイス毎に前回とのデバイス値の変化を検知し、変化を検知した場合に残すように制御してもよい。
<Compression of information>
FIG. 10 is a diagram illustrating information compression of a data record. The data record group 92a indicates a data record before information compression. The values that have changed since the previous scan cycle are shaded. Here, four relay devices RL1, RL2, RL3, and RL4 are designated as collection targets. In addition, a scan number is used as the collection count. The counter may be time information acquired by a timer or the like (example: a numerical value indicating a time interval from when a certain relay is turned on to when it is turned off). In the data record group 92a, there is no change point of the relay device between the data record of the scan number "1" and the data record of the scan number "2". That is, the data record with scan number "2" can be compressed (discarded or deleted). However, the relay device RL1 for the data record with the scan number "3" and the relay device RL1 for the data record with the scan number "1" are different. As described above, since the scan number "3" has a change point, the data record of the scan number "3" is not compressed. Since there is no change point of the relay device between the data record of scan number "3" and the data record of scan number "4", the data record of scan number "4" can be compressed. Similarly, since there is no change point of the relay device between the data record of scan number "5" and the data record of scan number "6", the data record of scan number "6" can be compressed. By executing information compression focusing on such a change point, the compressed data record group 92b is realized. Each data record constituting the compressed data record group 92b has a change point. As described above, in the present embodiment, in the group of one or more devices (RL1 to RL4), the values collected in the previous scan cycle and the values collected in the current scan cycle are all the devices in the group to be collected. If it does not change in, the values collected in this scan cycle are deleted and the time series data to be collected is compressed. Although examples of management in a group have been described here, there is no intention of limiting the present invention, and data may be compressed by determining ON / OFF for each device without grouping. Further, in the case of data (analog value) that is not in the ON / OFF bit format, a change in the device value from the previous time may be detected for each device, and control may be performed so that the change is left when the change is detected.

<全体フロー>
図11は、本実施形態に係るプログラマブルロジックコントローラにおいてデータ収集から異常デバイスの特定処理までの全体フローを示す。以下で説明する処理は、拡張ユニット4aのCPU41aによって実行される処理として説明する。しかし、本発明を限定する意図はなく、それらの処理の一部が基本ユニット3や他の拡張ユニット4bで実行されてもよいし、或いはプログラマブルロジックコントローラに通信可能に接続された外部装置(分析装置)によって実行されてもよい。
<Overall flow>
FIG. 11 shows an overall flow from data collection to identification processing of an abnormal device in the programmable logic controller according to the present embodiment. The process described below will be described as a process executed by the CPU 41a of the expansion unit 4a. However, there is no intention of limiting the present invention, and a part of those processes may be executed by the basic unit 3 or another expansion unit 4b, or an external device (analysis) communicably connected to the programmable logic controller. It may be executed by the device).

S1でCPU41a(設定部71)は基本ユニット3と拡張ユニット4bを設定する。例えば、CPU41aは基本ユニット3のための収集設定36aを基本ユニット3に転送する。基本ユニット3は、収集設定36aを記憶装置32に格納する。CPU41aは基本ユニット3のための収集設定36bを拡張ユニット4bに転送する。拡張ユニット4bは、収集設定36bをメモリ42bに格納する。 In S1, the CPU 41a (setting unit 71) sets the basic unit 3 and the expansion unit 4b. For example, the CPU 41a transfers the collection setting 36a for the basic unit 3 to the basic unit 3. The basic unit 3 stores the collection setting 36a in the storage device 32. The CPU 41a transfers the collection setting 36b for the basic unit 3 to the expansion unit 4b. The expansion unit 4b stores the collection setting 36b in the memory 42b.

S2でCPU41a(収集部52c)は設定された収集設定に従って、収集対象となるデバイスの時系列データを収集する。ここでは、所定量の収集データが格納された場合に次の処理に進むようにしてもよい。つまり、ここでは、学習フェーズへ移行するタイミングを判定し、学習するのに十分なデータ量(所定数のスキャン周期の時系列データ)がバッファやメモリカードなどの記憶部に蓄積されると次の処理へ進む。 In S2, the CPU 41a (collection unit 52c) collects time-series data of the device to be collected according to the set collection setting. Here, when a predetermined amount of collected data is stored, the process may proceed to the next process. That is, here, when the timing of transition to the learning phase is determined and a sufficient amount of data (time-series data of a predetermined number of scan cycles) for learning is accumulated in a storage unit such as a buffer or a memory card, the next step is Proceed to processing.

S3でCPU41a(分類部76及び決定部77)はS2で収集されたデータを分析して、異常デバイスを特定するための学習モデル(本実施形態では、パラメータ)を作成する。学習フェーズの処理については、図15を用いて後述する。 In S3, the CPU 41a (classification unit 76 and determination unit 77) analyzes the data collected in S2 to create a learning model (parameter in this embodiment) for identifying an abnormal device. The processing of the learning phase will be described later with reference to FIG.

S4でCPU41a(収集部52c)は設定された収集設定に従って、収集対象となるデバイスの時系列データを収集する。S4以降の処理は、実際にシステムの運用時の処理となる。ここでのデータの収集は、基本的には上記S2と同様のデータ収集が行われる。なお、学習フェーズについてはシステムの運用開始時に行われてもよいし、ユーザからの指示を受け付けたタイミングで開始されてもよい。また、定期的に行うようにしてもよい。つまり、システム運用時においては常にデータ収集が行われ、定期的に学習フェーズが行われ、保存条件が成立したタイミングで推定フェーズが行われる。例えばプログラマブルロジックコントローラの運用中に異常が発生し、基本ユニット3が保存条件の成立を検知した場合に、基本ユニット3の第一バッファ37aに収集された時系列データがメモリカード44に保存させる。S5でCPU41a(特定部78)は、メモリカード44に保存された時系列データを取得してS3で決定されたパラメータを適用することによって、異常デバイスを特定する。即ち、ここでは推定フェーズにおける処理が行われるが、詳細については図16を用いて後述する。また、CPU41aは、特定部78によって特定された特定結果に基づいて、生成部74によって当該特定結果を示す表示データを生成し、基本ユニット3の表示部5に表示するか、或いは、送信部79によって通信部43を介して生成した表示データ又は特定結果を外部装置へ送信する。この場合、外部装置において特定結果がオペレータに対して表示される。S5の運用は、上述したようなプログラマブルロジックコントローラの運用中に異常が発生した場合に、基本ユニット3が保存条件の成立を検知し、異常デバイスを特定する以外にも、デバイス値を常時収集し、当該デバイス値に異常がないかを分析する方法や、ユーザにより予め定められたデバイス値が所定の変化をした場合に、基本ユニットにより収集されているデバイス値を分析する方法、定期的に、或いはユーザからの監視指示に基づいて、デバイス値に異常がないかを分析する方法であってもよい。これらの場合、「異常」とは、分析対象のデバイス値が、正常時のデバイス値と異なっている、すなわち、正常時のデータと乖離していることを表し、必ずしも、プログラマブルロジックコントローラに発生している異常を示すものではない。なお、これらの収集タイミングを考慮したデータ収集から異常デバイスを特定する推定フェーズの処理手順については図16を用いて詳細に後述する。 In S4, the CPU 41a (collection unit 52c) collects time-series data of the device to be collected according to the set collection setting. The processing after S4 is actually the processing at the time of system operation. The data collection here is basically the same as the data collection in S2 above. The learning phase may be performed at the start of system operation, or may be started at the timing of receiving an instruction from the user. It may also be performed on a regular basis. That is, during system operation, data is always collected, the learning phase is periodically performed, and the estimation phase is performed when the storage conditions are satisfied. For example, when an abnormality occurs during the operation of the programmable logic controller and the basic unit 3 detects that the storage condition is satisfied, the time series data collected in the first buffer 37a of the basic unit 3 is stored in the memory card 44. In S5, the CPU 41a (specific unit 78) identifies the abnormal device by acquiring the time-series data stored in the memory card 44 and applying the parameters determined in S3. That is, although the processing in the estimation phase is performed here, the details will be described later with reference to FIG. Further, the CPU 41a generates display data indicating the specific result by the generation unit 74 based on the specific result specified by the specific unit 78, and displays the display data on the display unit 5 of the basic unit 3 or the transmission unit 79. The display data or the specific result generated via the communication unit 43 is transmitted to the external device. In this case, the specific result is displayed to the operator in the external device. In the operation of S5, when an abnormality occurs during the operation of the programmable logic controller as described above, the basic unit 3 detects the establishment of the storage condition and not only identifies the abnormal device but also constantly collects the device value. , A method of analyzing whether the device value is normal, or a method of analyzing the device value collected by the basic unit when the device value predetermined by the user changes by a predetermined value, periodically, Alternatively, it may be a method of analyzing whether or not there is an abnormality in the device value based on a monitoring instruction from the user. In these cases, "abnormal" means that the device value to be analyzed is different from the device value at the normal time, that is, it is different from the data at the normal time, and it does not necessarily occur in the programmable logic controller. It does not indicate any abnormalities. The processing procedure of the estimation phase for identifying an abnormal device from data collection in consideration of these collection timings will be described in detail later with reference to FIG.

<収集データの分類>
図12は、収集される時系列データの類型の一例を示す。1201〜1206は各類型のデバイス信号(時系列データ)を示す。デバイス信号には外部信号が含まれてもよい。なお、以下で説明する類型は一例であり、本発明を限定する意図はなくその他の類型にも本発明が適用されてもよい。また、本発明においては分類される類型は、分類効果を向上させるべく、これら複数の類型のうちの少なくとも2つの類型を含むことが望ましい。なお、学習時における時系列データの分類は、ユーザが分類のための周期(動作サイクル)を決定するデバイスを選択することで、当該デバイスの繰り返し性に基づいて実行される。
<Classification of collected data>
FIG. 12 shows an example of the types of time series data collected. Reference numerals 1201 to 1206 indicate device signals (time series data) of each type. The device signal may include an external signal. The types described below are examples, and the present invention may be applied to other types without any intention of limiting the present invention. Further, in the present invention, it is desirable that the types classified include at least two types among these plurality of types in order to improve the classification effect. The classification of the time series data at the time of learning is executed based on the repeatability of the device by selecting the device for determining the cycle (operation cycle) for the classification by the user.

1201は、装置の動作サイクルに同期して動作するデバイスのデバイス信号を示す。1210は装置の動作サイクルを示す。1201の類型は、装置の動作サイクルごとに同様の変化パターン(定常的な変化パターン)が発生する。この類型では、たとえば、正常状態とみなせる期間において取得された時系列データから定常的な変化パターンを特定し、新たに取得された時系列データについて特定した定常的な変化パターンからの乖離に基づいて異常デバイス(いつもと違うデバイス)を特定するといった検知手法が割り当てられる。具体的には、正常状態とみなせる複数周期の時系列データの変化パターンについて、変化点に関する時間のばらつきを測定し、測定されたばらつきに応じてしきい値を設定する。その後に取得された時系列データの変化点が変化点に対応して設定されたしきい値の範囲を超えるか否かに基づいて異常デバイスを検知する検知アルゴリズムが割り当てられる。例えば、装置の動作サイクルごとの複数の波形を重ね合わせ、デバイスがOFFからONに変化した点のばらつきに基づき、当該変化点の基準値としきい値とを設定し、これらのパラメータを用いて異常デバイスを特定することができる。また、1201の各周期において、1回目の信号の立ち上がりタイミングを示す相対時刻や各周期における位相を評価変数とし、当該評価変数のばらつきに基づいて評価変数に対応するパラメータを決定してもよい。たとえば、各周期における位相を評価変数とした場合は、位相の上限しきい値と下限しきい値をそれぞれパラメータとしてもよい。 Reference numeral 1201 indicates a device signal of a device that operates in synchronization with the operation cycle of the device. Reference numeral 1210 indicates the operation cycle of the device. In the 1201 type, a similar change pattern (steady change pattern) occurs for each operation cycle of the device. In this type, for example, a steady-state change pattern is specified from the time-series data acquired during a period that can be regarded as a normal state, and based on the deviation from the specified steady-state change pattern for the newly acquired time-series data. A detection method such as identifying an abnormal device (a device different from usual) is assigned. Specifically, for a change pattern of time-series data having a plurality of cycles that can be regarded as a normal state, the time variation with respect to the change point is measured, and a threshold value is set according to the measured variation. A detection algorithm for detecting an abnormal device is assigned based on whether or not the change point of the time series data acquired thereafter exceeds the threshold range set corresponding to the change point. For example, a plurality of waveforms for each operation cycle of the device are superimposed, and a reference value and a threshold value of the change point are set based on the variation of the point where the device changes from OFF to ON, and an abnormality is made using these parameters. The device can be identified. Further, in each cycle of 1201, the relative time indicating the rising timing of the first signal and the phase in each cycle may be used as evaluation variables, and the parameters corresponding to the evaluation variables may be determined based on the variation of the evaluation variables. For example, when the phase in each period is used as an evaluation variable, the upper limit threshold value and the lower limit threshold value of the phase may be used as parameters, respectively.

一方、1202は、スキャン周期には同期せず、当該装置の動作サイクル以外の周期に同期して動作するデバイスのデバイス信号を示す。この類型についても、たとえば、正常状態とみなせる期間において取得された時系列データから定常的な変化パターンを特定し、新たに取得された時系列データについて特定した定常的な変化パターンからの乖離に基づいて異常デバイス(いつもと違うデバイス)を特定するといった検知手法が割り当てられる。具体的には、正常状態とみなせる複数周期の時系列データの変化パターンについて、変化点に関する時間のばらつきを測定し、測定されたばらつきに応じてしきい値を設定する。その後に取得された時系列データの変化点が変化点に対応して設定されたしきい値の範囲を超えるか否かに基づいて異常デバイスを検知する検知アルゴリズムが割り当てられる。また、1202の各周期において、2回目の信号の立ち上がりタイミングを示す相対時刻や各周期における位相を評価変数とし、当該評価変数のばらつきに基づいて評価変数に対応するパラメータを決定してもよい。たとえば、各周期における相対時刻を評価変数とした場合は、相対時刻の上限しきい値と下限しきい値をそれぞれパラメータとしてもよい。 On the other hand, 1202 indicates a device signal of a device that is not synchronized with the scan cycle and operates in synchronization with a cycle other than the operation cycle of the device. Also for this type, for example, a steady change pattern is specified from the time series data acquired during the period that can be regarded as a normal state, and based on the deviation from the specified steady change pattern for the newly acquired time series data. A detection method such as identifying an abnormal device (a device different from usual) is assigned. Specifically, for a change pattern of time-series data having a plurality of cycles that can be regarded as a normal state, the time variation with respect to the change point is measured, and a threshold value is set according to the measured variation. A detection algorithm for detecting an abnormal device is assigned based on whether or not the change point of the time series data acquired thereafter exceeds the threshold range set corresponding to the change point. Further, in each cycle of 1202, the relative time indicating the rising timing of the second signal and the phase in each cycle may be used as evaluation variables, and the parameters corresponding to the evaluation variables may be determined based on the variation of the evaluation variables. For example, when the relative time in each cycle is used as an evaluation variable, the upper limit threshold value and the lower limit threshold value of the relative time may be used as parameters, respectively.

1203は、一定した値をとるデバイスのデバイス信号を示す。この類型では、たとえば、正常状態とみなせる期間において取得された時系列データから、正常時の値を特定し、新たに取得された時系列データについて、特定した正常時の値と異なるものを異常デバイス(いつもと違うデバイス)として特定するといった検知手法が割り当てられる。具体的には、正常状態とみなせる時系列データにおけるデバイスの値を検出基準値として設定し、その後に取得された時系列データの値が、正常時の値に対応して設定された検出基準値と異なるか否かに基づいて異常デバイスを検知する検知アルゴリズムが割り当てられる。つまり、値(一定値)が変化した場合に異常と判断することができる。1204は、不定期に動作するデバイスのデバイス信号を示す。この類型については、異常デバイスを特定する際に用いるデータからは除外される。1205は、アナログ値をとるデバイスのデバイス信号を示す。アナログ値をとるデバイスでは、後述するように、ビットデバイスのデバイス値ではないので、図13AでS21のNo(図13BのS27)へ進み、図13Bで示すように、データの変化方法に応じてそれぞれで推定フェーズにおけるアルゴリズムが異なる。アナログ値を取るデバイスの推定フェーズにおけるアルゴリズムとしては、動的時間伸縮法や自己回帰モデルなど種々の方法を利用することができる。1206は、単調増加、単調減少するデバイスのデバイス信号を示す。この類型では、微分値や積算値を用いて異常デバイスを特定する。また、単調増加または単調減少するタイミングを示す相対時刻や各周期における位相を評価変数として用いてもよい。なお、ここで説明した類型は一例であり、他の類型に分類されるデバイスも想定され、例えば、(階段状のデバイス信号など)複数の状態をとりうるものなどがある。複数の状態をとるものについては、正常時の状態と異なる状態に変化した場合に異常と判断することもできる。 1203 represents a device signal of a device that takes a constant value. In this type, for example, the value at the normal time is specified from the time series data acquired during the period that can be regarded as the normal state, and the newly acquired time series data that is different from the specified normal value is the abnormal device. A detection method such as identifying as (a device different from usual) is assigned. Specifically, the device value in the time-series data that can be regarded as the normal state is set as the detection reference value, and the value of the time-series data acquired thereafter is the detection reference value set corresponding to the value in the normal state. A detection algorithm that detects an abnormal device is assigned based on whether or not it differs from. That is, when the value (constant value) changes, it can be determined as abnormal. 1204 indicates a device signal of a device that operates irregularly. This type is excluded from the data used to identify anomalous devices. 1205 represents a device signal of a device that takes an analog value. As will be described later, the device that takes an analog value is not the device value of the bit device, so the process proceeds to No. S21 (S27 in FIG. 13B) in FIG. 13A, and as shown in FIG. 13B, depending on the data change method. The algorithm in the estimation phase is different for each. As an algorithm in the estimation phase of the device that takes an analog value, various methods such as a dynamic time expansion / contraction method and an autoregressive model can be used. 1206 indicates a device signal of a device that monotonically increases and decreases monotonically. In this type, anomalous devices are identified using derivative values and integrated values. Further, a relative time indicating the timing of monotonically increasing or monotonically decreasing or a phase in each cycle may be used as an evaluation variable. The type described here is an example, and devices classified into other types are also assumed. For example, there are devices that can take a plurality of states (such as a stepped device signal). For those that take multiple states, it can be determined that they are abnormal when they change to a state different from the normal state.

ここで、図14を参照して、デバイスの型について説明する。図14に示すように、各デバイスは0、1のビット型のデバイスと、アナログ値をとる、ワード型のデバイスや浮動小数点数型のデバイスがある。なお、ワードデバイスには、さらに、1ワード符号なし整数(0〜65535)、1ワード符号あり整数(−32768〜32767)、2ワード符号なし整数(0〜4294967295)、及び2ワード符号あり整数(−214783648〜214783647)がある。このような型を考慮すると、例えば、スキャン周期あたりの変化率が所定値以上で、型がビット以外であればアナログ値をとるデバイスであると判断することができる。 Here, the type of the device will be described with reference to FIG. As shown in FIG. 14, each device includes a bit type device of 0 and 1, and a word type device and a floating point number type device that take analog values. In addition, the word device further includes a one-word unsigned integer (0 to 65535), a one-word signed integer (-32768 to 32767), a two-word unsigned integer (0 to 249497295), and a two-word signed integer (0 to 249497295). -2147863648 to 214783647). Considering such a type, for example, if the rate of change per scan cycle is a predetermined value or more and the type is other than a bit, it can be determined that the device takes an analog value.

<分類>
図13A及び図13Bは、収集されたデータを分類する際の処理手順を示すフローチャートである。以下で説明する処理は、拡張ユニット4aのCPU41aによって実現される。しかし、本発明を限定する意図はなく、それらの処理の一部が基本ユニット3や他の拡張ユニット4bで実行されてもよいし、或いはプログラマブルロジックコントローラに通信可能に接続された外部装置(分析装置)によって実行されてもよい。
<Category>
13A and 13B are flowcharts showing a processing procedure when classifying the collected data. The processing described below is realized by the CPU 41a of the expansion unit 4a. However, there is no intention of limiting the present invention, and a part of those processes may be executed by the basic unit 3 or another expansion unit 4b, or an external device (analysis) communicably connected to the programmable logic controller. It may be executed by the device).

S21でCPU41aは、分類対象の時系列データがビットデバイスのデバイス値であるか否かを判断する。ビットデバイスのデバイス値であればS22に進み、そうでなければ、図13BのS27に進む。 In S21, the CPU 41a determines whether or not the time-series data to be classified is the device value of the bit device. If it is the device value of the bit device, the process proceeds to S22. If not, the process proceeds to S27 in FIG. 13B.

S22でCPU41aは、分類対象の時系列データの値に変化があるか否かを判断する。変化があればS24へ進み、変化がなく一定値をとるものであればS23に進む。S23でCPU41aは分類対象の時系列データを一定値をとるデバイス(1203)であると分類し、処理を終了する。ここで分類情報として、当該時系列データに紐づく情報、例えば分類された類型を示すフラグ情報が当該時系列データまたは当該時系列データに対応するデバイスを示す識別情報に紐づけて格納される。このように、学習フェーズの分類時において分類した類型のフラグ情報とデバイスの識別情報とを紐づけて格納しておくことにより、推定フェーズにおいては、検証対象の時系列データが何れのデバイスからのデータであるかに従って、当該デバイスの識別情報に紐づく類型に応じて、異常デバイスの検知アルゴリズムである評価変数やパラメータを容易に選択することができる。つまり、推定フェーズにおいては、検証対象の時系列データが何れの類型に対応するかを特定する処理を省略することができる。なお、分類情報としては、分類された類型を示すフラグ情報を例として示したが、フラグ情報に代えて異常デバイス特定のアルゴリズムを示すアルゴリズム情報であってもよい。また、分類情報として格納される識別情報は、時系列データに対応するデバイスが変数である場合は、当該変数を示す識別情報となることはいうまでもない。 In S22, the CPU 41a determines whether or not there is a change in the value of the time series data to be classified. If there is a change, the process proceeds to S24, and if there is no change and a constant value is obtained, the process proceeds to S23. In S23, the CPU 41a classifies the time-series data to be classified as a device (1203) that takes a constant value, and ends the process. Here, as the classification information, information associated with the time-series data, for example, flag information indicating the classified type is stored in association with the time-series data or the identification information indicating the device corresponding to the time-series data. In this way, by storing the flag information of the type classified at the time of classifying the learning phase and the device identification information in association with each other, in the estimation phase, the time series data to be verified is from any device. Depending on whether the data is data, evaluation variables and parameters that are abnormal device detection algorithms can be easily selected according to the type associated with the identification information of the device. That is, in the estimation phase, it is possible to omit the process of specifying which type the time series data to be verified corresponds to. As the classification information, the flag information indicating the classified type is shown as an example, but the algorithm information indicating the algorithm for identifying the abnormal device may be used instead of the flag information. Further, it goes without saying that the identification information stored as the classification information becomes the identification information indicating the variable when the device corresponding to the time series data is a variable.

S24でCPU41aは、時系列データの値に変化がある場合に、当該変化が各周期において定常的な変化パターンであるかを判断する。定常的な変化パターンであると判断した場合にはS25に進み、定常的な変化パターンではないと判断した場合にはS26に進む。ここで、定常的な変化パターンとは、各周期において同様のパターンで変化するものを示す。このように、定常的な変化パターンは、各周期内において時系列データの値に変化があるパターンであり、各周期間において固定的な同様のパターンであることから、固定の変化パターンとも称する。S25でCPU41aは、所定の周期で動作するデバイスと分類し、処理を終了する。なお、所定の周期で動作するデバイスには、上述したように、装置の動作サイクルに同期して動作するデバイス(1201)と、装置の動作サイクル以外の周期に同期して動作するデバイス(1202)とがあり、CPU41aは、それぞれへの分類を行う。一方、S26でCPU41aは、不定期で動作するデバイス(1204)に分類し、処理を終了する。 In S24, when there is a change in the value of the time series data, the CPU 41a determines whether the change is a steady change pattern in each cycle. If it is determined that the change pattern is steady, the process proceeds to S25, and if it is determined that the pattern is not a steady change pattern, the process proceeds to S26. Here, the steady change pattern means a pattern that changes in the same pattern in each cycle. As described above, the steady change pattern is a pattern in which the value of the time series data changes within each cycle, and is a similar pattern that is fixed between each cycle. Therefore, it is also referred to as a fixed change pattern. In S25, the CPU 41a classifies the device as a device that operates at a predetermined cycle, and ends the process. As described above, the devices that operate in a predetermined cycle include a device that operates in synchronization with the operation cycle of the device (1201) and a device that operates in synchronization with a cycle other than the operation cycle of the device (1202). The CPU 41a classifies each of them. On the other hand, in S26, the CPU 41a classifies the device (1204) that operates irregularly and ends the process.

なお、CPU41aは、特定のデバイスに関する時系列データの値の変化に基づいて、装置の動作サイクルや装置の動作サイクル以外の周期を特定してもよい。たとえば、特定のデバイスのデバイス値は、装置の各動作サイクル内で一つのパルスを有し、各動作サイクルの開始タイミングを規定する変化点を有する時系列データとして収集される。つまり、特定のデバイスの値は、装置の動作サイクルと同期して変化するもので、その変化点は動作サイクルを規定するものである。このような特定のデバイスは、オペレータの選択により設定されてもよい。同様にして、動作サイクル以外の周期を規定するデバイスも、オペレータの選択により設定されてもよい。もちろん、収集した時系列データから当該デバイスの動作サイクルを自動的に特定するようにしてもよいし、特定後においてオペレータにより調整可能にしてもよい。これによりオペレータをより支援することができ、経験の浅いオペレータに対しても使い勝手の良い操作体系を提供することができる。また、動作サイクル以外の周期で動作するデバイスは、動作サイクルを基準とすると不定期で動作するデバイスと定義してもよく、たとえば、動作サイクル以外の周期を規定するデバイスを設定しない場合、CPU41aは、動作サイクル以外の周期で動作するデバイスを不定期で動作するデバイス(1204)に分類する。 The CPU 41a may specify a cycle other than the operation cycle of the device and the operation cycle of the device based on the change in the value of the time series data related to the specific device. For example, the device value of a particular device is collected as time series data that has one pulse within each operation cycle of the device and has a change point that defines the start timing of each operation cycle. That is, the value of a specific device changes in synchronization with the operation cycle of the device, and the change point defines the operation cycle. Such a specific device may be set by the operator's choice. Similarly, a device that defines a cycle other than the operation cycle may be set by the operator's choice. Of course, the operation cycle of the device may be automatically specified from the collected time-series data, or may be adjusted by the operator after the specification. As a result, the operator can be further supported, and an easy-to-use operation system can be provided even to an inexperienced operator. Further, a device that operates in a cycle other than the operation cycle may be defined as a device that operates irregularly based on the operation cycle. For example, if a device that defines a cycle other than the operation cycle is not set, the CPU 41a , Devices that operate in cycles other than the operation cycle are classified into devices that operate irregularly (1204).

一方、S21でビットデバイスでないと判断されると、図13Bに示すS27に進み、CPU41aは、分類対象の時系列データにおいて所定値以上の変化があるか否かを判断する。ここでは、変化している信号の極値が所定値以上であるか否かを判断する。変化がある場合はS28に進み、そうでない場合はS212に進む。 On the other hand, if it is determined in S21 that the device is not a bit device, the process proceeds to S27 shown in FIG. 13B, and the CPU 41a determines whether or not there is a change of a predetermined value or more in the time series data to be classified. Here, it is determined whether or not the extreme value of the changing signal is equal to or greater than a predetermined value. If there is a change, the process proceeds to S28, and if not, the process proceeds to S212.

S28でCPU41aは、所定の周期で変化しているか否かを判断し、所定の周期で変化していなければS29に進み、変化していればS210に進む。S210でCPU41aは、変化している値が単調増加又は単調減少しているか否かを判断する。単調増加又は単調減少していればS211に進み、そうでなければS29に進む。 In S28, the CPU 41a determines whether or not it has changed in a predetermined cycle, and if it has not changed in a predetermined cycle, proceeds to S29, and if it has changed, proceeds to S210. In S210, the CPU 41a determines whether or not the changing value is monotonically increasing or monotonically decreasing. If it is monotonically increasing or monotonously decreasing, the process proceeds to S211. If not, the process proceeds to S29.

S29でCPU41aは、アナログ値のデバイス(1205)に分類し、処理を終了する。アナログ値のデバイスにおいては種々の類型が存在し、分類対象のデバイスの種別に応じてそれぞれ個別の対応が行われる。一方、S211でCPU41aは、単調増加又は単調減少のデバイス(1206)であると分類し、処理を終了する。また、S212でCPU41aは、その他のデバイスであると分類し、処理を終了する。その他のデバイスであると判断した場合には当該分類対象の時系列データの特徴が抽出できないものであり、正常時の特徴のある動作を特定できないため、異常デバイスを特定する際には用いない。 In S29, the CPU 41a classifies the device into an analog value device (1205) and ends the process. There are various types of analog value devices, and individual measures are taken according to the type of device to be classified. On the other hand, in S211 the CPU 41a classifies the device as a monotonically increasing or monotonically decreasing device (1206), and ends the process. Further, in S212, the CPU 41a classifies the device as another device and ends the process. If it is determined that the device is another device, the characteristics of the time-series data to be classified cannot be extracted, and the characteristic operation during normal operation cannot be specified. Therefore, it is not used when identifying an abnormal device.

以上のように、CPU41aは、分類対象の時系列データに基づいて、分類対象のデバイスを自動的に分類するが、これに加え、分類対象のデバイスに対する類型の設定をオペレータから受け付けるようにしてもよい。CPU41aは、オペレータの指定に応じて、分類対象のデバイスに対する類型の設定を受け付ける。そして、CPU41aは、分類された類型を示すフラグ情報を当該分類対象のデバイスを示す識別情報に紐づけて格納する。分類対象のデバイスに対する類型の設定は、CPU41aによる分類前に実行されてもよい。たとえば、複数の分類対象のデバイスのうち特定のデバイスについて、オペレータの指定に基づいて類型の設定が実行された場合、CPU41aは、予め類型が設定されたデバイスに対して、分類対象の時系列データに基づく分類を実行しなくてもよい。一方、CPU41aは、複数の分類対象のデバイスのうちオペレータの指定が行われなかった他のデバイスに対して、分類対象の時系列データに基づく分類を実行してもよい。特に、前回までの学習によってデバイスの類型が決定していて、さらに追加の学習を実施する場合には、オペレータの指定に基づいて前回までの学習によってデバイスの類型に固定してもよく、変更が必要なデバイスについてはオペレータの指定に基づいて前回までの学習によってデバイスの類型と異なる類型を決定してもよい。たとえば、異常デバイスを特定する際に使用されない類型を決定してもよい。 As described above, the CPU 41a automatically classifies the devices to be classified based on the time-series data to be classified, but in addition to this, the CPU 41a may accept the type setting for the devices to be classified from the operator. good. The CPU 41a accepts the type setting for the device to be classified according to the operator's designation. Then, the CPU 41a stores the flag information indicating the classified type in association with the identification information indicating the device to be classified. The type setting for the device to be classified may be executed before the classification by the CPU 41a. For example, when the type setting is executed for a specific device among a plurality of classification target devices based on the operator's specification, the CPU 41a sets the time series data of the classification target for the device for which the type is set in advance. It is not necessary to perform the classification based on. On the other hand, the CPU 41a may execute classification based on the time-series data of the classification target for the other devices for which the operator is not specified among the plurality of devices to be classified. In particular, when the device type is determined by the previous learning and additional learning is performed, the device type may be fixed by the previous learning based on the operator's specification, and the change may be made. For the required device, a type different from the device type may be determined by learning up to the previous time based on the operator's specification. For example, a type that is not used in identifying anomalous devices may be determined.

また、分類対象のデバイスに対する類型の設定は、CPU41aによる分類後に実行されてもよい。たとえば、複数の分類対象デバイスについて、CPU41aは、分類対象の時系列データに基づいて、分類対象のデバイスを自動的に分類する。その後、CPU41aは、オペレータの指定により類型の設定がされたデバイスについて、自動的に分類した類型を、オペレータの指定に応じて分類対象のデバイスに対して設定された類型に更新してもよい。これにより、自動分類するために使用する時系列データの期間が短い場合や期間に偏りがある場合であっても、オペレータによる既知の情報と組み合わせることで、分類対象のデバイスについて、効率よく所望の分類に近づけることができる。 Further, the type setting for the device to be classified may be executed after the classification by the CPU 41a. For example, for a plurality of classification target devices, the CPU 41a automatically classifies the classification target devices based on the classification target time series data. After that, the CPU 41a may update the type automatically classified for the device whose type is set by the operator's designation to the type set for the device to be classified according to the operator's designation. As a result, even if the period of the time series data used for automatic classification is short or the period is biased, by combining it with the information known by the operator, the device to be classified can be efficiently desired. You can get closer to the classification.

<学習フェーズ>
図15は、収集された時系列データを分析して各デバイスの特徴に基づいて分類し、検知アルゴリズムを決定する際の処理手順を示す。以下で説明する処理は、拡張ユニット4aのCPU41aによって実現される。しかし、本発明を限定する意図はなく、それらの処理の一部が基本ユニット3や他の拡張ユニット4bで実行されてもよいし、或いはプログラマブルロジックコントローラに通信可能に接続された外部装置(分析装置)によって実行されてもよい。
<Learning phase>
FIG. 15 shows a processing procedure for analyzing the collected time series data, classifying it based on the characteristics of each device, and determining the detection algorithm. The processing described below is realized by the CPU 41a of the expansion unit 4a. However, there is no intention of limiting the present invention, and a part of those processes may be executed by the basic unit 3 or another expansion unit 4b, or an external device (analysis) communicably connected to the programmable logic controller. It may be executed by the device).

学習フェーズ開始のタイミングとしては、例えば前回の学習処理から所定期間が経過したタイミングや所定量の時系列データが収集されたタイミング、ユーザからの指示を受け付けた場合である。学習フェーズが開始されると、CPU41a(収集部52c)は設定された収集設定に従って、収集対象となるデバイスの時系列データを収集する(S2)。 The timing of starting the learning phase is, for example, the timing when a predetermined period has elapsed from the previous learning process, the timing when a predetermined amount of time series data is collected, and the case where an instruction from the user is received. When the learning phase is started, the CPU 41a (collection unit 52c) collects time-series data of the device to be collected according to the set collection setting (S2).

S31でCPU41aは、分類処理を実行する。分類処理は、例えば、所定量の収集データが基本ユニット3のメモリカード44に格納された場合に、基本ユニット3からの指示に応じて拡張ユニット4aで行われる。基本ユニット3は、メモリカード44に所定量の収集データが保存されたことを検知して、拡張ユニットに対して分類開始の指示を送ってもよい。また、学習するのに十分なデータ量(所定数のスキャン周期の時系列データ)がバッファメモリやメモリカードなどの記憶部に蓄積されたことを拡張ユニットが検知して開始してもよい。分類処理の詳細については図13A及び図13Bを用いて既に説明しているため、ここでは割愛する。 In S31, the CPU 41a executes the classification process. The classification process is performed in the expansion unit 4a in response to an instruction from the basic unit 3, for example, when a predetermined amount of collected data is stored in the memory card 44 of the basic unit 3. The basic unit 3 may detect that a predetermined amount of collected data has been stored in the memory card 44 and send an instruction to start classification to the expansion unit. Further, the expansion unit may start by detecting that a sufficient amount of data for learning (time-series data of a predetermined number of scan cycles) has been accumulated in a storage unit such as a buffer memory or a memory card. Since the details of the classification process have already been described with reference to FIGS. 13A and 13B, they are omitted here.

続いて、S32でCPU41aは、S31で分類された時系列データに従って、異常デバイスを特定する際のパラメータを決定し、処理を終了する。ここでの処理は分類された類型ごとに行われ、時系列データに対応するデバイスの類型とパラメータとが関連付けて記憶される。また、既に決定されたパラメータが存在する場合には、既に決定されたパラメータに代えて今回決定したパラメータに更新するか、或いは、既に決定されたパラメータと今回決定したパラメータとを用いて新たなパラメータを算出し更新してもよい。算出方法については平均値など様々な手法が適用され得るが、それぞれの時系列データに適した手法が選択される。また、これら決定されたパラメータについては、オペレータによって変更可能としてもよい。これにより、学習期間が短い場合に極端なパラメータが決定されたとしても調整可能とすることができる。 Subsequently, in S32, the CPU 41a determines a parameter for identifying an abnormal device according to the time-series data classified in S31, and ends the process. The processing here is performed for each classified type, and the device type corresponding to the time series data and the parameter are stored in association with each other. If a parameter that has already been determined exists, the parameter that has already been determined is replaced with the parameter that has been determined this time, or a new parameter is used using the parameter that has already been determined and the parameter that has been determined this time. May be calculated and updated. Various methods such as an average value can be applied to the calculation method, but a method suitable for each time series data is selected. Further, these determined parameters may be changed by the operator. As a result, even if an extreme parameter is determined when the learning period is short, it can be adjusted.

ここで、S32で決定されるパラメータについて説明する。図12の1201、1202の類型(所定の周期に同期して値が定常的なパターンで変化するデバイス)については、CPU41aは、例えば装置の動作サイクル内の波形の変化パターンから、装置の動作サイクルごとの波形の任意の変化点間の時間を算出し、当該変化点間の時間の分布に基づき、変化点間の時間のしきい値を、パラメータとして決定する。さらに、この場合のパラメータには、正常時の時系列データのデバイス値が変化するタイミングを含んでもよい。また、上記パラメータである変化点間の時間のしきい値は、学習時のばらつきから、例えば標準偏差と平均値を計算し、平均値+3×標準偏差を上限のしきい値とし、平均値−3×標準偏差を下限のしきい値として決定してもよい。また、1203の類型(一定の値をとるデバイス)については、CPU41aは、当該一定値をパラメータとする。このように、所定の周期に同期して値が定常的なパターンで変化するデバイスについては、変化点間の時間間隔や、変化点のタイミング、これらに関わるしきい値がパラメータとして用いられる。 Here, the parameters determined in S32 will be described. Regarding the types 1201 and 1202 in FIG. 12 (devices whose values change in a steady pattern in synchronization with a predetermined cycle), the CPU 41a determines, for example, the operation cycle of the device from the change pattern of the waveform in the operation cycle of the device. The time between arbitrary change points of each waveform is calculated, and the threshold value of the time between change points is determined as a parameter based on the time distribution between the change points. Further, the parameter in this case may include the timing at which the device value of the time series data in the normal state changes. For the time threshold between the change points, which is the above parameter, for example, the standard deviation and the average value are calculated from the variation during learning, and the average value + 3 × standard deviation is set as the upper limit threshold value, and the average value- 3 × standard deviation may be determined as the lower limit threshold. Further, for the 1203 type (device that takes a constant value), the CPU 41a uses the constant value as a parameter. As described above, for a device whose value changes in a steady pattern in synchronization with a predetermined period, the time interval between the change points, the timing of the change points, and the threshold value related to these are used as parameters.

1205の類型(アナログ値)については、例えば学習時の時系列データの値と、学習時の時系列データとの距離に関するしきい値とをパラメータとしてもよい。距離の算出方法は、例えば、点ごとの差の和を求める方法でもよい。この場合、推定時には、学習時の時系列データと、推定時の時系列データとの距離を計算し、当該距離がしきい値の範囲内かを判定する。また、1206の類型(単調増加、単調減少)については、例えば正常時における単調増加する際の増加値や、単調減少する際の減少値がパラメータとして決定される。 For the 1205 type (analog value), for example, the value of the time-series data at the time of learning and the threshold value regarding the distance between the time-series data at the time of learning may be used as parameters. The distance calculation method may be, for example, a method of obtaining the sum of the differences for each point. In this case, at the time of estimation, the distance between the time-series data at the time of learning and the time-series data at the time of estimation is calculated, and it is determined whether the distance is within the threshold range. Further, for the 1206 types (monotonic increase, monotonous decrease), for example, an increase value when the monotonous increase occurs in a normal state and a decrease value when the monotonous decrease occurs are determined as parameters.

このように、本実施形態によれば、各デバイスの時系列データの周期性に関する特徴に基づいて、各デバイスを予め定められた複数の類型のいずれかにそれぞれ分類し、さらに、分類されたそれぞれの類型に適切な異常(いつもと違う変化)の検知アルゴリズムを適用する。つまり、本実施形態では、学習フェーズにおいて、正常時(学習時)の時系列データからデバイスを予め定められた複数の類型のいずれかに分類する。さらに、それぞれの類型に応じて検知アルゴリズムを決定するとともに、それぞれの検知アルゴリズムに応じた評価変数やパラメータを設定する。一方、推定フェーズにおいては、学習フェーズにおいて検知アルゴリズムが決定された各デバイスについて、決定された推定対象のデバイスの類型に従い、当該類型に応じて決まる検知アルゴリズムをデバイスの時系列データに適用する。このように、学習フェーズにおいて決定されたデバイスの類型や、デバイスの類型に対応し、異常デバイスの検知アルゴリズムを用いてデバイスの時系列データを分析することによって、異常デバイスを特定する。なお、学習時において所定の類型に分類されなかったデバイスについては、評価変数やパタメータも設定されないため、推定時においては収集対象とされないことが望ましい。つまり、このようなデータを収集したとしても異常デバイスであるか否かを特定するための検知アルゴリズムが設定されていないため、処理負荷やメモリ資源の消費を無駄に増大させることとなり、これを予防するためである。 As described above, according to the present embodiment, each device is classified into one of a plurality of predetermined types based on the characteristics of the periodicity of the time series data of each device, and each of the classified devices is further classified. Apply an appropriate anomaly (unusual change) detection algorithm to the type of. That is, in the present embodiment, in the learning phase, the device is classified into one of a plurality of predetermined types from the time series data at the normal time (learning time). Furthermore, the detection algorithm is determined according to each type, and the evaluation variables and parameters corresponding to each detection algorithm are set. On the other hand, in the estimation phase, for each device for which the detection algorithm is determined in the learning phase, the detection algorithm determined according to the type is applied to the time series data of the device according to the type of the determined device to be estimated. In this way, the abnormal device is identified by analyzing the time-series data of the device using the device type and the device type determined in the learning phase and using the abnormality device detection algorithm. For devices that are not classified into a predetermined type at the time of learning, evaluation variables and parameters are not set, so it is desirable that they are not collected at the time of estimation. In other words, even if such data is collected, the detection algorithm for identifying whether or not it is an abnormal device is not set, so the processing load and memory resource consumption will be unnecessarily increased, which is prevented. To do.

<推定フェーズ>
図16は、異常デバイスを特定する際の処理手順を示すフローチャートである。以下で説明する処理は、基本ユニット3のCPU31及び拡張ユニット4aのCPU41aによって実現される。しかし、本発明を限定する意図はなく、それらの処理の一部が基本ユニット3や拡張ユニット4a、4bなどの他のユニットで実行されてもよいし、或いはプログラマブルロジックコントローラに通信可能に接続された外部装置(分析装置)によって実行されてもよい。ここでは、一連の処理として、デバイス値を取得して保存条件が成立するとバッファメモリからメモリカード44に保存して特定処理を実行する処理を一連の処理として説明する。従って、デバイス値を取得してメモリカード44に保存する基本ユニット3の処理と基本ユニット3によってメモリカード44に保存されたデバイス値を取得して特定処理を実行する拡張ユニット4aの処理を一連の処理で示す。つまり、保存条件が成立してデバイス値を保存する処理(下記S41乃至S46)については、基本ユニット3のCPU31(収集部52a)で行い、メモリカード44に保存されたデバイス値を用いて異常を特定する処理(S47及びS48)が拡張ユニット4aのCPU41aで実行される。もちろん、S41乃至S48の処理又はその一部については他のユニットで実行するようにしてもよい。
<Estimation phase>
FIG. 16 is a flowchart showing a processing procedure when identifying an abnormal device. The processing described below is realized by the CPU 31 of the basic unit 3 and the CPU 41a of the expansion unit 4a. However, there is no intention of limiting the present invention, and a part of those processes may be executed by other units such as the basic unit 3 and the expansion units 4a and 4b, or may be communicably connected to the programmable logic controller. It may be executed by an external device (analyzer). Here, as a series of processes, when the device value is acquired and the storage condition is satisfied, the process of saving the device value from the buffer memory to the memory card 44 and executing the specific process will be described as a series of processes. Therefore, a series of processes of the basic unit 3 that acquires the device value and saves it in the memory card 44 and the process of the expansion unit 4a that acquires the device value stored in the memory card 44 by the basic unit 3 and executes the specific process are performed. Shown in processing. That is, the process of saving the device value when the save condition is satisfied (S41 to S46 below) is performed by the CPU 31 (collection unit 52a) of the basic unit 3, and the device value saved in the memory card 44 is used to cause an abnormality. The specifying process (S47 and S48) is executed by the CPU 41a of the expansion unit 4a. Of course, the processing of S41 to S48 or a part thereof may be executed by another unit.

ここで、基本ユニット3のバッファメモリ(第一バッファ37a)に保存されているデバイス値をメモリカード44へ記憶させるための保存条件について説明する。例えば、保存条件とは、PLCに異常が発生した場合や、ユーザにより予め保存トリガとなるデバイスを指定しておき、当該デバイスのデバイス値に所定の変化があった場合、ユーザによる分析命令があった場合、定期的に監視する監視周期が経過した場合、基本ユニット3に接続される拡張ユニットから分析命令が発せられた場合などに満たされる条件である。これらの保存条件は、ユーザにより設定され、プロジェクトデータとして転送され記憶されているものや、PLCの動作中にユーザにより入力されるもの、拡張ユニット4から生成される情報に基づくものなどがある。 Here, the storage conditions for storing the device values stored in the buffer memory (first buffer 37a) of the basic unit 3 in the memory card 44 will be described. For example, the storage condition includes an analysis command by the user when an abnormality occurs in the PLC or when a device to be a storage trigger is specified in advance by the user and a predetermined change is made in the device value of the device. In this case, the conditions are satisfied when the monitoring cycle for periodic monitoring has elapsed, or when an analysis command is issued from the expansion unit connected to the basic unit 3. These storage conditions are set by the user, transferred and stored as project data, input by the user during the operation of the PLC, and based on the information generated from the expansion unit 4.

S41でCPU31は、収集条件が成立したか否かを判断する。収集条件とは、例えば予め定められた収集周期が経過したタイミングや各スキャンのエンド処理のタイミングで満足される条件である。 In S41, the CPU 31 determines whether or not the collection condition is satisfied. The collection condition is, for example, a condition that is satisfied at the timing when a predetermined collection cycle elapses or the timing of the end processing of each scan.

S42で基本ユニット3のCPU31は、図11の上記S4で収集されたデバイス値を取得して、S43で、取得したデバイス値が第一バッファ37aに前回保存されたデバイス値と同じ値であるか否かを判断する。同じ値であれば、次のデバイス値の処理に移るため、処理をS41に戻す。一方、前回格納されたデバイス値と異なる場合にはS44に進む。 In S42, the CPU 31 of the basic unit 3 acquires the device value collected in S4 of FIG. 11, and in S43, is the acquired device value the same as the device value previously saved in the first buffer 37a? Judge whether or not. If the values are the same, the process is returned to S41 in order to move to the process of the next device value. On the other hand, if the device value is different from the previously stored device value, the process proceeds to S44.

S44でCPU31は、取得したデバイス値を第一バッファ37aに保存し、S45に進む。このように、収集部52aは、収集設定36aによって設定された収集周期(例えば、スキャン周期)ごとにデバイス値(及び、時刻情報)を取得して、第一バッファ37aに格納する。なお、第一バッファ37aにはリングバッファが採用されることが望ましい。これは、メモリ資源を考慮して、第一バッファ37aに記憶されている全てのデータがログデータ(収集データ)として収集されるわけではないからである。 In S44, the CPU 31 saves the acquired device value in the first buffer 37a and proceeds to S45. In this way, the collection unit 52a acquires the device value (and time information) for each collection cycle (for example, scan cycle) set by the collection setting 36a and stores it in the first buffer 37a. It is desirable that a ring buffer is adopted as the first buffer 37a. This is because not all the data stored in the first buffer 37a is collected as log data (collected data) in consideration of the memory resource.

S45でCPU31は、第一バッファ37aに格納されたデバイス値を基本ユニット3のメモリカード44に保存する保存条件が成立したか否かを判断する。ここでの保存条件は、例えばプログラマブルロジックコントローラの運用中に異常が発生した異常時に成立するように設定される。なお、上述したように、PLCの異常時以外にも保存条件が成立するように設定し、デバイス値が異常かどうかを特定する処理を実行してもよい。つまり、「デバイス値の異常」とは、必ずしもPLCの異常を示すものではなく、単にいつものデバイス値と違う値を示すものであってもよい。従って、PLCの異常時以外にも、保存条件が成立する例としては、いつもと違うデバイス値が発生したタイミングや、ユーザからの監視指示を受け付けたタイミング、ユーザからの監視指示を受け付けた後、さらに所定の実行周期経過後、又は定期的に異常を判定するための指定されたタイミングなどが想定されうる。これらの詳細な説明については第2及び第3の実施形態で後述する。なお、第1乃至第3の実施形態で説明する機能は、少なくとも1つが設けられるようにすることができる。 In S45, the CPU 31 determines whether or not the storage condition for storing the device value stored in the first buffer 37a in the memory card 44 of the basic unit 3 is satisfied. The storage conditions here are set so as to be satisfied when an abnormality occurs during the operation of the programmable logic controller, for example. As described above, the storage condition may be set so as to be satisfied even when the PLC is abnormal, and a process for identifying whether or not the device value is abnormal may be executed. That is, the “device value abnormality” does not necessarily indicate an abnormality in the PLC, but may simply indicate a value different from the usual device value. Therefore, other than when the PLC is abnormal, examples of the storage conditions being satisfied include the timing when a device value different from usual occurs, the timing when a monitoring instruction from the user is received, and after receiving the monitoring instruction from the user. Further, it is possible to assume a designated timing for determining an abnormality after a predetermined execution cycle has elapsed or periodically. These detailed explanations will be described later in the second and third embodiments. It should be noted that at least one of the functions described in the first to third embodiments can be provided.

保存条件が成立すると、S46で基本ユニット3のCPU31は、異常デバイスを特定すべく推定対象の時系列データを基本ユニット3の第一バッファ37aから取得し、メモリカード44に保存する。推定対象のデータは、デフォルトでは全デバイスのデータとし、オペレータの指定に応じて選択されてもよいし、異常の種類に応じて選択されてもよい。また、これらの時系列データについては、異常発生時の所定期間前から、異常発生時の所定時間経過後までの間の時系列データを含むようにしてもよい。或いは、異常発生後から所定期間内のデータとしてもよい。 When the storage condition is satisfied, the CPU 31 of the basic unit 3 in S46 acquires the time-series data to be estimated from the first buffer 37a of the basic unit 3 in order to identify the abnormal device, and stores it in the memory card 44. The data to be estimated is the data of all devices by default, and may be selected according to the operator's specification or may be selected according to the type of abnormality. Further, these time-series data may include time-series data from before a predetermined period when an abnormality occurs to after a predetermined time elapses when an abnormality occurs. Alternatively, the data may be data within a predetermined period after the occurrence of the abnormality.

次に、S47で拡張ユニット4aのCPU41aは、S46でメモリカード44に保存された時系列データについてそれぞれ、学習時に決定された当該時系列データに対応するデバイスの類型に基づいて、それぞれの類型に最適な検知手法と、検知手法に応じた評価変数やパラメータを用いて異常デバイスを特定する。上述したように、本実施形態によれば、学習時にデバイス値の変化の特徴を抽出して各デバイス値を予め定められた類型に分類し、分類されたデバイスそれぞれの類型に適切な異常(いつもと違う変化)の検知手法を適用する。つまり、本実施形態では、学習フェーズにおいて、正常時の時系列データからデバイス値を分類し、それぞれの類型に応じて検知手法を決定するとともに、それぞれの検知手法に応じた評価変数やパラメータを設定する。一方、推定フェーズの上記S47においては、学習フェーズにおいて分類された各デバイスの類型に応じて決まる検知アルゴリズムである評価変数及びパラメータを当該デバイスの時系列データに適用して分析することによって、異常を特定する。なお、時系列データの類型については、上述したように、分類時においては、類型のフラグ情報と、当該時系列データに対応するデバイスの識別情報とが紐づけて格納されている。従って、S47ではCPU41aは、推定対象の時系列データの取得先であるデバイスの識別情報から対応する類型を判別し、当該類型に応じた検知アルゴリズムである評価変数やパラメータを用いて異常デバイスを特定する。判定手法については、それぞれのパラメータに応じて上述した方法により行う。 Next, in S47, the CPU 41a of the expansion unit 4a sets the time-series data stored in the memory card 44 in S46 into each type based on the type of the device corresponding to the time-series data determined at the time of learning. The abnormal device is identified by using the optimum detection method and the evaluation variables and parameters according to the detection method. As described above, according to the present embodiment, the characteristics of changes in device values are extracted during learning, each device value is classified into a predetermined type, and an abnormality appropriate for each type of the classified device (always). (Changes different from) are applied. That is, in the present embodiment, in the learning phase, the device values are classified from the time series data at the normal time, the detection method is determined according to each type, and the evaluation variables and parameters are set according to each detection method. do. On the other hand, in S47 of the estimation phase, an abnormality is detected by applying evaluation variables and parameters, which are detection algorithms determined according to the type of each device classified in the learning phase, to the time series data of the device. Identify. As for the type of time series data, as described above, at the time of classification, the flag information of the type and the identification information of the device corresponding to the time series data are stored in association with each other. Therefore, in S47, the CPU 41a determines the corresponding type from the identification information of the device from which the time series data to be estimated is acquired, and identifies the abnormal device by using the evaluation variable or parameter which is the detection algorithm according to the type. do. The determination method is performed by the method described above according to each parameter.

ここで、図17を参照して、異常デバイスとして特定する際の判定手法について説明する。1701、1702は、1201、1202の類型(所定の周期に同期して値が定常的なパターンで変化するデバイス)における異常デバイスのデータを示す。1711、1712が異常箇所を示す。このように、正常時と比較して、変化するはずの信号が変化しない場合や変化点がずれた場合、パルス幅が異なる場合などが発生したデバイスが存在すると当該デバイスを異常デバイスと特定することができる。CPU41aは、決定された検知アルゴリズムを用いることによって、正常時の変化から異なるデータを判別することができる。また、1703は、1203の類型(一定の値をとるデバイス)における異常デバイスのデータを示す。1713に示すように、一定値をとるはずの信号が変化しているため、異常デバイスと特定することができる。 Here, with reference to FIG. 17, a determination method for identifying the device as an abnormal device will be described. 1701 and 1702 show data of abnormal devices in the types 1201 and 1202 (devices whose values change in a steady pattern in synchronization with a predetermined period). 1711 and 1712 indicate abnormal locations. In this way, if there is a device in which the signal that should change does not change, the change point shifts, or the pulse width differs compared to the normal state, the device is identified as an abnormal device. Can be done. The CPU 41a can discriminate different data from the change in the normal state by using the determined detection algorithm. Further, 1703 shows the data of the abnormal device in the 1203 type (device that takes a constant value). As shown in 1713, since the signal that should take a constant value is changing, it can be identified as an abnormal device.

1704は、1201、1202の類型(所定の周期に同期して値が定常的なパターンで変化するデバイス)など、同じ類型に分類された2つのデバイスの時系列データを用いて異常デバイスを特定するアルゴリズムを示す。当該アルゴリズムにおいて、所定周期に同期して変化するデバイスにおいて、2つのデバイスのそれぞれの値の変化点の時間間隔をチェックする。例えば、一方のデバイスでは1周期において2つの変化点(a1、a2)があり、他方のデバイスでは1周期において4つの変化点(b1、b2、b3、b4)があるとする。この場合において、各変化点の時間差がしきい値以内の値であるか否かを判定してもよい。詳細には、変化点a1と変化点b1〜b4それぞれとの時間差と、変化点a2と変化点b1〜b4のそれぞれとの時間差をそれぞれのしきい値と判定することにより異常デバイスかどうかを判断してもよい。この場合のパラメータは、変化点間の時間差それぞれのしきい値と、各変化点のタイミングと、各変化点のタイミングのしきい値となる。なお、この判定手法を利用して異常デバイスを特定する場合、2つのデバイスが異常デバイスとして特定される。 The 1704 identifies an abnormal device using time-series data of two devices classified into the same type, such as the types 1201 and 1202 (devices whose values change in a steady pattern in synchronization with a predetermined period). The algorithm is shown. In the algorithm, in a device that changes in synchronization with a predetermined cycle, the time interval of the change point of each value of the two devices is checked. For example, suppose that one device has two change points (a1, a2) in one cycle and the other device has four change points (b1, b2, b3, b4) in one cycle. In this case, it may be determined whether or not the time difference at each change point is within the threshold value. Specifically, it is determined whether or not the device is an abnormal device by determining the time difference between the change point a1 and each of the change points b1 to b4 and the time difference between the change point a2 and each of the change points b1 to b4 as the respective threshold values. You may. The parameters in this case are the threshold value of each time difference between the change points, the timing of each change point, and the threshold value of the timing of each change point. When identifying an abnormal device using this determination method, two devices are identified as abnormal devices.

図16の説明に戻る。次に、S49でCPU41aは、S48の特定結果を出力し、処理を終了する。ここでは、まず生成部74が特定結果を表示するための表示データを生成し、当該表示データを基本ユニット3の表示部5や、外部装置に送信してその表示部に表示させる。ここで、表示データに基づく表示画面については図18を用いて後述する。 Returning to the description of FIG. Next, in S49, the CPU 41a outputs the specific result of S48 and ends the process. Here, first, the generation unit 74 generates display data for displaying the specific result, transmits the display data to the display unit 5 of the basic unit 3 or an external device, and displays the display data on the display unit. Here, the display screen based on the display data will be described later with reference to FIG.

図18は、特定結果の表示例を示す。 FIG. 18 shows a display example of a specific result.

画面1800は、横軸に時間を示し、縦軸に異常デバイスの発生数を示す。生成部74は、特定結果に従って異常デバイスとして特定したデバイスと、その際の時系列データとから画面1800の表示データを生成する。プログラマブルロジックコントローラに異常が発生すると、設備が停止し、異常デバイスが増える傾向にある。従って、画面1800のような所定期間ごと(例えば、5分間隔など)の時間間隔ごとに異常デバイス発生数の累計を表示することで、オペレータはいつから異常が発生しているかを容易に認識することができる。 The screen 1800 shows the time on the horizontal axis and the number of abnormal devices on the vertical axis. The generation unit 74 generates the display data of the screen 1800 from the device specified as the abnormal device according to the specific result and the time series data at that time. When an error occurs in the programmable logic controller, the equipment tends to stop and the number of abnormal devices tends to increase. Therefore, by displaying the cumulative number of abnormal devices generated for each time interval (for example, every 5 minutes) such as the screen 1800, the operator can easily recognize when the abnormality has occurred. Can be done.

画面1810は、異常デバイスとして特定された各デバイスの状況を示す表示である。デバイスごとに異常が発生した時刻や異常の内容を表示する。異常の内容としては、異常と判断するに至った情報を表示する。例えば、デバイスAでは、一定値をとるデバイスにおいて、正常時の値が123であったのに対し、値が127に変化したために異常と判断していることが分かる。また、デバイスBでは、所定周期に同期して変化するデバイスにおいて、変化の間隔異常が発生したことを示す。 The screen 1810 is a display showing the status of each device identified as an abnormal device. Displays the time when the error occurred and the details of the error for each device. As the content of the abnormality, the information that has led to the determination of the abnormality is displayed. For example, in the device A, in the device that takes a constant value, the value at the normal time was 123, but the value changed to 127, so that it can be seen that it is determined to be abnormal. Further, in the device B, it is shown that the change interval abnormality has occurred in the device that changes in synchronization with a predetermined cycle.

画面1820は、推定対象のデバイスの異常度を示す表示である。生成部74は、特定結果から、推定されたデバイスについてデバイスの異常度をランキング表示する表示データを生成する。つまり、画面1820では、異常の可能性が高い候補デバイスがデバイス名等で識別可能に表示される。なお、表示については、異常度に加えて、その異常内容や、デバイスの分類を表示してもよい。ここで、異常度とは、例えば発生した異常回数や所定のしきい値との差分の大きさにより決定される。つまり、異常度とは異常の大きさを示すものである。画面1820では、異常度の大きい順に表示している例を示しているが、発生時刻順などの条件でソートして表示してもよい。また、デバイスの分類手法に従ってソートしてもよいし、予めユーザによって選択された分類手法に係る異常の内容のみを表示するようにしてもよい。例えば、異常度は所定のしきい値を用いて以下の式により求めてもよい。
異常度=(現在値−平均値)/(しきい値−平均値)
つまり、現在値に従って次のように定義される。現在値が上限しきい値を上回っている場合は異常度が1以上となる。現在値が上限しきい値と等しい場合は異常度が1となる。現在値が平均値と等しい場合には異常度が0となる。現在値が下限しきい値と等しい場合には異常度が−1となる。現在値が下限しきい値を下回っている場合には−1となる。異常度については絶対値をとるようにしてもよい。また、比較対象の所定値と不一致である場合には一律に異常度1としてもよい。
The screen 1820 is a display showing the degree of abnormality of the device to be estimated. The generation unit 74 generates display data for ranking and displaying the degree of abnormality of the estimated device from the specific result. That is, on the screen 1820, candidate devices having a high possibility of abnormality are displayed so as to be identifiable by the device name or the like. As for the display, in addition to the degree of abnormality, the content of the abnormality and the classification of the device may be displayed. Here, the degree of abnormality is determined, for example, by the number of occurrences of abnormality or the magnitude of the difference from a predetermined threshold value. In other words, the degree of abnormality indicates the magnitude of the abnormality. Although the screen 1820 shows an example of displaying in descending order of the degree of abnormality, it may be sorted and displayed according to conditions such as the order of occurrence time. Further, the device may be sorted according to the classification method of the device, or only the content of the abnormality related to the classification method selected by the user in advance may be displayed. For example, the degree of abnormality may be calculated by the following formula using a predetermined threshold value.
Abnormality = (current value-average value) / (threshold value-average value)
That is, it is defined as follows according to the current value. If the current value exceeds the upper limit threshold value, the degree of abnormality is 1 or more. If the current value is equal to the upper limit threshold value, the degree of abnormality is 1. If the current value is equal to the average value, the degree of abnormality is 0. When the current value is equal to the lower limit threshold value, the degree of abnormality becomes -1. If the current value is below the lower threshold, it will be -1. The degree of anomaly may be taken as an absolute value. Further, when the value does not match the predetermined value to be compared, the degree of abnormality may be uniformly set to 1.

画面1830は、正常時と異常時のデバイスの信号を比較可能に表示した例である。画面1830に示すように、異常箇所を強調表示するようにすることが望ましい。図18の例では、異常箇所の信号付近を点線の枠で囲むように表示しているが、当該部分の信号を他の色と異なる色で表示してもよいし、当該部分を点滅表示してもよい。 The screen 1830 is an example in which the signals of the devices in the normal state and the abnormal state are displayed in a comparable manner. As shown on the screen 1830, it is desirable to highlight the abnormal part. In the example of FIG. 18, the vicinity of the signal at the abnormal portion is displayed so as to be surrounded by a dotted line frame, but the signal at the relevant portion may be displayed in a color different from other colors, or the relevant portion may be displayed blinking. You may.

<追加学習>
図21は、追加学習をする際の処理手順を示すフローチャートである。ここで、追加学習とは、図15を用いて説明した学習フェーズにおける学習とは異なるタイミングで、かつ追加的に行う学習処理である。そのタイミングについては、種々のタイミングが想定されるが、後述するように、推定フェーズにおいて所定のデバイスが正常であるにも関わらず異常と特定 された場合や、オペレータから指定されたタイミング、システムの経時変化に対応するための定期的なタイミングなどである。つまり、追加学習とは、S32で決定した異常デバイスを特定するためのパラメータ等の学習モデルを更新する必要のあるタイミングにおいて追加的に実施される学習である。以下で説明する処理は、拡張ユニット4aのCPU41aによって実現される。しかし、本発明を限定する意図はなく、それらの処理の一部が基本ユニット3や他の拡張ユニット4bで実行されてもよいし、或いはプログラマブルロジックコントローラに通信可能に接続された外部装置(分析装置)によって実行されてもよい。
<Additional learning>
FIG. 21 is a flowchart showing a processing procedure when performing additional learning. Here, the additional learning is a learning process that is additionally performed at a timing different from the learning in the learning phase described with reference to FIG. Various timings are assumed, but as will be described later, when a predetermined device is identified as abnormal even though it is normal in the estimation phase, or when the timing specified by the operator and the system It is a regular timing to respond to changes over time. That is, the additional learning is learning that is additionally performed at the timing when it is necessary to update the learning model such as the parameters for identifying the abnormal device determined in S32. The processing described below is realized by the CPU 41a of the expansion unit 4a. However, there is no intention of limiting the present invention, and a part of those processes may be executed by the basic unit 3 or another expansion unit 4b, or an external device (analysis) communicably connected to the programmable logic controller. It may be executed by the device).

S201でCPU41a(収集部52c)は設定された収集設定に従って、装置が正常動作している時の収集対象となるデバイスの時系列データを収集する。収集対象のデバイスには、推定フェーズにおいて判定対象となる複数のデバイスが含まれる。また、推定フェーズにおいて判定対象とならないデバイスは収集対象のデバイスから除外されてもよい。たとえば、不定期で動作するデバイス(1204)に分類されたデバイスは、収集対象のデバイスから除外されてもよい。 In S201, the CPU 41a (collection unit 52c) collects time-series data of the device to be collected when the device is operating normally according to the set collection setting. The device to be collected includes a plurality of devices to be determined in the estimation phase. In addition, devices that are not subject to determination in the estimation phase may be excluded from devices to be collected. For example, a device classified as a device (1204) that operates irregularly may be excluded from the devices to be collected.

ここで装置が正常動作している時の収集対象となるデバイスの時系列データとは、推定フェーズにおける判定結果が正常と判断するべきであるにもかかわらず異常と判断してしまうデバイスの時系列データである。たとえば学習フェーズにおいて学習が不十分であると、推定フェーズにおける判定結果が異常となり得る。したがって、CPU41aは、装置が正常動作しているにもかかわらず、収集対象となる時系列データの判定結果が異常となった場合に追加学習を実施してもよい。また、推定フェーズにおける判定結果が異常となり、異常発生時(いつもと違う状態)の時系列データが収集された場合であっても、その時系列データの中に正常動作している期間に対応する時系列データが含まれている場合には、そのような正常動作している期間に対応する時系列データもまた装置が正常動作している時の収集対象となるデバイスの時系列データに相当する。このとき、正常動作している期間に対応する時系列データに対する判定結果が異常となった場合にはその部分を用いて追加学習をするようにしてもよい。 Here, the time series data of the device to be collected when the device is operating normally is the time series of the device that is judged to be abnormal even though the judgment result in the estimation phase should be judged to be normal. It is data. For example, if learning is insufficient in the learning phase, the determination result in the estimation phase may be abnormal. Therefore, the CPU 41a may perform additional learning when the determination result of the time-series data to be collected becomes abnormal even though the device is operating normally. In addition, even if the judgment result in the estimation phase becomes abnormal and the time series data at the time of the abnormality occurrence (a state different from usual) is collected, the time corresponding to the period during normal operation in the time series data. When series data is included, the time series data corresponding to such a period of normal operation also corresponds to the time series data of the device to be collected when the device is operating normally. At this time, if the determination result for the time-series data corresponding to the period of normal operation becomes abnormal, additional learning may be performed using that portion.

次に、S202でCPU41aは、追加学習の条件を満たされているかを判定する、つまり、追加学習のタイミングが到来したかを判定する。追加学習開始のタイミングとしては、例えば前回の学習処理から所定期間が経過したタイミングや所定量の時系列データが収集されたタイミング、オペレータからの指示を受け付けたタイミングである。また、追加学習開始のタイミングとしては、推定フェーズにおいて装置が正常動作中であると推定している所定のタイミングでもよく、推定フェーズにおいて装置が異常動作したと推定したタイミングでもよい。たとえば、装置の動作がたまに遅くなるが、その動作の遅さは正常範囲である場合や、装置の電源を再投入したときに、エアーの圧力が変わって動作時間が変わった場合(経時変化)など、1回の学習ではなく、時間を空けて更新(追加学習)することが、精度を上げるために有効な場合がある。 Next, in S202, the CPU 41a determines whether the condition for additional learning is satisfied, that is, determines whether the timing for additional learning has arrived. The timing of starting the additional learning is, for example, the timing when a predetermined period has elapsed from the previous learning process, the timing when a predetermined amount of time series data is collected, and the timing when an instruction from the operator is received. Further, the timing of starting additional learning may be a predetermined timing in which the device is estimated to be operating normally in the estimation phase, or may be a timing in which the device is estimated to be operating abnormally in the estimation phase. For example, the device sometimes slows down, but the slowness is within the normal range, or when the air pressure changes and the operating time changes when the device is turned on again (changes over time). For example, it may be effective to update (additional learning) at intervals instead of one learning in order to improve the accuracy.

S311でCPU41aは、収集対象に設定された複数のデバイスについて、各デバイスが推定フェーズにおいて判定対象であるか否かを判定する。CPU41aは、デバイスが判定対象であると判定するとそのデバイスについて追加学習を実施するためステップS312に移行し、デバイスが判定対象でないと判定するとそのデバイスについて追加学習を実施せずにステップS341に移行する。たとえば、CPU41aは、不定期で動作するデバイス(1204)に分類されたデバイスは判定対象でないと判定し、追加学習を実施せずにステップS341に移行する。 In S311 the CPU 41a determines whether or not each of the plurality of devices set as the collection target is the determination target in the estimation phase. When the CPU 41a determines that the device is the determination target, it proceeds to step S312 to perform additional learning for the device, and when it determines that the device is not the determination target, it proceeds to step S341 without performing additional learning for the device. .. For example, the CPU 41a determines that the device classified as the device (1204) that operates irregularly is not the determination target, and proceeds to step S341 without performing additional learning.

S312でCPU41aは、分類処理を実行する。分類処理は、例えば、電源を再投入した後、所定量の収集データが基本ユニット3のメモリカード44に格納された場合に、基本ユニット3からの指示に応じて拡張ユニット4aで行われる。格納された上記所定量の収集データは、追加学習の対象期間に収集された各デバイスの時系列データとなる。基本ユニット3は、メモリカード44に所定量の収集データが保存されたことを検知して、拡張ユニットに対して分類開始の指示を送ってもよい。また、電源を再投入した後、学習するのに十分なデータ量(所定数のスキャン周期の時系列データ)がバッファメモリ(第一バッファ37a)やメモリカード44などの記憶部に蓄積されたことを拡張ユニット4aが検知して開始してもよい。 In S312, the CPU 41a executes the classification process. The classification process is performed in the expansion unit 4a in response to an instruction from the basic unit 3, for example, when a predetermined amount of collected data is stored in the memory card 44 of the basic unit 3 after the power is turned on again. The stored predetermined amount of collected data becomes time-series data of each device collected during the target period of additional learning. The basic unit 3 may detect that a predetermined amount of collected data has been stored in the memory card 44 and send an instruction to start classification to the expansion unit. Further, after the power is turned on again, a sufficient amount of data for learning (time-series data of a predetermined number of scan cycles) is accumulated in a storage unit such as a buffer memory (first buffer 37a) or a memory card 44. May be detected by the expansion unit 4a and started.

具体的には、S312でCPU41aは、前回までに決定された類型と、そのデバイスについての時系列データの特徴量と、今回収集された分類対象の時系列データとに基づいて、分類対象のデバイスを自動的に分類する。たとえば、CPU41aは、前回までの学習により一定値をとるデバイス(1203)の類型に分類されていて、そのデバイスについて今回収集された正常動作時における時系列データがその一定値とは異なる値を含む場合には、不定期で動作するデバイス(1204)に分類を更新する。ここで、一定値をとるデバイス(1203)の特徴量は、その一定値が相当する。同様に、CPU41aは、前回までの学習により装置の動作サイクルに同期して動作するデバイス(1201)に分類されていて、そのデバイスについて今回収集された正常動作時における時系列データが前回学習時のものと異なるパターンを含む場合には、不定期で動作するデバイス(1204)に分類を更新する。ここで、装置の動作サイクルに同期して動作するデバイス(1201)の特徴量は、装置の動作サイクル内の波形の変化パターン、つまり、時系列データの変化パターンが相当する。なお 、分類が更新されるということは、更新された類型に応じて決まる検知アルゴリズムも更新されることとなる。また、更新された検知アルゴリズムに応じて、後述するS324やS334で対応するパラメータも更新される。 Specifically, in S312, the CPU 41a is a device to be classified based on the types determined up to the previous time, the feature amount of the time series data for the device, and the time series data to be classified this time. Is automatically classified. For example, the CPU 41a is classified into a type of device (1203) that takes a constant value by learning up to the previous time, and the time series data collected this time during normal operation for the device includes a value different from the constant value. In that case, the classification is updated to the device (1204) that operates irregularly. Here, the feature amount of the device (1203) that takes a constant value corresponds to the constant value. Similarly, the CPU 41a is classified into a device (1201) that operates in synchronization with the operation cycle of the device by learning up to the previous time, and the time series data at the time of normal operation collected this time for the device is the time series data at the time of the previous learning. If it contains a pattern different from the one, the classification is updated to the device (1204) that operates irregularly. Here, the feature amount of the device (1201) that operates in synchronization with the operation cycle of the device corresponds to the change pattern of the waveform in the operation cycle of the device, that is, the change pattern of the time series data. In addition, when the classification is updated, the detection algorithm determined according to the updated type is also updated. Further, the parameters corresponding in S324 and S334 described later are also updated according to the updated detection algorithm.

なお、CPU41aは、分類対象の時系列データに基づいて、分類対象のデバイスを自動的に分類するが、これに加え、分類対象のデバイスに対する類型の設定を受け付けるようにしてもよい。分類対象のデバイスのうち、多くのデバイスは類型の変更は不要であり、また、変更が必要な類型についても、どのデバイスをどの類型に変更すべきかをオペレータが認識していることもあり得る。したがって、CPU41aは、オペレータの指定に応じて、分類対象のデバイスに対する類型の設定を受け付け、分類された類型を示すフラグ情報を当該分類対象のデバイスを示す識別情報に紐づけて格納する。あるいは、オペレータの指定に応じて、不定期で動作するデバイス(1204)に分類し、推定フェーズにおける判定対象外としてもよい。分類対象のデバイスに対する類型の設定は、CPU41aによる分類前に実行されてもよい。たとえば、複数の分類対象のデバイスのうち特定のデバイスについて、オペレータの指定に基づいて類型の設定が実行された場合は、予め類型が設定されたデバイスに対して、CPU41aによる分類対象の時系列データに基づく分類は実行されない。一方、複数の分類対象のデバイスうち上記特定のデバイスとは異なる他のデバイスに対して、CPU41aは、分類対象の時系列データに基づく分類を実行する。特に、前回までの学習によってデバイスの類型が決定していて、さらに追加の学習を実施する場合には、オペレータの指定に基づいて前回までの学習によってデバイスの類型に固定してもよく、変更が必要なデバイスについてオペレータの指定に基づいて前回までの学習によってデバイスの類型と異なる類型を決定してもよい。たとえば、異常デバイスを特定する際に使用されない類型を決定してもよい。 The CPU 41a automatically classifies the devices to be classified based on the time-series data to be classified, but in addition to this, the CPU 41a may accept the setting of the type for the devices to be classified. Of the devices to be classified, many devices do not need to change the type, and the operator may be aware of which type should be changed to which type for the type that needs to be changed. Therefore, the CPU 41a accepts the setting of the type for the device to be classified according to the designation of the operator, and stores the flag information indicating the classified type in association with the identification information indicating the device to be classified. Alternatively, it may be classified into devices (1204) that operate irregularly according to the operator's designation, and may be excluded from the determination target in the estimation phase. The type setting for the device to be classified may be executed before the classification by the CPU 41a. For example, when the type setting is executed for a specific device among a plurality of classification target devices based on the operator's specification, the time series data of the classification target by the CPU 41a is applied to the device for which the type is set in advance. Classification based on is not performed. On the other hand, among the plurality of devices to be classified, the CPU 41a executes classification based on the time-series data to be classified for other devices different from the specific device. In particular, when the device type is determined by the previous learning and additional learning is performed, the device type may be fixed by the previous learning based on the operator's specification, and the change may be made. A type different from the device type may be determined by learning up to the previous time based on the operator's specification for the required device. For example, a type that is not used in identifying anomalous devices may be determined.

S321でCPU41aは、S312による再分類の中で前回までの学習により決定されたデバイスの類型が維持されたか否かを判定する。CPU41aは、前回までの学習により決定されたデバイスの類型が維持されたと判定すると、パラメータを決定するためにS322に移行する。一方、前回までの学習により決定されたデバイスの類型が維持されていない判定すると、即ちデバイスの類型が再分類されて更新されたと判定すると、S323に移行して、CPU41aは、分類処理の更新結果に基づいて、デバイスが推定フェーズにおいて判定対象か否かを判定する。CPU41aは、デバイスが判定対象であると判定するとそのデバイスについてパラメータを決定するためS324に移行し、デバイスが判定対象でないと判定するとS341に移行する。たとえば、CPU41aは、不定期で動作するデバイス(1204)に分類されたデバイスは判定対象でないと判定し、追加学習を中断してS341に移行する。 In S321, the CPU 41a determines whether or not the device type determined by the previous learning is maintained in the reclassification by S312. When the CPU 41a determines that the device type determined by the previous learning is maintained, the CPU 41a shifts to S322 to determine the parameter. On the other hand, if it is determined that the device type determined by the previous learning is not maintained, that is, if it is determined that the device type has been reclassified and updated, the process proceeds to S323, and the CPU 41a updates the classification process. Based on, it is determined whether or not the device is a determination target in the estimation phase. When the CPU 41a determines that the device is the determination target, it shifts to S324 to determine the parameters for the device, and when it determines that the device is not the determination target, it shifts to S341. For example, the CPU 41a determines that the device classified as the device (1204) that operates irregularly is not the determination target, interrupts the additional learning, and shifts to S341.

S322でCPU41aは、対象のデバイスについて既に決定されたパラメータと、対象のデバイスについて今回収集した正常動作時の時系列データとを用いて新たなパラメータを算出し更新し、S331に移行する。たとえば、前回までの学習により装置の動作サイクルに同期して動作するデバイス(1201)が決定され、そのデバイスの類型が維持された場合、CPU41aは、前回までの学習により決定された時系列データの任意の変化点間の時間のばらつきを示す上限のしきい値及び下限のしきい値と、今回収集した正常動作時の時系列データとに基づいて、新たな上限のしきい値及び下限のしきい値を算出して更新する。このように、今回収集した正常動作時の時系列データの任意の変化点間の時間と、上限のしきい値及び下限のしきい値とに基づいて、新たな上限のしきい値及び下限のしきい値が算出されて更新されることにより、今回収集した正常動作時の時系列データの任意の変化点間の時間のばらつきやしきい値からの乖離度合いに応じて更新後のしきい値の幅が広がったり狭まったりする。 In S322, the CPU 41a calculates and updates new parameters using the parameters already determined for the target device and the time-series data during normal operation collected this time for the target device, and shifts to S331. For example, when the device (1201) that operates in synchronization with the operation cycle of the device is determined by the learning up to the previous time and the type of the device is maintained, the CPU 41a determines the time series data determined by the learning up to the previous time. Based on the upper and lower thresholds that indicate the time variation between arbitrary change points and the time-series data during normal operation collected this time, the new upper and lower thresholds are set. Calculate and update the threshold value. In this way, based on the time between arbitrary change points of the time series data during normal operation collected this time and the upper limit threshold value and the lower limit threshold value, the new upper limit threshold value and lower limit threshold value are set. By calculating and updating the threshold value, the threshold value after updating according to the time variation between arbitrary change points of the time series data during normal operation collected this time and the degree of deviation from the threshold value. Widens or narrows.

S324でCPU41aは、今回収集した正常動作時の時系列データを用いて更新後の類型に対応するパラメータを算出して更新し、S331に移行する。ここで算出し決定されるパラメータは、図15のS32で決定されるパラメータと同じ算出方法であってもよい。たとえば、算出方法については平均値など様々な手法が適用され得るが、それぞれの時系列データに適した手法が選択される。また、これら決定されたパラメータについては、オペレータによって変更可能としてもよい。これにより、学習期間が短い場合に極端なパラメータが決定されたとしても調整可能とすることができる。 In S324, the CPU 41a calculates and updates the parameters corresponding to the updated type using the time-series data during normal operation collected this time, and shifts to S331. The parameter calculated and determined here may be the same calculation method as the parameter determined in S32 of FIG. For example, various methods such as an average value can be applied to the calculation method, but a method suitable for each time series data is selected. Further, these determined parameters may be changed by the operator. As a result, even if an extreme parameter is determined when the learning period is short, it can be adjusted.

S331でCPU41aは、オペレータから各デバイスについて分類に対する修正入力を受け付けたか否かを判定する。たとえば、CPU41aは、オペレータの指定に応じて、分類対象のデバイスに対する類型の設定を受け付けて、分類された類型を修正することができ、CPU41aは、そのようなオペレータからの修正入力に基づく分類の修正があったか否かを判定する。CPU41aは、オペレータから各デバイスについて分類に対する修正入力を受付けていないと判断するとS333に移行する。 In S331, the CPU 41a determines whether or not the operator has accepted the correction input for the classification for each device. For example, the CPU 41a can accept the setting of the type for the device to be classified and modify the classified type according to the designation of the operator, and the CPU 41a can modify the classification based on the correction input from such an operator. Determine if there was a correction. When the CPU 41a determines that the correction input for the classification is not received from the operator for each device, the CPU 41a shifts to S333.

一方、オペレータから分類に対する修正入力を受け付けたと判断するとS332に進み、CPU41aは、オペレータの指定に応じて、設定した分類対象のデバイスに対する類型に対し、修正の適否を判定し、適すると判定すると、オペレータの指定に応じて設定された分類の類型への修正を反映する。つまり、CPU41aは、設定された分類の類型に対し、今回収集された正常動作時における時系列データが適合するか否かを判定する。また、CPU41aは、オペレータの指定に応じて設定された分類の類型が適さないと判定すると、適さない旨を報知するようにしてもよく、適さない旨を報知するとともに分類の再指定を促すようにしてもよい。たとえば、CPU41aは、オペレータの指定に応じて、一定値をとるデバイス(1203)の類型に分類されていて、今回収集された正常動作時における時系列データが一定値とは異なる値を含む場合には、オペレータが設定した類型は適合しないことを報知してもよく、当該デバイスを不定期で動作するデバイス(1204)に再分類してもよい。同様に、CPU41aは、オペレータの指定に応じて、装置の動作サイクルに同期して動作するデバイス(1201)に分類されていて、今回収集された正常動作時における時系列データが異なるパターンを含む場合には、オペレータが設定した類型は適合しないことを報知してもよく、当該デバイスを不定期で動作するデバイス(1204)に再分類してもよい。CPU41aは、S332の処理が終わると、修正後の分類に従うパラメータを決定するため再びS321に処理を戻す。 On the other hand, if it is determined that the correction input for the classification has been received from the operator, the process proceeds to S332, and the CPU 41a determines the suitability of the correction for the set type for the device to be classified according to the operator's designation, and determines that the correction is appropriate. Reflects the modification to the classification type set according to the operator's specification. That is, the CPU 41a determines whether or not the time-series data collected this time during normal operation matches the set classification type. Further, when the CPU 41a determines that the classification type set according to the operator's designation is not suitable, the CPU 41a may notify that it is not suitable, notify that it is not suitable, and prompt the redesignation of the classification. It may be. For example, the CPU 41a is classified into a type of device (1203) that takes a constant value according to the operator's designation, and the time series data collected this time during normal operation includes a value different from the constant value. May notify that the type set by the operator does not match, and may reclassify the device into a device (1204) that operates irregularly. Similarly, the CPU 41a is classified into a device (1201) that operates in synchronization with the operation cycle of the device according to the operator's designation, and the time series data at the time of normal operation collected this time contains a different pattern. May be notified that the type set by the operator does not match, and the device may be reclassified as a device (1204) that operates irregularly. When the processing of S332 is completed, the CPU 41a returns the processing to S321 again in order to determine the parameters according to the modified classification.

S333で、CPU41aは、オペレータから各デバイスについてのパラメータの修正入力があったか否かを判定する。たとえば、CPU41aは、オペレータの修正入力に応じて、S322又はS324で更新されたパラメータを更に調整することができる。オペレータによるパラメータの修正指示を受け付けていないと判断した場合は、処理をS341に進める。一方、オペレータによるパラメータの修正指示があった場合は、S334でCPU41aは、オペレータの指定に応じて、設定した分類対象のデバイスに対するパラメータに対し、今回収集された正常動作時における時系列データが適合するか否かを判定する。CPU41aは、適すると判定すると、オペレータの指定に応じて設定されたパラメータへの修正を反映する。また、CPU41aは、オペレータの指定に応じて設定されたパラメータの修正が適さないと判定すると、適さない旨を報知するようにしてもよく、適さない旨を報知するとともにパラメータの再指定を促すようにしてもよい。なお、CPU41aは、S32と同様の算出手法でパラメータを算出してもよい。 In S333, the CPU 41a determines whether or not there is a parameter correction input for each device from the operator. For example, the CPU 41a can further adjust the parameters updated in S322 or S324 according to the correction input of the operator. If it is determined that the parameter correction instruction by the operator is not accepted, the process proceeds to S341. On the other hand, when the operator gives an instruction to correct the parameters, the CPU 41a in S334 matches the time-series data collected this time during normal operation with respect to the parameters for the set classification target device according to the operator's specification. Determine whether or not to do so. When the CPU 41a determines that it is suitable, it reflects the modification to the parameters set according to the operator's designation. Further, when the CPU 41a determines that the modification of the parameter set according to the operator's specification is not suitable, the CPU 41a may notify that it is not suitable, and notify that it is not suitable and prompt the parameter to be redesignated. It may be. The CPU 41a may calculate the parameters by the same calculation method as in S32.

続いて、S341でCPU41aは、学習対象の全てのデバイスに対して追加学習処理が完了したか否かを判定する。CPU41aは、学習対象のいずれかのデバイスに対して追加学習処理が完了していない場合は、未完了のデバイスについて追加学習処理をするためにS311に処理を戻す。一方、CPU41aは、学習対象の全てのデバイスに対して追加学習処理が完了すると、追加学習処理を終了する。 Subsequently, in S341, the CPU 41a determines whether or not the additional learning process has been completed for all the devices to be learned. When the additional learning process is not completed for any of the devices to be learned, the CPU 41a returns the process to S311 in order to perform the additional learning process for the incomplete device. On the other hand, the CPU 41a ends the additional learning process when the additional learning process is completed for all the devices to be learned.

<変形例>
本発明は上記実施形態に限らず様々な変形が可能である。例えば、上記実施形態ではビットデバイスやワードデバイスの収集データについて分析して分類する例について説明したが、本発明はこのようなデバイス値のみ限定されない。例えば、収集データとしては、上記実施形態で説明した例に限らず、カメラ映像やイベントログなどの情報でもよい。
<Modification example>
The present invention is not limited to the above embodiment and can be modified in various ways. For example, in the above embodiment, an example of analyzing and classifying collected data of a bit device or a word device has been described, but the present invention is not limited to such device values. For example, the collected data is not limited to the example described in the above embodiment, and may be information such as a camera image or an event log.

図19は、収集データの変形例を示す。ここでは、収集データがカメラ映像(動画像)である場合について説明する。1901は、収集されるカメラ映像を示す。工場施設内の所定箇所を撮影した映像である。例えば、CPU41aは、これらのカメラ映像1901を複数の領域に分割し、当該領域内の輝度値を特徴量としてパラメータを決定してもよい。カメラ映像1901は、ベルトコンベア1904で複数の製品1905が等間隔で搬送される様子を示す。このような場合に、1902に示すように、所定領域1903内の輝度値が時間とともに変化することを利用して正常に動作しているか否かを判断することができる。例えば、カメラ映像1901の網掛け部分では、所定の時間間隔で製品が通過するため、当該製品の画像(輝度値)が定期的に割り込むことになる。そのような輝度値の変化を利用して、正常に製品が流れているか、或いは、複数の領域を監視することにより、製品がベルトコンベア上で斜行していないかを確認することができる。また、図19では製品の搬送経路を例に説明したが、例えばロボットが駆動している箇所を撮影し、当該ロボットのアームの動作に合わせて所定の画像領域に定期的にアーム部分の画像が割り込む場合などにもロボットが正常に動作しているかチェックすることができる。なお、カメラ映像についてはアナログ値をとるデバイスとして分類してもよい。 FIG. 19 shows a modified example of the collected data. Here, a case where the collected data is a camera image (moving image) will be described. 1901 shows the camera image to be collected. This is an image of a predetermined location in a factory facility. For example, the CPU 41a may divide these camera images 1901 into a plurality of regions and determine the parameters using the luminance value in the regions as a feature amount. The camera image 1901 shows how a plurality of products 1905 are conveyed at equal intervals on the belt conveyor 1904. In such a case, as shown in 1902, it is possible to determine whether or not the operation is normal by utilizing the fact that the luminance value in the predetermined region 1903 changes with time. For example, in the shaded portion of the camera image 1901, since the product passes at a predetermined time interval, the image (luminance value) of the product is periodically interrupted. By utilizing such a change in the brightness value, it is possible to confirm whether the product is flowing normally or whether the product is skewed on the belt conveyor by monitoring a plurality of areas. Further, although the transport path of the product has been described as an example in FIG. 19, for example, a portion where the robot is driven is photographed, and an image of the arm portion is periodically displayed in a predetermined image area according to the operation of the arm of the robot. It is possible to check whether the robot is operating normally even when interrupting. The camera image may be classified as a device that takes an analog value.

<第2の実施形態>
以下では、本発明の第2の実施形態について説明する。上記第1の実施形態では、基本的にPLCが異常を示す場合、即ち、上記保存条件がプログラマブルロジックコントローラの異常時である場合の処理の流れについて主に説明した。しかし、既に記載しているように、本発明はPLCの異常発生をトリガにして異常デバイスを特定する特定機能に限らず、正常時の時系列データとの差分を分析する処理(分析機能)にも適用することができる。従って、本実施形態では、収集したデバイス値が正常時の時系列データから乖離した値(いつもと違うデバイス値)であるかを分析、検証する処理について説明する。なお、以下では、上記第1の実施形態と異なる部分についてのみ説明を記載する。
<Second embodiment>
The second embodiment of the present invention will be described below. In the first embodiment, the processing flow when the PLC basically shows an abnormality, that is, when the storage condition is an abnormality of the programmable logic controller has been mainly described. However, as already described, the present invention is not limited to the specific function of identifying an abnormal device by triggering the occurrence of an abnormality in PLC, but also in the process (analysis function) of analyzing the difference from the time series data at the normal time. Can also be applied. Therefore, in the present embodiment, a process of analyzing and verifying whether the collected device value is a value deviating from the time series data at the normal time (device value different from usual) will be described. In the following, only the parts different from the first embodiment will be described.

本実施形態においても、デバイス値の変化の特徴を抽出して分類し、分類したそれぞれの特徴に適切な異常(いつもと違う変化)の検知アルゴリズムを適用する。つまり、本実施形態においても、上記第1の実施形態と同様に、学習フェーズにおいて、正常時の時系列データからデバイス値を分類し、それぞれの類型に応じて検知アルゴリズムを決定するとともに、それぞれの検知アルゴリズムに応じた評価変数やパラメータを設定する。本実施形態においても、これらの学習フェーズは推定フェーズが実行される前に予め行われ、分類した類型を示すフラグ情報と、時系列データに対応するデバイスの識別情報が格納される。また、推定フェーズにおいては、推定対象の時系列データの類型に応じて決まる検知アルゴリズムを適用して分析することによって、いつもと違うデバイス値であるかを分析して検証する。 即ち、推定フェーズにおいて再度の分類処理は行われない。この場合、運用時における分類処理の処理不可や意図しない学習データの更新を避けることができる。なお、推定フェーズにおいても分類処理を行うようにしてもよい。この場合、すでに学習している正常時のデータに基づいて、新たに得られた時系列データのうち、正常とみなせるものを抽出し、新たに抽出された時系列データと、すでに学習している時系列データに基づき経時的な変化に対応して学習データを更新するようにしてもよい。たとえば、所定の周期に同期して値が定常的なパターンで変化するデバイスについて、新たに抽出された時系列データと、すでに学習している時系列データのばらつきに基づきパラメータに含まれるしきい値を更新してもよい。 Also in this embodiment, the characteristics of changes in device values are extracted and classified, and an appropriate abnormality (change different from usual) detection algorithm is applied to each of the classified characteristics. That is, also in the present embodiment, as in the first embodiment, in the learning phase, the device values are classified from the time series data at the normal time, the detection algorithm is determined according to each type, and each of them is used. Set evaluation variables and parameters according to the detection algorithm. Also in this embodiment, these learning phases are performed in advance before the estimation phase is executed, and flag information indicating the classified type and device identification information corresponding to the time series data are stored. In the estimation phase, a detection algorithm determined according to the type of time-series data to be estimated is applied and analyzed to analyze and verify whether the device value is different from usual. That is, the classification process is not performed again in the estimation phase. In this case, it is possible to avoid unprocessable classification processing and unintended update of learning data during operation. The classification process may also be performed in the estimation phase. In this case, based on the normally learned data, the newly obtained time series data that can be regarded as normal is extracted, and the newly extracted time series data and the already learned time series data are already learned. The learning data may be updated in response to changes over time based on the time series data. For example, for a device whose value changes in a steady pattern in synchronization with a predetermined period, the threshold value included in the parameter based on the variation between the newly extracted time series data and the time series data that has already been learned. May be updated.

図16を参照して、デバイス値がいつもと違うデバイス値であるか否か、すなわち、正常時のデバイス値と乖離しているか否かを検証する際の処理手順について説明する。以下で説明する処理は、基本ユニット3のCPU31及び拡張ユニット4aのCPU41aによって実現される。なお、上記第1の実施形態と異なる処理(S45)についてのみ説明を記載し、その他処理については説明を省略する。 With reference to FIG. 16, a processing procedure for verifying whether or not the device value is different from the usual device value, that is, whether or not the device value deviates from the normal device value will be described. The processing described below is realized by the CPU 31 of the basic unit 3 and the CPU 41a of the expansion unit 4a. The description will be given only for the process (S45) different from that of the first embodiment, and the description will be omitted for the other processes.

S45でCPU31は、第一バッファ37aに格納されたデバイス値を基本ユニット3のメモリカード44に保存する 保存条件が成立したか否かを判断する。ここで、上記第1の実施形態では当該保存条件がプログラマブルロジックコントローラで異常が発生した場合に成立する旨を説明した。しかし、本実施形態では、ユーザにより予め保存トリガとなるデバイスを指定しておき、当該デバイスに所定の変化があった場合、ユーザによる分析命令があった場合、定期的に監視する監視周期が経過した場合、基本ユニット3に接続される拡張ユニットから分析命令が発せられた場合、収集したデバイス値がいつもと違うデバイス値である場合など、当該保存条件が成立するように制御される。例えば、S43で前回と異なるデバイス値が発生した場合にS45で保存条件が成立したと判断し、特定処理へ進んでもよい。また、前回のデバイス値との差分(乖離程度)や正常時と異なるデバイス値の発生個数に応じて保存条件が成立するように制御してもよい。ユーザからの分析指示については、リアルタイムで特定のデバイスを分析、検証するように指示することが可能であるが、特定のデバイスの過去のデータを検証するように指示するものであってもよい。また、S47では、異常デバイスを特定するのではなく、正常時の時系列データからの乖離する異常状態を分析、検証することになる。 In S45, the CPU 31 determines whether or not the storage condition for storing the device value stored in the first buffer 37a in the memory card 44 of the basic unit 3 is satisfied. Here, it has been described that in the first embodiment, the storage condition is satisfied when an abnormality occurs in the programmable logic controller. However, in the present embodiment, a device to be a save trigger is specified in advance by the user, and if there is a predetermined change in the device, or if there is an analysis command by the user, a monitoring cycle for periodically monitoring elapses. In this case, the storage condition is controlled to be satisfied, such as when an analysis command is issued from the expansion unit connected to the basic unit 3, or when the collected device value is a device value different from usual. For example, when a device value different from the previous one occurs in S43, it may be determined in S45 that the storage condition is satisfied, and the process may proceed to the specific process. Further, it may be controlled so that the storage condition is satisfied according to the difference (degree of deviation) from the previous device value and the number of generated device values different from the normal state. The analysis instruction from the user can be instructed to analyze and verify a specific device in real time, but may be an instruction to verify the past data of the specific device. Further, in S47, instead of identifying the abnormal device, the abnormal state deviating from the time series data at the normal time is analyzed and verified.

次に、図18を参照して、本実施形態に係る分析結果の表示例について説明する。形式的には上記第1の実施形態の特定結果と同様の表示となるが、本実施形態では異常デバイスを特定するのではなく、正常時の時系列データとの乖離が発生している状態(異常状態)を特定するものであり、それに応じて表示内容が変更される。 Next, a display example of the analysis result according to the present embodiment will be described with reference to FIG. Formally, the display is the same as the specific result of the first embodiment, but in this embodiment, the abnormal device is not specified, and a deviation from the time-series data at the normal time occurs ( (Abnormal state) is specified, and the displayed contents are changed accordingly.

従って、例えば画面1800では、デバイスの異常数ではなく、正常時の時系列データとの乖離が発生した回数を示す。異常度についても、デバイス異常が発生した回数を用いて求めるのではなく、上記本実施形態における異常状態が発生した回数、すなわち、正常時の時系列データとの乖離が発生した回数を用いて求めることが望ましい。 Therefore, for example, on the screen 1800, not the number of abnormalities of the device but the number of times the deviation from the normal time series data has occurred is shown. The degree of abnormality is also calculated not by using the number of times the device abnormality has occurred, but by using the number of times the abnormal state has occurred in the present embodiment, that is, the number of times the deviation from the normal time series data has occurred. Is desirable.

<第3の実施形態>
以下では、本発明の第3の実施形態について説明する。上記第1及び第2の実施形態では、それぞれ特定機能、分析機能について説明した。本実施形態では、さらに、定期的にデバイス値を収集して監視する監視機能について説明する。なお、以下では、上記第1及び第2の実施形態と異なる部分についてのみ説明を記載する。
<Third embodiment>
Hereinafter, a third embodiment of the present invention will be described. In the first and second embodiments, the specific function and the analysis function have been described, respectively. In the present embodiment, a monitoring function for periodically collecting and monitoring device values will be described. In the following, only the parts different from the first and second embodiments will be described.

図20は、本実施形態に係る監視を開始するための監視開始信号を出力する処理手順を示すフローチャートを示す。以下で説明する処理は、基本ユニット3のCPU31によって実行される。しかし、本発明を限定する意図はなく、拡張ユニット4aのCPU41aによって実行されてもよい。 FIG. 20 shows a flowchart showing a processing procedure for outputting a monitoring start signal for starting monitoring according to the present embodiment. The process described below is executed by the CPU 31 of the basic unit 3. However, there is no intention of limiting the present invention, and it may be executed by the CPU 41a of the expansion unit 4a.

S51でCPU31は、監視周期が経過したか否かを判断する。監視周期は、プログラマブルロジックコントローラのオペレータ(管理者)が設定可能な値であり、任意の周期を設定することができる。設定された値については、例えば、記憶装置32の収集設定36aに設定される。監視周期が経過した場合はS53に進み、そうでない場合はS52に進む。 In S51, the CPU 31 determines whether or not the monitoring cycle has elapsed. The monitoring cycle is a value that can be set by the operator (administrator) of the programmable logic controller, and any cycle can be set. The set value is set, for example, in the collection setting 36a of the storage device 32. If the monitoring cycle has elapsed, the process proceeds to S53, otherwise the process proceeds to S52.

S52でCPU31は、ユーザから監視指示を受け付けたか否かを判断する。当該監視指示については、PC2aや基本ユニット3の操作部6を介したユーザ入力を通じて受け付けることができる。ユーザからの監視指示を受け付けた場合にはS53に進み、そうでない場合は処理をS51に戻す。 In S52, the CPU 31 determines whether or not the monitoring instruction has been received from the user. The monitoring instruction can be received through user input via the operation unit 6 of the PC 2a or the basic unit 3. If the monitoring instruction from the user is received, the process proceeds to S53, and if not, the process returns to S51.

S53でCPU31は、監視開始信号を生成し、基本ユニット3へ出力して、処理を終了する。基本ユニット3は、当該監視開始信号を受信すると、図16のS46で保存条件が成立したと判断して、S47以降の処理を実行し、分析処理を実行する。ここで、S46の保存条件は監視開始信号を受信した直後に成立し、所定期間前から現在までにメモリカード44に保存されている時系列データを収集する。また、S46の保存条件は監視開始信号の受信後、所定の実行周期を経過した後に成立し、監視開始信号を受信してから所定期間の間にメモリカード44に保存されている時系列データを収集してもよい。あるいは、S46の保存条件は監視開始信号の受信後、所定の実行周期を経過した後に成立し、監視開始信号の受信前後の所定期間の間にメモリカード44に保存されている時系列データを収集してもよい。 In S53, the CPU 31 generates a monitoring start signal, outputs it to the basic unit 3, and ends the process. When the basic unit 3 receives the monitoring start signal, it determines that the storage condition is satisfied in S46 of FIG. 16, executes the processing after S47, and executes the analysis processing. Here, the storage condition of S46 is satisfied immediately after receiving the monitoring start signal, and time-series data stored in the memory card 44 from before a predetermined period to the present is collected. Further, the storage condition of S46 is satisfied after a predetermined execution cycle has elapsed after receiving the monitoring start signal, and the time series data stored in the memory card 44 during the predetermined period after receiving the monitoring start signal is stored. You may collect it. Alternatively, the storage condition of S46 is satisfied after a predetermined execution cycle has elapsed after receiving the monitoring start signal, and time-series data stored in the memory card 44 is collected during a predetermined period before and after receiving the monitoring start signal. You may.

これらの監視対象のデータについてはユーザ設定により選択することができる。なお、上記第2の実施形態と同様に、S48においては、異常デバイスを特定するのではなく、正常時の時系列データからの乖離する異常状態を分析、検証することになる。また、分析結果については、上記第2の実施形態と同様の表示が出力される。 The data to be monitored can be selected by user setting. As in the second embodiment, in S48, the abnormal device is not specified, but the abnormal state deviating from the time series data at the normal time is analyzed and verified. Further, the analysis result is output in the same manner as in the second embodiment.

<まとめ>
以上説明したように本実施形態に係るプログラマブルロジックコントローラは、ユーザプログラムを繰り返し実行する実行エンジンと、ユーザプログラムに従って実行エンジンによりアクセスされるデータを記憶する記憶領域である複数のデバイスを有するデバイスメモリとを備える。また、プログラマブルロジックコントローラは、ユーザプログラムのスキャン周期ごとに所定の収集設定に従って複数のデバイスのうち収集対象のデバイスで保持されているデータを収集し、収集された各デバイスの時系列データの特徴に基づいて、各デバイスを複数の類型のいずれかにそれぞれ分類し、各デバイスについて前記収集手段によって収集されたデバイスの時系列データ及び前記分類手段により当該デバイスが分類された類型に従って、異常デバイスを特定する際の検知アルゴリズムを決定する。また、前記収集手段によって収集されたデバイスの時系列データを、前記分類手段によって当該デバイスが分類された類型に従い、当該デバイスに対して前記決定手段によって決定された検知アルゴリズムを用いて分析することで異常デバイスを特定する。このように、本実施形態に係るプログラマブルロジックコントローラによれば、各デバイスに関連するデータの周期性や連続性などの特徴を分析して分類し、効率よく異常デバイスを特定することができる。
<Summary>
As described above, the programmable logic controller according to the present embodiment includes an execution engine that repeatedly executes the user program and a device memory having a plurality of devices that are storage areas for storing data accessed by the execution engine according to the user program. To be equipped. In addition, the programmable logic controller collects the data held by the device to be collected among a plurality of devices according to a predetermined collection setting for each scan cycle of the user program, and features the time-series data of each collected device. Based on this, each device is classified into one of a plurality of types, and an abnormal device is identified for each device according to the time series data of the device collected by the collecting means and the type in which the device is classified by the classification means. Determine the detection algorithm when doing so. Further, by analyzing the time series data of the device collected by the collecting means according to the type in which the device is classified by the classification means, the device is analyzed by using the detection algorithm determined by the determining means. Identify the anomalous device. As described above, according to the programmable logic controller according to the present embodiment, features such as periodicity and continuity of data related to each device can be analyzed and classified, and an abnormal device can be efficiently identified.

また、本プログラムコントローラは、さらに、ユーザ指示に応じて、決定された検知アルゴリズムを用いて、収集された各デバイスの時系列データを正常時の時系列データとの乖離を分析して異常が発生していないかを検証する。なお、このような分析機能については、所定の周期で定期的に行うようにしてもよい(監視機能)。 In addition, this program controller further analyzes the deviation of the collected time-series data of each device from the normal time-series data by using the determined detection algorithm in response to the user's instruction, and an abnormality occurs. Verify if not. It should be noted that such an analysis function may be performed periodically at a predetermined cycle (monitoring function).

また、本プログラマブルロジックコントローラは、所定数のスキャン周期の時系列データが蓄積されると、時系列データの特徴に基づいて、それぞれの時系列データを分類し、検知アルゴリズムを決定して更新する。このように、本発明によれば、プログラマブルロジックコントローラの動作中において定期的に学習フェーズに対応する機能が実行され、異常時の特定処理における精度を向上させることができる。 Further, when the time-series data of a predetermined number of scan cycles are accumulated, the programmable logic controller classifies each time-series data based on the characteristics of the time-series data, determines the detection algorithm, and updates the time-series data. As described above, according to the present invention, the function corresponding to the learning phase is periodically executed during the operation of the programmable logic controller, and the accuracy in the specific processing at the time of abnormality can be improved.

また、本プログラマブルロジックコントローラは、1以上のデバイスのグループにおいて、前回のスキャン周期において収集した値と、今回のスキャン周期において収集した値とが収集対象の前記グループの全てのデバイスで変化していなければ、今回のスキャン周期において収集した値を削除して、収集する時系列データを圧縮する。これによりメモリ資源を有効に活用することができる。 Further, in this programmable logic controller, in one or more groups of devices, the value collected in the previous scan cycle and the value collected in the current scan cycle must be changed in all the devices in the group to be collected. For example, the values collected in this scan cycle are deleted, and the time-series data to be collected is compressed. As a result, memory resources can be effectively used.

また、本プログラマブルロジックコントローラは、複数のデバイスのうち、少なくとも、一定の値をとるデバイスと、装置の動作サイクルに同期して値が定常的なパターンで変化するデバイスと、装置の動作サイクルは異なる周期に同期して値が定常的なパターンで変化するデバイスと、不定期で値が変化するデバイスと、アナログ値のデバイスと、値が単調増加又は単調減少するデバイスとに分類する。さらに、これらの分類に基づいて、特徴に基づく検知アルゴリズムを決定することにより、異常時において、効率よく異常デバイスを特定することができる。なお、不定期で値が変化するデバイスは特徴を抽出できないため、異常の特定には用いない。 Further, in this programmable logic controller, at least, among a plurality of devices, a device that takes a constant value and a device whose value changes in a steady pattern in synchronization with the operation cycle of the device have different operation cycles of the device. It is classified into a device whose value changes in a steady pattern in synchronization with a cycle, a device whose value changes irregularly, a device having an analog value, and a device whose value monotonically increases or decreases. Furthermore, by determining the detection algorithm based on the characteristics based on these classifications, it is possible to efficiently identify the abnormal device at the time of abnormality. Note that devices whose values change irregularly cannot extract features, so they are not used to identify abnormalities.

また、本プログラマブルロジックコントローラは、異常デバイスを特定する際に、決定された検知アルゴリズムと、該検知アルゴリズムに対応する時系列データの特徴とを比較して、差分が所定のしきい値を超える場合に、異常デバイスとして特定する。また、本プログラマブルロジックコントローラは、2つの時系列データにおけるそれぞれの値の変化点の時間差を、異常を特定する際の検知アルゴリズムとして決定し、2つの時系列データにおける時間差が所定の範囲内にない場合に、2つの時系列データに対応する2つのデバイスを、異常デバイスとして特定するようにしてもよい。このように、本発明によれば、分類した各類型に応じて、検知アルゴリズムを決定し、異常時においては、当該検知アルゴリズムを用いてそれぞれの類型にあった手法で異常デバイスを特定する。 Further, when the programmable logic controller identifies an abnormal device, it compares the determined detection algorithm with the characteristics of the time series data corresponding to the detection algorithm, and when the difference exceeds a predetermined threshold value. In addition, identify it as an abnormal device. Further, this programmable logic controller determines the time difference between the change points of the respective values in the two time series data as a detection algorithm when identifying an abnormality, and the time difference between the two time series data is not within a predetermined range. In some cases, the two devices corresponding to the two time series data may be identified as abnormal devices. As described above, according to the present invention, the detection algorithm is determined according to each of the classified types, and when an abnormality occurs, the abnormal device is identified by a method suitable for each type using the detection algorithm.

また、本プログラマブルロジックコントローラは、特定結果を示す表示データを作成し、当該プログラマブルロジックコントローラの表示装置に表示するか、又は、外部装置に送信する。表示画面としては、種々の表示画面により特定結果を表示することができる(図18)。 In addition, the programmable logic controller creates display data indicating a specific result and displays it on the display device of the programmable logic controller or transmits it to an external device. As the display screen, a specific result can be displayed on various display screens (FIG. 18).

また、上記実施形態では、プログラマブルロジックコントローラに含まれる拡張ユニット4aが時系列データを収集して分類し、分類に従って検知アルゴリズムを決定し、異常時においては異常デバイスを特定する例について説明した。しかし、本発明はこれに限定されず、基本ユニットや他の拡張ユニットによって上述した機能の少なくとも一部が実現されてもよい。さらに、プログラマブルロジックコントローラと通信可能に接続された分析装置(外部装置)が上述した機能を実現してもよい。 Further, in the above embodiment, an example in which the expansion unit 4a included in the programmable logic controller collects and classifies time series data, determines a detection algorithm according to the classification, and identifies an abnormal device in the event of an abnormality has been described. However, the present invention is not limited to this, and at least a part of the above-mentioned functions may be realized by a basic unit or another expansion unit. Further, an analyzer (external device) communicatively connected to the programmable logic controller may realize the above-mentioned functions.

発明は上記の実施形態に制限されるものではなく、発明の要旨の範囲内で、種々の変形・変更が可能である。 The invention is not limited to the above-described embodiment, and various modifications and changes can be made within the scope of the gist of the invention.

Claims (20)

ユーザプログラムを繰り返し実行する実行エンジンと、
前記ユーザプログラムに従って前記実行エンジンによりアクセスされるデータを記憶する記憶領域である複数のデバイスを有するデバイスメモリと、
前記ユーザプログラムの実行周期ごとに所定の収集設定に従って前記複数のデバイスのうち収集対象のデバイスで保持されているデータを収集する収集手段と、
前記収集手段によって収集された各デバイスの時系列データの特徴に基づいて、各デバイスを複数の類型のいずれかにそれぞれ分類する分類手段と、
各デバイスについて前記収集手段によって収集されたデバイスの時系列データ及び前記分類手段により当該デバイスが分類された類型に従って、当該デバイスを異常デバイスとして特定する際の検知アルゴリズムを決定する決定手段と、
前記収集手段によって収集されたデバイスの時系列データを、前記分類手段によって当該デバイスが分類された類型に従い、当該デバイスに対して前記決定手段によって決定された検知アルゴリズムを用いて分析することで異常デバイスを特定する特定手段と
を備えることを特徴とするプログラマブルロジックコントローラ。
An execution engine that repeatedly executes the user program,
A device memory having a plurality of devices, which is a storage area for storing data accessed by the execution engine according to the user program, and
A collection means for collecting data held by the device to be collected among the plurality of devices according to a predetermined collection setting for each execution cycle of the user program.
A classification means for classifying each device into one of a plurality of types based on the characteristics of the time series data of each device collected by the collection means.
For each device, a determination means for determining a detection algorithm for identifying the device as an abnormal device according to the time series data of the device collected by the collection means and the type in which the device is classified by the classification means.
Anomalous devices are analyzed by analyzing the time-series data of the devices collected by the collecting means according to the type in which the devices are classified by the classification means using the detection algorithm determined by the determining means for the devices. A programmable logic controller, characterized in that it comprises a specific means of identifying the.
前記特定手段は、さらに、ユーザ指示に応じて、又は定期的に、前記決定手段によって決定された検知アルゴリズムを用いて、前記収集手段によって収集された各デバイスの時系列データと正常時の時系列データとの乖離を分析することで異常デバイスを特定することを特徴とする請求項1に記載のプログラマブルロジックコントローラ。 The specific means further, in response to a user instruction or periodically, using the detection algorithm determined by the determination means, the time series data of each device collected by the collection means and the time series in normal time. The programmable logic controller according to claim 1, wherein an abnormal device is identified by analyzing a deviation from data. 前記分類手段は、前記収集手段によって所定数のスキャン周期の時系列データが蓄積されると、該時系列データの特徴に基づいて、それぞれの時系列データを分類し、
前記決定手段は、前記分類手段によって分類された前記時系列データに従って、異常を特定する際の前記検知アルゴリズムを決定して更新することを特徴とする請求項1又は2に記載のプログラマブルロジックコントローラ。
When the time-series data of a predetermined number of scan cycles are accumulated by the collection means, the classification means classifies each time-series data based on the characteristics of the time-series data.
The programmable logic controller according to claim 1 or 2, wherein the determination means determines and updates the detection algorithm when identifying an abnormality according to the time-series data classified by the classification means.
前記分類手段は、任意のデバイスに対しユーザ指示を受け付けると、当該ユーザ指示に応じて当該デバイスを分類することを特徴とする請求項1乃至3の何れか1項に記載のプログラマブルロジックコントローラ。 The programmable logic controller according to any one of claims 1 to 3, wherein when the classification means receives a user instruction for an arbitrary device, the device is classified according to the user instruction. 前記収集手段は、1以上のデバイスのグループにおいて、前回のスキャン周期において収集した値と、今回のスキャン周期において収集した値とが収集対象の前記グループの全てのデバイスで変化していなければ、前記今回のスキャン周期において収集した値を削除して、収集する時系列データを圧縮することを特徴とする請求項1乃至4の何れか1項に記載のプログラマブルロジックコントローラ。 If the value collected in the previous scan cycle and the value collected in the current scan cycle are not changed in all the devices in the group to be collected in the group of one or more devices, the collection means is described. The programmable logic controller according to any one of claims 1 to 4, wherein the values collected in the current scan cycle are deleted and the collected time-series data is compressed. 前記類型は、一定の値をとる類型と、前記プログラマブルロジックコントローラの動作サイクルに同期して値が定常的なパターンで変化する類型と、前記動作サイクルとは異なる周期に同期して値が定常的なパターンで変化するデバイスと、不定期で値が変化する類型と、アナログ値の類型と、値が単調増加又は単調減少する類型とのうち、少なくとも2つの類型を含むことを特徴とする請求項1乃至5の何れか1項に記載のプログラマブルロジックコントローラ。 The types are a type that takes a constant value, a type in which the value changes in a steady pattern in synchronization with the operation cycle of the programmable logic controller, and a type in which the value is constant in synchronization with a cycle different from the operation cycle. A claim characterized by including at least two types of a device that changes in a pattern, a type in which a value changes irregularly, a type in which an analog value is used, and a type in which a value monotonically increases or decreases. The programmable logic controller according to any one of 1 to 5. 前記決定手段は、前記分類手段によって不定期で値が変化するデバイスと分類された時系列データを除外して、異常を特定する際の検知アルゴリズムを決定することを特徴とする請求項6に記載のプログラマブルロジックコントローラ。 The sixth aspect of claim 6 is characterized in that the determination means excludes time-series data classified as a device whose value changes irregularly by the classification means and determines a detection algorithm for identifying an abnormality. Programmable logic controller. 前記特定手段は、前記検知アルゴリズムとして、前記分類手段によって分類された前記時系列データの類型に基づき、前記異常デバイスの分析に用いる評価変数と当該評価変数に応じたパラメータを用いて分析することで異常デバイスを特定することを特徴とする請求項1乃至7の何れか1項に記載のプログラマブルロジックコントローラ。 The specific means analyzes by using the evaluation variable used for the analysis of the abnormal device and the parameter corresponding to the evaluation variable based on the type of the time series data classified by the classification means as the detection algorithm. The programmable logic controller according to any one of claims 1 to 7, wherein an abnormal device is identified. 追加学習の条件が満たされたか否かを判定する追加学習判定手段をさらに備え、
前記追加学習判定手段により追加学習の条件が満たされたと判定すると、前記分類手段は、現在の各デバイスの前記類型と、前記収集手段よって追加学習の対象期間に収集された各デバイスの時系列データの特徴とに基づいて、各デバイスを複数の類型のいずれかにそれぞれ再分類し、前記決定手段は、各デバイスについて前記収集手段によって追加学習の対象期間に収集されたデバイスの時系列データと、前記分類手段により当該デバイスが再分類された類型又は現在の各デバイスの検知アルゴリズムとに従って、当該デバイスを異常デバイスとして特定する際の検知アルゴリズムを再決定する ことを特徴とする請求項8に記載のプログラマブルロジックコントローラ。
Further equipped with an additional learning determination means for determining whether or not the additional learning conditions are satisfied,
When it is determined that the additional learning condition is satisfied by the additional learning determination means, the classification means determines the type of each current device and the time series data of each device collected by the collection means during the target period of the additional learning. Each device is reclassified into one of a plurality of types based on the characteristics of the device, and the determination means includes time-series data of the devices collected by the collection means for each device during the target period of additional learning. The eighth aspect of claim 8, wherein the detection algorithm for identifying the device as an abnormal device is redetermined according to the type in which the device is reclassified by the classification means or the current detection algorithm of each device. Programmable logic controller.
前記特定手段は、前記決定手段によって決定された検知アルゴリズムと、該検知アルゴリズムに対応する時系列データの特徴とを比較して、差分が所定のしきい値を超える場合に、異常デバイスとして特定することを特徴とする請求項1乃至9の何れか1項に記載のプログラマブルロジックコントローラ。 The specific means compares the detection algorithm determined by the determination means with the characteristics of the time-series data corresponding to the detection algorithm, and identifies the device as an abnormal device when the difference exceeds a predetermined threshold value. The programmable logic controller according to any one of claims 1 to 9, wherein the programmable logic controller. 前記決定手段は、2つの時系列データにおけるそれぞれの値の変化点の時間差を、異常を特定する際の検知アルゴリズムとして決定し、
前記特定手段は、前記2つの時系列データにおける前記時間差が所定の範囲内にない場合に、前記2つの時系列データに対応する2つのデバイスを、異常デバイスとして特定することを特徴とする請求項1乃至10の何れか1項に記載のプログラマブルロジックコントローラ。
The determination means determines the time difference between the change points of the respective values in the two time series data as a detection algorithm for identifying an abnormality.
The specific means is characterized in that when the time difference between the two time series data is not within a predetermined range, the two devices corresponding to the two time series data are specified as abnormal devices. The programmable logic controller according to any one of 1 to 10.
特定結果として、異常の可能性が高い候補デバイスが識別可能に出力する出力手段をさらに備えることを特徴とする請求項1乃至11の何れか1項に記載のプログラマブルロジックコントローラ。 The programmable logic controller according to any one of claims 1 to 11, further comprising an output means for identifiable output of a candidate device having a high possibility of abnormality as a specific result. 前記出力手段は、前記特定結果として、異常の大きさを示す異常度の大きい順で、又は、異常の発生時刻の早い順で、各デバイスを表示部に表示することを特徴とする請求項12に記載のプログラマブルロジックコントローラ。 12. The output means is characterized in that, as the specific result, each device is displayed on the display unit in descending order of the degree of abnormality indicating the magnitude of the abnormality or in the order of the earliest occurrence time of the abnormality. Programmable logic controller described in. 前記出力手段は、前記特定結果として、異常デバイスであると特定されたデバイスの正常時の時系列データと、異常時の時系列データが比較可能に表示部に表示することを特徴とする請求項12又は13に記載のプログラマブルロジックコントローラ。 The output means is characterized in that, as the specific result, the normal time series data of the device identified as the abnormal device and the abnormal time series data are displayed on the display unit in a comparable manner. 12. The programmable logic controller according to 12 or 13. 前記収集手段によって収集される時系列データには、画像データが含まれることを特徴とする請求項1乃至14の何れか1項に記載のプログラマブルロジックコントローラ。 The programmable logic controller according to any one of claims 1 to 14, wherein the time-series data collected by the collecting means includes image data. 前記時系列データの特徴は、周期性又は連続性に関する特徴であることを特徴とする請求項1乃至15の何れか1項に記載のプログラマブルロジックコントローラ。 The programmable logic controller according to any one of claims 1 to 15, wherein the feature of the time series data is a feature relating to periodicity or continuity. 基本ユニットと、当該基本ユニットに接続された拡張ユニットとをさらに備え、
前記基本ユニットは、
前記実行エンジンと、前記デバイスメモリと、前記収集手段とを含み、
前記拡張ユニットは、
前記分類手段と、前記決定手段と、前記特定手段とを含むことを特徴とする請求項1乃至16の何れか1項に記載のプログラマブルロジックコントローラ。
Further equipped with a basic unit and an expansion unit connected to the basic unit,
The basic unit is
The execution engine, the device memory, and the collection means are included.
The expansion unit
The programmable logic controller according to any one of claims 1 to 16, further comprising the classification means, the determination means, and the specific means.
前記デバイスの監視周期を設定する設定手段と、
前記設定手段により設定された前記監視周期ごとに、監視を開始する監視開始信号を生成する生成手段と、
前記生成手段により生成された前記監視開始信号に応じて、前記収集手段により収集された各デバイスのうち分析対象となる時系列データ、及び、前記決定手段によって決定された前記検知アルゴリズムを用いて、前記分析対象となる時系列データを分析し、当該分析結果を表示部に出力する分析手段と
を備えることを特徴とする請求項1乃至17の何れか1項に記載のプログラマブルロジックコントローラ。
A setting means for setting the monitoring cycle of the device and
A generation means for generating a monitoring start signal for starting monitoring for each monitoring cycle set by the setting means, and a generation means for generating a monitoring start signal.
In response to the monitoring start signal generated by the generation means, the time-series data to be analyzed among the devices collected by the collection means and the detection algorithm determined by the determination means are used. The programmable logic controller according to any one of claims 1 to 17, further comprising an analysis means for analyzing the time-series data to be analyzed and outputting the analysis result to the display unit.
前記収集手段により収集されたデバイスの時系列データを、前記分類手段及び前記特定手段によって用いられる前に、一旦保持するメモリカードをさらに備えることを特徴とする請求項1乃至18の何れか1項に記載のプログラマブルロジックコントローラ。 One of claims 1 to 18, further comprising a memory card that temporarily holds the time-series data of the device collected by the collecting means before being used by the classification means and the specific means. Programmable logic controller described in. ユーザプログラムを繰り返し実行する実行エンジンと、前記ユーザプログラムに従って前記実行エンジンによりアクセスされるデータを記憶する記憶領域である複数のデバイスを有するデバイスメモリと、前記ユーザプログラムのスキャン周期ごとに所定の収集設定に従って前記複数のデバイスのうち収集対象のデバイスで保持されているデータを収集する収集手段とを備えるプログラマブルロジックコントローラと通信可能に接続された分析装置であって、
前記収集手段によって収集された各デバイスの時系列データを前記プログラマブルロジックコントローラから取得する取得手段と、
前記収集手段によって取得された各デバイスの時系列データの特徴に基づいて、各デバイスを複数の類型のいずれかにそれぞれ分類する分類手段と、
各デバイスについて前記収集手段によって収集されたデバイスの時系列データ及び前記分類手段により当該デバイスが分類された類型に従って、当該デバイスを異常デバイスとして特定する際の検知アルゴリズムを決定する決定手段と、
前記収集手段によって収集されたデバイスの時系列データを、前記分類手段によって当該デバイスが分類された類型に従い、当該デバイスに対して前記決定手段によって決定された検知アルゴリズムを用いて分析することで異常デバイスを特定する特定手段と、
前記特定手段による特定結果を出力する出力手段と
を備えることを特徴とする分析装置。
An execution engine that repeatedly executes the user program, a device memory having a plurality of devices that are storage areas for storing data accessed by the execution engine according to the user program, and a predetermined collection setting for each scan cycle of the user program. An analyzer that is communicably connected to a programmable logic controller comprising a collecting means for collecting data held by the device to be collected among the plurality of devices according to the above.
An acquisition means for acquiring time-series data of each device collected by the collection means from the programmable logic controller, and
A classification means for classifying each device into one of a plurality of types based on the characteristics of the time series data of each device acquired by the collection means.
For each device, a determination means for determining a detection algorithm for identifying the device as an abnormal device according to the time series data of the device collected by the collection means and the type in which the device is classified by the classification means.
Anomalous devices are analyzed by analyzing the time-series data of the devices collected by the collecting means according to the type in which the devices are classified by the classification means using the detection algorithm determined by the determining means for the devices. With specific means to identify
An analyzer comprising an output means for outputting a specific result by the specific means.
JP2020161926A 2020-01-31 2020-09-28 Programmable logic controller and analyzer Pending JP2021125218A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
US17/126,209 US11982987B2 (en) 2020-01-31 2020-12-18 Programmable logic controller and analyzer
CN202110127485.0A CN113204203A (en) 2020-01-31 2021-01-29 Programmable logic controller and analyzer

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2020014970 2020-01-31
JP2020014970 2020-01-31

Publications (1)

Publication Number Publication Date
JP2021125218A true JP2021125218A (en) 2021-08-30

Family

ID=77459472

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2020161926A Pending JP2021125218A (en) 2020-01-31 2020-09-28 Programmable logic controller and analyzer

Country Status (1)

Country Link
JP (1) JP2021125218A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP7550130B2 (ja) 2021-10-26 2024-09-12 株式会社オービック 異常検知装置、異常検知方法、異常検知プログラム及び基幹系情報システム

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP7550130B2 (ja) 2021-10-26 2024-09-12 株式会社オービック 異常検知装置、異常検知方法、異常検知プログラム及び基幹系情報システム

Similar Documents

Publication Publication Date Title
US20210240154A1 (en) Programmable logic controller and analyzer
US10503146B2 (en) Control system, control device, and control method
US10915419B2 (en) Industrial control system, and assistance apparatus, control assist method, and program thereof
JP7406451B2 (en) programmable logic controller
US10901398B2 (en) Controller, control program, control system, and control method
JP2005243008A (en) Diagnostic system, diagnostic method, tool and component
JP7450471B2 (en) Programmable logic controller and PLC system
JP7275062B2 (en) System, method and computer readable storage medium for anomaly detection in time-varying system behavior
CN112673326B (en) Control device and storage medium
US12008072B2 (en) Control system and control method
CN112612239A (en) Programmable logic controller
JP2020047016A (en) Control apparatus and control system
JP7413742B2 (en) Prediction system, information processing device and information processing program
JP2021125218A (en) Programmable logic controller and analyzer
JP7102801B2 (en) Control system, control device and display device
US20220317650A1 (en) Analysis apparatus, control method thereof, and analysis system
JP2021189482A (en) Programmable logic controller
JP2020057289A (en) Information processor, calculation method, and calculation program
US11516099B2 (en) Resource monitoring system, resource monitoring method, and information storage medium
JP7450470B2 (en) Setting device and PLC system
JP7524784B2 (en) Information processing device, control system, and report output method
EP4254104A1 (en) Device and program for collecting data
EP4361742A1 (en) Prediction system, information processing device, and information processing program
JP6984786B1 (en) System construction support program, system construction support method, and system construction support device
JP7461811B2 (en) Programmable Logic Controller

Legal Events

Date Code Title Description
RD02 Notification of acceptance of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7422

Effective date: 20210113

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20230615

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20240209

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20240315

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20240508

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20240830