Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JP7558735B2 - Programmable logic controller and analytical device - Google Patents
[go: Go Back, main page]

JP7558735B2 - Programmable logic controller and analytical device - Google Patents

Programmable logic controller and analytical device Download PDF

Info

Publication number
JP7558735B2
JP7558735B2 JP2020161926A JP2020161926A JP7558735B2 JP 7558735 B2 JP7558735 B2 JP 7558735B2 JP 2020161926 A JP2020161926 A JP 2020161926A JP 2020161926 A JP2020161926 A JP 2020161926A JP 7558735 B2 JP7558735 B2 JP 7558735B2
Authority
JP
Japan
Prior art keywords
data
series data
unit
time series
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.)
Active
Application number
JP2020161926A
Other languages
Japanese (ja)
Other versions
JP2021125218A (en
Inventor
哲也 宮坂
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
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/CN113204203B/en
Publication of JP2021125218A publication Critical patent/JP2021125218A/en
Application granted granted Critical
Publication of JP7558735B2 publication Critical patent/JP7558735B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Programmable Controllers (AREA)

Description

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

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

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

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

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

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

本発明は、例えば、プログラマブルロジックコントローラであって、
ユーザプログラムを繰り返し実行する実行エンジンと、
前記ユーザプログラムに従って前記実行エンジンによりアクセスされるデータを記憶する記憶領域である複数のデバイスを有するデバイスメモリと、
前記ユーザプログラムの実行周期ごとに所定の収集設定に従って前記複数のデバイスのうち収集対象のデバイスで保持されているデータを収集する収集手段と、
前記収集手段によって収集された各デバイスの時系列データの特徴に基づいて、各デバイスを複数の類型のいずれかにそれぞれ分類する分類手段と、
各デバイスについて前記収集手段によって収集されたデバイスの時系列データ及び前記分類手段により当該デバイスが分類された類型に従って、当該デバイスを異常デバイスとして特定する際の検知アルゴリズムを決定する決定手段と、
前記収集手段によって収集されたデバイスの時系列データを、前記分類手段によって当該デバイスが分類された類型に従い、当該デバイスに対して前記決定手段によって決定された検知アルゴリズムを用いて分析することで異常デバイスを特定する特定手段とを備え
前記類型は、一定の値をとるビットデバイスの類型と、前記プログラマブルロジックコントローラの動作サイクルに同期して値が定常的なパターンで変化するビットデバイスの類型と、前記動作サイクルとは異なる周期に同期して値が定常的なパターンで変化するビットデバイスの類型と、不定期でビットデバイスの値が変化するビットデバイスの類型と、アナログ値の類型と、値が単調増加又は単調減少する類型とのうち、少なくとも2つの類型を含むことを特徴とする。
The present invention relates to, for example, a programmable logic controller,
an execution engine for repeatedly executing a user program;
a device memory having a plurality of devices which are storage areas for storing data accessed by the execution engine according to the user program;
a collection means for collecting data held in a collection target device among the plurality of devices in accordance with 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 characteristics of the time-series data of each device collected by the collection means;
A determination means for determining a detection algorithm for identifying each device as an abnormal device according to the time-series data of the device collected by the collection means and the type into which the device is classified by the classification means;
a device identification unit that identifies an abnormal device by analyzing the time-series data of the device collected by the collection unit according to the type into which the device is classified by the classification unit, using the detection algorithm determined by the determination unit for the device ;
The types include at least two types among a bit device type having a constant value, a bit device type whose value changes in a steady pattern in synchronization with the operation cycle of the programmable logic controller, a bit device type whose value changes in a steady pattern in synchronization with a period different from the operation cycle, a bit device type whose value changes irregularly, an analog value type, and a type whose value monotonically increases or decreases .

また、本発明は、例えば、ユーザプログラムを繰り返し実行する実行エンジンと、前記ユーザプログラムに従って前記実行エンジンによりアクセスされるデータを記憶する記憶領域である複数のデバイスを有するデバイスメモリと、前記ユーザプログラムのスキャン周期ごとに所定の収集設定に従って前記複数のデバイスのうち収集対象のデバイスで保持されているデータを収集する収集手段とを備えるプログラマブルロジックコントローラと通信可能に接続された分析装置であって、
前記収集手段によって収集された各デバイスの時系列データを前記プログラマブルロジックコントローラから取得する取得手段と、
前記収集手段によって取得された各デバイスの時系列データの特徴に基づいて、各デバイスを複数の類型のいずれかにそれぞれ分類する分類手段と、
各デバイスについて前記収集手段によって収集されたデバイスの時系列データ及び前記分類手段により当該デバイスが分類された類型に従って、当該デバイスを異常デバイスとして特定する際の検知アルゴリズムを決定する決定手段と、
前記収集手段によって収集されたデバイスの時系列データを、前記分類手段によって当該デバイスが分類された類型に従い、当該デバイスに対して前記決定手段によって決定された検知アルゴリズムを用いて分析することで異常デバイスを特定する特定手段と、
前記特定手段による特定結果を出力する出力手段と
を備え
前記類型は、一定の値をとるビットデバイスの類型と、前記プログラマブルロジックコントローラの動作サイクルに同期して値が定常的なパターンで変化するビットデバイスの類型と、前記動作サイクルとは異なる周期に同期して値が定常的なパターンで変化するビットデバイスの類型と、不定期でビットデバイスの値が変化するビットデバイスの類型と、アナログ値の類型と、値が単調増加又は単調減少する類型とのうち、少なくとも2つの類型を含むことを特徴とする。
The present invention also provides an analysis device communicably connected to a programmable logic controller, the analysis device comprising, for example, 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 in accordance with the user program, and collection means that collects data held in a collection target device among the plurality of devices in accordance with a predetermined collection setting for each scan period of the user program,
an acquisition means for acquiring the time series data of each device collected by the collection means from the programmable logic controller;
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;
A determination means for determining a detection algorithm for identifying each device as an abnormal device according to the time-series data of the device collected by the collection means and the type into which the device is classified by the classification means;
an identification means for identifying an abnormal device by analyzing the time series data of the device collected by the collection means according to the type into which the device is classified by the classification means, using the detection algorithm determined by the determination means for the device;
an output unit that outputs a result of the determination by the determination unit ;
The types include at least two types among a bit device type having a constant value, a bit device type whose value changes in a steady pattern in synchronization with the operation cycle of the programmable logic controller, a bit device type whose value changes in a steady pattern in synchronization with a period different from the operation cycle, a bit device type whose value changes irregularly, an analog value type, and a type whose value monotonically increases or decreases .

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

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

以下、添付図面を参照して実施形態が詳しく説明される。尚、以下の実施形態は特許請求の範囲に係る発明を限定するものではなく、また実施形態で説明されている特徴の組み合わせの全てが発明に必須のものとは限らない。実施形態で説明されている複数の特徴のうち二つ以上の特徴が任意に組み合わされてもよい。また、同一又は同様の構成には同一の参照番号が付され、重複した説明は省略される。同一又は類似の要素を示す参照符号の末尾には小文字のアルファベットが付与されることがある。複数の要素に共通する事項が説明される場合、小文字のアルファベットが省略される。 The embodiments are described in detail below with reference to the attached drawings. Note that the following embodiments do not limit the invention according to the claims, and not all combinations of features described in the embodiments are necessarily essential to the invention. Any combination of two or more features among the multiple features described in the embodiments may be used. In addition, the same reference numbers are used for the same or similar configurations, and duplicate descriptions are omitted. Lowercase letters may be added to the end of reference numbers indicating the same or similar elements. When matters common to multiple elements are described, the lowercase letters are omitted.

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

図1は、本発明の実施の形態によるプログラマブル・ロジック・コントローラシステムの一構成例を示す概念図である。図1が示すように、このシステムは、ラダープログラムなどのユーザプログラムの編集を行うためのPC2aと、工場等に設置される各種制御装置を統括的に制御するためのPLC(プログラマブルロジックコントローラ)1とを備えている。PCはパーソナルコンピュータの略称である。ユーザプログラムは、ラダー言語やSFC(シーケンシャルファンクションチャート)などのフローチャート形式のモーションプログラムなどのグラフィカルプログラミング言語を用いて作成されてもよいし、C言語などの高級プログラミング言語を用いて作成されてもよい。以下では、説明の便宜上、ユーザプログラムはラダープログラムとする。PLC1は、CPUが内蔵された基本ユニット3と、1つ乃至複数の拡張ユニット4を備えている。基本ユニット3に対して1つ乃至複数の拡張ユニット4が着脱可能となっている。 Figure 1 is a conceptual diagram showing an example of the configuration of a programmable logic controller system according to an embodiment of the present invention. As shown in Figure 1, this system includes a PC 2a for editing user programs such as ladder programs, and a PLC (Programmable Logic Controller) 1 for comprehensively controlling various control devices installed in a factory or the like. 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 motion program in a flow chart format 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 is referred to as a ladder program. The PLC 1 includes a basic unit 3 with a built-in CPU, and one or more expansion units 4. One or more expansion units 4 are detachable 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 called the CPU unit) 3 is equipped with 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 the PLC 1 and error information generated in the PLC 1. Here, the device includes various devices (relays, timers, counters, etc.) included in the basic unit 3 and the expansion unit 4, and also refers to an area on the memory provided to store the device value (device data), 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 a volatile RAM or the like may be made non-volatile by a 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 the input state from the input device, the output state to the output device, and the state of the internal relay (auxiliary relay), timer, counter, data memory, etc. set on the user program. Device values are classified into bit and word types. A bit device stores a one-bit device value, such as 0/1, ON/OFF, H/L, etc. A word device stores a one-word device value. A variable may be specified as a device to be collected by a data utilization program described in detail below. A variable is also a storage means for storing information, and is accessed by an execution engine according to a user program. Therefore, in the following description, a device also refers to a variable. A memory that stores a device may be called a device memory. A memory that stores collected data may be called a data memory.

拡張ユニット4は、PLC1の機能を拡張するために用意されている。各拡張ユニット4には、その拡張ユニット4の機能に対応するフィールドデバイス(被制御装置)10が接続されることがあり、これにより、各フィールドデバイス10が拡張ユニット4を介して基本ユニット3に接続される。フィールドデバイス10は、センサやカメラなどの入力機器であってもよいし、アクチュエータなどの出力機器であってもよい。また、一つの拡張ユニット4に対して複数のフィールドデバイスが接続されてもよい。 The expansion unit 4 is provided to expand the functions of the PLC 1. A field device (controlled device) 10 corresponding to the function of each expansion unit 4 may be connected to each expansion unit 4, and each field device 10 is thereby connected to the basic unit 3 via the expansion unit 4. The field device 10 may be an input device such as a sensor or a camera, or an output device such as an actuator. In addition, multiple 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 workpiece, or it 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 is a data utilization unit that collects data to be collected from the basic unit 3 and the expansion unit 4b, executes a user program (data utilization program) such as a flow, processes the collected data to create data to be displayed, and creates display data (source data) for displaying a dashboard on the display unit 7 or the PC 2. In this embodiment, an example in which the expansion unit 4a collects data from each device is described, but the collection unit may be provided in the basic unit 3 or in another expansion unit. The expansion unit 4a can also function as an analysis device that analyzes the collected data according to instructions from the basic unit 3 or a predetermined timing. In this embodiment, an example in which the expansion unit 4a operates as an analysis device is described, but this is not intended to limit the present invention, and the basic unit 3 may function as the analysis device, or an external device such as the PCs 2a and 2b may function as the analysis device. The flow (flow program) described below is merely one example of a data utilization program. The basic unit 3 may also be called a CPU unit. A system including the PLC 1 and the PC 2 may also 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 operated mainly by a programmer. On the other hand, PC2b is a computer operated mainly by a field staff. PC2a may be called a program creation support device (setting device). PC2 is, for example, a portable notebook type or tablet type personal computer or a smartphone, and is an external computer equipped with 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 the PLC1, is created using PC2a. The created ladder program is converted into a mnemonic code in PC2a. PC2 is connected to the basic unit 3 of the PLC1 via a communication cable 9 such as a USB (Universal Serial Bus) cable. For example, PC2a sends the ladder program converted into the mnemonic code to the basic unit 3. The basic unit 3 converts the ladder program into a machine code and stores it in a memory provided in the basic unit 3. Note that, although the mnemonic code is transmitted to the basic unit 3 here, the present invention is not limited to this. For example, PC2a 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. 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 a USB cable. 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, a 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 executes the project editing program 14a stored in the storage device 12a on the CPU 11a, and edits the project data 15 through the operation unit 8a. The CPU 11a executes the project editing program 14a, thereby realizing the project creation unit 16 and the project transfer unit 17. 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 PLC 1. The project data 15 includes one or more user programs (e.g., ladder program, control program, motion program, data utilization program), configuration information of the basic unit 3 and the expansion unit 4, setting information of specific functions provided in the basic unit 3 and the expansion unit 4, etc. The configuration information includes the connection positions of the multiple expansion units 4 relative to the basic unit 3 and device allocation information. It may also include information indicating the functions provided in the basic unit 3 (e.g., data collection function, communication function, positioning function), information indicating the functions of the expansion unit 4 (e.g., communication function, positioning function, shooting function), etc. The setting information of a specific function includes setting information on the functions (e.g., data collection function, communication function, positioning function) provided in the basic unit 3, for example, in the case of a data collection function, including setting information on data collection conditions and data collection targets, and setting information on the functions of the expansion unit 4 (e.g., communication function, positioning function, data utilization function, photography function). Here, editing the project data 15 includes creating and changing (re-editing) the project data 15. The user can read the project data 15 stored in the storage device 12a as necessary and change the project data 15 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, a 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 executes the web browser program 14d to realize the web browser 18. The web browser 18 accesses the setting page of the data utilization application provided by the extension unit 4a and accesses the dashboard page via the communication unit 13b. The CPU 11b also displays the identification result (judgment result) on the display unit 7b according to the screen information indicating the identification result (judgment result) when an abnormality occurs, which is transmitted from the extension 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 the PLC 1. 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, or 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 has 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 project data input from the PC 2a. The first buffer 37a stores device values (time-series data) to be collected from the device unit 34 for each scan period. The first buffer will be described in detail later with reference to FIG. 5. When a 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 storing the time series data in the memory card 44 in this way, for example, data to be classified or identified can be verified later by an external device, and important latest data can be stored as log information. In addition, in the present invention, data of all devices related to the PLC 1 is basically collected, so the collected data is huge, and the effect of reducing the processing load can be expected by storing the data to be processed in a separate memory. Furthermore, it is also possible to easily execute the collection process and the process related to the collected data (classification process and identification process) in parallel. Here, the storage condition is established when an abnormality occurs in the PLC, when a device that is a storage trigger is specified in advance by the user and a predetermined change occurs in the device, when an analysis command is issued by the user, when a periodic monitoring period has elapsed, when an analysis command is issued from an expansion unit connected to the basic unit 3, etc. The storage condition may be set in advance by the user and stored in the storage device 32 of the basic unit 3 as part of the project data. When the CPU 31 detects that the storage condition is satisfied, the CPU 31 issues a command to store the device value stored in the first buffer 37a in a memory card 44 such as an SD card, and notifies the expansion unit 4a that the data to be analyzed has been stored. The control program for the basic unit 3 is stored in the project storage unit 35 as 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. In FIG. 4, a communication circuit related to the expansion bus 90 is implemented in the CPU 31, but may be implemented as part of the communication unit 33. The communication unit 33 may have a network communication circuit. The CPU 31 receives project data from the PC 2a via the communication unit 33.

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

拡張ユニット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. The expansion unit 4a may further include a memory card (e.g., an SD card) that is detachable from the expansion unit 4a and stores time-series data, which is control data from each device. The CPU 41b of the expansion unit 4b controls the field device 10 according to instructions (device values) from the basic unit 3 stored in the device. The CPU 41b also stores the control results of the field device 10 in a device called a buffer memory. The control results stored in the device are transferred to the basic unit 3 by input/output refresh. The control results stored in the device are also transferred to the basic unit 3 according to a read command 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, a storage area used as a buffer memory is secured in the RAM. The memory 42 may include a buffer that temporarily holds data acquired by the field device 10 (e.g., device values, still image data, video data).

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

なお、制御データを収集する機能は、データ活用アプリケーション以外のユーザプログラムによって実現されてもよい。また、収集されたデータに関連する処理を行う機能には、プログラマブルロジックコントローラの異常時において異常デバイスを特定する特定機能や、正常時の時系列データとの乖離を分析し、いつもと違うデバイス値を検証する分析機能、定期的に上記分析を行う監視機能が含まれる。フローはデータを収集する演算ブロック、データ処理を実行する演算ブロック、及び、表示データを作成する演算ブロックなどを有してもよい。ダッシュボードは、グラフ表示部品や数値表示部品などを有する。これらの表示部品は、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. The function of performing processing related to the collected data includes a function of identifying an abnormal device when the programmable logic controller is abnormal, a function of analyzing deviations from normal time-series data and verifying device values that are different from usual, and a monitoring function of periodically performing the above analysis. The flow may have an operation block that collects data, an operation block that executes data processing, and an operation block that creates display data. The dashboard has a graph display component and a numerical display component. These display components may be realized by HTML data, CSS data, and JavaScript (registered trademark) code. The collection of HTML data, CSS data, and JavaScript (registered trademark) code may be called a Web application. In this embodiment, the flow is realized by a flow template. The flow template is prepared in advance for each application, and has one or more operation blocks in which flow template parameters specified by the user are set. The dashboard is also realized by a template. A dashboard template has one or more display components for which dashboard template parameters specified by the user are set. Dashboard template parameters are a wide variety of information, such as the name of the dashboard, device names, numerical values, and unit variable names. A unit variable is a variable that the extension unit 4a uses to hold the execution results of a 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 the functions realized by the CPU 31 regarding data utilization. The execution engine 51 repeatedly executes a user program for each scan period, which is an execution period. The execution engine 51 may be realized by an ASIC or FPGA provided outside the CPU 31. ASIC is an abbreviation for application specific integrated circuit. FPGA is an abbreviation for field programmable gate array. These dedicated circuits can often execute specific data processing faster 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 period, which is an execution period, creates a data record, and stores the data record in the first buffer 37a. When the execution engine executes a ladder program as a user program, the scan period of the ladder program corresponds to the execution period, and when the execution engine executes a motion program as a user program, the control period of the motion program corresponds to the execution period. When collecting device values for each scan period of the ladder program, the device values to be collected may be collected from the device unit 34 during the end processing period of the scan period, and a data record may be created and stored in the first buffer 37a. 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 for collecting data (program code such as a trigger command). 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 period is set by the user, transferred as part of the project data, and stored as the collection setting 36a in the storage device 32 of the basic unit 3. In addition to the collection period, the collection setting 36a includes devices to be collected. The collection period may be a period different from the scan period, which is the execution period, and the control period of the motion program. In this case, the device values to be collected may be collected from the device unit for each collection period specified by the collection setting 36a, and a data record may be created and stored in the first buffer 37a. Here, the basic unit 3 may analyze characteristics such as periodicity and continuity of each device value by its own device or by the expansion unit 4a when collecting data, and classify the devices according to the analysis results. On the other hand, such analysis may not be performed when collecting data, but may be performed by the device itself or by the expansion unit 4a when it is necessary to analyze the data, such as when time series data for a predetermined number of scan periods has been collected or when an abnormality occurs.

第一バッファ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 susceptible to the effects of extended scan time due to collection and transfer processes. The device values to be collected are specified by the collection settings 36a. The collection settings 36a can 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 a memory card 44 provided in the basic unit 3, and transfers the data records saved in the memory card 44 to the expansion unit 4a. The transfer unit 53a executes the transfer process when communication traffic on the expansion bus 90 is free, but a dedicated expansion bus for sending data records to the expansion unit 4a may also be provided.

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

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

<データ活用ユニットの機能>
図6は拡張ユニット4aのCPU41aによって実現される機能を説明する図である。
<Functions of the Data Utilization Unit>
FIG. 6 is a diagram for explaining the functions 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 that collects (obtains) 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 part of the project data, and stored in the memory 42a of the expansion unit 4a. The collection 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 example is described in which the basic unit 3 collects the device value and temporarily stores it in a buffer, and then the collection unit 52c of the expansion unit 4a collects it at a predetermined timing. However, the present invention is not limited to this, and an analysis unit such as the extension unit 4a may directly acquire the device value and store the device value in a memory provided in the extension 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 missing. 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. 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 PC 2b and writes them to the memory 42a. The processing setting 61 includes information and a flow (program) that defines the data processing to be performed on the collected data by the data processing unit 73. The display settings 62 include dashboard templates (HTML data, CSS, JavaScript (registered trademark) code, etc.) that provide data processing results 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による異常デバイスの推定は、プログラマブルロジックコントローラの運用中に異常が発生した場合や、定期的に、或いはユーザからの監視指示に基づいて開始してもよい。また、ユーザにより予め設定された保存条件が満たされた場合に、開始してもよい。 Furthermore, the CPU 41a of the expansion unit 4a realizes a classification unit 76, a determination unit 77, an identification unit 78, and a 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. 12. The classification unit 76 executes the classification process at any timing, but basically executes the classification process at the timing when the operation of the system is started or when an instruction from the user is received. The determination unit 77 determines parameters for identifying an 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 executes a parameter determination process, and updates the parameter if a parameter has already been determined for the same device. When updating, the parameter may be updated by overwriting, or a new parameter may be determined from two parameters, such as by taking an average value. In addition, the process at the time of update may be determined for each device. In this way, the classification unit 76 and the determination unit 77 are processing units that function in a learning phase in which the collected data is analyzed to learn what the data is like under normal conditions, and determine parameters for estimating an abnormal device. On the other hand, the identification unit 78 is a processing unit that functions in an estimation phase in which an abnormal device is estimated. The identification unit 78 uses the determined parameters to identify an abnormal device from the time-series data of each device collected by the collection unit 52c. Details of the identification process will be described later. Here, an abnormal device refers to a storage area of the device memory in which data different from that under normal conditions is stored. The identification unit 78 may start estimating an abnormal device when an abnormality occurs during operation of the programmable logic controller, periodically, or based on a monitoring instruction from a user. It may also start when a storage condition previously set by a user is satisfied.

生成部74は、ダッシュボードの表示部品を定義する表示設定62にしたがって、ダッシュボードのテンプレートにデータ処理結果を代入することで、ダッシュボードの表示データを作成する。また、生成部74は、特定部78による異常デバイスの特定結果に基づいて、当該特定結果を表示するための表示データ(画面情報)を作成する。表示データは、例えば、HTMLデータや画像データ、CSS(カスケーディングスタイルシート)、JavaScript(登録商標)のコードなどであってもよい。表示部品としては、例えば、円グラフ部品、棒グラフ部品、折れ線グラフ部品、数値表示部品などが含まれる。Webサーバ70は、Webブラウザ18によりダッシュボードのWebページにアクセスがあると、ダッシュボードの表示データをWebブラウザ18に送信する。Webブラウザ18が表示データを受信してダッシュボードを表示する。また、送信部79は、生成部74によって生成された表示データを外部装置に送信する。送信する際の通信回線、通信手法については特に限定はしない。また、無線接続であっても、有線接続であってもよい。 The generating unit 74 creates display data for the dashboard by substituting the data processing results into the dashboard template according to the display settings 62 that define the display components of the dashboard. The generating unit 74 also creates display data (screen information) for displaying the identification results based on the identification results of the abnormal device by the identifying unit 78. The display data may be, for example, HTML data, image data, CSS (Cascading Style Sheets), or JavaScript (registered trademark) code. Examples of the display components include pie chart components, bar chart components, line graph components, and numerical display components. When the web page of the dashboard is accessed 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. The transmitting unit 79 also transmits the display data generated by the generating unit 74 to an external device. There are no particular limitations on the communication line and communication method used when transmitting. Also, the connection may be wireless or wired.

なお、複数のデータ活用アプリケーションが提供されることがある。この場合、データ活用アプリケーションごとに必要とするデータと読み出しタイミングが異なることがあり、データ活用アプリケーションごとにサブバッファがメモリ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を介して実行される。 Note that multiple data utilization applications may be provided. In this case, the data and read timing required for each data utilization application may differ, and a sub-buffer may be secured in the memory 42a for each data utilization application. The collection unit 52c reads the data records stored in the second buffer 37b and stores the data for the first data utilization application in the first sub-buffer 38a. The collection unit 52c reads the data records stored in the second buffer 37b and stores the data for the second data utilization application in the second sub-buffer 38b. Note that the collection unit 52c may read the data records stored in the third buffer 37c and store the data for the first data utilization application in the first sub-buffer 38a. The collection unit 52c may read the data records stored in the third buffer 37c and store the data for the second data utilization application in the second sub-buffer 38b. The data processing unit 73 reads the data from the first sub-buffer 38a according to the first data utilization application, executes data processing, and generates a processing result. The data processing unit 73 reads the data from the second sub-buffer 38b according to the second data utilization application, executes data processing, and generates a processing result. The decompression engine 75 is a function paired 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 data compressed and transferred by the basic unit 3 and stores the data in the second buffer 37b. The decompression engine 75 decompresses data compressed and transferred by the expansion unit 4b and stores the data in the third buffer 37c. This will reduce congestion in communication traffic on the expansion bus 90. The decompression engine 75 may be realized by an ASIC or FPGA, etc. In this way, data transmission between the basic unit 3 and the expansion units 4a, 4b is performed 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を読み出して表示画面(ソースデータ)を作成する。このようにサブバッファを活用することで、元のデータを変更することなくバッファ内に維持することが可能となる。バッファ内に保持された元のデータは他の目的で利用可能となる。 There may be multiple pieces of data required for each data utilization application. In that case, the chunks of data collected in each scan may be kept in the buffer, and multiple pieces of data required may be stored in the sub-buffer. Furthermore, even when distributing data to the sub-buffer, a timestamp or the like may be added to each record. As shown in FIG. 16, the second buffer 37b (or the third buffer 37c) holds chunks of collected data. One record includes a scan number, a timer value (timestamp), and collected data. In this example, the collected data includes relays RL1 to RL3, and devices Dev1 and Dev2. The first data utilization application 1601 requires relays RL1 to RL3 from the collected data. Therefore, the scan number, timer value, and relays RL1 to RL3 are read from the second buffer 37b and stored in the first sub-buffer 38a. The first data utilization application 1601 reads the scan number, timer value, and relays RL1 to RL3 from the first sub-buffer 38a to create a display screen (source data). The second data utilization application 1602 requires relay RL3, devices Dev1, and Dev2 from the collected data. Therefore, the scan number, timer value, relay RL3, devices Dev1, and Dev2 are read from the second buffer 37b and stored in the second sub-buffer 38b. The second data utilization application 1602 reads the scan number, timer value, relay RL3, devices Dev1, and Dev2 from the second sub-buffer 38b to create a display screen (source data). By utilizing the sub-buffer 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 the extension unit 4b related to data utilization>
FIG. 7 is a diagram for explaining the functions 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 (such as executing a motion flow if it is a motion unit). The collection unit 52b collects 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 out the data records stored in the fourth buffer 37d at the timing specified by the collection setting 36 or at the timing when a transfer request is received by the expansion unit 4a, and transfers them to the third buffer 37c of the expansion unit 4a via the expansion bus 90. The transfer unit 53b may transfer the data records at a timing when the communication traffic of the expansion bus 90 monitored by the monitoring unit 54 is low. The compression engine 55b compresses the data records according to the collection setting 36. In other words, the transfer unit 53b may transfer the data records compressed by the compression engine 55b to the expansion unit 4a. The compression engine 55b may be implemented by the CPU 41b, but from the standpoint of high-speed processing and reducing the processing load on the CPU 41b, it may also be implemented by an ASIC or FPGA.

<データレコードの例>
図8は収集部52aによって第一バッファ37aに書き込まれるデータレコード91を示している。複数のデータレコード91は時系列データの一例である。この例で、収集部52aは一スキャン周期ごとに、Dev0、Dev1、Dev10というデバイス名のデバイス値をデバイス部34aから収集し、収集カウント及びタイマーから取得された時刻情報を付加して一つのデータレコードを作成し、第一バッファ37aに格納する。なお、収集対象は、拡張ユニット4bに割り当てられたバッファメモリ又はデバイスに格納されたデータであってもよい。この例で第一バッファ37aはFIFO(先入先出)タイプのバッファである。収集カウントは、一つのデータレコードを収集するたびに1ずつカウントアップされるカウンタのカウント値である。収集カウントはシーケンシャルに付与される番号であるため、データレコードの抜けや圧縮を検出することに役立つ。
<Example of a data record>
FIG. 8 shows a data record 91 written by the collection unit 52a to the first buffer 37a. The multiple data records 91 are an example of time-series data. In this example, the collection unit 52a collects device values of device names Dev0, Dev1, and Dev10 from the device unit 34a for each scan period, and creates one data record by adding the collection count and time information obtained from the timer, and stores the data in the first buffer 37a. The collection target may be data stored in a buffer memory or device assigned 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 one each time a data record is collected. Since the collection count is a number that is assigned sequentially, 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 timestamp is useful, for example, when displaying data acquired by the base unit 3 and data acquired by the expansion unit 4b on a dashboard for comparison. In general, the collection timing in the base unit 3 does not match the collection timing in the expansion unit 4b. Therefore, in order to compare the operation of the base unit 3 and the operation of the expansion unit 4b, information is required to link the data of the base unit 3 with the data of the expansion unit 4b. In general, the base unit 3 and the expansion units 4a and 4b can synchronize their time information by inter-unit synchronization or the like. Therefore, by adding the time information when the base unit 3 and the expansion unit 4b each collected the data record to the data record, the data processing unit 73 can align multiple data records acquired by different units on the time axis.

<転送のタイミング>
図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 data records. As shown in FIG. 9, the PLC 1 repeatedly executes input/output refresh, user program execution, and end processing. In order to reduce the extension of the scan cycle, the transfer processing is executed while avoiding the input/output refresh period. Similarly, in order to reduce the extension of the scan cycle, the transfer processing is executed while avoiding the execution period of UREAD and UWRIT. UREAD is an instruction to read data from the buffer memory assigned to the expansion unit 4, and is described in the user program. Therefore, during the execution period of the user program, the basic unit 3 accesses the expansion unit 4 according to UREAD to obtain data from the buffer memory. UWRIT is an instruction to write data to the buffer memory assigned to the expansion unit 4, and is described in the user program. During the execution period of the user program, the basic unit 3 accesses the expansion unit 4 according to UWRIT to write data to the buffer memory.

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

<情報の圧縮>
図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のビット形式ではないデータ(アナログ値)の場合は、デバイス毎に前回とのデバイス値の変化を検知し、変化を検知した場合に残すように制御してもよい。
<Information compression>
FIG. 10 is a diagram for explaining information compression of data records. The data record group 92a shows data records before information compression. Values that have changed since the previous scan period are shaded. Here, four relay devices RL1, RL2, RL3, and RL4 are specified as collection targets. Also, the scan number is adopted as the collection count. The counter may be time information acquired by a timer or the like (e.g., a numerical value indicating the time interval from when a 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 with scan number "1" and the data record with scan number "2". In other words, the data record with scan number "2" can be compressed (discarded or deleted). However, the relay device RL1 of the data record with scan number "3" is different from the relay device RL1 of the data record with scan number "1". In this way, since the scan number "3" has a change point, the data record with scan number "3" is not compressed. Since there is no change point of the relay device between the data record with scan number "3" and the data record with scan number "4", the data record with scan number "4" can be compressed. Similarly, since there is no change point of the relay device between the data record with scan number "5" and the data record with scan number "6", the data record with scan number "6" can be compressed. By performing information compression focusing on such change points, a compressed data record group 92b is realized. Each data record constituting the compressed data record group 92b has a change point. Thus, in this embodiment, in one or more device groups (RL1 to RL4), if the value collected in the previous scan cycle and the value collected in the current scan cycle do not change for all devices in the group to be collected, the value collected in the current scan cycle is deleted and the collected time series data is compressed. Note that here, an example of managing in a group has been described, but this is not intended to limit the present invention, and data may be compressed by determining ON/OFF for each device without grouping. In the case of data that is not in an ON/OFF bit format (analog value), a change in device value from the previous time may be detected for each device, and if a change is detected, the data may be controlled to be retained.

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

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 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 collection settings that have been set. Here, the process may proceed to the next step when a predetermined amount of collected data has been stored. In other words, the timing to move to the learning phase is determined here, and the process proceeds to the next step when a sufficient amount of data for learning (time series data for a predetermined number of scan cycles) has been accumulated in a storage unit such as a buffer or memory card.

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

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 collection settings that have been set. The processing from S4 onwards is processing during actual system operation. The data collection here is basically the same as that in S2 above. The learning phase may be performed when the system starts operating, or may be started when an instruction from the user is received. It may also be performed periodically. That is, data collection is always performed during system operation, the learning phase is performed periodically, and the estimation phase is performed when the storage condition is satisfied. For example, when an abnormality occurs during 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 (identification unit 78) acquires the time series data stored in the memory card 44 and applies the parameters determined in S3 to identify the abnormal device. That is, processing in the estimation phase is performed here, and details will be described later using FIG. 16. Further, the CPU 41a generates display data indicating the identification result by the generating unit 74 based on the identification result identified by the identifying unit 78, and displays the display data on the display unit 5 of the basic unit 3, or transmits the generated display data or the identification result to an external device by the transmitting unit 79 via the communication unit 43. In this case, the identification result is displayed to the operator in the external device. The operation of S5 may be a method in which, 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 identifies the abnormal device, or a method in which the device value is constantly collected and analyzed to see if there is an abnormality in the device value, a method in which the device value collected by the basic unit is analyzed when a device value predetermined by the user changes in a predetermined manner, or a method in which the device value is analyzed periodically or based on a monitoring instruction from the user. In these cases, "abnormality" indicates that the device value to be analyzed is different from the device value in the normal state, i.e., that it deviates from the data in the normal state, and does not necessarily indicate an abnormality occurring in the programmable logic controller. The processing steps of the estimation phase for identifying abnormal devices from data collection taking into account these collection timings will be described in detail later using FIG. 16.

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

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

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

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

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

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

S21でCPU41aは、分類対象の時系列データがビットデバイスのデバイス値であるか否かを判断する。ビットデバイスのデバイス値であればS22に進み、そうでなければ、図13BのS27に進む。 In S21, the CPU 41a determines whether the time series data to be classified is a device value of a bit device. If it is a device value of a 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 judges whether or not there is a change in the value of the time series data to be classified. If there is a change, proceed to S24, and if there is no change and the value is constant, proceed to S23. In S23, the CPU 41a classifies the time series data to be classified as a device (1203) that has a constant value, and ends the process. Here, as classification information, information linked to the time series data, for example, flag information indicating the classified type, is linked to the time series data or the identification information indicating the device corresponding to the time series data and stored. In this way, by linking and storing the flag information of the type classified at the time of classification in the learning phase and the identification information of the device, in the estimation phase, according to which device the time series data to be verified is from, it is possible to easily select evaluation variables and parameters, which are the detection algorithm for abnormal devices, according to the type linked to the identification information of the device. In other words, in the estimation phase, the process of identifying which type the time series data to be verified corresponds to can be omitted. As the classification information, flag information indicating the classification type is shown as an example, but algorithm information indicating an algorithm for identifying an abnormal device may be used instead of flag information. Also, it goes without saying that, if the device corresponding to the time series data is a variable, the identification information stored as the classification information will be identification information indicating the variable.

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

なお、CPU41aは、特定のデバイスに関する時系列データの値の変化に基づいて、装置の動作サイクルや装置の動作サイクル以外の周期を特定してもよい。たとえば、特定のデバイスのデバイス値は、装置の各動作サイクル内で一つのパルスを有し、各動作サイクルの開始タイミングを規定する変化点を有する時系列データとして収集される。つまり、特定のデバイスの値は、装置の動作サイクルと同期して変化するもので、その変化点は動作サイクルを規定するものである。このような特定のデバイスは、オペレータの選択により設定されてもよい。同様にして、動作サイクル以外の周期を規定するデバイスも、オペレータの選択により設定されてもよい。もちろん、収集した時系列データから当該デバイスの動作サイクルを自動的に特定するようにしてもよいし、特定後においてオペレータにより調整可能にしてもよい。これによりオペレータをより支援することができ、経験の浅いオペレータに対しても使い勝手の良い操作体系を提供することができる。また、動作サイクル以外の周期で動作するデバイスは、動作サイクルを基準とすると不定期で動作するデバイスと定義してもよく、たとえば、動作サイクル以外の周期を規定するデバイスを設定しない場合、CPU41aは、動作サイクル以外の周期で動作するデバイスを不定期で動作するデバイス(1204)に分類する。 The CPU 41a may specify the operation cycle of the device or a period other than 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 the specific device has one pulse in each operation cycle of the device and is collected as time series data having a change point that specifies the start timing of each operation cycle. In other words, the value of the specific device changes in synchronization with the operation cycle of the device, and the change point specifies the operation cycle. Such a specific device may be set by the selection of the operator. Similarly, a device that specifies a period other than the operation cycle may also be set by the selection of the operator. Of course, the operation cycle of the device may be automatically specified from the collected time series data, or may be adjustable by the operator after specification. This can provide more support to the operator, and an easy-to-use operation system can be provided even for inexperienced operators. A device that operates in a period 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 specifies a period other than the operation cycle is not set, the CPU 41a classifies the device that operates in a period other than the operation cycle as a device that operates 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, where 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 determines whether or not the extreme value of the changing signal is a predetermined value or more. 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 the value is changing at a predetermined cycle, and if it is not changing at the predetermined cycle, proceeds to S29, and if it is changing, proceeds to S210. In S210, the CPU 41a determines whether the changing value is monotonically increasing or decreasing. If it is monotonically increasing or decreasing, proceeds to S211, and if not, proceeds to S29.

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

以上のように、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 of the devices to be classified. In addition, the CPU 41a may accept the setting of the type of the devices to be classified from the operator. The CPU 41a accepts the setting of the type of the devices to be classified according to the designation of the operator. Then, the CPU 41a stores flag information indicating the classified type in association with the identification information indicating the device to be classified. The setting of the type of the devices to be classified may be performed before classification by the CPU 41a. For example, when the type setting is performed for a specific device among the multiple devices to be classified based on the designation of the operator, the CPU 41a may not perform classification based on the time series data of the devices to be classified for the devices to which the type has been set in advance. On the other hand, the CPU 41a may perform classification based on the time series data of the devices to be classified for other devices among the multiple devices to be classified that have not been designated by the operator. In particular, when the device type has been determined by previous learning and additional learning is to be performed, the device type may be fixed to the previous learning type based on the operator's specification, or for devices that require a change, a different device type from the previous learning type may be determined based on the operator's specification. For example, a type that is not used when identifying an abnormal device may be determined.

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

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

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

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

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

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

1205の類型(アナログ値)については、例えば学習時の時系列データの値と、学習時の時系列データとの距離に関するしきい値とをパラメータとしてもよい。距離の算出方法は、例えば、点ごとの差の和を求める方法でもよい。この場合、推定時には、学習時の時系列データと、推定時の時系列データとの距離を計算し、当該距離がしきい値の範囲内かを判定する。また、1206の類型(単調増加、単調減少)については、例えば正常時における単調増加する際の増加値や、単調減少する際の減少値がパラメータとして決定される。 For the type 1205 (analog value), the parameters may be, for example, the value of the time series data at the time of learning and a threshold value related to the distance from the time series data at the time of learning. The distance may be calculated, for example, by finding the sum of the differences at 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 value. Also, for the type 1206 (monotonically increasing, monotonically decreasing), for example, the increase value during monotonically increasing under normal conditions and the decrease value during monotonically decreasing are determined as parameters.

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

<推定フェーズ>
図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の処理又はその一部については他のユニットで実行するようにしてもよい。
<Estimated Phase>
FIG. 16 is a flowchart showing the 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, this is not intended to limit the present invention, and some of these processes may be executed by other units such as the basic unit 3 or the expansion units 4a and 4b, or may be executed by an external device (analysis device) communicatively connected to the programmable logic controller. Here, a process of acquiring a device value and storing it from the buffer memory to the memory card 44 when a storage condition is satisfied and executing a specific process will be described as a series of processes. Therefore, the process of the basic unit 3 that acquires the device value and stores 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 a specific process are shown as a series of processes. In other words, the process of storing the device value when the storage condition is satisfied (S41 to S46 below) is performed by the CPU 31 (collection unit 52a) of the basic unit 3, and the process of identifying an abnormality using the device value stored in the memory card 44 (S47 and S48) is executed by the CPU 41a of the expansion unit 4a. Of course, the processes in steps S41 to S48 or a part of them may be executed by another unit.

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

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

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 above, and in S43, determines whether the acquired device value is the same as the device value previously stored in the first buffer 37a. If the values are the same, the process returns to S41 to move on to processing 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 values in the first buffer 37a and proceeds to S45. In this way, the collection unit 52a acquires the device values (and time information) for each collection period (e.g., scan period) set by the collection setting 36a and stores them in the first buffer 37a. It is preferable to use a ring buffer for the first buffer 37a. This is because, taking memory resources into consideration, not all of the data stored in the first buffer 37a is collected as log data (collected data).

S45でCPU31は、第一バッファ37aに格納されたデバイス値を基本ユニット3のメモリカード44に保存する保存条件が成立したか否かを判断する。ここでの保存条件は、例えばプログラマブルロジックコントローラの運用中に異常が発生した異常時に成立するように設定される。なお、上述したように、PLCの異常時以外にも保存条件が成立するように設定し、デバイス値が異常かどうかを特定する処理を実行してもよい。つまり、「デバイス値の異常」とは、必ずしもPLCの異常を示すものではなく、単にいつものデバイス値と違う値を示すものであってもよい。従って、PLCの異常時以外にも、保存条件が成立する例としては、いつもと違うデバイス値が発生したタイミングや、ユーザからの監視指示を受け付けたタイミング、ユーザからの監視指示を受け付けた後、さらに所定の実行周期経過後、又は定期的に異常を判定するための指定されたタイミングなどが想定されうる。これらの詳細な説明については第2及び第3の実施形態で後述する。なお、第1乃至第3の実施形態で説明する機能は、少なくとも1つが設けられるようにすることができる。 In S45, the CPU 31 judges whether 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 condition here is set to be satisfied, for example, when an abnormality occurs during operation of the programmable logic controller. As described above, the storage condition may be set to be satisfied when an abnormality occurs other than when the PLC is abnormal, and a process for identifying whether the device value is abnormal may be executed. In other words, "abnormal device value" does not necessarily indicate an abnormality in the PLC, but may simply indicate a value different from the usual device value. Therefore, examples of the storage condition being satisfied other than when the PLC is abnormal include the timing when an unusual device value occurs, the timing when a monitoring instruction is received from the user, after a predetermined execution period has elapsed after a monitoring instruction is received from the user, or a specified timing for periodically determining an abnormality. A detailed description of these will be given later in the second and third embodiments. 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 conditions are met, in S46 the CPU 31 of the basic unit 3 acquires the time series data of the estimation target 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 of the estimation target is data of all devices by default, and may be selected according to an operator's specification, or may be selected according to the type of abnormality. Furthermore, this time series data may include time series data from a specified period before the occurrence of the abnormality to a specified time after the occurrence of the abnormality. Alternatively, it may be data within a specified 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 identifies an abnormal device using the detection method optimal for each type of time series data stored in the memory card 44 in S46 based on the type of device corresponding to the time series data determined during learning, and the evaluation variables and parameters corresponding to the detection method. As described above, according to this embodiment, the characteristics of the change in the device value are extracted during learning, and each device value is classified into a predetermined type, and an appropriate detection method for an abnormality (unusual change) is applied to each type of classified device. That is, in this embodiment, in the learning phase, the device value is classified from the time series data in the normal state, a detection method is determined according to each type, and evaluation variables and parameters corresponding to each detection method are set. On the other hand, in the above S47 of the estimation phase, the evaluation variables and parameters, which are detection algorithms determined according to the type of each device classified in the learning phase, are applied to the time series data of the device and analyzed to identify an abnormality. As described above, regarding the type of time series data, 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 linked and stored. Therefore, in S47, the CPU 41a determines the corresponding type from the identification information of the device from which the time-series data of the estimation target was obtained, and identifies the abnormal device using the evaluation variables and parameters that are the detection algorithm corresponding to the type. The determination method is performed according to the method described above for each parameter.

ここで、図17を参照して、異常デバイスとして特定する際の判定手法について説明する。1701、1702は、1201、1202の類型(所定の周期に同期して値が定常的なパターンで変化するデバイス)における異常デバイスのデータを示す。1711、1712が異常箇所を示す。このように、正常時と比較して、変化するはずの信号が変化しない場合や変化点がずれた場合、パルス幅が異なる場合などが発生したデバイスが存在すると当該デバイスを異常デバイスと特定することができる。CPU41aは、決定された検知アルゴリズムを用いることによって、正常時の変化から異なるデータを判別することができる。また、1703は、1203の類型(一定の値をとるデバイス)における異常デバイスのデータを示す。1713に示すように、一定値をとるはずの信号が変化しているため、異常デバイスと特定することができる。 Now, referring to FIG. 17, a method of determining whether a device is abnormal will be described. 1701 and 1702 indicate data of an abnormal device in the 1201 and 1202 types (devices whose values change in a steady pattern in synchronization with a predetermined cycle). 1711 and 1712 indicate the abnormal location. In this way, when a device exists in which a signal that should change does not change, the change point is shifted, or the pulse width is different compared to the normal state, the device can be identified as an abnormal device. By using the determined detection algorithm, the CPU 41a can distinguish different data from the normal state. Also, 1703 indicates data of an abnormal device in the 1203 type (devices whose values are constant). As shown in 1713, a signal that should be a constant value has changed, so the device 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つのデバイスが異常デバイスとして特定される。 1704 shows an algorithm for identifying an abnormal device using time series data of two devices classified into the same type, such as types 1201 and 1202 (devices whose values change in a steady pattern in synchronization with a predetermined cycle). In this algorithm, the time interval between the change points of the values of the two devices is checked for devices that change in synchronization with a predetermined cycle. For example, 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 the time difference between each change point is within a threshold value. In detail, it may be determined whether the device is abnormal 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. In this case, the parameters are the threshold value for each time difference between the change points, the timing of each change point, and the threshold value for the timing of each change point. When using this determination method to identify abnormal devices, two devices are identified as abnormal devices.

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

図18は、特定結果の表示例を示す。 Figure 18 shows an example of the display of the identification results.

画面1800は、横軸に時間を示し、縦軸に異常デバイスの発生数を示す。生成部74は、特定結果に従って異常デバイスとして特定したデバイスと、その際の時系列データとから画面1800の表示データを生成する。プログラマブルロジックコントローラに異常が発生すると、設備が停止し、異常デバイスが増える傾向にある。従って、画面1800のような所定期間ごと(例えば、5分間隔など)の時間間隔ごとに異常デバイス発生数の累計を表示することで、オペレータはいつから異常が発生しているかを容易に認識することができる。 Screen 1800 shows time on the horizontal axis and the number of abnormal devices on the vertical axis. The generation unit 74 generates the display data for screen 1800 from devices identified as abnormal devices according to the identification results and the time series data at that time. When an abnormality occurs in a 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 device occurrences for each specified time interval (e.g., every 5 minutes) as in screen 1800, the operator can easily recognize when the abnormality began to occur.

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

画面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 generating unit 74 generates display data for displaying the degree of abnormality of the estimated device in a ranking based on the identification result. That is, on the screen 1820, candidate devices with a high possibility of abnormality are displayed in an identifiable manner by device name or the like. In addition to the degree of abnormality, the display may also show the abnormality content and the classification of the device. Here, the degree of abnormality is determined, for example, by the number of abnormalities that have occurred or the magnitude of the difference from a predetermined threshold value. In other words, the degree of abnormality indicates the magnitude of the abnormality. The screen 1820 shows an example in which the degree of abnormality is displayed in descending order, but the abnormalities may be sorted and displayed according to conditions such as the order of occurrence time. In addition, the device may be sorted according to the classification method, or only the contents of the abnormality related to the classification method selected in advance by the user may be displayed. For example, the degree of abnormality may be calculated using a predetermined threshold value according to the following formula:
Anomaly level = (current value - average value) / (threshold value - average value)
That is, the degree of abnormality is defined according to the current value as follows: If the current value is above the upper threshold, the degree of abnormality is 1 or more. If the current value is equal to the upper threshold, the degree of abnormality is 1. If the current value is equal to the average value, the degree of abnormality is 0. If the current value is equal to the lower threshold, the degree of abnormality is -1. If the current value is below the lower threshold, the degree of abnormality is -1. The degree of abnormality may be an absolute value. Also, if there is a mismatch with a specified value to be compared, the degree of abnormality may be uniformly set to 1.

画面1830は、正常時と異常時のデバイスの信号を比較可能に表示した例である。画面1830に示すように、異常箇所を強調表示するようにすることが望ましい。図18の例では、異常箇所の信号付近を点線の枠で囲むように表示しているが、当該部分の信号を他の色と異なる色で表示してもよいし、当該部分を点滅表示してもよい。 Screen 1830 is an example of a display that allows a comparison of the device's signals when normal and when abnormal. As shown in screen 1830, it is desirable to highlight the abnormal part. In the example of FIG. 18, the area around the signal of the abnormal part is displayed surrounded by a dotted frame, but the signal of that part may be displayed in a color different from the other parts, or that part may be displayed by flashing.

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

S201でCPU41a(収集部52c)は設定された収集設定に従って、装置が正常動作している時の収集対象となるデバイスの時系列データを収集する。収集対象のデバイスには、推定フェーズにおいて判定対象となる複数のデバイスが含まれる。また、推定フェーズにおいて判定対象とならないデバイスは収集対象のデバイスから除外されてもよい。たとえば、不定期で動作するデバイス(1204)に分類されたデバイスは、収集対象のデバイスから除外されてもよい。 In S201, the CPU 41a (collection unit 52c) collects time series data of devices to be collected when the apparatus is operating normally, according to the collection settings that have been set. The devices to be collected include multiple devices that are to be judged in the estimation phase. In addition, devices that are not to be judged in the estimation phase may be excluded from the devices to be collected. For example, devices classified as devices that operate irregularly (1204) 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 time series data of the device that is judged to be abnormal even though the judgment result in the estimation phase should be judged to be normal. For example, if learning is insufficient in the learning phase, the judgment result in the estimation phase may be abnormal. Therefore, the CPU 41a may perform additional learning when the judgment result of the time series data to be collected is abnormal even though the device is operating normally. Also, even if the judgment result in the estimation phase is abnormal and time series data at the time of the abnormality (unusual state) is collected, if the time series data includes time series data corresponding to a period of normal operation, 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. In this case, if the judgment result for the time series data corresponding to the period of normal operation is abnormal, additional learning may be performed using that part.

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

S311でCPU41aは、収集対象に設定された複数のデバイスについて、各デバイスが推定フェーズにおいて判定対象であるか否かを判定する。CPU41aは、デバイスが判定対象であると判定するとそのデバイスについて追加学習を実施するためステップS312に移行し、デバイスが判定対象でないと判定するとそのデバイスについて追加学習を実施せずにステップS341に移行する。たとえば、CPU41aは、不定期で動作するデバイス(1204)に分類されたデバイスは判定対象でないと判定し、追加学習を実施せずにステップS341に移行する。 In S311, the CPU 41a determines whether each of the multiple devices set as collection targets is a target for judgment in the estimation phase. If the CPU 41a determines that a device is a target for judgment, it proceeds to step S312 to perform additional learning for that device, and if it determines that the device is not a target for judgment, it proceeds to step S341 without performing additional learning for that device. For example, the CPU 41a determines that a device classified as a device that operates irregularly (1204) is not a target for judgment, 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 by 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 back on. The stored predetermined amount of collected data becomes the time series data of each device collected during the target period for additional learning. The basic unit 3 may detect that a predetermined amount of collected data has been saved in the memory card 44 and send an instruction to start classification to the expansion unit. In addition, the expansion unit 4a may detect that a sufficient amount of data for learning (time series data for a predetermined number of scan periods) has been accumulated in a memory unit such as a buffer memory (first buffer 37a) or memory card 44 after the power is turned back on and start the classification process.

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

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

S321でCPU41aは、S312による再分類の中で前回までの学習により決定されたデバイスの類型が維持されたか否かを判定する。CPU41aは、前回までの学習により決定されたデバイスの類型が維持されたと判定すると、パラメータを決定するためにS322に移行する。一方、前回までの学習により決定されたデバイスの類型が維持されていない判定すると、即ちデバイスの類型が再分類されて更新されたと判定すると、S323に移行して、CPU41aは、分類処理の更新結果に基づいて、デバイスが推定フェーズにおいて判定対象か否かを判定する。CPU41aは、デバイスが判定対象であると判定するとそのデバイスについてパラメータを決定するためS324に移行し、デバイスが判定対象でないと判定するとS341に移行する。たとえば、CPU41aは、不定期で動作するデバイス(1204)に分類されたデバイスは判定対象でないと判定し、追加学習を中断してS341に移行する。 In S321, the CPU 41a judges whether or not the type of device determined by the previous learning has been maintained in the reclassification in S312. If the CPU 41a judges that the type of device determined by the previous learning has been maintained, the process proceeds to S322 to determine parameters. On the other hand, if the CPU 41a judges that the type of device determined by the previous learning has not been maintained, that is, if the CPU 41a judges that the type of device has been reclassified and updated, the process proceeds to S323, where the CPU 41a judges whether or not the device is a judgment target in the estimation phase based on the update result of the classification process. If the CPU 41a judges that the device is a judgment target, the process proceeds to S324 to determine parameters for the device, and if the CPU 41a judges that the device is not a judgment target, the process proceeds to S341. For example, the CPU 41a judges that a device classified as a device that operates irregularly (1204) is not a judgment target, interrupts additional learning, and proceeds 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 currently collected time series data for the target device during normal operation, and proceeds to S331. For example, if a device (1201) that operates in synchronization with the operation cycle of the device is determined by the previous learning, and the type of the device is maintained, the CPU 41a calculates and updates new upper and lower thresholds based on the upper and lower thresholds indicating the time variation between any change points of the time series data determined by the previous learning, and the currently collected time series data during normal operation. In this way, the new upper and lower thresholds are calculated and updated based on the time between any change points of the currently collected time series data during normal operation, and the upper and lower thresholds, and the width of the updated thresholds is widened or narrowed depending on the time variation between any change points of the currently collected time series data during normal operation and the degree of deviation from the threshold.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

S52でCPU31は、ユーザから監視指示を受け付けたか否かを判断する。当該監視指示については、PC2aや基本ユニット3の操作部6を介したユーザ入力を通じて受け付けることができる。ユーザからの監視指示を受け付けた場合にはS53に進み、そうでない場合は処理をS51に戻す。 In S52, the CPU 31 determines whether or not a monitoring instruction has been received from the user. The monitoring instruction can be received through user input via the PC 2a or the operation unit 6 of the basic unit 3. If a monitoring instruction has been received from the user, the process proceeds to S53; 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 met in S46 of FIG. 16, and executes the process from S47 onwards to execute the analysis process. Here, the storage condition in S46 is met immediately after receiving the monitoring start signal, and collects the time series data stored in the memory card 44 from a predetermined period before to the present. The storage condition in S46 may also be met after a predetermined execution cycle has elapsed after receiving the monitoring start signal, and collects the time series data stored in the memory card 44 during the predetermined period after receiving the monitoring start signal. Alternatively, the storage condition in S46 may be met after a predetermined execution cycle has elapsed after receiving the monitoring start signal, and collects the time series data stored in the memory card 44 during the predetermined period before and after receiving the monitoring start signal.

これらの監視対象のデータについてはユーザ設定により選択することができる。なお、上記第2の実施形態と同様に、S48においては、異常デバイスを特定するのではなく、正常時の時系列データからの乖離する異常状態を分析、検証することになる。また、分析結果については、上記第2の実施形態と同様の表示が出力される。 The data to be monitored can be selected by user settings. As in the second embodiment, in S48, abnormal devices are not identified, but abnormal states that deviate from normal time-series data are analyzed and verified. The analysis results are displayed 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 a user program, and a device memory having a plurality of devices that is a storage area for storing data accessed by the execution engine according to the user program. The programmable logic controller also collects data held in a device to be collected among a plurality of devices according to a predetermined collection setting for each scan period of the user program, classifies each device into one of a plurality of types based on the characteristics of the collected time-series data of each device, and determines a detection algorithm for identifying an abnormal device according to the time-series data of the device collected by the collection means and the type into which the device is classified by the classification means. An abnormal device is identified by analyzing the time-series data of the device collected by the collection means using the detection algorithm determined for the device by the determination means according to the type into which the device is classified by the classification means. In this way, the programmable logic controller according to the present embodiment can analyze and classify characteristics such as periodicity and continuity of data related to each device, and efficiently identify an abnormal device.

また、本プログラムコントローラは、さらに、ユーザ指示に応じて、決定された検知アルゴリズムを用いて、収集された各デバイスの時系列データを正常時の時系列データとの乖離を分析して異常が発生していないかを検証する。なお、このような分析機能については、所定の周期で定期的に行うようにしてもよい(監視機能)。 Furthermore, in response to user instructions, the program controller further uses a determined detection algorithm to analyze the deviation of the collected time series data of each device from normal time series data to verify whether any abnormalities have occurred. Note that this analysis function may be performed periodically at a specified interval (monitoring function).

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

また、本プログラマブルロジックコントローラは、1以上のデバイスのグループにおいて、前回のスキャン周期において収集した値と、今回のスキャン周期において収集した値とが収集対象の前記グループの全てのデバイスで変化していなければ、今回のスキャン周期において収集した値を削除して、収集する時系列データを圧縮する。これによりメモリ資源を有効に活用することができる。 In addition, for one or more device groups, if the values collected in the previous scan cycle and the values collected in the current scan cycle have not changed for all devices in the group, the programmable logic controller deletes the values collected in the current scan cycle and compresses the collected time series data. This allows memory resources to be used efficiently.

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

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

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

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

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

Claims (19)

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

Applications Claiming Priority (2)

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

Publications (2)

Publication Number Publication Date
JP2021125218A JP2021125218A (en) 2021-08-30
JP7558735B2 true JP7558735B2 (en) 2024-10-01

Family

ID=77459472

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2020161926A Active JP7558735B2 (en) 2020-01-31 2020-09-28 Programmable logic controller and analytical device

Country Status (1)

Country Link
JP (1) JP7558735B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP7550130B2 (en) * 2021-10-26 2024-09-12 株式会社オービック Anomaly detection device, anomaly detection method, anomaly detection program, and core information system
DE112022005289T5 (en) * 2022-04-18 2024-08-29 Mitsubishi Electric Corporation Simulation program, simulation device and control method

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2018180759A (en) 2017-04-07 2018-11-15 株式会社日立製作所 System analyzer and system analysis method
JP2019159697A (en) 2018-03-12 2019-09-19 オムロン株式会社 Control system and control method

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2018180759A (en) 2017-04-07 2018-11-15 株式会社日立製作所 System analyzer and system analysis method
JP2019159697A (en) 2018-03-12 2019-09-19 オムロン株式会社 Control system and control method

Also Published As

Publication number Publication date
JP2021125218A (en) 2021-08-30

Similar Documents

Publication Publication Date Title
CN113204203B (en) Programmable logic controllers and analyzers
JP7406451B2 (en) programmable logic controller
EP3379358B1 (en) Control system, control device, control program, and control method
JP7596660B2 (en) Prediction system, information processing device, and information processing program
JP7450471B2 (en) Programmable logic controller and PLC system
JP7413742B2 (en) Prediction system, information processing device and information processing program
EP3382485A1 (en) Controller, control program, control system, and control method
JP7558735B2 (en) Programmable logic controller and analytical device
CN112673326B (en) Control device and storage medium
JP7668669B2 (en) Analytical device, analytical system, and control method thereof
JP7668670B2 (en) Analytical device, analytical system, and control method thereof
JP7102801B2 (en) Control system, control device and display device
CN110908856A (en) Resource monitoring system, resource monitoring method and program
US12008072B2 (en) Control system and control method
JP7151312B2 (en) control system
JP2021189482A (en) Programmable logic controller
US20240386293A1 (en) Prediction system, information processing device, and non-transitory information recording medium with computer-readable information processing program recorded thereon
JP7556306B2 (en) Prediction system, information processing device, and information processing program
JP7450470B2 (en) Setting device and PLC system
JP2023151888A (en) Prediction systems, control devices and control programs
JP2023151755A (en) Information processing device and information processing program

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

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20240830

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20240918

R150 Certificate of patent or registration of utility model

Ref document number: 7558735

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150