JP7273935B2 - External setting device, logging setting method and program - Google Patents

External setting device, logging setting method and program Download PDF

Info

Publication number
JP7273935B2
JP7273935B2 JP2021191970A JP2021191970A JP7273935B2 JP 7273935 B2 JP7273935 B2 JP 7273935B2 JP 2021191970 A JP2021191970 A JP 2021191970A JP 2021191970 A JP2021191970 A JP 2021191970A JP 7273935 B2 JP7273935 B2 JP 7273935B2
Authority
JP
Japan
Prior art keywords
unit
time
display
program
data
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
JP2021191970A
Other languages
Japanese (ja)
Other versions
JP2022016659A (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
Family has litigation
First worldwide family litigation filed litigation Critical https://patents.darts-ip.com/?family=87884970&utm_source=google_patent&utm_medium=platform_link&utm_campaign=public_patent_search&patent=JP7273935(B2) "Global patent litigation dataset” by Darts-ip is licensed under a Creative Commons Attribution 4.0 International License.
Priority claimed from JP2018199199A external-priority patent/JP6757385B2/en
Priority claimed from JP2020143397A external-priority patent/JP6986125B2/en
Application filed by Keyence Corp filed Critical Keyence Corp
Priority to JP2021191970A priority Critical patent/JP7273935B2/en
Publication of JP2022016659A publication Critical patent/JP2022016659A/en
Application granted granted Critical
Publication of JP7273935B2 publication Critical patent/JP7273935B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Programmable Controllers (AREA)

Description

本発明は、プログラマブルロジックコントローラおよびメインユニットに関する。 The present invention relates to programmable logic controllers and main units.

プログラマブル・ロジック・コントローラ(PLC)はファクトリーオートメーションにおいて製造機器や搬送装置、検査装置を制御するコントローラである。PLCはユーザによって作成されるラダープログラムなどのユーザプログラムを実行することで様々な拡張ユニットや被制御機器を制御する。ユーザプログラムを実際にPLC上で実行してみて、ユーザプログラムの作成時には想定していなかった事象が見つかり、ユーザプログラムの修正が必要となることがある。ユーザは修正箇所を特定するためにユーザプログラムを見直すだけでなく、PLCが生成したログデータを参照する。ログデータにはユーザプログラムを実行しているときに収集されたデバイスの値(デバイス値)が記憶される。PLCの分野においてデバイスとは情報を記憶する記憶領域を意味する。デバイスとしては、一ビットの情報を保持するリレーデバイスや一ワードの情報を保持するワードデバイスなどがある。特許文献1によれば、デバイス値をロギングすることが提案されている。 A programmable logic controller (PLC) is a controller that controls manufacturing equipment, transport equipment, and inspection equipment in factory automation. The PLC controls various expansion units and controlled devices by executing user programs such as ladder programs created by users. When the user program is actually executed on the PLC, an event that was not assumed when the user program was created may be found, and the user program may need to be modified. The user not only reviews the user program in order to identify the corrected portion, but also refers to the log data generated by the PLC. The log data stores device values (device values) collected during execution of the user program. In the field of PLC, a device means a storage area that stores information. Devices include a relay device that holds 1-bit information and a word device that holds 1-word information. According to Patent Literature 1, it is proposed to log device values.

特開平10-011118号公報JP-A-10-011118

ところで、ユーザプログラムによって制御されるフィールドデバイスや検査対象物(ワーク)の状態をカメラで撮影し、ロギングデータとともに参照したいというニーズが存在する。フィールドデバイスやワークの状態を画像で確認できれば、ユーザプログラムなどにバグがあるのか、それともフィールドデバイスの設置に課題があるのか、または、ワークの搬送に課題があるかなどを、ユーザは判断しやすくなる。ユーザプログラムの修正が必要な場合にもどのプログラム部分を修正すればよいかもユーザにとって判断しやすくなろう。トラブルが発生したときの画像データ(二次元データ)に加え、デバイス値があれば、さらにユーザはトラブルを解決しやすくなるであろう。しかし、デバイス値の更新周期(スキャン周期)と、二次元データの生成周期(保存周期)とは一般には異なっている。そのため、どのデバイス値と、どの二次元データとが関連しているかを特定することはユーザにとって困難であった。なお、このような課題は、画像データなどの二次元データに留まらず、他のデータについても同様に生じ得る。例えば、モーション制御について説明すると、現在値や現在速度などのモーションデータの更新周期(いわゆる制御周期)は、スキャン周期と異なっているため、どのデバイス値と、どのモーションデータとが時間的に関連しているかを特定することはユーザにとって困難であった。他にも例えば、通信制御について説明すると、サイクリック通信で取得される通信データ(例えば一又は複数のセンサ値)の更新周期は、スキャン周期と異なっているため、どのデバイス値と、どの通信パラメータとが時間的に関連しているかを特定することはユーザにとって困難であった。このように、カメラ、モータを駆動するモータアンプ、センサ、通信コントローラ等の監視機器から入力されるデータが、どのデバイス値と時間的に関連しているかを特定することは、ユーザにとって困難であった。 By the way, there is a need to photograph the state of field devices and inspection objects (workpieces) controlled by a user program with a camera and to refer to them together with logging data. If the status of field devices and workpieces can be confirmed with images, the user can easily determine whether there is a bug in the user program, whether there is a problem with the installation of the field device, or whether there is a problem with the transportation of the workpiece. Become. When the user program needs to be modified, the user will be able to easily determine which part of the program should be modified. If there are device values in addition to image data (two-dimensional data) when a problem occurs, it will be easier for the user to solve the problem. However, the device value update cycle (scan cycle) generally differs from the two-dimensional data generation cycle (save cycle). Therefore, it is difficult for the user to identify which device value is associated with which two-dimensional data. It should be noted that such a problem can occur not only in two-dimensional data such as image data, but also in other data as well. For example, in motion control, the update cycle (so-called control cycle) of motion data such as the current value and current speed is different from the scan cycle. It was difficult for the user to identify whether the In addition, for example, when explaining communication control, since the update cycle of communication data (for example, one or more sensor values) acquired by cyclic communication is different from the scan cycle, which device value and which communication parameter It was difficult for the user to identify whether and are temporally related. As described above, it is difficult for the user to specify which device value temporally relates data input from monitoring equipment such as a camera, a motor amplifier for driving a motor, a sensor, and a communication controller. rice field.

そこで、本発明は、カメラ、モータアンプ、センサ、通信コントローラ等の各種監視機器から入力されるデータとデバイス値との時間的な関係を特定しやすくすることを目的とする。 SUMMARY OF THE INVENTION Accordingly, an object of the present invention is to make it easier to identify the temporal relationship between data input from various monitoring devices such as cameras, motor amplifiers, sensors, and communication controllers and device values.

本発明は、たとえば、
プログラマブルロジックコントローラに接続される外部設定機器であって、
ユーザから受け付けられた命令語であって、先頭デバイスおよび当該先頭デバイスを基準としたデバイスの個数を引数とする命令語を含むラダープログラムを記憶する記憶部と、
前記記憶部に記憶されたラダープログラムを解析することにより、前記命令語の引数から特定されるデバイス範囲に対応する複数の異なるデバイスを抽出するデバイス抽出部と、
前記デバイス抽出部により抽出された複数の異なるデバイスを用いて、前記プログラマブルロジックコントローラでロギングされるデバイスを設定するログ設定データを作成するログ設定部と
を備える外部設定機器を提供する。
The present invention, for example,
An external setting device connected to a programmable logic controller,
a storage unit for storing a ladder program including an instruction received from a user and having as arguments a head device and the number of devices based on the head device;
a device extraction unit that extracts a plurality of different devices corresponding to the device range specified from the argument of the instruction word by analyzing the ladder program stored in the storage unit;
a log setting unit that uses a plurality of different devices extracted by the device extraction unit to create log setting data for setting devices to be logged by the programmable logic controller;
To provide an external setting device comprising :

本発明によれば、カメラ、モータアンプ、センサ、通信コントローラ等の各種監視機器から入力されるデータとデバイス値との時間的な関係を特定しやすくなる。 According to the present invention, it becomes easier to identify the temporal relationship between data input from various monitoring devices such as cameras, motor amplifiers, sensors, and communication controllers and device values.

プログラマブルロジックコントローラシステムを示す図Diagram showing a programmable logic controller system ラダープログラムを説明する図Diagram explaining the ladder program プログラム作成支援装置を説明する図Diagram for explaining the program creation support device PLCを説明する図Diagram explaining PLC ラダープログラムのスキャンを説明する図Diagram explaining ladder program scanning プログラム作成支援装置の機能を説明する図Diagram for explaining the functions of the program creation support device ロギングの設定方法を説明するフローチャートFlowchart explaining how to configure logging プログラム部品の選択方法を説明する図Diagram explaining how to select a program part 機能の選択方法を説明する図Diagram explaining how to select functions ユニットモニタを説明する図Diagram explaining the unit monitor ユニットモニタの設定を説明する図Diagram explaining unit monitor settings 抽出リストを説明する図Diagram explaining the extraction list 抽出リストを説明する図Diagram explaining the extraction list 抽出リストのマージを説明する図Diagram explaining the merging of extract lists スキャンタイムへの影響の推定結果を説明する図Diagram explaining the estimation results of the impact on the scan time デバイス種別の選択UIを説明する図Diagram explaining the device type selection UI デバイスの抽出方法を示すフローチャートFlowchart showing how to extract a device ユーザプログラムの一例を示す図Diagram showing an example of a user program 基本ユニットの機能を説明する図Diagram explaining the functions of the basic unit 構成情報の作成処理を説明する図Diagram explaining the process of creating configuration information 基本ユニットのCPUの機能を説明する図Diagram explaining the functions of the CPU of the basic unit 拡張ユニットのCPUの機能を説明する図Diagram explaining the functions of the CPU of the expansion unit ログデータの一例を示す図Diagram showing an example of log data 基本ユニットにおけるロギング処理を示すフローチャートFlowchart showing logging processing in the basic unit 拡張ユニットにおけるロギング処理を示すフローチャートFlowchart showing logging processing in expansion unit PLCの接続形態を示す図Diagram showing PLC connection configuration PLCの接続形態を示す図Diagram showing PLC connection configuration ロギングのタイミングを説明する図Diagram explaining timing of logging ログデータの表示を説明する図Diagram explaining log data display ログデータの表示UIを説明する図Diagram for explaining the log data display UI 収集時間の設定方法を説明する図Diagram explaining how to set collection time 収集時間の設定方法を説明する図Diagram explaining how to set collection time デバッグ処理の概要を示すフローチャートFlowchart outlining the debugging process 出力部を説明する図Diagram explaining the output section プロジェクト作成部を説明する図Diagram explaining the project creation part ログ表示部を説明する図Diagram explaining the log display part プログラム表示モジュールを説明する図Diagram explaining the program display module ユーザーインターフェースを説明する図Diagram explaining the user interface プロジェクトデータとログデータの表示モジュールを説明する図Diagram explaining the display module for project data and log data 警告画面を説明する図Diagram explaining the warning screen 波形表示モジュールを説明する図Diagram explaining the waveform display module ユーザーインターフェースを説明する図Diagram explaining the user interface リアルタイムチャートモニタを説明する図Diagram explaining the real-time chart monitor 再生制御モジュールを説明する図Diagram explaining the playback control module ユーザプログラムとデバイス値とを表示するUIを説明する図A diagram for explaining a UI that displays user programs and device values. HMIのエミュレータを説明する図Diagram explaining HMI emulator ユーザプログラムとデバイス値とを表示する処理を示すフローチャートFlowchart showing processing for displaying user programs and device values デバイス値の波形を表示する処理を示すフローチャートFlowchart showing processing for displaying waveforms of device values 再生制御を示すフローチャートFlowchart showing playback control 相互に関連した複数のプログラム部品を説明する図Diagram explaining multiple interrelated program parts プログラム部品とデバイスの抽出結果を表示するUIを説明する図Diagram explaining the UI that displays the results of extracting program parts and devices プログラム部品とデバイスの抽出処理を示すフローチャートFlowchart showing program part and device extraction processing デバッグの流れを説明するフローチャートFlowchart explaining the flow of debugging 修正されたプログラム部品を説明する図Diagram explaining modified program part

以下に本発明の一実施形態を示す。以下で説明される個別の実施形態は、本発明の上位概念、中位概念および下位概念など種々の概念を理解するために役立つであろう。また、本発明の技術的範囲は、特許請求の範囲によって確定されるのであって、以下の個別の実施形態によって限定されるわけではない。 An embodiment of the present invention is shown below. The specific embodiments described below may be helpful in understanding various concepts such as the broader, middle and narrower concepts of the present invention. Moreover, the technical scope of the present invention is determined by the claims and is not limited by the following individual embodiments.

<システム構成>
はじめにプログラマブルロジックコントローラ(PLC、単にプログラマブルコントローラと呼ばれてもよい)を当業者にとってよりよく理解できるようにするために、一般的なPLCの構成とその動作について説明する。
<System configuration>
First, the configuration and operation of a typical PLC will be described so that those skilled in the art can better understand programmable logic controllers (PLCs, which may be simply called programmable controllers).

図1は、本発明の実施の形態によるプログラマブル・ロジック・コントローラシステムの一構成例を示す概念図である。図1が示すように、このシステムは、ラダープログラムなどのユーザプログラムの編集を行うためのPC2と、工場等に設置される各種制御装置を統括的に制御するためのPLC(プログラマブルロジックコントローラ)1とを備えている。PCはパーソナルコンピュータの略称である。ユーザプログラムは、ラダー言語やSFC(シーケンシャルファンクションチャート)などのフローチャート形式のモーションプログラムなどのグラフィカルプログラミング言語を用いて作成されてもよいし、C言語などの高級プログラミング言語を用いて作成されてもよい。以下では、説明の便宜上、ユーザプログラムはラダープログラムとする。PLC1は、CPUが内蔵された基本ユニット3と、1つないし複数の拡張ユニット4を備えている。基本ユニット3に対して1つないし複数の拡張ユニット4が着脱可能となっている。たとえば、拡張ユニット4aはモータ(フィールドデバイス10a)を駆動してワークの位置決めする位置決めユニットであり、拡張ユニット4bはカウンタユニットであってもよい。カウンタユニットは手動パルサなどのエンコーダ(フィールドデバイス10b)からの信号をカウントする。なお、参照符号の末尾に付与されているa、b、c・・・の文字は省略されることがある。基本ユニット3はCPUユニットと呼ばれることもある。なお、PLC1とPC2とを含むシステムはプログラマブルロジックコントローラシステムと呼ばれてもよい。 FIG. 1 is a conceptual diagram showing one configuration example of a programmable logic controller system according to an embodiment of the present invention. As shown in FIG. 1, this system includes a PC 2 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. and PC is an abbreviation for personal computer. The user program may be created using a graphical programming language such as a ladder language or a flowchart-type motion program such as SFC (Sequential Function Chart), or may be created using a high-level programming language such as C language. . In the following description, the user program is assumed to be a ladder program for convenience of explanation. The PLC 1 has a basic unit 3 with a built-in CPU and one or more expansion units 4 . One or a plurality of extension units 4 are detachable from the basic unit 3 . For example, the expansion unit 4a may be a positioning unit that drives a motor (field device 10a) to position a workpiece, and the expansion unit 4b may be a counter unit. The counter unit counts signals from an encoder (field device 10b) such as a manual pulser. Note that the letters a, b, c, etc. attached to the end of the reference numerals may be omitted. The basic unit 3 is sometimes called a CPU unit. A system including PLC1 and PC2 may be called a programmable logic controller system.

基本ユニット3には、表示部5および操作部6が備えられている。表示部5は、基本ユニット3に取り付けられている各拡張ユニット4の動作状況などを表示することができる。操作部6の操作内容に応じて表示部5は表示内容を切り替える。表示部5は、通常、PLC1内のデバイスの現在値(デバイス値)やPLC1内で生じたエラー情報などを表示する。デバイスとは、デバイス値(デバイスデータ)を格納するために設けられたメモリ上の領域を指す名称であり、デバイスメモリと呼ばれてもよい。デバイス値とは、入力機器からの入力状態、出力機器への出力状態およびユーザプログラム上で設定される内部リレー(補助リレー)、タイマー、カウンタ、データメモリ等の状態を示す情報である。デバイス値の型にはビット型とワード型がある。ビットデバイスは1ビットのデバイス値を記憶する。ワードデバイスは1ワードのデバイス値を記憶する。 The basic unit 3 is provided with a display section 5 and an operation section 6 . The display unit 5 can display the operation status of each expansion unit 4 attached to the basic unit 3 . The display section 5 switches the display content according to the operation content of the operation section 6 . The display unit 5 normally displays current values (device values) of devices in the PLC 1, error information occurring in the PLC 1, and the like. A device is a name indicating an area on a memory provided for storing device values (device data), and may be called a device memory. A device value is information that indicates the state of an input from an input device, the state of an output to an output device, and the state of internal relays (auxiliary relays), timers, counters, data memories, etc. that are set on a user program. Device value types include bit type and word type. A bit device stores a 1-bit device value. A word device stores a device value of one word.

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

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

なお、図1は示していないが、PC2の操作部8には、PC2に接続されたマウスなどのポインティングデバイスが含まれていてもよい。また、PC2は、USB以外の他の通信ケーブル9を介して、PLC1の基本ユニット3に対して着脱可能に接続されるような構成であってもよい。また、通信ケーブル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. FIG. Also, the PC 2 may be detachably connected to the basic unit 3 of the PLC 1 via a communication cable 9 other than USB. Alternatively, it may be configured to be wirelessly connected to the basic unit 3 of the PLC 1 without using the communication cable 9 .

<ラダープログラム>
図2は、ラダープログラムの作成時にPC2の表示部7に表示されるラダー図Ldの一例を示す図である。PC2はマトリックス状に配置された複数のセルを表示部7に表示する。各セルには仮想デバイスのシンボルが配置される。シンボルは入力リレーや出力リレーなどを示している。複数のシンボルによってリレー回路が形成される。ラダー図Ldには、たとえば、10列×N行(Nは任意の自然数)のセルが配置されている。そして、各行のセル内には仮想デバイスのシンボルが適宜配置される。
<Ladder program>
FIG. 2 is a diagram showing an example of the ladder diagram Ld displayed on the display unit 7 of the PC 2 when creating the ladder program. The PC 2 displays a plurality of cells arranged in a matrix on the display section 7 . A virtual device symbol is placed in each cell. Symbols indicate input relays, output relays, and the like. A plurality of symbols form a relay circuit. In the ladder diagram Ld, for example, 10 columns×N rows (N is any natural number) of cells are arranged. Symbols of virtual devices are appropriately arranged in the cells of each row.

図2が示すリレー回路は、入力装置からの入力信号に基づいてオン/オフされる3つの仮想デバイス(以下、「入力デバイス」と呼ぶ。)のシンボルと、出力装置の動作を制御するためにオン/オフされる仮想デバイス(以下、「出力デバイス」と呼ぶ。)のシンボルと、が適宜結合されることにより構成されている。 The relay circuit shown in FIG. 2 has symbols of three virtual devices (hereafter referred to as "input devices") that are turned on/off based on input signals from the input device, and a symbol for controlling the operation of the output device. Symbols of virtual devices to be turned on/off (hereinafter referred to as "output devices") are combined as appropriate.

各入力デバイスのシンボルの上方に表示されている文字(「R0001」、「R0002」および「R0003」)は、その入力デバイスのデバイス名(アドレス名)を表している。各入力デバイスのシンボルの下方に表示されている文字(「フラグ1」、「フラグ2」および「フラグ3」)は、その入力デバイスに対応付けられたデバイスコメントを表している。出力デバイスのシンボルの上方に表示されている文字(「原点復帰」)は、その出力デバイスの機能を表す文字列からなるラベルである。 The characters ("R0001", "R0002" and "R0003") displayed above the symbol of each input device represent the device name (address name) of the input device. Characters (“Flag 1”, “Flag 2” and “Flag 3”) displayed below the symbol of each input device represent device comments associated with the input device. The characters (“return to origin”) displayed above the symbol of the output device is a label consisting of a character string representing the function of that output device.

図2が示す例では、デバイス名「R0001」および「R0002」にそれぞれ対応する2つの入力デバイスのシンボルが直列的に結合されることにより、AND回路が構成されている。また、これらの2つの入力デバイスのシンボルからなるAND回路に対して、デバイス名「R0003」に対応する入力デバイスのシンボルが並列的に結合されることにより、OR回路が構成されている。すなわち、このリレー回路では、一行目の2つのシンボルに対応する入力デバイスがいずれもオンした場合、または、二行目のシンボルに対応する入力デバイスがオンした場合にのみ、一行目のシンボルに対応する出力デバイスがオンになる。 In the example shown in FIG. 2, an AND circuit is configured by serially connecting symbols of two input devices respectively corresponding to the device names "R0001" and "R0002". An OR circuit is configured by connecting in parallel the symbol of the input device corresponding to the device name "R0003" to the AND circuit consisting of the symbols of these two input devices. That is, in this relay circuit, only when both the input devices corresponding to the two symbols in the first row are turned on, or when the input devices corresponding to the symbols in the second row are turned on, the symbols in the first row are The output device to be used is turned on.

<プログラム作成支援装置>
図3は、PC2の電気的構成について説明するためのブロック図である。図3が示すように、PC2は、CPU21、表示部7、操作部8、記憶装置22および通信部23を備えている。表示部7、操作部8、記憶装置22および通信部23は、それぞれCPU21に対して電気的に接続されている。記憶装置22はRAMやROMを含み、さらに着脱可能なメモリカードを含んでもよい。CPUは中央演算処理装置の略称である。ROMはリードオンリーメモリの略称である。RAMはランダムアクセスメモリの略称である。
<Program creation support device>
FIG. 3 is a block diagram for explaining the electrical configuration of the PC2. As shown in FIG. 3, the PC 2 includes a CPU 21, a display section 7, an operation section 8, a storage device 22 and a communication section . The display unit 7, the operation unit 8, the storage device 22, and the communication unit 23 are electrically connected to the CPU 21, respectively. The storage device 22 includes RAM and ROM, and may also include a removable memory card. CPU is an abbreviation for central processing unit. ROM is an abbreviation for read-only memory. RAM is an abbreviation for random access memory.

ユーザは、記憶装置22に記憶されているコンピュータプログラム(編集ソフトウエア)をCPU21に実行させて、操作部8を通じてプロジェクトデータを編集する。プロジェクトデータは、一つ以上のユーザープログラム(例:ラダープログラム)と、基本ユニット3や拡張ユニット4の構成情報などを含む。構成情報は、基本ユニット3に対する複数の拡張ユニット4の接続位置や、基本ユニット3に備えられた機能(例:通信機能や位置決め機能)を示す情報、拡張ユニット4の機能(例:撮影機能)などを示す情報である。ここで、プロジェクトデータの編集には、プロジェクトデータの作成および変更が含まれる。編集ソフトウエアを用いて作成されたプロジェクトデータは、記憶装置22に記憶される。また、ユーザは、必要に応じて記憶装置22に記憶されているプロジェクトデータを読み出し、そのプロジェクトデータを、編集ソフトウエアを用いて変更することができる。通信部23は、通信ケーブル9を介してPC2を基本ユニット3に通信可能に接続するためのものである。CPU21は通信部23を介してプロジェクトデータを基本ユニット3に転送する。 The user causes the CPU 21 to execute a computer program (editing software) stored in the storage device 22 and edits the project data through the operation section 8 . The project data includes one or more user programs (eg ladder program), configuration information of the basic unit 3 and expansion unit 4, and the like. The configuration information includes information indicating connection positions of a plurality of extension units 4 to the base unit 3, functions provided in the base unit 3 (eg, communication function and positioning function), and functions of the extension unit 4 (eg, imaging function). and so on. Here, editing project data includes creating and changing project data. Project data created using editing software is stored in the storage device 22 . In addition, the user can read the project data stored in the storage device 22 and change the project data using editing software as necessary. The communication section 23 is for communicably connecting the PC 2 to the basic unit 3 via the communication cable 9 . The CPU 21 transfers the project data to the basic unit 3 via the communication section 23 .

<PLC>
図4はPLC1の電気的構成について説明するためのブロック図である。図4が示すように、基本ユニット3は、CPU31、表示部5、操作部6、記憶装置32および通信部33を備えている。表示部5、操作部6、記憶装置32、および通信部33は、それぞれCPU31に電気的に接続されている。記憶装置32は、RAMやROM、メモリカードなどを含んでもよい。記憶装置32はデバイス部34やプロジェクト記憶部35、着脱可能なメモリカード36などの複数の記憶領域を有している。デバイス部34はビットデバイスやワードデバイスなどを有し、各デバイスはデバイス値を記憶する。プロジェクト記憶部35は、PC2から入力されたプロジェクトデータを記憶する。記憶装置32は基本ユニット3用の制御プログラムも記憶する。図4が示すように基本ユニット3と拡張ユニット4とは拡張バスの一種であるユニット内部バス90を介して接続されている。なお、ユニット内部バス90に関する通信機能は通信部33の一部として実装されてもよい。通信部33は、ネットワーク通信回路を有してもよい。CPU31は、通信部33を介してログデータなどをPC2やクラウドなどに送信してもよい。
<PLC>
FIG. 4 is a block diagram for explaining the electrical configuration of the PLC1. As shown in FIG. 4 , the basic unit 3 includes a CPU 31 , display section 5 , operation section 6 , storage device 32 and communication section 33 . The display unit 5, the operation unit 6, the storage device 32, and the communication unit 33 are electrically connected to the CPU 31, respectively. The storage device 32 may include RAM, ROM, memory cards, and the like. The storage device 32 has a plurality of storage areas such as a device section 34, a project storage section 35, a removable memory card 36, and the like. The device unit 34 has bit devices, word devices, etc., and each device stores a device value. The project storage unit 35 stores project data input from the PC2. Storage device 32 also stores the control program for basic unit 3 . As shown in FIG. 4, the basic unit 3 and the expansion unit 4 are connected via a unit internal bus 90 which is a kind of expansion bus. Note that the communication function related to the unit internal bus 90 may be implemented as part of the communication section 33 . The communication unit 33 may have a network communication circuit. The CPU 31 may transmit log data or the like to the PC 2 or the cloud via the communication section 33 .

ここで、ユニット内部バス90について、補足説明する。このユニット内部バス90は、次に説明する入出力リフレッシュ等が行われるバスであって、ユニット内部バス90における通信制御は、いわゆるバスマスタ38によって実現される(なお、通信部33の一部としてバスマスタを設けてもよいし、CPU31の一部としてバスマスタ38を設けてもよい)。バスマスタ38は、ユニット内部バス90での通信を制御するための制御回路であって、CPU31からの通信要求を受けて、拡張ユニット4との間で、後述する入出力リフレッシュ等の通信を行う。 Here, the unit internal bus 90 will be additionally explained. This unit internal bus 90 is a bus for performing input/output refresh, etc., which will be described below, and communication control on the unit internal bus 90 is realized by a so-called bus master 38 (a bus master may be provided, or a bus master 38 may be provided as part of the CPU 31). The bus master 38 is a control circuit for controlling communication on the unit internal bus 90, receives a communication request from the CPU 31, and performs communication such as input/output refresh, which will be described later, with the expansion unit 4. FIG.

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

図5は基本ユニット3のスキャンタイムを示す模式図である。図5が示すように1つのスキャンタイムTは、入出力のリフレッシュを行うためのユニット間通信201、プログラム実行202、END処理204により構成されている。ユニット間通信201で、基本ユニット3は、ラダープログラムを実行して得られた出力データを基本ユニット3内の記憶装置32から拡張ユニット4などの外部機器に送信する。さらに、基本ユニット3は、拡張ユニット4などの外部機器から受信した入力データを基本ユニット3内の記憶装置32に取り込む。つまり、基本ユニット3のデバイスに記憶されているデバイス値は出力リフレッシュによって拡張ユニット4のデバイスに反映される。同様に、拡張ユニット4のデバイスに記憶されているデバイス値は入力リフレッシュによって基本ユニット3のデバイスに反映される。このように入出力リフレッシュによって基本ユニット3のデバイスと拡張ユニット4のデバイスが同期する。なお、リフレッシュ以外のタイミングでデバイス値をユニット間で更新する仕組み(ユニット間同期)が採用されてもよい。ただし、基本ユニット3のデバイスは基本ユニット3が随時書き換えており、同様に、拡張ユニット4のデバイスは拡張ユニット4が随時書き換えている。つまり、基本ユニット3のデバイスは基本ユニット3の内部の装置によって随時アクセス可能である。同様に、拡張ユニット4のデバイスは拡張ユニット4の内部の装置によって随時アクセス可能になっている。基本ユニット3と拡張ユニット4との間では基本的にリフレッシュのタイミングにおいて相互にデバイス値を更新して同期する。プログラム実行202で、基本ユニット3は、更新された入力データを用いてプログラムを実行(演算)する。図5が示すようにプログラム実行202においては複数のプログラムモジュールまたはラダープログラムがプロジェクトデータにしたがって順番に実行されてもよい。基本ユニット3はプログラムの実行によりデータを演算処理する。なお、END処理とは、PC2や基本ユニット3に接続された表示器(図示せず)等の外部機器とのデータ通信、システムのエラーチェック等の周辺サービスに関する処理全般を意味する。 FIG. 5 is a schematic diagram showing the scan time of the basic unit 3. As shown in FIG. As shown in FIG. 5, one scan time T is composed of inter-unit communication 201 for refreshing input/output, program execution 202, and END processing 204. FIG. In inter-unit communication 201 , the basic unit 3 transmits output data obtained by executing the ladder program from the storage device 32 in the basic unit 3 to an external device such as the expansion unit 4 . Furthermore, the basic unit 3 takes in input data received from an external device such as the expansion unit 4 into the storage device 32 within the basic unit 3 . That is, the device value stored in the device of the basic unit 3 is reflected in the device of the expansion unit 4 by the output refresh. Similarly, the device values stored in the expansion unit 4 devices are reflected in the basic unit 3 devices by input refresh. Thus, the devices of the basic unit 3 and the devices of the expansion unit 4 are synchronized by input/output refresh. Note that a mechanism (inter-unit synchronization) of updating device values between units at a timing other than refresh may be employed. However, the devices of the basic unit 3 are rewritten by the basic unit 3 as needed, and similarly, the devices of the expansion unit 4 are rewritten by the expansion unit 4 as needed. In other words, the devices in the base unit 3 can be accessed by devices inside the base unit 3 at any time. Similarly, the devices in expansion unit 4 are accessible by devices internal to expansion unit 4 at any time. Basically, the basic unit 3 and the expansion unit 4 mutually update and synchronize the device values at the refresh timing. At program execution 202, the basic unit 3 executes (computes) the program using the updated input data. As shown in FIG. 5, in program execution 202, multiple program modules or ladder programs may be executed in sequence according to project data. The basic unit 3 performs arithmetic processing on data by executing programs. The END process means all processes related to peripheral services such as data communication with an external device such as a display (not shown) connected to the PC 2 or the basic unit 3, and system error check.

このように、PC2はユーザの操作に応じたラダープログラムを作成し、作成したラダープログラムをPLC1に転送する。PLC1は、入出力リフレッシュ、ラダープログラムの実行およびEND処理を1サイクル(1スキャン)として、このサイクルを周期的、すなわちサイクリックに繰り返し実行する。これにより、各種の入力機器(センサ等)からのタイミング信号に基づいて、各種の出力機器(モータ等)を制御する。なお、スキャン周期とは別に、基本ユニット3や拡張ユニット4はそれぞれ内部制御周期を有している。基本ユニット3や拡張ユニット4は内部制御周期を基準としてフィールドデバイス10などの機能を制御する。 Thus, the PC2 creates a ladder program according to the user's operation, and transfers the created ladder program to the PLC1. The PLC 1 performs input/output refresh, ladder program execution and END processing as one cycle (one scan), and periodically, that is, cyclically repeats this cycle. As a result, various output devices (motors, etc.) are controlled based on timing signals from various input devices (sensors, etc.). In addition to the scan cycle, the basic unit 3 and the expansion unit 4 each have an internal control cycle. The basic unit 3 and the expansion unit 4 control the functions of the field device 10 and the like based on the internal control cycle.

<ロギング>
ユーザがユーザプログラムを改良したり、修正したりする際に、PLC1がユーザプログラムを実行している際に取得されたデバイス値が役に立つことがある。そこで、PLC1は予め指定されたデバイス値を取得し、ログデータを作成する。ここで、PLC1が管理するデバイスには、ユーザプログラムによって利用されるものだけでなく、ユーザプログラムによって利用されないものも存在する。また、ユーザプログラムを改良したり、修正したりする際に役立つデバイスもあれば、役に立たないデバイスもある。一般にデバイスの数は数千個に及ぶため、ユーザが必要なデバイスを指定することは大きな負担となっていた。そこで、PC2は、ユーザプログラムを解析し、ユーザプログラムに使用または記述されているデバイスをロギング対象として抽出する。これにより、ユーザの負担が軽減される。
<Logging>
Device values obtained while the PLC 1 is executing the user program may be useful when the user improves or modifies the user program. Therefore, the PLC 1 acquires a device value specified in advance and creates log data. Here, the devices managed by the PLC 1 include not only devices that are used by the user program, but also devices that are not used by the user program. Also, some devices are useful in improving or modifying user programs, while others are not. Since the number of devices is generally several thousand, it has been a heavy burden for the user to specify the required device. Therefore, the PC 2 analyzes the user program and extracts devices used or described in the user program as logging targets. This reduces the burden on the user.

PLC1が管理するすべてのデバイスをロギングの対象とすると、スキャンタイムが長くなってしまう。なぜなら、ロギングは、ユーザプログラムの一つとして実行されたり、入出力リフレッシュの際に実行されたりするからである。時には、ロギングのもたらす遅延によって、ユーザプログラムがユーザの希望通りに動作しないこともありうる。したがって、ロギング対象のデバイスの数は適切に維持されるべきであろう。 If all the devices managed by the PLC 1 are targeted for logging, the scan time will become long. This is because logging may be performed as part of the user program or during I/O refresh. Occasionally, the delays introduced by logging can cause a user program not to behave as desired by the user. Therefore, the number of logged devices should be maintained appropriately.

ユーザプログラムは、複数のプログラム部品(例:プログラムモジュール(メインのラダープログラムとサブのラダープログラム)、ファンクションブロック)から構成されることがある。このうち、ユーザが修正を希望するプログラム部品に関連したデバイスがロギングされれば、ユーザにとって十分な場合がある。また、複数のプログラム部品のうちで、ユーザは特定のプログラム部品を抽出対象から除外したり、特定のプログラム部品を抽出対象に追加したりすることを希望することもあろう。よって、プログラム部品を単位として、ロギング対象からデバイスを追加または削除できればユーザにとって便利であろう。 A user program may consist of a plurality of program parts (eg, program modules (main ladder program and sub ladder program), function blocks). Of these, it may be sufficient for the user if the device associated with the program part that the user wishes to modify is logged. Moreover, the user may wish to exclude a specific program part from the extraction target or add a specific program part to the extraction target among the plurality of program parts. Therefore, it would be convenient for the user if devices could be added or deleted from the logging targets in units of program parts.

上述したように基本ユニット3や拡張ユニット4は一つ以上の機能を有している。各機能には様々なデバイスが割り付けられている。よって、これらの機能を単位として、ロギング対象からデバイスを追加または削除できればユーザにとって便利であろう。たとえば、基本ユニット3の通信機能に関する望ましくないイベントが発生した場合、ユーザは、基本ユニット3の通信機能に関するデバイスのデバイス値を参照することで、このイベントを解消することが容易になろう。 As described above, the base unit 3 and expansion unit 4 have one or more functions. Various devices are assigned to each function. Therefore, it would be convenient for the user to be able to add or remove devices from logging targets based on these functions. For example, if an undesirable event related to the communication function of the base unit 3 occurs, the user will be able to easily resolve this event by referring to the device value of the device related to the communication function of the base unit 3.

●ロギングの設定(自動抽出と加除)
図6はPC2のCPU21が記憶装置22に記憶されている編集ソフトウエアを実行することで実現される機能を示している。これらの機能の一部またはすべてはASICやFPGAなどのハードウエア回路により実現されてもよい。ASICは特定用途集積回路の略称である。FPGAはフィールドプログラマブルゲートアレイの略称である。
●Logging settings (automatic extraction and addition/removal)
FIG. 6 shows functions realized by executing editing software stored in the storage device 22 by the CPU 21 of the PC 2 . Some or all of these functions may be realized by hardware circuits such as ASIC and FPGA. ASIC is an abbreviation for Application Specific Integrated Circuit. FPGA is an abbreviation for Field Programmable Gate Array.

なお、本実施形態では、図6に示す機能をPC2上で実現することとしたが、本発明はこれに限られず、PLC1上で実現しても構わない。 In this embodiment, the functions shown in FIG. 6 are implemented on the PC2, but the present invention is not limited to this, and may be implemented on the PLC1.

プロジェクト作成部50は、表示部7にプロジェクトデータ71を作成するためのUIを表示し、操作部8から入力されたユーザ指示にしたがってプロジェクトデータ71を作成し、記憶装置22に記憶する。UIはユーザーインターフェースの略称である。プロジェクトデータ71には、ユーザプログラムと、PLC1の構成情報などが含まれている。プログラム作成部63は、UIを介したユーザ操作に基づいて、ユーザプログラムを構成する複数のプログラム部品(各モジュール)を作成する。機能設定部62は、基本ユニット3の機能や拡張ユニット4の機能に関する設定を実行する。たとえば、機能設定部62は、基本ユニット3に設けられた機能に対していずれかのデバイスを割り付けたり、拡張ユニット4に設けられた機能に対していずれかのデバイスを割り付けたりし、機能とデバイスとの関係を示す割付情報を構成情報に書き込む。なお、プロジェクト作成部50は、ユーザプログラムがどのようなプログラム部品から構成されているかを示すプログラム構成情報も、プロジェクトデータ71として記憶させる。PLC1全体がどのようなユニットから構成されるかを示すユニット構成情報も、プロジェクトデータ71として記憶させる。 The project creation unit 50 displays a UI for creating project data 71 on the display unit 7 , creates project data 71 according to user instructions input from the operation unit 8 , and stores the project data 71 in the storage device 22 . UI is an abbreviation for user interface. The project data 71 includes user programs, configuration information of the PLC 1, and the like. The program creating unit 63 creates a plurality of program parts (each module) that constitute a user program based on user operations via the UI. The function setting section 62 executes settings related to the functions of the basic unit 3 and the functions of the expansion unit 4 . For example, the function setting unit 62 allocates any device to the function provided in the basic unit 3, or allocates any device to the function provided in the expansion unit 4. , and writes the allocation information indicating the relationship with the configuration information. The project creating unit 50 also stores program configuration information indicating what kind of program parts the user program is configured from as the project data 71 . Unit configuration information indicating what kind of units the entire PLC 1 is configured from is also stored as project data 71 .

ログ設定部51は、プロジェクトデータ71を解析することでプロジェクトデータ71に記述されているデバイスを抽出し、抽出されたデバイスをロギング対象として設定するためのログ設定データ72を作成する。ログ設定部51は各種の機能を有している。部品指定部52は、操作部8から入力されるユーザ指示にしたがって、デバイスの抽出対象となるプログラム部品を指定する。また、部品指定部52は、操作部8から入力されるユーザ指示にしたがって、デバイスの抽出対象から除外されるプログラム部品を指定する。 The log setting unit 51 analyzes the project data 71 to extract devices described in the project data 71, and creates log setting data 72 for setting the extracted devices as logging targets. The log setting unit 51 has various functions. The part designation unit 52 designates a program part to be extracted from a device according to a user instruction input from the operation unit 8 . In addition, the component designation unit 52 designates program components to be excluded from devices to be extracted according to user instructions input from the operation unit 8 .

デバイス抽出部53は、プロジェクトデータ71を解析することでプロジェクトデータ71に記述されているデバイスを抽出し、ログ設定データ72を作成する。追加部54は、部品指定部52により抽出対象として指定されたプログラム部品を解析し、プログラム部品に記述されているデバイスを抽出し、抽出リストに追加する。 削除部55は、部品指定部52により除外対象として指定されたプログラム部品を解析し、プログラム部品に記述されているデバイスを抽出し、抽出されたデバイスを抽出リストから削除する。あるいは、削除部55は、抽出されたデバイスを除外リストに追加する。マージ部56は、複数のプログラム部品からそれぞれ抽出されたデバイスのうち、重複して抽出されたデバイスを抽出リストから削除する。特定部57は、プロジェクトデータ71においてメモリカードに対する命令語を検知し、当該命令語の対象となっているデバイスを特定し、特定されたデバイスを抽出リストに追加する。 The device extraction unit 53 analyzes the project data 71 to extract devices described in the project data 71 and creates log setting data 72 . The adding unit 54 analyzes the program parts specified as extraction targets by the parts specifying unit 52, extracts the devices described in the program parts, and adds them to the extraction list. The deletion unit 55 analyzes the program parts designated as exclusion targets by the parts designation unit 52, extracts the devices described in the program parts, and deletes the extracted devices from the extraction list. Alternatively, deletion unit 55 adds the extracted device to the exclusion list. The merging unit 56 deletes duplicate extracted devices from the extraction list among the devices extracted from the plurality of program parts. The identifying unit 57 detects an instruction word for the memory card in the project data 71, identifies the device that is the target of the instruction word, and adds the identified device to the extraction list.

本実施形態では、部品指定部52がプログラム部品を指定した後、追加部54が、その指定されたプログラム部品を解析することにより、ロギング対象となるデバイスを抽出・追加することとしたが、本発明はこれに限られない。例えば、追加部54は、プロジェクトデータ71に含まれる一又は複数のプログラム部品を先に解析することでデバイスを抽出し、抽出されたデバイスを抽出リストに追加した後で、部品指定部52によって指定されたプログラム部品に記述されたデバイスを抽出し、これを抽出リストへ追加するようにしてもよい。 In this embodiment, after the component designating unit 52 designates a program component, the adding unit 54 analyzes the designated program component to extract and add a device to be logged. The invention is not limited to this. For example, the adding unit 54 first analyzes one or more program parts included in the project data 71 to extract devices, adds the extracted devices to the extraction list, and then specifies them by the parts specifying unit 52. It is also possible to extract the device described in the specified program part and add it to the extraction list.

同様にして、削除部55は、プロジェクトデータ71に含まれる一又は複数のプログラム部品を先に解析することで抽出リストを作成した後で、部品指定部52によって指定されたプログラム部品に記述されたデバイスを抽出し、これを抽出リストから削除するようにしてもよい。 Similarly, the deletion unit 55 first analyzes one or a plurality of program parts included in the project data 71 to create an extraction list, and then deletes the parts described in the program parts specified by the parts specification unit 52 . A device may be extracted and removed from the extraction list.

なお、本実施形態では、説明の便宜上、追加部54と削除部55を分けているが、一つの機能ブロックであってもよいことは言うまでもない。 In this embodiment, for convenience of explanation, the addition unit 54 and the deletion unit 55 are separated, but needless to say, they may be one functional block.

手動設定部58は、操作部8を通じて入力されるユーザ指示に従って一つのデバイスや、関連した一連のデバイスを抽出リストに追加する。推定部59は、デバイス抽出部53により記録対象として抽出されたデバイスの数に基づきPLC1によるデバイス値の記録がユーザプログラムの実行に与える影響を推定する。ロギングによってデバイス値の数に相関した遅延時間がスキャンタイムに加算される。よって、推定部59は、デバイス値の数に所定係数を乗算することで遅延時間を求め、遅延時間を推定結果として表示部7に表示してもよい。この遅延時間はスキャンタイムの伸びと呼ばれてもよい。 The manual setting unit 58 adds one device or a series of related devices to the extraction list according to user instructions input through the operation unit 8 . The estimation unit 59 estimates the effect of the recording of device values by the PLC 1 on execution of the user program based on the number of devices extracted as recording targets by the device extraction unit 53 . Logging adds a delay to the scan time that correlates to the number of device values. Therefore, the estimation unit 59 may obtain the delay time by multiplying the number of device values by a predetermined coefficient, and display the delay time as the estimation result on the display unit 7 . This delay time may be referred to as scan time extension.

機能指定部60は、操作部8から入力されるユーザ指示にしたがって、デバイスの抽出対象となる基本ユニット3の機能や拡張ユニット4の機能を指定する。また、機能指定部60は、操作部8から入力されるユーザ指示にしたがって、デバイスの抽出対象から除外される基本ユニット3の機能や拡張ユニット4の機能を指定する。追加部54は、機能指定部60により抽出対象として指定された機能の構成情報を解析し、構成情報により当該機能に割り付けられたデバイスを抽出し、抽出リストに追加する。 削除部55は、機能指定部60により除外対象として指定された機能の構成情報を解析し、構成情報により当該機能に割り付けられているデバイスを抽出し、抽出されたデバイスを抽出リストから削除する。マージ部56は、複数の機能のそれぞれについて抽出されたデバイスのうち、重複して抽出されたデバイスを抽出リストから削除する。特定部57は、プロジェクトデータ71においてメモリカードに対する命令語を検知し、当該命令語の対象となっているデバイスを特定し、特定されたデバイスを抽出リストに追加する。 The function designating section 60 designates the function of the basic unit 3 and the function of the expansion unit 4, which are the target of device extraction, in accordance with user instructions input from the operating section 8. FIG. Further, the function designating section 60 designates the functions of the basic unit 3 and the functions of the expansion unit 4 to be excluded from the devices to be extracted, according to user instructions input from the operation section 8 . The adding unit 54 analyzes the configuration information of the function specified as the extraction target by the function specifying unit 60, extracts the device allocated to the function according to the configuration information, and adds it to the extraction list. The deletion unit 55 analyzes the configuration information of the function specified as an exclusion target by the function specifying unit 60, extracts the device assigned to the function according to the configuration information, and deletes the extracted device from the extraction list. The merging unit 56 deletes redundantly extracted devices from the extraction list among the devices extracted for each of the plurality of functions. The identifying unit 57 detects an instruction word for the memory card in the project data 71, identifies the device that is the target of the instruction word, and adds the identified device to the extraction list.

ログ表示部61は、PLC1において生成されたログデータ73を、メモリカード36を介して読み出し、表示部7にログデータ73を表示する。たとえば、ログ表示部61は、ログデータ73に記録されているデバイス値と、プロジェクトデータ71のプログラム部品とを関連付けて表示部7に表示してもよい。ログ表示部61は、プログラマブルロジックコントローラ用のエンジニアリングツールの中核をなす。 The log display unit 61 reads log data 73 generated in the PLC 1 via the memory card 36 and displays the log data 73 on the display unit 7 . For example, the log display unit 61 may associate the device values recorded in the log data 73 with the program parts of the project data 71 and display them on the display unit 7 . The log display unit 61 forms the core of an engineering tool for programmable logic controllers.

図7はロギングの設定方法を示すフローチャートである。ここでは、すでにユーザプログラムを含むプロジェクトデータ71は完成しているものとする。 FIG. 7 is a flow chart showing a logging setting method. Here, it is assumed that the project data 71 including the user program has already been completed.

S1でCPU21(部品指定部52)はデバイスの抽出対象となるプログラム部品の指定を受け付ける。 In S1, the CPU 21 (component specifying unit 52) accepts specification of a program component to be extracted from a device.

図8はデバイスを抽出されるプログラム部品の選択を受け付けるためのUI100を示している。ログ設定部51は、ロギングの設定プログラムが起動されると、表示部7にUI100を表示する。UI100において、複数のプログラム部品はそれぞれの分類(モジュール/ファンクションブロック/マクロ)に基づいてツリー状に示されている。また、各プログラム部品にはチェックボックス102が関連付けて表示されている。操作部8の操作に応じてポインタ101がチェックボックス102にチェックを付与すると、追加部54は、チェックを付与されたチェックボックス102に対応するプログラム部品を抽出リストに追加する。一方、操作部8の操作に応じてポインタ101がチェックボックス102のチェックを外すと、削除部55は、チェックを外れたチェックボックス102に対応するプログラム部品を抽出リストから削除(除外)する。 FIG. 8 shows a UI 100 for accepting selection of program parts from which devices are extracted. The log setting unit 51 displays the UI 100 on the display unit 7 when the logging setting program is started. In the UI 100, a plurality of program parts are shown in tree form based on their classification (module/function block/macro). A check box 102 is displayed in association with each program part. When the pointer 101 checks the checkbox 102 according to the operation of the operation unit 8, the adding unit 54 adds the program part corresponding to the checked checkbox 102 to the extraction list. On the other hand, when the pointer 101 unchecks the check box 102 according to the operation of the operation unit 8, the deletion unit 55 deletes (excludes) the program part corresponding to the unchecked check box 102 from the extraction list.

なお、図8において毎スキャンモジュールとは、ユーザプログラムが一スキャンされるたびに一回実行されるプログラム部品である。この例では、毎スキャンモジュールは、メインプログラムとサブモジュールとを有している。定周期モジュールは、一定の周期ごとに実行されるプログラム部品である。ユニット間同期モジュールは、ユニット間同期が実行されるたびに実行されるプログラム部品である。初期化モジュールは図示されていないが、初期化モジュールはユーザプログラムを起動すると最初に実行されるモジュールである。そのため、初期化モジュールはトラブルの原因となりにくいため、デバイスの抽出対象から除外されてもよい。 Note that each scan module in FIG. 8 is a program part that is executed once each time the user program is scanned. In this example, each scan module has a main program and submodules. A periodic module is a program part that is executed at regular intervals. The inter-unit synchronization module is a program part that is executed each time inter-unit synchronization is performed. Although the initialization module is not shown, the initialization module is the first module executed when the user program is started. Therefore, initialization modules are less likely to cause trouble, and thus may be excluded from devices to be extracted.

ファンクションブロック(FB)は、ユーザプログラムにより呼び出されて使用される。ファンクションブロックは複数のモジュールから呼び出されるため、それぞれ個別のインスタンスを生成する。この場合、複数のインスタンスがそれぞれデバイスの抽出対象として選択されてもよいし、元のファンクションブロックを選択することでそのファンクションブロックに関連して生成されるすべてインスタンスがデバイスの抽出対象として選択されてもよい。 A function block (FB) is called and used by a user program. Since the function block is called from multiple modules, it creates separate instances for each. In this case, multiple instances may be selected for device extraction, or by selecting the original function block, all instances generated in relation to that function block are selected for device extraction. good too.

マクロは、プログラムの一種であり、データ整形のためのマクロなどがある。 Macros are a type of program, and include macros for data shaping.

S2でCPU21(機能指定部60)はデバイスの抽出対象となる機能の指定を受け付ける。 In S2, the CPU 21 (function specifying unit 60) accepts the specification of the function to be extracted from the device.

図9はデバイスを抽出される機能の選択を受け付けるためのUI110を示している。ログ設定部51は、ロギングの設定プログラムが起動されると、表示部7にUI110を表示する。なお、UI100とUI110は同時に表示されてもよいし、ユーザ操作にしたがって選択的に表示されてもよい。UI110において、複数の機能はそれぞれが属するユニットに基づいてツリー状に示されている。また、各機能にはチェックボックス102が関連付けて表示されている。操作部8の操作に応じてポインタ101がチェックボックス102にチェックを付与すると、追加部54は、チェックを付与されたチェックボックス102に対応する機能を抽出リストに追加する。一方、操作部8の操作に応じてポインタ101がチェックボックス102のチェックを外すと、削除部55は、チェックを外れたチェックボックス102に対応する機能を抽出リストから削除(除外)する。 FIG. 9 shows the UI 110 for accepting selection of a function for extracting devices. The log setting unit 51 displays the UI 110 on the display unit 7 when the logging setting program is started. Note that the UI 100 and the UI 110 may be displayed at the same time, or may be selectively displayed according to a user's operation. In the UI 110, a plurality of functions are shown in tree form based on the units to which they belong. A check box 102 is displayed in association with each function. When the pointer 101 checks the check box 102 according to the operation of the operation unit 8, the adding unit 54 adds the function corresponding to the checked check box 102 to the extraction list. On the other hand, when the pointer 101 unchecks the check box 102 according to the operation of the operation unit 8, the deletion unit 55 deletes (excludes) the function corresponding to the unchecked check box 102 from the extraction list.

図9において基本ユニット3の機能である通信エラーモニタは通信部33の通信エラーを監視する機能である。センサI/Oモニタはセンサの入出力を監視する機能である。モーションユニットは位置決めユニットとも呼ばれ、軸とよばれる制御対象の位置を制御する。一般に軸ごとにモータなどの駆動源が存在する。アナログ入力ユニットは、入力されるアナログ信号をサンプリングしてデジタル信号に変換するユニットである。ユニットモニタはモーションユニットやアナログ入力ユニットなどの拡張ユニット4の動作を監視する機能である。 In FIG. 9, the communication error monitor, which is a function of the basic unit 3, is a function of monitoring communication errors in the communication section 33. FIG. The sensor I/O monitor is a function that monitors sensor input/output. A motion unit, also called a positioning unit, controls the position of a controlled object called an axis. Generally, there is a drive source such as a motor for each axis. The analog input unit is a unit that samples an input analog signal and converts it into a digital signal. A unit monitor is a function for monitoring the operation of the extension units 4 such as motion units and analog input units.

ここで、ユニットモニタの一例として、モーションユニットのユニットモニタについて、更に詳述する。図10Aは、モーションユニットの軸1についてのユニットモニタ440の画面の模式図である。図10Bは、ユニットモニタ440による監視の対象を変更するための設定画面441の模式図である。 Here, as an example of the unit monitor, the unit monitor of the motion unit will be described in further detail. FIG. 10A is a schematic diagram of the screen of the unit monitor 440 for axis 1 of the motion unit. FIG. 10B is a schematic diagram of a setting screen 441 for changing the target of monitoring by the unit monitor 440. As shown in FIG.

図10Aに示すように、ユニットモニタ440による監視対象として、現在座標、指令座標、現在速度、指令速度、帰還トルク、負荷率、ピーク電流といった各項目が設定されている。各項目には、バッファメモリ(UG)が割り当てられている。例えば、現在座標には、UG4とUG5が割り当てられている。本実施形態では、1個のUGに16ビットを確保しており、現在座標を32ビット表現するために、2個のUGを確保している。UGのデバイス値としては、例えば、0PLS(パルス)のような数値となる。また、指令座標には、UG8とUG9が割り当てられている。2個のUGを確保しているのは、上述と同様の理由である(32ビット表現の確保のため)。UGの割り当ては、ユニット設計者が自由に行うことができるので、未使用のUG(UG6やUG7)も幾つか存在している。同様にして、現在速度にはUG10,UG11が、指令速度にはUG12,UG13が、それぞれ割り当てられている。その他、図10Aでは、帰還トルク、負荷率、ピーク電流などの各項目に対してUGが割り当てられている。 As shown in FIG. 10A, items such as current coordinates, command coordinates, current speed, command speed, feedback torque, load factor, and peak current are set as objects to be monitored by the unit monitor 440 . Each item is assigned a buffer memory (UG). For example, the current coordinates are assigned UG4 and UG5. In this embodiment, 16 bits are reserved for one UG, and two UGs are reserved to represent the current coordinates in 32 bits. The UG device value is, for example, a numerical value such as 0PLS (pulse). UG8 and UG9 are assigned to command coordinates. Two UGs are reserved for the same reason as described above (to ensure 32-bit representation). Since UG allocation can be freely performed by the unit designer, there are some unused UGs (UG6 and UG7). Similarly, UG10 and UG11 are assigned to the current speed, and UG12 and UG13 are assigned to the command speed. In addition, in FIG. 10A, UG is assigned to each item such as feedback torque, load factor, and peak current.

図10Bに示すように、どの項目をユニットモニタ440による監視対象とするかは、ユーザが自由に選択(設定)できる。例えば、図10Bに示す「非表示」の欄442から1項目を選択し、右矢印ボタン443をクリックすることで、その1項目が「表示」の欄444へ移動し、ユニットモニタ440による監視対象となる。OKボタン445をクリックすることで、「表示」の欄444に列挙された項目が監視対象として確定する。なお、図10A及び図10Bでは、モーションユニットの軸1についてのみ説明したが、軸2,軸3と複数ある場合にも、同様である。各軸について、ユーザにより選択された項目が監視対象となる。 As shown in FIG. 10B, the user can freely select (set) which items are to be monitored by the unit monitor 440 . For example, by selecting one item from the "hidden" column 442 shown in FIG. becomes. By clicking the OK button 445, the items listed in the "display" column 444 are determined as the monitoring targets. 10A and 10B, only axis 1 of the motion unit has been described, but the same is true when there are a plurality of axes 2 and 3. FIG. For each axis, items selected by the user are monitored.

一般に、モーションユニット(拡張ユニット4a)を使って、モータ(フィールドデバイス10a)を駆動してワークの位置決めを行う場合、基本ユニット3は、モータの位置決め開始トリガーを示すリレーデバイスをONすることにより、拡張ユニット4aに対して動作開始指令を送る。そして、動作開始指令を送った後は、拡張ユニット4aにおける具体的な処理動作(ワークの位置決め)に関与しない。言い換えると、基本ユニット3は、モータの現在位置や現在速度をリアルタイムに逐一認識しておらず、逐一認識する必要もない。その後、拡張ユニット4aにおける処理動作が完了した場合、基本ユニット3は、モータの位置決め完了トリガーを示すリレーデバイスがONされたことを通じて、モータの位置決め完了を認識する。このようなことから、モータの現在座標や現在速度に対応するデバイス(UG)は、基本的に、ラダープログラムには記述されない(但し、ユーザは、ごく一部のUGを読み出すための特別な命令語をラダープログラムに記述することは可能である)。 In general, when a motion unit (extension unit 4a) is used to drive a motor (field device 10a) to position a workpiece, the basic unit 3 turns on a relay device that indicates a positioning start trigger for the motor. An operation start command is sent to the expansion unit 4a. After sending the operation start command, it is not involved in the specific processing operation (positioning of the workpiece) in the expansion unit 4a. In other words, the basic unit 3 does not recognize the current position and current speed of the motor in real time, nor does it need to recognize them. After that, when the processing operation in the expansion unit 4a is completed, the basic unit 3 recognizes the completion of motor positioning through the turning on of the relay device indicating the motor positioning completion trigger. For this reason, the device (UG) corresponding to the current coordinates and current speed of the motor is basically not described in the ladder program (however, the user can use a special command to read out a small part of the UG). It is possible to describe words in a ladder program).

しかし、PLCの運用時にトラブルが生じた場合に、その原因究明の為、トラブルが生じた時点でのモータの現在座標や現在速度を把握したいことがある。このようなときに、上述したようにモータの現在座標や現在速度は、基本的にはラダープログラムに記述されるものではないため、ロギング対象としての抽出リストに挙がっていないことが多く、その原因究明が容易でなかった。 However, when trouble occurs during operation of the PLC, it is sometimes desired to grasp the current coordinates and current speed of the motor at the time when the trouble occurs in order to investigate the cause. In such a case, as mentioned above, the current coordinates and current speed of the motor are basically not described in the ladder program, so they are often not included in the extraction list for logging. It was not easy to find out.

そこで、本実施形態では、ユーザは、図9に示すUI110を通じて、モーションユニットのユニットモニタを選択できるようにしている。これにより、追加部54は、図10Bを用いて説明したように、モーションユニットのユニットモニタ440による監視の対象となっているUGを抽出リストに自動追加することができる。なお、基本ユニット3の通信エラーモニタ・センサI/Oモニタ、アナログ入力ユニットのユニットモニタについても、同様である。各モニタによる監視の対象となっているデバイス又はパラメータを抽出リストに自動追加することができる。 Therefore, in this embodiment, the user can select the unit monitor of the motion unit through the UI 110 shown in FIG. As a result, the adding unit 54 can automatically add the UG being monitored by the unit monitor 440 of the motion unit to the extraction list, as described with reference to FIG. 10B. The same applies to the communication error monitor/sensor I/O monitor of the basic unit 3 and the unit monitor of the analog input unit. Devices or parameters monitored by each monitor can be automatically added to the extraction list.

なお、その他のモニタについて図示は省略するが、簡単に説明する。基本ユニット3の機能である通信エラーモニタは、例えば、サイクリック通信の開設タイムアウトエラーに割り付けられたデバイスを監視する。センサの入出力を監視するセンサI/Oモニタは、例えば、一又は複数のセンサの出力やエラー有無に割り付けられたデバイスを監視する。アナログ入力ユニットのユニットモニタは、例えば、AD変換データ、特殊データ、オフセット値、ゼロシフト、ピーク値、ボトム値などの各種パラメータに割り付けられたデバイス(DM又はR)を監視する。これらのデバイスは、ユニット設計者によって、予めデフォルト(初期設定)として割り付けられたものであるが、上述したモーションユニットのユニットモニタのように、ユーザによって監視対象が変更されてもよい。要するに、図9に示すUI110は、ユーザから機能の選択入力を受け付け可能な設定画面となっている。そして、選択入力される機能ごとに、表示部(モニタ)に表示させる監視項目を定めたテンプレート(設定情報)が対応付けられている(テンプレートはメモリに保存されている)。そのテンプレートによって特定されるデバイスは、上述したように予めデフォルトで割り付けられたものであってもよいし、ユーザが設定画面を介して加除(編集)した後のものであってもよい。機能指定部60は、ユーザ操作に基づいて一又は複数の機能を選択すると、その機能に対応付けられたテンプレートに従って、監視対象となるデバイスを抽出リストに追加する。 Although illustration of other monitors is omitted, they will be briefly described. A communication error monitor, which is a function of the basic unit 3, monitors, for example, a device assigned to a cyclic communication opening timeout error. A sensor I/O monitor that monitors the input/output of a sensor monitors, for example, the output of one or a plurality of sensors and the device assigned to the presence or absence of an error. The unit monitor of the analog input unit monitors devices (DM or R) assigned to various parameters such as AD conversion data, special data, offset value, zero shift, peak value and bottom value. These devices are assigned in advance by the unit designer as defaults (initial settings), but the user may change the monitoring target like the unit monitor of the motion unit described above. In short, the UI 110 shown in FIG. 9 is a setting screen capable of accepting a function selection input from the user. A template (setting information) defining monitoring items to be displayed on the display unit (monitor) is associated with each function to be selectively input (the template is stored in the memory). The device specified by the template may be assigned in advance by default as described above, or may be added or removed (edited) by the user via the setting screen. When one or a plurality of functions are selected based on a user operation, the function designation unit 60 adds devices to be monitored to the extraction list according to templates associated with the functions.

S3でデバイス抽出部53は部品指定部52により指定されたプログラム部品を解析し、指定されたプログラム部品において記述されているデバイスを抽出する。 In S3, the device extraction unit 53 analyzes the program parts specified by the parts specification unit 52 and extracts the devices described in the specified program parts.

図10Cはプロジェクトデータ71に含まれる複数のプログラム部品のうち指定されたプログラム部品から抽出されたデバイスの一例を示している。図10Cによれば、デバイスを抽出されたプログラム部品の名称と、先頭デバイスの名称(デバイス番号)と、先頭デバイスを基準として抽出されるデバイスの個数と、実際にロギング対象として抽出されたデバイス名とが示されている。一般に、先頭デバイスを基準として指定個数に相当する数のデバイスが抽出される。しかし、指定個数を超えた数のデバイスが抽出されることもある。R34000はリレーデバイスであり、1ビットの情報を保持するデバイスであるが、R34000からR34015までの一連の16個のデバイスが抽出されている。これは、16ビット分のデバイスをまとめてロギングしたほうが、データ処理速度の観点で有利だからである。なお、図10Cにおいて、R34000の個数は「1」となっているが、これは1ワード(16ビット)を示している。また、CR4001の個数も「1」となっているが、これも1ワード(CR4001,CR4002,・・・,CR4015,CR4100の16ビット)を示している。グローバルとは、複数のプログラム部品から共通に使用されるデバイスである。Mainはメインプログラムを示している。first_operationはファンクションブロックの名称である。Subはサブプログラム(サブモジュール)を示している。 FIG. 10C shows an example of a device extracted from a designated program part among the plurality of program parts included in the project data 71. FIG. According to FIG. 10C, the name of the program part from which the device was extracted, the name (device number) of the leading device, the number of devices extracted based on the leading device, and the device name actually extracted as the logging target is shown. In general, a number of devices corresponding to a specified number are extracted with the leading device as a reference. However, the number of devices extracted may exceed the specified number. R34000 is a relay device that holds 1-bit information, and a series of 16 devices from R34000 to R34015 are extracted. This is because logging 16-bit devices collectively is advantageous in terms of data processing speed. Note that in FIG. 10C, the number of R34000 is "1", which indicates one word (16 bits). The number of CR4001 is also "1", which also indicates one word (16 bits of CR4001, CR4002, . . . , CR4015, CR4100). A global is a device commonly used by multiple program parts. Main indicates the main program. first_operation is the name of the function block. Sub indicates a subprogram (submodule).

S4でデバイス抽出部53は機能指定部60により指定された機能の構成情報を解析し、構成情報において機能と関連付けられているデバイスを抽出する。 In S4, the device extraction unit 53 analyzes the configuration information of the function specified by the function specification unit 60, and extracts the device associated with the function in the configuration information.

図11はPLC1に備えられた複数の機能(基本ユニット3および拡張ユニット4)のうち指定された機能(ユニット)から抽出されたデバイスの一例を示している。この例では、機能指定部60により指定されたモーションユニットからいくつかのバッファメモリ(UG)が抽出されている。図11によれば、デバイスを抽出された機能の名称と、先頭デバイスの名称(デバイス番号)と、先頭デバイスを基準として抽出されるデバイスの個数と、実際にロギング対象として抽出されたデバイス名とが示されている。ここでは、モーションユニットのユニットモニタにより監視可能なデバイスが抽出されている。すなわち、図10Aを用いて上述したように、UG4-UG5はモータの現在座標を示しており、UG8-UG9はモータの指令座標を示しており、UG10-UG11はモータの現在速度を示しており、UG12-UG13はモータの指令速度を示している。その他のUGについては、説明を省略する。 FIG. 11 shows an example of a device extracted from a specified function (unit) among a plurality of functions (basic unit 3 and expansion unit 4) provided in PLC1. In this example, several buffer memories (UG) are extracted from the motion unit specified by the function specifying section 60. FIG. According to FIG. 11, the name of the function from which the device was extracted, the name (device number) of the leading device, the number of devices extracted based on the leading device, and the name of the device actually extracted as the logging target. It is shown. Here, devices that can be monitored by the unit monitor of the motion unit are extracted. That is, as described above with reference to FIG. 10A, UG4-UG5 indicate the current coordinates of the motor, UG8-UG9 indicate the commanded coordinates of the motor, and UG10-UG11 indicate the current speed of the motor. , UG12-UG13 indicate the commanded speed of the motor. Description of other UGs will be omitted.

S5で手動設定部58は操作部8を通じてユーザにより手動で指定されたデバイスを抽出リストに追加する。たとえば、手動設定部58は、デバイス番号などを直接入力可能なUIを表示部7に表示し、ユーザによるデバイスの指定を補助してもよい。 In S5, the manual setting unit 58 adds the device manually specified by the user through the operation unit 8 to the extraction list. For example, the manual setting unit 58 may display on the display unit 7 a UI that allows direct input of the device number, etc., to assist the user in specifying the device.

S6でマージ部56は、プログラム部品から抽出されたデバイス、機能から抽出されたデバイスおよび手動で追加されたデバイスをマージしてロギング対象リストを作成する。ロギング対象リストはデバイスリストと呼ばれてもよい。 In S6, the merging unit 56 creates a logging target list by merging devices extracted from program parts, devices extracted from functions, and devices added manually. A logging target list may be referred to as a device list.

図12はマージ処理の概念を説明する図である。デバイス抽出部53はプログラム部品から抽出されたデバイスを記述した抽出リストL1を作成する。デバイス抽出部53は機能から抽出されたデバイスを記述した抽出リストL2を作成する。デバイス抽出部53はユーザにより手動で追加されたデバイスを記述した抽出リストL3を作成する。マージ部56は、抽出リストL1~L3をマージしてロギング対象リストL0を作成する。抽出リストL1~L3は、重複して抽出されたデバイスが存在する可能性がある。同一のデバイスが複数回にわたりロギングされると、ログデータが肥大化する。よって、同一のデバイスの重複したロギングを回避するために、マージ処理が実行される。たとえば、抽出リストL1ではデバイスの一種であるデータメモリDM0-DM100が登録されている。また、抽出リストL3ではデータメモリDM50-DM200が登録されている。つまり、DM50-DM100は重複している。マージ部56は、DM0-DM100とDM50-DM200をマージしてDM0-DM200をロギング対象リストL0に記述する。 FIG. 12 is a diagram for explaining the concept of merge processing. The device extraction unit 53 creates an extraction list L1 describing the devices extracted from the program parts. The device extraction unit 53 creates an extraction list L2 describing the devices extracted from the functions. The device extraction unit 53 creates an extraction list L3 describing the devices added manually by the user. The merging unit 56 merges the extraction lists L1 to L3 to create a logging target list L0. The extracted lists L1 to L3 may have duplicate extracted devices. When the same device is logged multiple times, the log data becomes bloated. Therefore, a merge process is performed to avoid duplicate logging of the same device. For example, data memories DM0 to DM100, which are one type of device, are registered in the extraction list L1. Data memories DM50 to DM200 are registered in the extraction list L3. That is, DM50-DM100 overlap. The merging unit 56 merges DM0-DM100 and DM50-DM200 and describes DM0-DM200 in the logging target list L0.

S7で推定部59はロギング対象リストL0を解析し、スキャンタイムへの影響を推定し、推定結果を表示部7に表示する。 In S<b>7 , the estimation unit 59 analyzes the logging target list L<b>0 , estimates the influence on the scan time, and displays the estimation result on the display unit 7 .

図13は推定結果を表示するためのUI140を示している。UI140はデバイスサイズとスキャンタイムの伸びとを表示する。デバイスサイズとは、ロギング対象リストL0に記述されているデバイスのトータルサイズを示している。スキャンタイムの伸びとは、ロギングによって発生する遅延時間である。推定部59はロギング対象リストL0を解析し、デバイスサイズとスキャンタイムの伸びとを演算する。操作部8を通じてリストボタン141が操作されると、推定部59はロギング対象リストL0を表示部7に表示してもよい。ユーザは、推定結果を考慮し、ロギング対象リストL0を確定するか、調整するかを判断する。ロギング対象リストL0を確定する場合、ユーザは、確定の意思を示すボタンをポインタ101により操作してもよい。 FIG. 13 shows UI 140 for displaying estimation results. The UI 140 displays the device size and scan time extension. The device size indicates the total size of the devices described in the logging target list L0. Extension of scan time is delay time caused by logging. The estimation unit 59 analyzes the logging target list L0 and calculates the device size and scan time extension. When the list button 141 is operated through the operation unit 8, the estimation unit 59 may display the logging target list L0 on the display unit 7. FIG. The user considers the estimation result and determines whether to fix or adjust the logging target list L0. When confirming the logging target list L0, the user may use the pointer 101 to operate a button indicating the intention of confirmation.

S8でログ設定部51はロギング対象を確定するかどうかを判定する。たとえば、ロギング対象リストL0を確定するためのボタンが操作されると、ログ設定部51はロギング対象を確定すると判定する。一方で、ロギング対象リストL0を修正するためのボタンが操作されると、ログ設定部51はロギング対象を修正すると判定する。ロギング対象を修正する場合、ログ設定部51はS3ないしS8を繰り返すことで、デバイスの抽出対象となるプログラム部品および機能の追加や削除を受け付け、ロギング対象リストL0を修正する。たとえば、スキャンタイムの伸びが許容閾値を超えると、いくつかのデバイスが削除される。スキャンタイムの伸びが許容閾値未満であれば、いくつかのデバイスが追加されてもよい。ロギング対象が確定すると、CPU21はS9に進む。 In S8, the log setting unit 51 determines whether or not to confirm the logging target. For example, when a button for finalizing the logging target list L0 is operated, the log setting unit 51 determines to finalize the logging target. On the other hand, when the button for modifying the logging target list L0 is operated, the log setting unit 51 determines to modify the logging target. When modifying the logging target, the log setting unit 51 repeats S3 to S8 to accept additions and deletions of program parts and functions to be extracted from the device, and modify the logging target list L0. For example, some devices are removed if the scan time increase exceeds an acceptable threshold. Some devices may be added if the increase in scan time is below the acceptable threshold. When the logging target is determined, the CPU 21 proceeds to S9.

S9でログ設定部51はロギング対象リストL0を含むログ設定データ72を作成し、記憶装置22に格納する。なお、CPU21は、プロジェクトデータ71とともにログ設定データ72を基本ユニット3に送信するよう通信部23を制御する。 In S<b>9 , the log setting unit 51 creates log setting data 72 including the logging target list L<b>0 and stores it in the storage device 22 . Note that the CPU 21 controls the communication section 23 to transmit the log setting data 72 together with the project data 71 to the basic unit 3 .

ここでは、主にデータメモリやバッファメモリなどのデバイスがロギング対象とされているが、各機能の動作状態や機能設定状態(例:IPアドレスなど)もロギング対象として追加されてもよい。 Here, devices such as data memory and buffer memory are mainly targeted for logging, but operating states and function setting states (eg, IP addresses, etc.) of each function may also be added as logging targets.

図14はデバイスの抽出処理で使用されるフィルタの設定UI120を示している。PLC1に関連したデバイスとしては複数の種別のデバイスが存在する。ユーザは特定の種別のデバイスに着目し、他の種別のデバイスについては無視したいと考えることもある。そこで、ログ設定部51は、フィルタの設定UI120を表示部7に表示し、抽出対象とするデバイス種別と、除外対象とするデバイス種別とをチェックボックス102を通じて受け付けてもよい。たとえば、デバイス抽出部53は、チェックボックス102にチェックを付与されたデバイス種別をプログラム部品や機能から抽出する。デバイス抽出部53は、チェックボックス102からチェックを外されたデバイス種別をプログラム部品や機能から抽出しない。これにより、ユーザの意図に沿って用意にロギング対象となるデバイスを取捨選択することが可能となる。 FIG. 14 shows a filter setting UI 120 used in device extraction processing. A plurality of types of devices exist as devices related to the PLC 1 . A user may want to focus on a particular type of device and ignore other types of devices. Therefore, the log setting unit 51 may display the filter setting UI 120 on the display unit 7 and receive the device type to be extracted and the device type to be excluded through the check boxes 102 . For example, the device extraction unit 53 extracts the device type with a check in the check box 102 from the program part or function. The device extraction unit 53 does not extract the device type for which the check is removed from the check box 102 from the program part or function. This makes it possible to easily select devices to be logged according to the user's intention.

ところで、CPU21は、プロジェクト作成部50によってプロジェクトデータ71が変更されると、デバイスの抽出処理を再度実行してもよい。これは、ユーザプログラムにおけるデバイスの記述が変更されている可能性があるからである。CPU21は、プロジェクト作成部50がプロジェクトデータ71の転送を実行する際に、デバイスの抽出処理を実行してもよい。プロジェクトデータ71は最終的にPLC1に書き込まれるため、この書き込みをトリガーとしてデバイスの抽出処理を実行することで、デバイスの抽出処理の実行回数が削減されよう。 By the way, when the project data 71 is changed by the project creating unit 50, the CPU 21 may execute the device extraction process again. This is because the description of the device in the user program may have changed. The CPU 21 may execute device extraction processing when the project creation unit 50 transfers the project data 71 . Since the project data 71 is finally written to the PLC 1, the number of times the device extraction process is executed may be reduced by executing the device extraction process with this writing as a trigger.

デバイス抽出部53はPC2に実装されているが、基本ユニット3に実装されてもよい。CPU31は、プロジェクトデータ71のうちPC2により指定されたプログラム部品や機能からデバイスを抽出し、ログ設定データ72を作成する。この場合、推定部59も基本ユニット3に実装されることになろう
●デバイスの抽出処理
図15はデバイス抽出部53が実行するプログラム部品からのデバイスの抽出処理を示すフローチャートである。図16はラダープログラムの一例を示している。このラダープログラムは拡張ユニット4として4軸を駆動するモーションユニットを制御するためのものである。
Although the device extractor 53 is mounted on the PC 2 , it may be mounted on the basic unit 3 . The CPU 31 extracts devices from the program parts and functions specified by the PC 2 from the project data 71 and creates log setting data 72 . In this case, the estimating section 59 will also be mounted in the basic unit 3. Device Extraction Processing FIG. FIG. 16 shows an example of a ladder program. This ladder program is for controlling the motion unit that drives the four axes as the extension unit 4 .

S11でデバイス抽出部53は、抽出対象として指定されたプログラム部品のi番目のステップの記述からデバイス番号を取得する。iの初期値は001である。図16が示すように、ラダープログラムの左端にはステップ番号が付与されている。001番のステップには、MR000というリレーデバイスがオンになると、モーションユニットに動作許可を与えるR34000というリレーデバイスがオンにし、かつ、モーションユニットの1番目の軸のサーボを稼動させるためのR34305というリレーデバイスをオンにすることが記述されている。よって、デバイス抽出部53は、デバイス番号としてMR000、R34000およびR34305を抽出する。なお、デバイス番号が間接参照やインデックス参照により記述されていることもある。この場合、デバイス抽出部53は、間接参照先やインデックス値を代入しているプログラムを検索し、実際のデバイス番号を特定する。なお、デバイス抽出部53は、実際のデバイス番号の抽出に失敗すると、抽出失敗を示すメッセージを表示部7に表示してもよい。さらに、デバイス抽出部53は、実際のデバイス番号をユーザに入力させるためのUIを表示部7に表示し、ユーザ入力を受け付けてもよい。さらにまた、上述した間接参照やインデックス参照を考慮すれば、デバイス抽出部53は、プログラムに直接記述されている特定のデバイスを抽出するだけでなく、プログラムに使用される特定のデバイス(間接参照やインデックス参照により特定されるデバイス等)をも抽出する。 In S11, the device extraction unit 53 acquires the device number from the description of the i-th step of the program part designated as the extraction target. The initial value of i is 001. As shown in FIG. 16, step numbers are given to the left end of the ladder program. In step No. 001, when the relay device MR000 is turned on, the relay device R34000 that gives motion unit operation permission is turned on, and the relay R34305 for operating the servo of the first axis of the motion unit It describes turning on the device. Therefore, the device extractor 53 extracts MR000, R34000 and R34305 as device numbers. Note that the device number may be described by indirect reference or index reference. In this case, the device extraction unit 53 searches for an indirect reference destination or a program in which the index value is assigned, and identifies the actual device number. Note that the device extraction unit 53 may display a message indicating the extraction failure on the display unit 7 when the extraction of the actual device number fails. Further, the device extracting unit 53 may display a UI for allowing the user to input the actual device number on the display unit 7 and accept user input. Furthermore, considering the above-described indirect references and index references, the device extractor 53 not only extracts specific devices directly described in the program, but also extracts specific devices (indirect references and index references) used in the program. devices specified by index reference) are also extracted.

S12でデバイス抽出部53は、命令語のアクセス範囲からデバイス範囲を取得する。命令語によっては、先頭デバイスのデバイス番号と、先頭デバイスを基準としたデバイスの個数とを引数とするものがある。たとえば、003番のステップにはリレーデバイスMR000がオンになると、FMOVという命令語を実行することが記述されている。この例では、FMOVは、指定された値(0)を、先頭デバイス(@EM0)を基準とした指定個数(10個)のデバイスに代入するための命令語(関連デバイスの初期化をするための命令語)である。つまり、アクセス範囲は、先頭アドレスと指定個数とによって定義されている。デバイス抽出部53は、@EM0から@EM9までの範囲をデバイス範囲に決定する。なお、アクセス範囲が間接参照やインデックス参照により記述されていることもある。この場合、デバイス抽出部53は、間接参照先やインデックス値を代入しているプログラムを検索し、実際のアクセス範囲を特定する。なお、デバイス抽出部53は、実際のアクセス範囲の抽出に失敗すると、抽出失敗を示すメッセージを表示部7に表示してもよい。さらに、デバイス抽出部53は、実際のアクセス範囲をユーザに入力させるためのUIを表示部7に表示し、ユーザ入力を受け付けてもよい。 In S12, the device extraction unit 53 acquires the device range from the access range of the instruction word. Some commands take as arguments the device number of the leading device and the number of devices relative to the leading device. For example, step 003 describes that when the relay device MR000 is turned on, the command FMOV is executed. In this example, FMOV is an instruction word (to initialize related devices) for assigning a specified value (0) to a specified number (10) of devices based on the leading device (@EM0). command). That is, the access range is defined by the starting address and the specified number. The device extraction unit 53 determines the range from @EM0 to @EM9 as the device range. Note that the access range may be described by indirect reference or index reference. In this case, the device extraction unit 53 searches for an indirect reference destination or a program that substitutes an index value, and identifies the actual access range. Note that the device extraction unit 53 may display a message indicating the extraction failure on the display unit 7 when the extraction of the actual access range fails. Further, the device extraction unit 53 may display a UI for allowing the user to input the actual access range on the display unit 7 and accept user input.

S13でデバイス抽出部53は、先頭デバイス番号とデバイス範囲に基づきデバイスを抽出し、抽出したデバイスを抽出リストに追加する。たとえば、001番のステップからはMR000、R34000およびR34005が抽出され、抽出リストに追加される。003番のステップからは@EM0から@EM9が抽出され、抽出リストに追加される。 In S13, the device extraction unit 53 extracts devices based on the leading device number and the device range, and adds the extracted devices to the extraction list. For example, MR000, R34000 and R34005 are extracted from step 001 and added to the extraction list. From step 003, @EM0 to @EM9 are extracted and added to the extraction list.

S14でデバイス抽出部53は、指定されたプログラム部品についてプログラム終端までデバイスの解析を終了したかどうかを判定する。プログラム終端までデバイスの解析を終了していなければ、デバイス抽出部53はS15に進む。S15でデバイス抽出部53は変数iに1を加算して、S11に戻る。プログラム終端までデバイスの解析を終了したのであれば、デバイス抽出部53はデバイスの抽出処理を終了する。 In S14, the device extraction unit 53 determines whether or not the device analysis for the specified program part has been completed up to the end of the program. If the device analysis is not completed until the end of the program, the device extractor 53 proceeds to S15. In S15, the device extraction unit 53 adds 1 to the variable i and returns to S11. If the device analysis is completed up to the end of the program, the device extraction unit 53 terminates the device extraction processing.

なお、図16に示すラダープログラムにおいて、004番のステップ以降から抽出されるデバイスについて、以下、簡単に説明する。 In the ladder program shown in FIG. 16, the devices extracted from step No. 004 onward will be briefly described below.

004,005番のステップは、モータの原点復帰(動作)要求であり、R34310は、モータの原点復帰開始トリガーを示すリレーデバイスである。本ステップからは、MR001、R34310、R40905,R40910,R34310の各デバイスが抽出される。 Steps 004 and 005 are requests for origin return (operation) of the motor, and R34310 is a relay device indicating a trigger for starting return to origin of the motor. From this step, the devices MR001, R34310, R40905, R40910, and R34310 are extracted.

006~008番のステップは、モータの原点復帰が完了した場合に、モーションユニットから原点復帰完了コードを読み出して、原点復帰が正しく完了しているか否かを判断する処理である。より具体的に説明すると、R40910は、モータの原点復帰完了トリガーを示すリレーデバイスである。基本ユニット3は、モーションユニットにおける原点復帰の具体的処理動作をリアルタイムに逐一認識しておらず、このフラグR40910がONしたか否かを監視することで、原点復帰が完了したか否かを判断する。このフラグR40910がONすると、バッファメモリをダイレクトに読み出すUREAD命令を実行する。図16に示すUREAD命令は、ユニット番号1のユニットにおける4060番のバッファメモリを読み出し、デバイス@EM0に1ワード分を代入する、という命令である。ここでは、4060番のバッファメモリには、原点復帰完了コードが格納されており、原点復帰が正常に終了した場合には0、原点復帰が異常終了した場合には0以外の数値(1や2等)が格納されるようになっている。そして、007番のステップに示すように、@EM0のデバイス値が0以外の場合には、基本ユニット3は、デバイスMR000をセットし、原点復帰が異常終了したことを認識する。一方、008番のステップに示すように、@EM0のデバイス値が0の場合には、基本ユニット3は、デバイスMR001をセットし、原点復帰が正常に終了したことを認識する。本ステップからは、R40910,@EM0,@MR000,@MR001の各デバイスが抽出される。 Steps 006 to 008 are a process of reading the return-to-origin completion code from the motion unit when the return-to-origin of the motor is completed, and determining whether or not the return-to-origin has been correctly completed. More specifically, R40910 is a relay device that indicates a motor return-to-origin completion trigger. The basic unit 3 does not recognize in real time the specific processing operations for returning to origin in the motion units, and by monitoring whether this flag R40910 is turned ON, it is determined whether or not the return to origin has been completed. do. When this flag R40910 is turned ON, a UREAD instruction for directly reading the buffer memory is executed. The UREAD instruction shown in FIG. 16 is an instruction to read out the 4060th buffer memory in the unit with the unit number 1 and to substitute one word in the device @EM0. Here, the buffer memory No. 4060 stores the return-to-origin completion code, which is 0 if the return-to-origin was completed normally, and a value other than 0 (1 or 2) if the return-to-origin was terminated abnormally. etc.) are stored. Then, as shown in step No. 007, if the device value of @EM0 is other than 0, the basic unit 3 sets the device MR000 and recognizes that the return to origin has ended abnormally. On the other hand, if the device value of @EM0 is 0 as shown in step No. 008, the basic unit 3 sets the device MR001 and recognizes that return to origin has been completed normally. From this step, the devices R40910, @EM0, @MR000, and @MR001 are extracted.

009番のステップは、原点復帰が正常に終了した場合に、1秒間だけ待機する処理である。デバイスT0は、設定値として10(100ms単位であるため1秒に相当)、現在のカウント値を有しており、カウント値が設定値になったらONするものである。本ステップからは、MR001,T0の各デバイスが抽出される。 Step 009 is a process of waiting for one second when return to origin has been completed normally. The device T0 has a set value of 10 (corresponding to 1 second because it is in units of 100 ms) and a current count value, and is turned ON when the count value reaches the set value. From this step, the devices MR001 and T0 are extracted.

最後に、010~011番のステップは、デバイスT0がONすると、ユニット番号1のユニットに対し、ファンクションブロック「First_operation」が実行される。そして、その実行結果が@MR002に格納され、完了コードが@EM1に格納される。本ステップから、@MR002,@EM1の各デバイスが抽出される。 Finally, in steps 010 to 011, when the device T0 turns ON, the function block "First_operation" is executed for the unit with the unit number 1. FIG. Then, the execution result is stored in @MR002, and the completion code is stored in @EM1. From this step, the devices @MR002 and @EM1 are extracted.

以上、図16を用いて詳述したように、一般的なラダープログラムでは、軸のサーボONや原点復帰要求、ファンクションブロックの起動や結果など、動作開始に応じたデバイスや、動作完了に応じたデバイスしか記述されない。しかし、トラブル発生時には、動作途中の状態(モータの現在座標や現在位置など)の情報があれば、原因究明に役立つので、上述したようにユニットモニタによる監視の対象となっているUGも、抽出リストに自動追加するようにしている。 As described above in detail with reference to FIG. 16, in a general ladder program, devices corresponding to the start of operation, such as axis servo ON, origin return request, function block activation and result, etc., and Only the device is described. However, when a problem occurs, if there is information about the state during operation (current coordinates and current position of the motor, etc.), it will be useful for investigating the cause, so as described above, UGs that are monitored by the unit monitor can also be extracted. I have it automatically added to the list.

指定されたプログラム部品のそれぞれについてこの抽出処理は実行される。 This extraction process is executed for each of the specified program parts.

●ロギングの実行
図17は基本ユニット3のCPU31の機能を示している。これらの機能の一部またはすべてはASICやFPGAなどのハードウエア回路により実現されてもよい。ASICは特定用途集積回路の略称である。FPGAはフィールドプログラマブルゲートアレイの略称である。
●Execution of logging FIG. 17 shows the functions of the CPU 31 of the basic unit 3. Some or all of these functions may be realized by hardware circuits such as ASIC and FPGA. ASIC is an abbreviation for Application Specific Integrated Circuit. FPGA is an abbreviation for Field Programmable Gate Array.

CPU31は、PC2から受信したプロジェクトデータ71とログ設定データ72を記憶装置32に記憶しているものとする。実行部80は、ユーザプログラムを繰り返し実行するラダー実行エンジン80aと、このラダー実行エンジン80aを制御したり、拡張ユニット4との入出力リフレッシュを実行したりするユニット制御部80bと、を有している。実行部80のラダー実行エンジン80aは、プロジェクトデータ71に含まれるユーザプログラムを繰り返し実行し、ユーザプログラムにしたがって拡張ユニット4を制御する。なお、実行部80のラダー実行エンジン80aは、ユーザプログラムにしたがって、デバイス部34の基本ユニットデバイス部34aに保持されている出力系のデバイスにデバイス値を書き込んだり、基本ユニットデバイス部34aに保持されている入力系のデバイスからデバイス値を読み込んだりする。 It is assumed that the CPU 31 stores the project data 71 and the log setting data 72 received from the PC 2 in the storage device 32 . The execution unit 80 has a ladder execution engine 80a that repeatedly executes a user program, and a unit control unit 80b that controls the ladder execution engine 80a and performs input/output refresh with the expansion unit 4. there is The ladder execution engine 80a of the execution unit 80 repeatedly executes the user program included in the project data 71, and controls the expansion unit 4 according to the user program. Note that the ladder execution engine 80a of the execution unit 80 writes device values to output devices held in the basic unit device section 34a of the device section 34, or Reads device values from input devices that are connected.

一方で、実行部80のユニット制御部80bは、入出力リフレッシュにより取得した拡張ユニットに関するデバイス値を、拡張ユニットデバイス部34bに読み書きする。また、基本ユニットと拡張ユニットは、ユニット内部バスによって電気的に接続されており、ユニット制御部80bは、このユニット内部バスにおける通信制御を行う機能、いわゆるバスマスタとしての機能を有している。ユニット制御部80bがバスマスタとして機能する場合には、図6を用いて説明したユニット構成情報、すなわち、PLC1全体がどのようなユニットから構成されるかを示す情報に基づいて、各拡張ユニットとリフレッシュ通信を行う。 On the other hand, the unit control section 80b of the execution section 80 reads and writes the device value related to the expansion unit acquired by the input/output refresh to the expansion unit device section 34b. The basic unit and the expansion unit are electrically connected by a unit internal bus, and the unit control section 80b has a function of controlling communication in this unit internal bus, that is, a function as a so-called bus master. When the unit control section 80b functions as a bus master, each extension unit and the refresh unit are controlled based on the unit configuration information described with reference to FIG. communicate.

記録部81は、ログ設定データ72にしたがってデバイス部34(基本ユニットデバイス部34a又は拡張ユニットデバイス部34b)からデバイス値を取得したり、拡張ユニット4のバッファメモリからデバイス値を取得したりして、ログデータ73としてメモリ(例えばリングバッファ)に書き込む。上述されたように、記録部81は、END処理の際などに、ロギング処理を実行する。 The recording unit 81 acquires device values from the device unit 34 (the base unit device unit 34a or the expansion unit device unit 34b) according to the log setting data 72, or acquires device values from the buffer memory of the expansion unit 4. , is written to a memory (for example, a ring buffer) as log data 73 . As described above, the recording unit 81 executes the logging process during the END process or the like.

END処理におけるロギング処理について、更に詳細に説明する。ログ設定データ72には、図10Cや図11を用いて説明したように、部品指定部52によって指定されたプログラム部品に記述されたデバイスや、機能指定部60によって指定された機能(例えばユニットモニタによる監視の対象)に割り付けられたデバイスが、ロギング対象として含まれている。前者のデバイスについては、END処理の際に、ログデータ73に書き込む一方で、後者のデバイスについては、END処理の際に、拡張ユニット4から対象となるデバイス(UG)のデバイス値を読み出して、ログデータ73に書き込む。 The logging process in the END process will be explained in more detail. As described with reference to FIGS. 10C and 11, the log setting data 72 includes the device described in the program part specified by the part specifying section 52 and the function specified by the function specifying section 60 (for example, the unit monitor monitored by) are included as logging targets. The former device is written to the log data 73 during the END process, while the latter device reads the device value of the target device (UG) from the expansion unit 4 during the END process, Write to log data 73 .

ここで、モータの現在座標や指令座標の更新周期(いわゆる制御周期)は、ラダープログラムのスキャン周期と比べて格段に短い。したがって、本実施形態では、スキャン周期と同期してUGのデバイス値を読み出すようにしているので、全ての現在座標や指令座標がログデータ73に書き込まれるわけではない。しかし、本発明はこれに限られず、例えば、拡張ユニット4のメモリに、制御周期ごとに現在座標や指令座標を格納していき、スキャン周期のタイミングで、それまで格納した複数の現在座標や指令座標等を読み出すように構成することも可能である。 Here, the update cycle (so-called control cycle) of the current coordinates and command coordinates of the motor is much shorter than the scan cycle of the ladder program. Therefore, in this embodiment, the UG device values are read in synchronization with the scan cycle, so not all current coordinates and command coordinates are written in the log data 73 . However, the present invention is not limited to this. It is also possible to configure so as to read out coordinates or the like.

また、記録部81は、時刻管理部83により保持されている時刻情報をログデータ73の各レコードに付与する。これによりログデータ73には時系列にデバイス値が並べられる。 The recording unit 81 also adds the time information held by the time management unit 83 to each record of the log data 73 . As a result, the device values are arranged in chronological order in the log data 73 .

ロギング対象となるデバイスは、基本的に、ログ設定データ72のロギング対象リストL0によって指定されるが、検知部82によって追加のデバイスが指定されてもよい。検知部82は、たとえば、デバイス部34に含まれているいずれかのデバイスに対する外部機器からのデバイス値の書き換えを検知してもよい。一般にデバイス値はユーザプログラムに従って書き換えられる場合と、外部機器によって書き換えられることがある。このような書き換えはユーザプログラムを解析するだけでは事前に把握することができない。記録部81は、検知部82によりデバイス値の書き換えが検知されたデバイスをロギング対象に追加してもよい。一般に外部機器からのデバイス値の書き換えは、ユーザにとって想定外の事象の原因となりやすい。よって、記録部81は、外部機器により書き換えられたデバイス値をロギングすることで、ユーザによるプログラムの改良に役立つであろう。 Devices to be logged are basically specified by the logging target list L0 of the log setting data 72, but additional devices may be specified by the detection unit . The detection unit 82 may detect rewriting of a device value from an external device to any device included in the device unit 34, for example. In general, device values may be rewritten according to a user program or rewritten by an external device. Such rewriting cannot be grasped in advance only by analyzing the user program. The recording unit 81 may add a device whose device value has been detected by the detection unit 82 to be logged. In general, rewriting of device values from an external device tends to cause unexpected events for users. Therefore, the recording unit 81 logs the device values rewritten by the external device, which will help the user improve the program.

ところで、END処理において、ユーザプログラムとは無関係に発行されるUG読み出し命令が発行されることがある。UGはバッファメモリを示すデバイス種別である。検知部82は、ユーザプログラムとは無関係に発行されるUG読み出し命令を検知してもよい。記録部81は、検知部82により検知されたUG読み出し命令の対象となっているバッファメモリを特定し、特定したバッファメモリを記録対象として追加してもよい。この拡張ユニット4がモーションユニットである場合、このようなバッファメモリには、トルク値や現在座標位置などが記憶されている。 By the way, in the END process, a UG read command may be issued independently of the user program. UG is a device type indicating a buffer memory. The detection unit 82 may detect a UG read command issued independently of the user program. The recording unit 81 may specify the buffer memory that is the target of the UG read command detected by the detection unit 82 and add the specified buffer memory as a recording target. If this expansion unit 4 is a motion unit, such a buffer memory stores torque values, current coordinate positions, and the like.

検知部82はFPGAなどにより実現されてもよい。実行部80はASICにより実現されてもよい。この場合、実行部80は記憶装置32に対してアドレス線を用いて読み出し/書き込み対象となっているデバイスのアドレスを指定する。よって、検知部82はこのアドレス線を監視することで、動的に、デバイス値を更新されたデバイスを検知してもよい。これはユーザプログラムに記述されていないデバイスを記録対象として追加する際に有用であろう。 The detection unit 82 may be realized by an FPGA or the like. The execution unit 80 may be realized by ASIC. In this case, the execution unit 80 designates the address of the device to be read/written from/to the storage device 32 using the address line. Therefore, by monitoring this address line, the detection unit 82 may dynamically detect devices whose device values have been updated. This may be useful when adding devices not described in the user program to be recorded.

検知部82は実行部80に設けられてもよい。この場合、実行部80は、デバイス部34の特定のデバイスに対してデバイス値を書き込むとともに、このデバイス値とデバイス名(デバイス番号)をログデータ73に書き込んでもよい。この手法は、ユーザプログラムに記述されていないデバイスであって、動的に割り付け割れるデバイスを記録対象として追加する際に有用であろう。 The detection unit 82 may be provided in the execution unit 80 . In this case, the execution unit 80 may write a device value to a specific device of the device unit 34 and write this device value and device name (device number) to the log data 73 . This method is useful when adding a dynamically allocated device, which is not described in the user program, to a recording target.

このように記録部81はログ設定データ72に含まれているデバイスリストとは無関係にデバイスを記録してもよい。極端な場合、ユーザはログ設定データ72を作成せずに、ログデータ73を取得可能となる。たとえば、実行部80が起動すると、実行部80は、デバイス部34におけるすべてのデバイスからデバイス値を取得する。検知部82は、デバイスを監視しているため、実行部80がデバイス値を読み出したことを検知し、記録部81にデバイス値を読み出されたデバイスの情報(アドレス情報)を伝達する。記録部81は、検知部82により伝達されたアドレス情報に基づきデバイス部34に含まれているすべてのデバイスからデバイス値を読み出してログデータ73に書き込む。それ以降もデバイス部34へのアクセスを検知部82が検知するたびに、記録部81はデバイス値をロギングする。 In this manner, the recording unit 81 may record devices regardless of the device list included in the log setting data 72 . In extreme cases, the user can obtain the log data 73 without creating the log setting data 72 . For example, when execution unit 80 is activated, execution unit 80 acquires device values from all devices in device unit 34 . Since the detection unit 82 monitors the device, it detects that the execution unit 80 has read the device value, and transmits information (address information) of the device from which the device value has been read to the recording unit 81 . The recording unit 81 reads device values from all the devices included in the device unit 34 based on the address information transmitted by the detection unit 82 and writes them to the log data 73 . After that, the recording unit 81 logs the device value each time the detection unit 82 detects access to the device unit 34 .

ところで、記録部81はスキャン周期ごと、または、所定の収集周期ごとにデバイス値をログデータ73に書き込んでもよい。たとえば、一周期内で検知部82が複数回にわたるデバイスへのアクセスを検知したとしても、記録部81は、最後のアクセスが検知されたときのデバイス値だけでログデータ73に書き込んでもよい。これにより、ログデータ73のデータサイズを削減することが可能となる。 By the way, the recording unit 81 may write the device value to the log data 73 for each scan cycle or for each predetermined collection cycle. For example, even if the detection unit 82 detects multiple accesses to the device within one cycle, the recording unit 81 may write to the log data 73 only the device value when the last access is detected. This makes it possible to reduce the data size of the log data 73 .

実行部80はデバイスを保持するキャッシュを有していてもよい。この場合、検知部82はキャッシュを監視することで、デバイスの書き込みを検知してもよい。 Execution unit 80 may have a cache that holds devices. In this case, the detection unit 82 may detect device writing by monitoring the cache.

ログ設定データ72には記録対象となるデバイスを示すデバイスリストが含まれているが、記録の除外対象となるデバイスを示すデバイスリストが含まれていてもよい。この場合、記録部81は、除外対象となるデバイスへのアクセスを検知部82が検知すると、そのデバイスについてのデバイス値の記録をスキップする。 The log setting data 72 includes a device list indicating devices to be recorded, but may also include a device list indicating devices to be excluded from recording. In this case, when the detection unit 82 detects access to a device to be excluded, the recording unit 81 skips recording the device value for that device.

検知部82は実行部80による拡張ユニット4のバッファメモリへのアクセスを検知してもよい。この場合、実行部80は、拡張ユニット4のバッファメモリから読み出したデバイス値を記憶装置32内に確保されたバッファ等に書き込む。記録部81はバッファからデバイス値を読み出してログデータ73に書き込む。 The detection unit 82 may detect access to the buffer memory of the expansion unit 4 by the execution unit 80 . In this case, the execution unit 80 writes the device value read from the buffer memory of the expansion unit 4 to a buffer or the like secured within the storage device 32 . The recording unit 81 reads the device value from the buffer and writes it to the log data 73 .

実行部80はユーザプログラムを繰り返し実行し、ユーザプログラムにしたがってデバイス値を書き換える。検知部82が実行部80に実装されている場合、実行部80はデバイス値を書き換える命令語を検知すると、その命令語とともにデバイス値を記録部81に出力する。記録部81は、命令語、デバイス値およびタイムスタンプ(デバイス値を取得した時刻)をログデータ73に書き込んでもよい。 The execution unit 80 repeatedly executes the user program and rewrites device values according to the user program. When the detection unit 82 is implemented in the execution unit 80 , the execution unit 80 outputs the device value to the recording unit 81 together with the instruction word when detecting an instruction word for rewriting the device value. The recording unit 81 may write the instruction word, the device value, and the time stamp (the time when the device value was acquired) to the log data 73 .

ところで、ログ設定データ72には、ログデータ73のデータ形式(例:バイナリー形式やテキスト形式)が含まれてもよい。データ形式としては、10進数16ビット、10進数32ビット、±10進数16ビット、±10進数32ビット、16進数16ビット、16進数32ビット、文字列、Float、DoubleFloatなどが、デバイスごとに設定されてもよい。このようなデータ形式はプログラム部品における命令語を解析することで判別可能である。 By the way, the log setting data 72 may include the data format of the log data 73 (eg, binary format or text format). 16-bit decimal, 32-bit decimal, ±16-bit decimal, ±32-bit decimal, 16-bit hexadecimal, 32-bit hexadecimal, character string, Float, DoubleFloat, etc. are set for each device. may be Such a data format can be discriminated by analyzing the instruction word in the program part.

出力部84は、ユーザプログラムの実行が終了したとき、或いは、メモリカードへの保存トリガリレーがONした場合など、所定の出力条件が満たされると、プロジェクトデータ71、ログデータ73、画像データをメモリカード36に書き込む。所定の出力条件が満たされるまでは、ログデータ73がメモリ(例えばリングバッファ)に記録されていき、容量が一杯になると、一番古いログデータ73が消去され、新しいログデータ73が追加記録されていく(いわゆるFIFO形式で記録する)。このメモリカード36は基本ユニット3から取り外されて、PC2の装着部に装着される。これにより、PC2の表示部7にログデータ73が表示されるようになる。なお、出力部84は、通信部33を介してPC2やクラウドなどにログデータ73を送信してもよい。 The output unit 84 stores the project data 71, the log data 73, and the image data in the memory when a predetermined output condition is satisfied, such as when the execution of the user program is completed or when the save trigger relay to the memory card is turned on. Write to card 36 . Log data 73 is recorded in a memory (for example, a ring buffer) until a predetermined output condition is satisfied, and when the capacity becomes full, the oldest log data 73 is deleted and new log data 73 is additionally recorded. (recorded in so-called FIFO format). This memory card 36 is removed from the basic unit 3 and mounted on the mounting portion of the PC 2 . As a result, the log data 73 is displayed on the display section 7 of the PC 2 . Note that the output unit 84 may transmit the log data 73 to the PC 2 , the cloud, or the like via the communication unit 33 .

なお、本実施形態では、所定の出力条件が満たされたときに、ログデータ73等をメモリカード36に書き込むこととしたが、本発明はこれに限られず、例えば、内部メモリ37(フラッシュメモリやハードディスクなどの不揮発性メモリ)に保存しても構わない。また、少なくともログデータ73については、所定の出力条件が満たされたときにメモリカード36又は内部メモリ37に保存される必要がある一方、プロジェクトデータ71については、所定の出力条件が満たされたときに限られない。例えば、PLC1が設定モード(PROGRAMモード)から運転モード(RUNモード)になったタイミングで、予めメモリカード36や内部メモリ37に保存しておいてもよい。 In this embodiment, the log data 73 and the like are written to the memory card 36 when a predetermined output condition is satisfied, but the present invention is not limited to this. It may be saved in a non-volatile memory such as a hard disk. At least the log data 73 must be saved in the memory card 36 or the internal memory 37 when predetermined output conditions are satisfied, while the project data 71 must be saved when the predetermined output conditions are satisfied. is not limited to For example, it may be stored in the memory card 36 or the internal memory 37 in advance at the timing when the PLC 1 changes from the setting mode (PROGRAM mode) to the operation mode (RUN mode).

●構成情報の作成
図18は機能設定部62が実行する構成情報の作成処理(ユニット設定)を説明する図である。機能設定部62はユニットエディタと呼ばれてもよい。機能設定部62はユニットエディタの起動を支持されると、ユニット設定UI150を表示部7に表示する。名称欄151は各ユニットの名称(例:型番など)を表示する欄である。なお、各ユニットには自動的にユニット番号が付与される。この例では、基本ユニット3にユニット番号として“0”が付与されている。入力領域欄152は入力系のデバイスを割り付けるための欄である。この例では、基本ユニット3に入力系のデバイスとしてR000からR015までのデバイスが割り付けられている。出力領域欄153は出力系のデバイスを割り付けるための欄である。この例では、基本ユニット3に出力系のデバイスとしてR500からR507までのデバイスが割り付けられている。占有領域欄154は、入出力混合系のデバイスを割り付けるための欄である。エンドユニットは、いわゆる終端ユニットである。ユーザは操作部8を通じて拡張ユニット4の種類、接続順番、割り付けられるデバイスを設定する。機能設定部62は、拡張ユニット4の種類、接続順番(ユニット番号)、基本ユニット3と拡張ユニット4とのそれぞれに割り付けられるデバイスを示す情報を構成情報に格納する。構成情報はユニット設定情報と呼ばれてもよい。ここでは、ユニットごとにデバイスが割り付けられているが、各ユニットの機能ごとにデバイスが割り付けられてもよい。機能設定部62は構成情報をプロジェクトデータ71の一部として管理している。
●Creation of configuration information FIG. 18 is a diagram for explaining the configuration information creation processing (unit setting) executed by the function setting unit 62. As shown in FIG. The function setting section 62 may be called a unit editor. The function setting unit 62 displays the unit setting UI 150 on the display unit 7 when activation of the unit editor is supported. A name column 151 is a column for displaying the name of each unit (eg, model number, etc.). A unit number is automatically assigned to each unit. In this example, the basic unit 3 is given "0" as the unit number. The input area column 152 is a column for allocating input devices. In this example, devices R000 to R015 are assigned to the basic unit 3 as input devices. The output area column 153 is a column for allocating an output system device. In this example, devices R500 to R507 are assigned to the basic unit 3 as output devices. The occupied area column 154 is a column for allocating mixed input/output type devices. End units are so-called terminal units. The user sets the type of expansion unit 4, the order of connection, and the device to be allocated through the operation unit 8. FIG. The function setting unit 62 stores information indicating the type of expansion unit 4, the order of connection (unit number), and the devices assigned to each of the base unit 3 and expansion unit 4 in the configuration information. Configuration information may be referred to as unit configuration information. Here, a device is assigned to each unit, but a device may be assigned to each function of each unit. The function setting section 62 manages the configuration information as part of the project data 71 .

このように構成情報には各ユニットに割り付けられているデバイスを示す情報や各機能に割り付けられているデバイスを示す情報が含まれている。そのため、デバイス抽出部53は構成情報を参照することで、各ユニットに割り付けられているデバイスや各機能に割り付けられているデバイスを抽出することができる。 In this way, the configuration information includes information indicating the device assigned to each unit and information indicating the device assigned to each function. Therefore, by referring to the configuration information, the device extraction unit 53 can extract the device assigned to each unit and the device assigned to each function.

<大容量データのロギング>
フィールドデバイス10としてカメラが存在する。ユーザはワークや制御対象の状態をカメラにより取得し、画像とデバイス値とを対比しながら、ユーザプログラムを改良することを望むことがある。したがって、相互に関連した画像とデバイス値とをどのように管理するかが問題となる。なぜなら、画像は拡張ユニット4により取得され、デバイス値は基本ユニット3によって取得されることが一般的だからである。さらに、画像の取得周期と、デバイス値の取得周期とは異なることが一般的である。このような事情から画像などの大容量データと、デバイス値のような比較的に小容量のデータとをどのように紐付けて管理するかが問題となる。
<Logging large amounts of data>
A camera exists as the field device 10 . A user may wish to improve a user program while acquiring the state of a workpiece or control object with a camera and comparing the image with device values. Therefore, the question arises how to manage interrelated image and device values. This is because images are generally obtained by the expansion unit 4 and device values are generally obtained by the basic unit 3 . Furthermore, the image acquisition period and the device value acquisition period are generally different. Under these circumstances, the problem is how to associate and manage large-capacity data such as images and relatively small-capacity data such as device values.

図19は基本ユニット3のCPU31の機能を示している。すでに説明された箇所には同一の参照符号が付与されている。この例では記録部81は収集部92aを有している。収集部92aは、所定の収集開始条件が満たされると、デバイス部34に保持されているデバイス値のうち、ログ設定データ72により指定されたデバイス値をデバイス部から読み出すとともに、時刻管理部83aから時刻情報を取得する。収集部92aはデバイス値と時刻情報とを関連付けてリングバッファ91aに格納する。なお、収集部92aは、ログ設定データ72により指定された収集周期(例:スキャン周期)ごとにデバイス値と時刻情報とを取得してリングバッファ91aに格納する。リングバッファ91aが採用されている理由は、リングバッファ91aに記憶されているすべてのデータがログデータ73としてメモリカード36に保存されるわけではないからである。たとえば、保存部93は、所定の保存条件が満たされたときに、リングバッファ91aからデバイス値と時刻情報とを読み出し、ログデータ73を作成してメモリカード36に保存してもよい。同様に、保存部93は、所定の保存条件が満たされたときに、拡張ユニット4から大容量データと時刻情報とを読み出し、ログデータ73を作成してメモリカード36に保存してもよい。保存部93は、上述したデバイス値及び時刻情報と、上述した大容量データ及び時刻情報とを、対応付けて保存する。ここで、「対応付けて」保存とは、PC2にて再生しやすい形で保存されていればよく、例えば、複数のファイルを対応付けたファイル管理がなされていてもよい。具体的に説明すると、メモリカード36において、特定のフォルダの下に、デバイス値及び時刻情報が格納された第1サブフォルダと、大容量データ及び時刻情報が格納された第2サブフォルダとが置かれている場合には、特定のフォルダまでのパス(ディレクトリパス)が共通フラグとなり、この共通フラグを使って、第1サブフォルダ内のファイルと第2サブフォルダ内のファイルを「対応付けて」保存することが可能になる。また、上述した特定のフォルダと同じレベル(ディレクトリ)に置かれた別フォルダがある場合、その別フォルダは、他のタイミングで保存されたデータパッケージを意味する。もちろん、この別フォルダの下にも上述同様のサブフォルダが置かれている。このように、保存部93は、上述したデバイス値及び時刻情報と、上述したデータ(大容量データ)及び時刻情報とを、共通フラグ(所定のディレクトリパス)により識別される複数のファイルに格納し、それら複数のファイルを保存してもよい。その他、例えば、共通フラグとしてファイル名を採用し、同一又は対応するファイル名をもつファイルを生成することで、「対応付けて」保存することも可能である。他にも例えば、時刻情報をキーとして、デバイス値とデータ(大容量データ)を対応付けてリスト化し、これを1つのファイルに纏めることによっても、「対応付けて」保存することが可能である。なお、本実施形態では、監視機器からのデータの一例として大容量データを考えたが、他にも例えば、モーションデータや通信データ、音声データなどの連続データであってもよいことは言うまでもない。送信部94は、PC2やクラウドなどにログデータ73を送信してもよい。リングバッファ91aが満杯になると、収集部92aは、リングバッファ91aに保持されている最も古い情報に対して、最も新しい情報を上書きする。 FIG. 19 shows the functions of the CPU 31 of the basic unit 3. As shown in FIG. Parts already described are provided with the same reference numerals. In this example, the recording section 81 has a collection section 92a. When a predetermined collection start condition is satisfied, the collection unit 92a reads the device value specified by the log setting data 72 among the device values held in the device unit 34, and reads the device value from the time management unit 83a. Get time information. The collection unit 92a associates the device value with the time information and stores them in the ring buffer 91a. The collection unit 92a acquires device values and time information for each collection cycle (eg, scan cycle) specified by the log setting data 72, and stores them in the ring buffer 91a. The reason why the ring buffer 91a is employed is that not all the data stored in the ring buffer 91a is saved in the memory card 36 as the log data 73. FIG. For example, the storage unit 93 may read the device value and the time information from the ring buffer 91a to create the log data 73 and store it in the memory card 36 when a predetermined storage condition is satisfied. Similarly, the storage unit 93 may read the large-capacity data and the time information from the expansion unit 4 to create the log data 73 and store it in the memory card 36 when a predetermined storage condition is satisfied. The storage unit 93 associates and stores the above-described device value and time information with the above-described large-capacity data and time information. Here, "stored in correspondence" means that the files are stored in a form that can be easily reproduced on the PC 2. For example, file management may be performed in which a plurality of files are associated with each other. Specifically, in the memory card 36, a first subfolder storing device values and time information and a second subfolder storing large-capacity data and time information are placed under a specific folder. In this case, the path to a specific folder (directory path) becomes a common flag, and using this common flag, the files in the first subfolder and the files in the second subfolder can be "associated" and saved. be possible. Also, if there is another folder placed at the same level (directory) as the specific folder described above, that other folder means a data package saved at another timing. Of course, subfolders similar to those described above are also placed under this separate folder. In this way, the storage unit 93 stores the above-described device value and time information and the above-described data (large capacity data) and time information in a plurality of files identified by a common flag (predetermined directory path). , you may save those multiple files. In addition, for example, file names can be used as common flags, and files with the same or corresponding file names can be generated to "associate" and save. In addition, for example, it is also possible to "associate" and save by listing device values and data (large-capacity data) with time information as a key and putting them together in one file. . In the present embodiment, large-capacity data was considered as an example of data from monitoring equipment, but it goes without saying that continuous data such as motion data, communication data, and voice data may also be used. The transmission unit 94 may transmit the log data 73 to the PC 2, cloud, or the like. When the ring buffer 91a becomes full, the collection unit 92a overwrites the oldest information held in the ring buffer 91a with the newest information.

ここではバッファの一例としてリングバッファ91aが採用されているが、これは一例にすぎない。バッファとしては、FIFO形式のバッファが採用されれば十分であろう。 Although the ring buffer 91a is employed here as an example of the buffer, this is merely an example. As a buffer, it would be sufficient if a FIFO type buffer is adopted.

図20はカメラ入力機能を有した拡張ユニット4のCPU41の機能を説明する図である。時刻管理部83bの時計は、基本ユニット3の時刻管理部83aの時計と同期している。たとえば、時刻管理部83aは、END処理の際に時刻情報を時刻管理部83bに送信する。時刻管理部83bは、受信した時刻情報に基づき、時刻管理部83bの時計を時刻管理部83aの時計に同期させる。時計は、時刻情報に基づき時間をカウントするカウンタにより実現されてもよい。収集部92bは、所定の収集条件(例:所定のリレーデバイスがオンになったこと)が満たされると、例えば周期的にトリガー信号を出力する。時刻管理部83bはトリガー信号が入力されたときの時刻情報を時計から取得し、時刻情報バッファ95に格納する。メモリ42は時刻情報バッファ95とリングバッファ91aを有している。接続ポート97はカメラ98を拡張ユニット4に接続するためのインタフェースである。接続ポート97は、収集部92bにより発行されたトリガー信号をカメラ98に周期的に出力したり、カメラ98が出力する画像データを画像受信部96aに出力したりする。画像データは大容量データの一例である。接続ポート97は、カメラ98等の監視機器と接続され、その監視機器からデータ(画像データ)が入力される第二の外部インタフェースの一例である。画像受信部96aは、接続ポート97を介してカメラ98からの画像データの入力を伴う撮像機能を実行する機能実行部96の全部又は一部となる。本実施形態では、機能実行部96(画像受信部96a)は、露光時間、ゲイン、ホワイトバランス、コントラストなどの撮像パラメータ(設定情報の一例)に基づいて、カメラ98の制御を実行する。このような撮像パラメータは、PC2において、所望のパラメータ値が設定され、図4に示す基本ユニット3の通信部33及びCPU31を介して、機能実行部96に送られる。そのため、図4に示す通信部33は、PC2や表示器などの外部設定機器から設定情報を受け付ける第一の外部インタフェースの一例である。なお、第一の外部インタフェースとしての通信部33は、上述したようにPC2にて作成されたユーザプログラムも受け付ける。カメラ98は、トリガー信号にしたがって撮像を実行し、画像データを出力する。画像受信部96aは、画像データを収集部92bに転送する。収集部92bは、時刻情報バッファ95に保持されている時刻情報と、画像受信部96aから出力された画像データとを関連付けてリングバッファ91aに格納する。リングバッファ91bが満杯になると、収集部92bは、リングバッファ91bに保持されている最も古い情報に対して、最も新しい情報を上書きする。なお、本実施形態では、収集部92bが自動的かつ周期的に撮像トリガー信号をカメラ98に出力することとしたが、本発明はこれに限られず、収集部92bは、例えばユーザプログラムからの指令に基づいて撮像トリガー信号をカメラ98に出力してもよい。 FIG. 20 is a diagram for explaining the functions of the CPU 41 of the expansion unit 4 having the camera input function. The clock of the time management section 83b is synchronized with the clock of the time management section 83a of the base unit 3. For example, the time management unit 83a transmits time information to the time management unit 83b during END processing. The time management unit 83b synchronizes the clock of the time management unit 83b with the clock of the time management unit 83a based on the received time information. A clock may be implemented by a counter that counts time based on time information. The collection unit 92b periodically outputs a trigger signal, for example, when a predetermined collection condition (eg, that a predetermined relay device is turned on) is satisfied. The time management unit 83 b acquires time information from the clock when the trigger signal is input, and stores it in the time information buffer 95 . The memory 42 has a time information buffer 95 and a ring buffer 91a. A connection port 97 is an interface for connecting the camera 98 to the expansion unit 4 . The connection port 97 periodically outputs the trigger signal issued by the collector 92b to the camera 98, and outputs the image data output by the camera 98 to the image receiver 96a. Image data is an example of large-capacity data. The connection port 97 is an example of a second external interface that is connected to monitoring equipment such as the camera 98 and receives data (image data) from the monitoring equipment. The image receiving unit 96 a is all or part of the function executing unit 96 that executes an image capturing function that involves inputting image data from the camera 98 via the connection port 97 . In this embodiment, the function executing section 96 (image receiving section 96a) controls the camera 98 based on imaging parameters (an example of setting information) such as exposure time, gain, white balance, and contrast. Desired parameter values are set for such imaging parameters in the PC 2 and sent to the function executing section 96 via the communication section 33 and the CPU 31 of the basic unit 3 shown in FIG. Therefore, the communication unit 33 shown in FIG. 4 is an example of a first external interface that receives setting information from an external setting device such as the PC 2 or display. Note that the communication unit 33 as a first external interface also receives a user program created by the PC 2 as described above. The camera 98 performs imaging according to the trigger signal and outputs image data. The image receiving section 96a transfers the image data to the collecting section 92b. The collecting unit 92b associates the time information held in the time information buffer 95 with the image data output from the image receiving unit 96a and stores them in the ring buffer 91a. When the ring buffer 91b becomes full, the collection unit 92b overwrites the oldest information held in the ring buffer 91b with the newest information. In this embodiment, the collecting unit 92b automatically and periodically outputs the imaging trigger signal to the camera 98, but the present invention is not limited to this. An imaging trigger signal may be output to the camera 98 based on .

ところで、基本ユニット3は毎スキャンごとに実行するリフレッシュ通信と、いつでも実行可能なダイレクト通信と、イベント的に実行されるメッセージ通信とのいずれかを用いて拡張ユニット4と通信する。保存部93は、たとえば、ダイレクト通信を使用して拡張ユニット4のリングバッファ91bから画像データと時刻情報とを読み出して、ログデータ73に追記する。なお、ダイレクト通信として、優先度つきの複数のダイレクト通信が実装されてもよい。この場合、ユーザプログラムに関連して実行されるダイレクト通信の優先度は相対的に高く設定され、ロギングのためのダイレクト通信の優先度は相対的に低く設定されてもよい。これにより、ロギングがユーザプログラムの実行に与える影響を小さくすることが可能となる。 By the way, the basic unit 3 communicates with the extension unit 4 using any one of refresh communication that is executed for each scan, direct communication that can be executed at any time, and message communication that is executed as an event. The storage unit 93 reads the image data and the time information from the ring buffer 91b of the expansion unit 4 using direct communication, and adds them to the log data 73, for example. As the direct communication, a plurality of direct communications with priority may be implemented. In this case, the priority of direct communication executed in relation to the user program may be set relatively high, and the priority of direct communication for logging may be set relatively low. This makes it possible to reduce the impact of logging on the execution of user programs.

<リングバッファを用いたロギング>
図21は基本ユニット3のリングバッファ91aに保持されたデバイス値と時刻情報とを示している。一つのレコードは、取得されたデバイス値と、このデバイス値が取得された時刻を示す時刻情報とを有している。
<Logging using ring buffer>
21 shows device values and time information held in the ring buffer 91a of the basic unit 3. FIG. One record has an acquired device value and time information indicating the time when this device value was acquired.

図21はさらに拡張ユニット4のリングバッファ91bに保持された画像データと時刻情報とを示している。一つのレコードは、取得された画像データと、この画像データが取得された時刻を示す時刻情報とを有している。 21 further shows image data and time information held in the ring buffer 91b of the expansion unit 4. FIG. One record has acquired image data and time information indicating the time when this image data was acquired.

図22は基本ユニット3におけるリングバッファ91aを用いたロギングを示している。 FIG. 22 shows logging using the ring buffer 91a in the base unit 3. FIG.

S21でCPU31(収集部92a)はデバイス値の取得条件が満たされたかどうかを判定する。取得条件はリングバッファ91aに対するデバイス値と時刻情報の格納を開始するための条件である。取得条件は、ユーザプログラム中に記述されてもよいし(例:開始リレーがオンになったこと)、ログ設定データ72において記述されていてもよい。取得条件が満たされると、CPU31はS22に進む。 In S21, the CPU 31 (collection unit 92a) determines whether the device value acquisition condition is satisfied. Acquisition conditions are conditions for starting to store device values and time information in the ring buffer 91a. Acquisition conditions may be described in the user program (eg, that the start relay is turned on) or may be described in the log setting data 72 . If the acquisition condition is satisfied, the CPU 31 proceeds to S22.

S22でCPU31(収集部92a)は取得リレーをONにする。取得リレーは一ビットデバイスであり、拡張ユニット4に対してリングバッファ91bへのデータの格納を指示するためのリレーである。 In S22, the CPU 31 (collection unit 92a) turns on the acquisition relay. The acquisition relay is a 1-bit device and is a relay for instructing the expansion unit 4 to store data in the ring buffer 91b.

S23でCPU31(収集部92a)はデバイス値の取得タイミングが到来したかどうかを判定する。取得タイミングは、たとえば、スキャン周期ごとなどであり(例えば毎スキャンにおけるEND処理において取得する等)、ログ設定データ72により定義されている。取得タイミングが到来すると、CPU31はS24に進む。 In S23, the CPU 31 (collection unit 92a) determines whether or not the device value acquisition timing has arrived. The acquisition timing is defined by the log setting data 72, for example, every scan cycle (for example, acquired in the END process in each scan). When the acquisition timing comes, the CPU 31 proceeds to S24.

S24でCPU31(収集部92a)は、ログ設定データ72により指定されたデバイス値をデバイス部34から取得するとともに、時刻管理部83aから時刻情報を取得し、これらをリングバッファ91aに書き込む。 In S24, the CPU 31 (collection unit 92a) acquires the device value specified by the log setting data 72 from the device unit 34, acquires time information from the time management unit 83a, and writes them to the ring buffer 91a.

S25でCPU31(収集部92a)は、保存タイミングが到来したかどうかを判定する。保存タイミングとは、リングバッファ91aに保持されている情報をログデータ73に保存するタイミングである。保存タイミングは、たとえば、所定のイベント(例:保存トリガ)が発生したことなどであってもよい。保存タイミングもログ設定データ72により定義されている。保存タイミングが到来していなければ、CPU31はS23に戻る。保存タイミングが到来していれば、CPU31はS26に進む。 In S25, the CPU 31 (collection unit 92a) determines whether or not the save timing has arrived. The save timing is the timing for saving the information held in the ring buffer 91 a in the log data 73 . The save timing may be, for example, the occurrence of a predetermined event (eg save trigger). The save timing is also defined by the log setting data 72 . If the save timing has not come, the CPU 31 returns to S23. If the save timing has come, the CPU 31 proceeds to S26.

S26でCPU31(収集部92a)は、リングバッファ91aに保持されている情報をログデータ73に保存する。なお、リングバッファ91aに保持されている情報のうち、保存対象となる情報がログ設定データ72により定義されていてもよい。たとえば、保存対象は、あるイベントが発生したタイミングから所定時間が経過するまでに取得された情報であってもよい。また、保存対象は、あるイベントが発生したタイミングよりも所定時間前の時刻である開始時刻から、当該イベントが発生したタイミングから所定時間が経過した時刻である終了時刻までに取得された情報であってもよい。 In S26, the CPU 31 (collection unit 92a) stores the information held in the ring buffer 91a in the log data 73. FIG. Note that the information to be saved among the information held in the ring buffer 91 a may be defined by the log setting data 72 . For example, the information to be saved may be information acquired within a predetermined period of time from the timing when a certain event occurred. The information to be saved is the information acquired from the start time, which is the time that is a predetermined time before the timing of the occurrence of an event, to the end time, which is the time that the predetermined time has passed since the timing of the occurrence of the event. may

S27で(収集部92a)は、拡張ユニット4のリングバッファ91bに保持されている情報をログデータ73に保存する。収集部92aは、ダイレクト通信を利用して、拡張ユニット4のリングバッファ91bに保持されている情報を読み出してもよい。より具体的には、収集部92aは、バッファメモリから情報を読み出すための命令を発行してもよい。なお、リングバッファ91bに保持されている情報のうち、保存対象となる情報も、ログ設定データ72により定義されていてもよい。たとえば、保存対象は、あるイベントが発生したタイミングから所定時間が経過するまでに取得された情報であってもよい。また、保存対象は、あるイベントが発生したタイミングよりも所定時間前の時刻である開始時刻から、当該イベントが発生したタイミングから所定時間が経過した時刻である終了時刻までに取得された情報であってもよい。 In S<b>27 , the collection unit 92 a saves the information held in the ring buffer 91 b of the expansion unit 4 in the log data 73 . The collection unit 92a may read the information held in the ring buffer 91b of the expansion unit 4 using direct communication. More specifically, the collection unit 92a may issue an instruction to read information from the buffer memory. Information to be saved among the information held in the ring buffer 91 b may also be defined by the log setting data 72 . For example, the information to be saved may be information acquired within a predetermined period of time from the timing when a certain event occurred. The information to be saved is the information acquired from the start time, which is the time that is a predetermined time before the timing of the occurrence of an event, to the end time, which is the time that the predetermined time has passed since the timing of the occurrence of the event. may

S28で(収集部92a)は、終了条件が満たされたかどうかを判定する。終了条件は、ロギングの終了条件である。終了条件もログ設定データ72により定義されていてもよい。終了条件が満たされていなければ、CPU31はS23に戻る。終了条件が満たされていれば、CPU31はロギング処理を終了する。 In S28, the (collection unit 92a) determines whether or not the termination condition is satisfied. A termination condition is a logging termination condition. A termination condition may also be defined by the log setting data 72 . If the termination condition is not satisfied, the CPU 31 returns to S23. If the termination condition is satisfied, the CPU 31 terminates the logging process.

図23は拡張ユニット4におけるリングバッファ91bを用いたロギングを示している。 FIG. 23 shows logging using the ring buffer 91b in the expansion unit 4. FIG.

S31でCPU41(収集部92b)は画像データの取得条件(例:取得リレーがONになったこと)が満たされたかどうかを判定する。取得リレーがONになると、CPU41はS32に進む。なお、本実施形態では取得リレーがONになったときに、画像データの取得条件が満たされたと判定するようにしたが、これは一例に過ぎない。他にも例えば、PLC1のモードが運転モードに切り替えられたときに、画像データの取得条件が満たされたと判定されてもよい。より具体的には、PLC1には、各種設定を行うための設定モード(プログラムモード)と、ラダープログラムを繰り返し実行して実際の運転を行う運転モード(RUNモード)とを切り替えるモード切替スイッチが設けられてもよい。この場合、ユーザによって、このモード切替スイッチがプログラムモードからRUNモードに切り替えられたら、画像データの取得条件が満たされたと判定されてもよい。 In S31, the CPU 41 (collection unit 92b) determines whether or not the image data acquisition condition (for example, the acquisition relay is turned on) is satisfied. When the acquisition relay is turned ON, the CPU 41 proceeds to S32. In this embodiment, it is determined that the image data acquisition condition is satisfied when the acquisition relay is turned on, but this is merely an example. Alternatively, for example, it may be determined that the image data acquisition condition is satisfied when the mode of the PLC 1 is switched to the operation mode. More specifically, the PLC 1 is provided with a mode selector switch for switching between a setting mode (program mode) for performing various settings and an operation mode (RUN mode) for performing actual operation by repeatedly executing the ladder program. may be In this case, when the user switches the mode switch from the program mode to the RUN mode, it may be determined that the image data acquisition condition is satisfied.

S32でCPU41(収集部92b)は画像データの取得タイミングが到来したかどうかを判定する。取得タイミングは、たとえば、拡張ユニット4の内部制御周期(撮像周期)ごとなどである。取得タイミングが到来すると、CPU41はS33に進む。 In S32, the CPU 41 (collection unit 92b) determines whether or not it is time to acquire the image data. The acquisition timing is, for example, every internal control cycle (imaging cycle) of the expansion unit 4 or the like. When the acquisition timing comes, the CPU 41 proceeds to S33.

S33でCPU41(収集部92b)は、大容量データと時刻情報を取得してリングバッファ91bに格納する。たとえば、収集部92bは、トリガー信号を発行し、カメラ98と時刻管理部83bに出力する。時刻管理部83bはトリガー信号を受信すると、内部時計から時刻情報を読み出して、時刻情報バッファ95に書き込む。カメラ98は、予め指定された撮像条件にしがって撮像を実行し、画像データを出力する。画像受信部96aは画像データを収集部92bに出力する。画像受信部96aは画像データをリングバッファ91bに直接的に書き込んでもよい。収集部92bは時刻情報バッファ95から読み出した時刻情報と、カメラ98により取得された画像データとを関連づけてリングバッファ91bに書き込む。 In S33, the CPU 41 (collecting unit 92b) acquires the large amount of data and the time information and stores them in the ring buffer 91b. For example, the collection unit 92b issues a trigger signal and outputs it to the camera 98 and the time management unit 83b. When the time management unit 83b receives the trigger signal, it reads the time information from the internal clock and writes it to the time information buffer 95. FIG. The camera 98 performs imaging according to predesignated imaging conditions and outputs image data. The image receiving section 96a outputs the image data to the collecting section 92b. The image receiving section 96a may directly write the image data to the ring buffer 91b. The collection unit 92b associates the time information read from the time information buffer 95 with the image data acquired by the camera 98 and writes them to the ring buffer 91b.

S34でCPU41(収集部92b)は、基本ユニット3からリングバッファ91bに対する読み出し要求(読み出し命令)が発行されたかどうかを判定する。読み出し要求を受信したのであれば、CPU41はS35に進む。読み出し要求が発行されていなければ、CPU41はS32に戻る。 In S34, the CPU 41 (collection unit 92b) determines whether or not the basic unit 3 has issued a read request (read command) to the ring buffer 91b. If the read request has been received, the CPU 41 proceeds to S35. If no read request has been issued, the CPU 41 returns to S32.

S35でCPU41(収集部92b)は、リングバッファ91bから大容量データである画像データと時刻情報とを取得して基本ユニット3に送信する。 In S<b>35 , the CPU 41 (collection unit 92 b ) acquires large-capacity image data and time information from the ring buffer 91 b and transmits them to the basic unit 3 .

S36でCPU41(収集部92b)は、終了条件が満たされたかどうかを判定する。たとえば、収集部92bは取得リレーがOFFになったかどうかを判定する。終了条件が満たされていなければ、CPU41はS32に戻る。終了条件が満たされていれば、CPU41はロギング処理を終了する。 In S36, the CPU 41 (collection unit 92b) determines whether or not the termination condition is satisfied. For example, the collection unit 92b determines whether the acquisition relay is turned off. If the termination condition is not satisfied, the CPU 41 returns to S32. If the termination condition is satisfied, the CPU 41 terminates the logging process.

<接続形態>
図24はビルディングブロックタイプのPLC1の接続形態を示している。基本ユニット3の右側面には、拡張ユニット4と接続して通信するためのIF99aが設けられている。IFはインタフェースの略称である。この例では、基本ユニット3には拡張ユニット4aが接続されており、拡張ユニット4aには拡張ユニット4bが接続されている。拡張ユニット4は右側面と左側面との両方にIF99を有している。基本ユニット3の右側面は拡張ユニット4aの左側面と対向している。よって、基本ユニット3のIF99aは拡張ユニット4aの左側面に設けられたIF99bと接続する。拡張ユニット4aの右側面は拡張ユニット4bの左側面と対向している。よって、拡張ユニット4aのIF99cは拡張ユニット4bの左側面に設けられたIF99dと接続する。なお、拡張ユニット4bの右側面に設けられた99eはエンドユニットに接続されてもよい。このように、IF99aからIF99eはユニット内部バス90を形成している。たとえば、拡張ユニット4aに接続されたカメラ98aにより取得された画像データはユニット内部バス90を介して基本ユニット3へ転送されうる。拡張ユニット4bに接続されたカメラ98bにより取得された画像データはユニット内部バス90を介して基本ユニット3へ転送されうる。
<Connection type>
FIG. 24 shows a connection form of a building block type PLC1. On the right side of the basic unit 3, an IF 99a is provided for connecting with the expansion unit 4 for communication. IF is an abbreviation for interface. In this example, the extension unit 4a is connected to the basic unit 3, and the extension unit 4b is connected to the extension unit 4a. The expansion unit 4 has IFs 99 on both the right side and the left side. The right side surface of the basic unit 3 faces the left side surface of the expansion unit 4a. Therefore, the IF 99a of the basic unit 3 is connected to the IF 99b provided on the left side of the expansion unit 4a. The right side surface of the extension unit 4a faces the left side surface of the extension unit 4b. Therefore, the IF 99c of the extension unit 4a is connected to the IF 99d provided on the left side of the extension unit 4b. Note that 99e provided on the right side of the extension unit 4b may be connected to the end unit. Thus, the IF 99a to IF 99e form the unit internal bus 90. FIG. For example, image data acquired by camera 98a connected to expansion unit 4a may be transferred to base unit 3 via unit internal bus 90. FIG. Image data acquired by the camera 98b connected to the expansion unit 4b can be transferred to the basic unit 3 via the unit internal bus 90. FIG.

このようにビルディングブロックタイプのPLC1では各ユニットの側面が接続面(連結面)となる。ユニット内部バス90の一部を形成するためのIF99も各ユニットの側面に設けられる。なお、上述したように、ユニット内部バス90での通信は、図4に示すバスマスタ38によって制御される。 Thus, in the building block type PLC 1, the side surface of each unit serves as a connection surface (connection surface). An IF 99 for forming part of the unit internal bus 90 is also provided on the side of each unit. As described above, communication on the unit internal bus 90 is controlled by the bus master 38 shown in FIG.

図25はバックプレーン200を有するPLC1の接続形態を示している。バックプレーン200は、基本ユニット3の底面および拡張ユニット4の底面に接続されるか、基本ユニット3の背面および拡張ユニット4の背面に接続される。バックプレーン200は基本ユニット3および拡張ユニット4を支持する支持プレート(ベースプレート)として機能する。ここでは一例として背面が接続面として説明される。基本ユニット3の背面はバックプレーン200の正面と対向している。よって、基本ユニット3の背面に設けられたIF99fはバックプレーン200の正面に設けられたIF99gと接続する。拡張ユニット4の背面はバックプレーン200の正面と対向している。拡張ユニット4aの背面に設けられたIF99hはバックプレーン200の正面に設けられたIF99iに接続される。拡張ユニット4bの背面に設けられたIF99jはバックプレーン200の正面に設けられたIF99kに接続される。IF99fないしIF99kはユニット内部バス90を形成している。 FIG. 25 shows the topology of the PLC 1 with the backplane 200. As shown in FIG. The backplane 200 is connected to the bottom surface of the basic unit 3 and the bottom surface of the expansion unit 4 or connected to the rear surface of the basic unit 3 and the rear surface of the expansion unit 4 . Backplane 200 functions as a support plate (base plate) that supports basic unit 3 and expansion unit 4 . Here, as an example, the rear surface is described as the connection surface. The rear surface of the basic unit 3 faces the front surface of the backplane 200 . Therefore, the IF 99f provided on the back of the basic unit 3 is connected to the IF 99g provided on the front of the backplane 200. FIG. The rear surface of the expansion unit 4 faces the front surface of the backplane 200 . The IF 99 h provided on the back of the expansion unit 4 a is connected to the IF 99 i provided on the front of the backplane 200 . The IF 99 j provided on the back of the expansion unit 4 b is connected to the IF 99 k provided on the front of the backplane 200 . IF99f to IF99k form unit internal bus 90. FIG.

なお、バックプレーン200は、ユニット内部バス90を介したバス通信を制御するための通信制御部213を有していてもよい。また、バックプレーン200は、CPU211やメモリ212を有していてもよい。メモリ212はRAMやROMに加え、メモリカード36を有していてもよい。この場合、CPU211は収集部92aや保存部93して機能してもよい。また、メモリ212にはリングバッファ91aが設けられてもよい。あるいは、CPU211は時刻管理部83bおよび収集部92を有していてもよい。この場合、メモリ212はリングバッファ91bを有する。 The backplane 200 may have a communication control section 213 for controlling bus communication via the unit internal bus 90 . Also, the backplane 200 may have a CPU 211 and a memory 212 . The memory 212 may have a memory card 36 in addition to RAM and ROM. In this case, the CPU 211 may function as the collection unit 92 a and the storage unit 93 . Further, the memory 212 may be provided with a ring buffer 91a. Alternatively, the CPU 211 may have the time management section 83 b and the collection section 92 . In this case, the memory 212 has a ring buffer 91b.

<ログの表示例>
図26はログデータ73の一例を示している。この例では、デバイス値d1~d10と、カメラ98aにより取得されたワーク画像i1~i3と、カメラ98bにより取得された他の画像j1~j3の取得タイミングが示されている。デバイス値d1~d10はスキャン周期ごとに取得されている。ワーク画像i1~i3はトリガー信号が発生したタイミングに取得されている。ワーク画像j1~j3はトリガー信号が発生したタイミングに取得されている。各データの位置はそれぞれの時刻情報を示している。図26が示すように、各データの取得時刻や取得周期は一致していない。そのため、ログ表示部61は、各データの時刻情報に基づき各データの表示タイミングを調整する。
<Log display example>
FIG. 26 shows an example of the log data 73. As shown in FIG. In this example, acquisition timings of device values d1 to d10, workpiece images i1 to i3 acquired by the camera 98a, and other images j1 to j3 acquired by the camera 98b are shown. Device values d1 to d10 are obtained for each scan cycle. The workpiece images i1 to i3 are acquired at the timing when the trigger signal is generated. Work images j1 to j3 are acquired at the timing when the trigger signal is generated. The position of each data indicates each time information. As shown in FIG. 26, the acquisition time and acquisition cycle of each data do not match. Therefore, the log display unit 61 adjusts the display timing of each data based on the time information of each data.

図27はログデータ73の表示タイミングと表示継続時間とを説明する図である。ログ表示部61は、各デバイス値の時刻情報にしたがって各デバイス値を表示部7に表示する。たとえば、ログ表示部61は、デバイス値d1の時刻情報とデバイス値d2の時刻情報との差分時間をデバイス値d1の表示継続時間に決定する。ログ表示部61は、デバイス値d1の表示を開始してから表示継続時間が経過すると、デバイス値d2の表示を開始する。以下、同様に表示継続時間が求められ、表示されるデバイス値が時刻情報や表示継続時間にしたがって切り替えられて行く。 FIG. 27 is a diagram for explaining the display timing and display duration of the log data 73. As shown in FIG. The log display unit 61 displays each device value on the display unit 7 according to the time information of each device value. For example, the log display unit 61 determines the difference time between the time information of the device value d1 and the time information of the device value d2 as the display duration time of the device value d1. The log display unit 61 starts displaying the device value d2 when the display continuation time elapses after starting to display the device value d1. Subsequently, the display continuation time is obtained in the same manner, and the displayed device value is switched according to the time information and the display continuation time.

すでに図26が示したように、デバイス値d1の取得時刻と、ワーク画像i1の取得時刻とは一致していない。そこで、ログ表示部61は、ワーク画像i1の取得時刻をデバイス値d1ないしd10の取得時刻と比較し、ワーク画像i1の取得時刻に最も近いデバイス値dxの取得時刻を求める。この例では、ワーク画像i1の取得時刻に最も近いのは、デバイス値d1の取得時刻である。よって、ログ表示部61は、デバイス値d1の表示を開始するとともに、ワーク画像i1の表示を開始する。次に、ログ表示部61は、ワーク画像i2の取得時刻に最も近いデバイス値dxの取得時刻を求める。この例では、デバイス値d4の取得時刻が、ワーク画像i2の取得時刻が最も近い。そこで、ログ表示部61は、デバイス値d4の表示タイミングが到来すると、デバイス値d4とワーク画像i2の表示を開始する。ログ表示部61は、他の画像j1の取得時刻に最も近いデバイス値dxの取得時刻を求める。この例では、他の画像j1の取得時刻に最も近いのは、デバイス値d2の取得時刻である。よって、ログ表示部61は、デバイス値d2の表示タイミングが到来すると、デバイス値d2の表示を開始するとともに、他の画像j1の表示を開始する。 As already shown in FIG. 26, the acquisition time of the device value d1 and the acquisition time of the workpiece image i1 do not match. Therefore, the log display unit 61 compares the acquisition time of the work image i1 with the acquisition times of the device values d1 to d10, and obtains the acquisition time of the device value dx closest to the acquisition time of the work image i1. In this example, the acquisition time of the device value d1 is closest to the acquisition time of the workpiece image i1. Therefore, the log display unit 61 starts displaying the device value d1 and also starts displaying the workpiece image i1. Next, the log display unit 61 obtains the acquisition time of the device value dx closest to the acquisition time of the workpiece image i2. In this example, the acquisition time of the device value d4 is closest to the acquisition time of the workpiece image i2. Therefore, when the timing for displaying the device value d4 arrives, the log display unit 61 starts displaying the device value d4 and the workpiece image i2. The log display unit 61 obtains the acquisition time of the device value dx that is closest to the acquisition time of the other image j1. In this example, the acquisition time of the device value d2 is closest to the acquisition time of the other image j1. Therefore, when the display timing of the device value d2 arrives, the log display unit 61 starts displaying the device value d2 and another image j1.

このようにログデータ73に含まれる複数のデータのうち、ロギングの周期がもっとも短いデータを基準として、各データの表示タイミングが調整されてもよい。 In this way, the display timing of each piece of data may be adjusted based on the data with the shortest logging cycle among the plurality of pieces of data included in the log data 73 .

図28はログデータ73の表示方法を説明する図である。この例では、デバイス値dxとしてリレーデバイスR000とデータメモリDM100が取得されている(xは1から10までの値をとる)。このように、一つのワーク画像ixに対して複数のデバイス値が時刻情報にしたがって紐付けられる。ログ表示部61は、デバイス値dx、ワーク画像ix、他の画像jxを一つのウインドウ内に表示してもよいし、それぞれ個別のウインドウに表示してもよい。また、ログ表示部61は、プロジェクトデータ71からユーザプログラムを読み出し、ユーザプログラムに対してデバイス値dxをマッピングして表示してもよい。たとえば、ログ表示部61は、表示対象のデバイス値dxに関連する命令語を含むステップを検索し、見つかったステップを表示するとともに、当該ステップにおける命令語の下にデバイス値を表示してもよい。なお、表示対象デバイスがリレーデバイスであることもある。ログ表示部61は、リレーデバイスのオン/オフに応じて命令語の表示色またはアイコン画像(例:矢印)を変更してもよい。アイコン画像としてはオンを示すものと、オフを示すものとがある。また、ログ表示部61はデバイス値をグラフ化して表示してもよい。この場合に、ログ表示部61は、一つのウインドウにデバイス値d1~d10を常に表示し、他のウインドウにワーク画像を表示する。ログ表示部61は、時間の経過とともにワーク画像を切り替える。ここで、ログ表示部61は時間軸方向に移動可能なバー103を表示してもよい。バー103はタイムラインバーと呼ばれてもよい。ログ表示部61は、時間の経過とともに左から右へ移動するようにバー103を表示してもよい。バー103はユーザによって移動されてもよい。この場合、ログ表示部61は操作部8を通じてバー103の移動操作(例:ポインタ101によるドラッグ操作)を受け付け、移動操作に応じて表示時刻を更新する。ログ表示部61はバー103により指定された表示時刻に対して取得時刻が最も近いデバイス値、ワーク画像および他の画像をログデータ73から抽出し、表示部7に表示してもよい。 FIG. 28 is a diagram for explaining how the log data 73 is displayed. In this example, relay device R000 and data memory DM100 are acquired as device value dx (x takes a value from 1 to 10). In this way, a plurality of device values are associated with one workpiece image ix according to time information. The log display unit 61 may display the device value dx, the work image ix, and the other image jx in one window, or may display them in separate windows. Further, the log display unit 61 may read out the user program from the project data 71, map the device value dx to the user program, and display it. For example, the log display unit 61 may search for a step containing an instruction related to the device value dx to be displayed, display the found step, and display the device value below the instruction in the step. . Note that the display target device may be a relay device. The log display unit 61 may change the display color of the command word or the icon image (eg, arrow) depending on whether the relay device is on or off. Icon images include those that indicate ON and those that indicate OFF. In addition, the log display unit 61 may display the device values in graph form. In this case, the log display unit 61 always displays the device values d1 to d10 in one window and displays the work image in another window. The log display unit 61 switches workpiece images as time elapses. Here, the log display unit 61 may display a bar 103 that can move in the direction of the time axis. Bar 103 may be called a timeline bar. The log display unit 61 may display the bar 103 so as to move from left to right over time. Bar 103 may be moved by the user. In this case, the log display unit 61 receives a movement operation (eg, a drag operation by the pointer 101) of the bar 103 through the operation unit 8, and updates the display time according to the movement operation. The log display unit 61 may extract from the log data 73 the device value, the work image, and other images whose acquisition times are closest to the display time specified by the bar 103 and display them on the display unit 7 .

なお、本実施形態では、監視機器の一例として、カメラ98を例示するとともに、機能実行部96の機能としては、カメラ98の撮像機能を例示した。本発明はこれに限られず、機能実行部96の機能として、モーション機能や通信機能であってもよい。まず、前者のモーション機能について詳述すると、基本ユニット3に、拡張ユニット4としてモーションユニットが連結されている場合を考える。この場合、PC2において、モーションユニットの動作を規定するプログラム(モーションフロープログラム)やパラメータ(軸構成や軸制御の設定パラメータなど)の設定がなされ、いわゆる設定情報が作成される。そして、第一の外部インタフェース(通信部33)を介して、設定情報がモーションユニットの機能実行部に送られ、モーションユニットに反映される。モーションユニットの機能実行部は、設定情報に従って、外部に接続されたモータアンプに対して目標座標や目標速度などの動作指令値を送信する。モータアンプからは、エンコーダを介して、現在座標や現在速度などのモーションデータを受信する。現在座標や現在速度などのモーションデータを受信する制御周期は、ラダープログラムのスキャン周期よりも短く、ラダープログラムのスキャン周期と非同期である。そこで、モーションユニットの収集部は、所定の周期でモーションデータを収集し、モーションデータを受信した受信時刻に関する情報と該モーションデータとを関連付けてリングバッファ91bに記憶する。その後、図22を用いて説明した処理と同様に、保存タイミングになると(図22のステップS25と同様)、リングバッファ91bからモーションデータ(現在座標や現在速度など)と時刻情報を取得して、ログデータに追記する。これにより、どのデバイス値と、どのモーションデータとが関連しているかを容易に特定することができる。一方で、後者の通信制御について詳述すると、基本ユニット3に、拡張ユニット4として通信ユニットが連結されている場合を考える。この場合、PC2において、通信ユニットの動作を規定するプログラム(通信フロープログラム)やパラメータ(通信周期や転送速度など)の設定がなされ、設定情報が作成される。そして、上述したモーション制御と同様に、通信部33を介して、設定情報が通信ユニットに反映される。そして、通信ユニットの機能実行部は、設定情報に従って、外部に接続されたセンサ群(複数の光電センサが連結されたもの等)から、複数のセンサ値などの通信データを受信する。このような通信データの受信周期(サイクリック通信周期)は、ラダープログラムのスキャン周期と非同期である。なお、センサ群を構成するセンサ数が多い場合には、通信データ自体が大容量データを構成する場合もある。通信ユニットの収集部は、所定の周期(いわゆるサイクリック通信周期)で通信データを収集し、通信データを受信した受信時刻に関する情報と通信データとを関連付けてリングバッファ91bに記憶する。あとは、図22を用いて説明した処理と同様に、保存タイミングになると(図22のステップS25と同様)、リングバッファ91bから通信データ(センサ値など)と時刻情報を取得して、ログデータに追記する。 In the present embodiment, the camera 98 is exemplified as an example of monitoring equipment, and the imaging function of the camera 98 is exemplified as the function of the function execution unit 96 . The present invention is not limited to this, and the function of the function executing section 96 may be a motion function or a communication function. First, to describe the former motion function in detail, consider a case where a motion unit is connected to the basic unit 3 as the extension unit 4 . In this case, in the PC 2, a program (motion flow program) and parameters (setting parameters for axis configuration and axis control, etc.) that define the operation of the motion unit are set, and so-called setting information is created. Then, the setting information is sent to the function executing section of the motion unit via the first external interface (communication section 33) and reflected in the motion unit. The function execution unit of the motion unit transmits operation command values such as target coordinates and target speed to the motor amplifiers connected to the outside according to the setting information. Motion data such as current coordinates and current speed are received from the motor amplifier via the encoder. The control cycle for receiving motion data such as current coordinates and current speed is shorter than the scan cycle of the ladder program and asynchronous with the scan cycle of the ladder program. Therefore, the collection unit of the motion unit collects motion data at a predetermined cycle, associates information about the reception time of the motion data with the motion data, and stores the information in the ring buffer 91b. After that, as in the process described with reference to FIG. 22, when it comes time to save (similar to step S25 in FIG. 22), motion data (current coordinates, current speed, etc.) and time information are acquired from the ring buffer 91b, Append to log data. This makes it possible to easily identify which device value is associated with which motion data. On the other hand, to describe the latter communication control in detail, consider a case where a communication unit is connected to the basic unit 3 as an expansion unit 4 . In this case, in the PC 2, a program (communication flow program) that defines the operation of the communication unit and parameters (communication cycle, transfer rate, etc.) are set, and setting information is created. Then, similarly to the motion control described above, the setting information is reflected in the communication unit via the communication section 33 . Then, the function execution section of the communication unit receives communication data such as a plurality of sensor values from an externally connected sensor group (such as a plurality of photoelectric sensors connected together) according to the setting information. The reception cycle of such communication data (cyclic communication cycle) is asynchronous with the scan cycle of the ladder program. In addition, when the number of sensors constituting the sensor group is large, the communication data itself may constitute a large amount of data. The collection unit of the communication unit collects communication data at a predetermined cycle (so-called cyclic communication cycle), associates the communication data with information about the reception time of the communication data, and stores the communication data in the ring buffer 91b. After that, as in the process described using FIG. 22, at the time of saving (similar to step S25 in FIG. 22), communication data (sensor values, etc.) and time information are acquired from the ring buffer 91b, and log data is stored. add to.

<収集期間の設定>
ログ設定部51はログデータ73の収集期間の設定を受け付けてもよい。
<Setting the collection period>
The log setting unit 51 may receive the setting of the collection period of the log data 73 .

図29は収集期間を設定するためのUI160を示している。なお、UI160、UI110、およびUI100はそれぞれに対応したタブをポインタ101で選択することで切り替えられてもよい。UI160は収集方法を指定するためのプルダウンメニュー161を有している。収集方法とはログデータ73の収集方法である。この例では、保存トリガー前後と呼ばれる収集方法と、開始リレーと呼ばれる収集方法とが説明される。保存トリガー前後とは、保存トリガーがオンになったタイミングよりも前の収集時間Taと保存トリガーがオンになったタイミングよりも後の収集時間Tbとにおいてログデータ73を収集する方法である。テキストボックス162は収集時間Tの入力を受け付ける。収集時間Tは、収集時間Taと収集時間Tbとの合計値である。テキストボックス163はトリガー後の収集時間Tbの入力を受け付ける。保存トリガーの設定部164は、保存トリガーとして利用されるリレーデバイスのデバイス名と、条件(例:オフからオンに切り替わったこと)との設定を受け付ける。上矢印は、保存トリガーとして指定されたリレーデバイスがオフからオンに切り替わったことを意味する。ガイダンス部165は、収集期間を説明するためのUIである。この例では、保存トリガーを境として、ログデータ73が収集されることが示されている。ログ設定部51は、上述されたデバイスサイズやスキャンタイムの伸びに関する情報もUI160に表示してもよい。 FIG. 29 shows UI 160 for setting the collection period. Note that the UI 160 , the UI 110 , and the UI 100 may be switched by selecting corresponding tabs with the pointer 101 . The UI 160 has a pull-down menu 161 for specifying the collection method. A collection method is a collection method of the log data 73 . In this example, a collection method called pre- and post-retention trigger and a collection method called start-relay are described. Before and after the save trigger is a method of collecting the log data 73 at the collection time Ta before the timing when the save trigger is turned on and at the collection time Tb after the timing when the save trigger is turned on. A text box 162 accepts an input of collection time T. FIG. The collection time T is the total value of the collection time Ta and the collection time Tb. A text box 163 accepts an input of collection time Tb after triggering. The storage trigger setting unit 164 receives settings of a device name of a relay device used as a storage trigger and a condition (for example, switching from off to on). An up arrow means that a relay device designated as a save trigger has switched from off to on. The guidance section 165 is a UI for explaining the collection period. This example shows that the log data 73 is collected with the storage trigger as a boundary. The log setting unit 51 may also display on the UI 160 information regarding the device size and the extension of the scan time described above.

保存トリガー前後と呼ばれる収集方法では、リングバッファ91にはデバイス値や画像データが常時格納される。保存部93は、保存トリガーであるリレーデバイスR200がオンになると、収集時間として指定された20秒のログデータ73を作成する。保存部93は、リレーデバイスR200がオンになったタイミングから18秒前に記録されたデータから、当該タイミングから2秒後までに記録されたデータをリングバッファ91から読み出してログデータ73を作成する。 In a collection method called before and after a save trigger, device values and image data are always stored in the ring buffer 91 . The storage unit 93 creates the log data 73 of 20 seconds specified as the collection time when the relay device R200, which is a storage trigger, is turned on. The storage unit 93 reads from the ring buffer 91 the data recorded 18 seconds before the timing when the relay device R200 was turned on and the data recorded 2 seconds after the timing, and creates the log data 73. .

図30は収集期間を設定するためのUI160を示している。この例ではポインタ101によってプルダウンメニュー161から収集方法として開始リレーが選択されている。ログ設定部51は、ユーザにより選択された収集方法にしたがってUI160を変更する。テキストボックス166は開始リレーとして使用されるリレーデバイスのデバイス名を受け付ける。ガイダンス部165が示すように、開始リレーと呼ばれる収集方法では、開始リレーがオンになったタイミングが収集時間の起点(開始点)となる。たとえば、製造ラインを流れてくる1個のワークをプレス処理するのに30秒かかると仮定する。また、トラブルが発生しうる時間は、30秒間の処理時間のうち最初の20秒間であると仮定する。リレーデバイスR000はプレス処理を開始するタイミングを規定するリレーである。収集部92は、リレーデバイスR000がオンになると、20秒間にわたりデバイス値や画像データをリングバッファ91に格納する。次のワークが到着することで、リレーデバイスR000が再びオンになると、収集部92は、20秒間にわたりデバイス値や画像データをリングバッファ91に格納する。保存トリガーであるリレーデバイスR200がオンになると、保存部93は、リングバッファ91に格納されている最新の20秒間にわたるデバイス値や画像データを取得してログデータ73を作成する。保存トリガーであるリレーデバイスR200は、トラブルが発生したときにオンとなるリレーデバイスである。 FIG. 30 shows UI 160 for setting the collection period. In this example, the start relay is selected as the collection method from the pull-down menu 161 with the pointer 101 . The log setting unit 51 changes the UI 160 according to the collection method selected by the user. Text box 166 accepts the device name of the relay device that will be used as the initiating relay. As indicated by the guidance section 165, in the collection method called start relay, the timing at which the start relay is turned on is the starting point (starting point) of the collection time. For example, it is assumed that it takes 30 seconds to press one workpiece flowing through the production line. It is also assumed that the time during which trouble can occur is the first 20 seconds of the 30-second processing time. A relay device R000 is a relay that defines the timing of starting press processing. When the relay device R000 is turned on, the collection unit 92 stores device values and image data in the ring buffer 91 for 20 seconds. When the next work arrives and the relay device R000 is turned on again, the collection unit 92 stores device values and image data in the ring buffer 91 for 20 seconds. When the storage trigger relay device R200 is turned on, the storage unit 93 acquires the device values and image data for the latest 20 seconds stored in the ring buffer 91 and creates the log data 73 . The storage trigger relay device R200 is a relay device that turns on when trouble occurs.

ログ設定部51はUI160を通じて設定された情報をログ設定データ72に格納し、プロジェクトデータ71とともに基本ユニット3に転送する。 The log setting unit 51 stores the information set through the UI 160 in the log setting data 72 and transfers it to the basic unit 3 together with the project data 71 .

<デバッグ>
図31はユーザにより実行されるユーザプログラムのデバッグ処理の概要を示すフローチャートである。
<Debug>
FIG. 31 is a flow chart showing an outline of debugging processing of a user program executed by a user.

S41でユーザはPC2を操作し、複数のプログラム部品から構成されるユーザプログラムを作成し、ユーザプログラムを含むプロジェクトデータ71を作成する。プログラム作成部63はユーザ入力にしたがってユーザプログラムを作成し、記憶装置22に格納する。プロジェクト作成部50はユーザ入力にしたがってプロジェクトデータ71を作成し、記憶装置22に格納する。プロジェクトデータ71は、プロジェクトデータ71またはユーザプログラムを識別するための識別情報を含む。プロジェクト作成部50は、プロジェクトデータ71またはユーザプログラムに対して演算を実行してハッシュ値または誤り検出符号などを求め、これらを識別情報としてプロジェクトデータ71に付加してもよい。なお、識別情報はGUID(グローバル一意識別子)などであってもよい。 In S41, the user operates the PC 2 to create a user program composed of a plurality of program parts, and create project data 71 including the user program. The program creation unit 63 creates a user program according to user input and stores it in the storage device 22 . The project creation unit 50 creates project data 71 according to user input and stores it in the storage device 22 . Project data 71 includes identification information for identifying project data 71 or a user program. The project creation unit 50 may perform calculations on the project data 71 or the user program to obtain hash values or error detection codes, and add these to the project data 71 as identification information. Note that the identification information may be a GUID (Globally Unique Identifier) or the like.

S42でユーザはPC2を操作し、プロジェクトデータ71をPLC1に転送する。プロジェクト作成部50はプロジェクトデータ71を記憶装置22から読み出し、通信部23を介してPLC1へ送信する。PLC1の基本ユニット3はプロジェクトデータ71を受信すると、記憶装置32に書き込む。 At S42, the user operates the PC2 and transfers the project data 71 to the PLC1. The project creation unit 50 reads out the project data 71 from the storage device 22 and transmits it to the PLC 1 via the communication unit 23 . When the basic unit 3 of the PLC 1 receives the project data 71, it writes it to the storage device 32. FIG.

S43でユーザは基本ユニット3の操作部6を操作し(例えば、PROGRAMモードからRUNモードに切り替えるモード切替スイッチを操作することにより)、プロジェクトの実行を指示する。実行部80はプロジェクトデータ71に含まれているユーザプログラムを実行する。記録部81はデバイス値などをロギングし、ロギングしたデバイス値をリングバッファ91aに格納(記録)する。出力部84のうちの保存部93は、所定の出力条件が満たされると、リングバッファ91aに記録されているデバイス値や、上述した画像データを、メモリカード36又は内部メモリ37に保存することで、ログデータ73を作成する。 In S43, the user operates the operation section 6 of the basic unit 3 (for example, by operating a mode switch for switching from PROGRAM mode to RUN mode) to instruct execution of the project. The execution unit 80 executes the user program contained in the project data 71. FIG. The recording unit 81 logs device values and the like, and stores (records) the logged device values in the ring buffer 91a. The storage unit 93 of the output unit 84 stores the device values recorded in the ring buffer 91a and the image data described above in the memory card 36 or the internal memory 37 when a predetermined output condition is satisfied. , log data 73 is created.

また、保存部93は、図19に示すように、ログデータ73に加えて、プロジェクトデータ71をメモリに保存する。これにより、PC2において、トラブル発生時のプロジェクトデータ71を使って、トラブル発生時の動きをモニタ上で再現できるようになる。詳細については後述する。 In addition to the log data 73, the storage unit 93 stores the project data 71 in the memory as shown in FIG. As a result, in the PC 2, using the project data 71 at the time of trouble occurrence, the operation at the time of trouble occurrence can be reproduced on the monitor. Details will be described later.

また、保存部93は、プロジェクトデータ71に加えて、プロジェクトデータ71の識別情報(ハッシュ値など)をメモリに保存する。これにより、PC2は、その識別情報を使って、現在の(リプレイ対象にしようとしている)プロジェクトデータが、実際のトラブル発生時のプロジェクトデータ71と一致するか否かを検証できるようになる。詳細については後述する。 In addition to the project data 71, the storage unit 93 also stores identification information (such as a hash value) of the project data 71 in the memory. As a result, the PC 2 can use the identification information to verify whether or not the current project data (to be replayed) matches the project data 71 when the actual trouble occurred. Details will be described later.

なお、本実施形態では、所定の出力条件が満たされたタイミングで、ログデータ73に加えて、プロジェクトデータ71及びその識別情報をメモリに保存することとしたが、本発明はこれに限られない。例えば、PLC1の運転開始前、運転開始時、または運転中に、プロジェクトデータ71及びその識別情報をメモリに保存しておき、所定の出力条件が満たされたタイミングで、ログデータ73のみをメモリに保存するようにしてもよい。要するに、所定の出力条件が満たされた時点で、ログデータ73と、プロジェクトデータ71と、その識別情報とが対応付けられた状態で、メモリに保存されていればよい。 In this embodiment, the project data 71 and its identification information are stored in the memory in addition to the log data 73 at the timing when the predetermined output condition is satisfied, but the present invention is not limited to this. . For example, the project data 71 and its identification information are stored in the memory before the operation of the PLC 1 is started, when the operation is started, or during the operation, and only the log data 73 is stored in the memory at the timing when the predetermined output condition is satisfied. You can save it. In short, when the predetermined output condition is satisfied, the log data 73, the project data 71, and their identification information should be stored in the memory in a state of being associated with each other.

また、本実施形態では、プロジェクトデータ71をメモリに保存しているが、本発明はこれに限られず、例えば、プロジェクトデータ71に代えて、プロジェクトデータ71の識別情報のみをメモリに保存するようにしてもよい。この場合、PC2における現在のプロジェクトデータは、実際のトラブル発生時のプロジェクトデータ71と一致することを前提としている。すなわち、プロジェクトデータをPLC1に転送した後、現在のプロジェクトデータは編集・改変されていないことを前提としている。仮に、両データが不一致と判定された場合には、ユーザは、現在のプロジェクトデータが、実際のトラブル発生時のプロジェクトデータ71とは異なることを認識した上でリプレイを行えばよいので、ユーザがこれを認識しない状態でリプレイ(不正確なトラブルシューティング)が行われるのを防ぐことができる。 Also, in this embodiment, the project data 71 are stored in the memory, but the present invention is not limited to this. may In this case, it is assumed that the current project data in the PC 2 matches the project data 71 when the actual trouble occurred. That is, it is assumed that the current project data has not been edited or modified after the project data was transferred to the PLC1. If it is determined that the two data do not match, the user should recognize that the current project data is different from the actual project data 71 when the trouble occurred before replaying. You can prevent replays (incorrect troubleshooting) from happening without knowing this.

S44でユーザは基本ユニット3の操作部6を操作し、プロジェクトデータ71とログデータ73をPC2へ転送するよう指示する。或いは、PC2の操作部8を操作して、メモリカード36に書き込まれたプロジェクトデータ71、プロジェクトデータ71の識別情報、およびログデータ73を読み出してもよい。出力部84はプロジェクトデータ71とログデータ73をPC2へ送信する。なお、出力部84はプロジェクトデータ71の転送が禁止されていると判定した場合に、プロジェクトデータ71の識別情報をログデータ73に付加する構成を採用してもよい。プロジェクトデータ71の識別情報とログデータ73とは別々に送信されてもよい。出力部84は、メモリカード36に書き込むための所定の条件が成立したタイミングで、プロジェクトデータ71またはユーザプログラムに対して(例えばハッシュ関数を用いた)演算を実行してハッシュ値または誤り検出符号などを求め、これらを識別情報としてログデータ73に付加してもよい。なお、PC2が実行する識別情報の作成ルールと、基本ユニット3が実行する識別情報の作成ルールとが一致していれば、どのようなルールが採用されてもよい。 In S44, the user operates the operation section 6 of the basic unit 3 and instructs to transfer the project data 71 and the log data 73 to the PC2. Alternatively, the operation unit 8 of the PC 2 may be operated to read the project data 71 written in the memory card 36, the identification information of the project data 71, and the log data 73. FIG. The output unit 84 transmits the project data 71 and the log data 73 to the PC2. Note that the output unit 84 may adopt a configuration in which the identification information of the project data 71 is added to the log data 73 when it is determined that the transfer of the project data 71 is prohibited. The identification information of the project data 71 and the log data 73 may be transmitted separately. The output unit 84 performs an operation (for example, using a hash function) on the project data 71 or the user program at the timing when a predetermined condition for writing to the memory card 36 is satisfied, and outputs a hash value or an error detection code or the like. may be obtained and added to the log data 73 as identification information. As long as the identification information creation rule executed by the PC 2 matches the identification information creation rule executed by the basic unit 3, any rule may be adopted.

S45でユーザはPC2を操作し、ログデータ73を再生(リプレイ)しつつトラブルの原因究明を行って、プロジェクトデータ71を構成するユーザプログラムのデバッグを実行する。ログデータ73の再生は、ログデータ73に含まれている時系列のデバイス値を波形として表示部7に表示することや、デバイス値をユーザプログラムに関連付けて表示することや、ログデータ73に含まれている時系列の画像データを表示部7に表示することを含む。ログ表示部61は、仮想的な時刻を計時する内部時計を有しており、内部時計に同期してログデータ73からデバイス値を取得して表示部7に表示する。プロジェクトデータ71がPLC1から送信されないこともある。この場合、ログ表示部61は、記憶装置22に保持されているプロジェクトデータ71(マスタデータ)のユーザプログラムを使用して、デバイス値をユーザプログラムに関連付けて表示してもよい。ログデータ73を再生することによるトラブルの原因究明の詳細については、後述する。 In S45, the user operates the PC 2, reproduces (replays) the log data 73, investigates the cause of the trouble, and debugs the user program that constitutes the project data 71. FIG. Reproduction of the log data 73 includes displaying the time-series device values included in the log data 73 as waveforms on the display unit 7, displaying the device values in association with the user program, and displaying the device values included in the log data 73. It includes displaying the time-series image data stored on the display unit 7 . The log display unit 61 has an internal clock that measures virtual time, acquires device values from the log data 73 in synchronization with the internal clock, and displays them on the display unit 7 . Project data 71 may not be sent from PLC1. In this case, the log display unit 61 may use the user program of the project data 71 (master data) held in the storage device 22 to display the device value in association with the user program. The details of investigating the cause of the trouble by reproducing the log data 73 will be described later.

ここで注意すべき点としては、ログデータ73を取得するために使用されたプロジェクトデータ71のバージョンと、PC2に保持されているプロジェクトデータ71のバージョンとが異なることがある。この場合、デバイス値をユーザプログラムに関連付けて表示することが不可能となるか、または、ユーザプログラムとデバイス値との関連付が誤ってしまうことも考えられる。この場合、ログ表示部61は、プロジェクトデータの識別情報を使って、ログデータ73を取得するために使用されたプロジェクトデータ71のバージョンと、PC2に保持されているプロジェクトデータ71のバージョンとが異なることを示す警告を表示部7に表示してもよい。なお、ログ表示部61は、第一のバージョンのプロジェクトデータ71を使用して取得されたログデータ73を、PC2に保持されている第2のバージョンのプロジェクトデータ71に関連付けて表示するかどうかをユーザに問い合わせもよい。ユーザがこのような表示を希望する場合、ログ表示部61は、第一のバージョンのプロジェクトデータ71を使用して取得されたログデータ73を、PC2に保持されている第2のバージョンのプロジェクトデータ71に関連付けて表示部7に表示する。なお、バージョンは識別情報によって管理される。ユーザがログデータ73に問題がないことを確認すると、デバッグは不要であり、後続のS46やS47も不要である。ユーザはログデータ73を分析し、ユーザプログラムのバグなどを発見し、ユーザプログラムを修正する。プロジェクト作成部50はユーザ入力にしたがってプロジェクトデータ71を修正(更新)し、記憶装置22に格納する。 It should be noted here that the version of the project data 71 used to acquire the log data 73 and the version of the project data 71 held in the PC 2 may differ. In this case, it may become impossible to display the device value in association with the user program, or the association between the user program and the device value may be erroneous. In this case, the log display unit 61 uses the identification information of the project data to make the version of the project data 71 used to acquire the log data 73 different from the version of the project data 71 held in the PC 2. A warning indicating this may be displayed on the display unit 7 . Note that the log display unit 61 determines whether or not to display the log data 73 acquired using the first version of the project data 71 in association with the second version of the project data 71 held in the PC 2 . You can also ask the user. When the user desires such a display, the log display unit 61 displays the log data 73 obtained using the first version of the project data 71 as the second version of the project data held in the PC 2 . 71 and displayed on the display unit 7 . Note that versions are managed by identification information. If the user confirms that there is no problem with the log data 73, no debugging is required, and subsequent S46 and S47 are also unnecessary. The user analyzes the log data 73, finds bugs and the like in the user program, and corrects the user program. The project creating unit 50 corrects (updates) the project data 71 according to the user's input and stores it in the storage device 22 .

S46でユーザはPC2を操作し、プロジェクトデータ71をPLC1に転送する。なお、プロジェクトデータ71内のユーザプログラムが変更されると、識別情報が更新される。これにより、修正前のプロジェクトデータ71と修正後のプロジェクトデータ71とが区別可能となる。 At S46, the user operates the PC2 to transfer the project data 71 to the PLC1. Note that the identification information is updated when the user program in the project data 71 is changed. This makes it possible to distinguish between the project data 71 before correction and the project data 71 after correction.

S47でユーザは基本ユニット3を操作し、プロジェクトデータ71に含まれるユーザプログラムの実行を指示することで、プロジェクトデータ71を検証する。実行部80はプロジェクトデータ71に含まれているユーザプログラムを実行する。PLC1がユーザの想定通りに稼働していれば、ユーザはプロジェクトデータ71のデバッグに成功したと判断する。なお、PLC1がユーザの想定通りに稼働していなければ、記録部81によって再びデバイス値などをロギングし、保存部93によってログデータ73を作成する。そして、ユーザはS44ないしS47を再び実行する。 In S47, the user operates the basic unit 3 and instructs execution of the user program included in the project data 71, thereby verifying the project data 71. FIG. The execution unit 80 executes the user program contained in the project data 71. FIG. If the PLC 1 operates as expected by the user, the user determines that debugging of the project data 71 has succeeded. If the PLC 1 does not operate as expected by the user, the recording unit 81 logs the device values and the like again, and the storage unit 93 creates the log data 73 . Then, the user executes S44 to S47 again.

このようにユーザはログデータ73を参照しながらプロジェクトデータ71をデバッグできる。そのため、デバッグの効率が向上すると考えられる。 Thus, the user can debug the project data 71 while referring to the log data 73 . Therefore, it is considered that debugging efficiency is improved.

なお、プロジェクトデータ71の転送はメモリカード36を介して実行されてもよい。つまり、PC2はメモリカード36に書き込む。ユーザはメモリカード36をPC2から取り外し、基本ユニット3にメモリカード36を取り付ける。基本ユニット3はメモリカード36からプロジェクトデータ71を読み出して記憶装置32に書き込む。同様に、ログデータ73の転送もメモリカード36を介して実行されてもよい。 Note that the project data 71 may be transferred via the memory card 36 . That is, the PC 2 writes to the memory card 36. The user removes the memory card 36 from the PC 2 and attaches the memory card 36 to the basic unit 3 . The basic unit 3 reads the project data 71 from the memory card 36 and writes it to the storage device 32 . Similarly, transfer of log data 73 may also be performed via memory card 36 .

<出力部>
図32は基本ユニット3に実装される出力部84を示している。出力部84は、ログデータ73に加えて、ログデータ73を取得する際に使用されたプロジェクトデータ71をPC2に転送してもよい。しかし、プロジェクトデータ71の情報漏洩を防ぐために、プロジェクトデータ71にはメモリカード36への書き出しや、PC2への送信を禁止するアクセス権限(プロテクト)が設定されることがある。そこで、判定部301は、プロジェクトデータ71に付与されているアクセス権限を参照し、プロジェクトデータ71の出力が禁止されているかどうかを判定する。プロジェクトデータ71の出力が禁止されている場合、出力部84はログデータ73を出力するが、プロジェクトデータ71を出力しない。一方、プロジェクトデータ71の出力が禁止されていない場合、出力部84はログデータ73とプロジェクトデータ71とを出力する。プロジェクトデータ71の出力が禁止されている場合、付加部302は、記憶装置32に保持されているプロジェクトデータ71の識別情報をログデータ73とともに出力してもよい。この識別情報はプロジェクトデータ71の一部であってもよいし、演算部303がプロジェクトデータ71またはユーザプログラムに対して所定の演算を実行することで識別情報を求めてもよい。所定の演算は、たとえば、ハッシュ演算であってもよいし、誤り検出符号の演算であってもよい。リアルタイム送信部304は、デバイス部34に保持されているデバイス値をリアルタイムで送信する。これは、PC2やHMI(ヒューマンインタフェース)などの表示装置にリアルタイムでデバイス値を表示する際に役立つ。
<Output part>
FIG. 32 shows an output section 84 mounted on the basic unit 3. As shown in FIG. The output unit 84 may transfer the project data 71 used when acquiring the log data 73 to the PC 2 in addition to the log data 73 . However, in order to prevent information leakage of the project data 71 , the project data 71 may be set with an access right (protection) that prohibits writing to the memory card 36 and transmission to the PC 2 . Therefore, the determination unit 301 refers to the access authority granted to the project data 71 and determines whether or not the output of the project data 71 is prohibited. When the output of the project data 71 is prohibited, the output unit 84 outputs the log data 73 but does not output the project data 71 . On the other hand, when the output of the project data 71 is not prohibited, the output unit 84 outputs the log data 73 and the project data 71 . When the output of the project data 71 is prohibited, the addition unit 302 may output the identification information of the project data 71 held in the storage device 32 together with the log data 73 . This identification information may be a part of the project data 71, or the identification information may be obtained by the calculation unit 303 executing a predetermined calculation on the project data 71 or the user program. The predetermined calculation may be, for example, a hash calculation or an error detection code calculation. A real-time transmission unit 304 transmits the device values held in the device unit 34 in real time. This is useful when displaying device values in real time on a display device such as a PC2 or HMI (Human Interface).

<プロジェクト作成部50>
図33はプロジェクト作成部50の詳細を示している。機能設定部62は操作部8から入力される情報に基づき拡張ユニット4の構成情報、基本ユニット3の機能および拡張ユニット4の機能を設定し、設定内容を示す構成情報を作成する。基本ユニット3の機能の設定としては、IPアドレスの設定、FTPクライアントに関する設定、プロジェクトデータ71のアクセス権限の設定などがある。拡張ユニット4の機能の設定としては、入力チャネルの設定やPLC同士の通信に関する設定などがある。構成情報はプロジェクトデータ71の一部である。編集部311(図6に示すプログラム作成部63を兼ねてもよい)は、表示部7にユーザプログラムの編集UIを表示し、操作部8から入力される情報に基づきユーザプログラムを編集する。デバッグ部314はプロジェクトデータ71を使用してユーザプログラムをデバッグする。付加部312はプロジェクトデータ71に識別情報を付加する。演算部313は識別情報(例:ハッシュ値や誤り検出符号)を演算により求める。なお、この演算部313による識別情報の演算(算出)機能については、出力部84が、同機能を発揮するようにしてもよい。
<Project creation unit 50>
FIG. 33 shows the details of the project creating unit 50. As shown in FIG. The function setting unit 62 sets the configuration information of the expansion unit 4, the functions of the basic unit 3 and the functions of the expansion unit 4 based on the information input from the operation unit 8, and creates configuration information indicating the setting contents. The settings of the functions of the basic unit 3 include IP address settings, FTP client settings, access authority settings for the project data 71, and the like. The function settings of the expansion unit 4 include input channel settings and settings related to communication between PLCs. Configuration information is part of project data 71 . The editing unit 311 (which may also serve as the program creation unit 63 shown in FIG. 6) displays an editing UI for the user program on the display unit 7 and edits the user program based on information input from the operation unit 8 . The debug unit 314 uses the project data 71 to debug the user program. The adding unit 312 adds identification information to the project data 71 . A calculation unit 313 obtains identification information (eg, a hash value or an error detection code) by calculation. Note that the function of computing (calculating) the identification information by the computation unit 313 may be performed by the output unit 84 .

<ログ表示部61>
図34はログ表示部61の詳細を示している。プログラム表示モジュール321はプロジェクトデータ71に含まれるユーザプログラムとともに、ログデータ73に含まれるデバイス値を表示部7に表示するモジュールである。また、プログラム表示モジュール321は、ユーザプログラムのみならず、プロジェクトデータ71に含まれるプログラム構成情報、複数のプログラム部品、ユニット構成、ユニット毎の機能設定など、ユーザがプロジェクトデータ71の設定内容を視認するための各種情報を表示可能となっている。画像表示モジュール323は、ログデータ73に含まれる時系列の画像データを表示部7に表示する。波形表示モジュール322は、ログデータ73に含まれる時系列のデバイス値を波形化して表示部7に表示するモジュールである。再生制御モジュール324は、プログラム表示モジュール321によって表示される情報と波形表示モジュール322によって表示される情報とを時間的に同期させる。これらのモジュールはエンジニアリングソフトウエアと呼ばれてもよい。なお、画像表示モジュール323は、プログラム表示モジュール321の一機能(画像表示部)として具現化されてもよいし、波形表示モジュール322の一機能(画像表示部)として具現化されてもよい。
<Log display unit 61>
FIG. 34 shows the details of the log display section 61. As shown in FIG. The program display module 321 is a module for displaying the device values included in the log data 73 together with the user program included in the project data 71 on the display unit 7 . The program display module 321 allows the user to view the setting contents of the project data 71, such as program configuration information, a plurality of program parts, unit configuration, and function settings for each unit, included in the project data 71 as well as the user program. It is possible to display various information for The image display module 323 displays the time-series image data included in the log data 73 on the display unit 7 . The waveform display module 322 is a module that converts time-series device values included in the log data 73 into waveforms and displays them on the display unit 7 . The playback control module 324 temporally synchronizes the information displayed by the program display module 321 and the information displayed by the waveform display module 322 . These modules may be called engineering software. The image display module 323 may be embodied as one function (image display section) of the program display module 321 or may be embodied as one function (image display section) of the waveform display module 322 .

●プログラム表示モジュール
図35Aはプログラム表示モジュール321の詳細を示している。時刻UI330aは、ユーザプログラムとともに表示されるデバイスの取得時刻(表示時刻)を操作するためのUI(例:スライドバーやカーソルなど)を提供する。表示時刻制御部331aは時刻UI330aにより指定された表示時刻を再生制御モジュール324に送出したり、再生制御モジュール324から通知された表示時刻を時刻UI330aに設定したりする。プログラム表示部332は、プロジェクトデータ71を表示部7に表示したり、識別情報に対応したプロジェクトデータ71を記憶装置22から読み出して表示部7に表示したりする。また、プログラム表示部332はデバイス値取得部333aにより取得されたデバイス値を、ユーザプログラムに使用または記述されているデバイスと関連付けて表示する。デバイス値取得部333aは、リアルタイム再生モードとログ再生モードとを有している。デバイス値取得部333aは、リアルタイム再生モードにおいて、PLC1のリアルタイム送信部304にアクセスし、デバイス値を取得し、プログラム表示部332に渡す。デバイス値取得部333aは、ログ再生モードにおいて、再生制御モジュール324にアクセスし、表示時刻とデバイス値を取得し、プログラム表示部332に渡す。
● Program Display Module FIG. 35A shows details of the program display module 321 . The time UI 330a provides a UI (eg, slide bar, cursor, etc.) for operating the acquisition time (display time) of the device displayed together with the user program. The display time control unit 331a sends the display time specified by the time UI 330a to the reproduction control module 324, and sets the display time notified from the reproduction control module 324 in the time UI 330a. The program display section 332 displays the project data 71 on the display section 7 or reads the project data 71 corresponding to the identification information from the storage device 22 and displays it on the display section 7 . The program display unit 332 also displays the device values acquired by the device value acquisition unit 333a in association with the devices used or described in the user program. The device value acquisition unit 333a has a real-time playback mode and a log playback mode. The device value acquisition unit 333 a accesses the real time transmission unit 304 of the PLC 1 in the real time reproduction mode, acquires the device value, and passes it to the program display unit 332 . The device value acquisition unit 333 a accesses the playback control module 324 in the log playback mode, acquires the display time and the device value, and passes them to the program display unit 332 .

図35Bは、プログラム表示部332等によって表示部7に表示されるGUIの一例を示す模式図である。 FIG. 35B is a schematic diagram showing an example of a GUI displayed on the display unit 7 by the program display unit 332 or the like.

図35Bにおいて、左欄のプロジェクト表示領域420には、プロジェクトデータ71を構成する様々な情報が表示されている。上から順に、ユニット構成(基本ユニット、モーションユニット、アナログ入力ユニット、カメラユニット)、プログラム構成(毎スキャンモジュール、定周期モジュール、ユニット間同期モジュール、ファンクションブロック、マクロ)が表示されている。モーションユニットについては、機能設定として軸構成や軸制御の設定パラメータが表示されている。ユーザは、図35Bに示すGUI上において、軸構成や軸制御をダブルクリックすることで、これらの設定パラメータについて、どのような設定内容になっているかを確認することができる。また、プロジェクト表示領域420において、毎スキャンモジュールに対してMainとSubが表示されているところ、ユーザがMainをクリックすると、中央のラダーモニタ450のプログラム表示領域410に、Mainプログラムが表示される。このように、図34に示すプログラム表示モジュール321は、メモリカード36からプロジェクトデータ71を読み出して、プロジェクト表示領域420に各種情報を表示したり、プログラム表示領域410に所望プログラムを表示したりする。 In FIG. 35B, various pieces of information forming the project data 71 are displayed in the project display area 420 in the left column. Unit configuration (basic unit, motion unit, analog input unit, camera unit), program configuration (every scan module, periodic module, inter-unit synchronization module, function block, macro) are displayed in order from the top. For the motion unit, setting parameters for axis configuration and axis control are displayed as function settings. By double-clicking on the axis configuration and axis control on the GUI shown in FIG. 35B, the user can confirm what kind of settings are made for these setting parameters. In the project display area 420, Main and Sub are displayed for each scan module, and when the user clicks Main, the Main program is displayed in the program display area 410 of the ladder monitor 450 in the center. Thus, the program display module 321 shown in FIG. 34 reads out the project data 71 from the memory card 36, displays various information in the project display area 420, and displays a desired program in the program display area 410.

ここで、プログラム表示領域410は、いわゆるラダーモニタ450の一部であり、リアルタイム再生モードにおいて単独で動作させることができるものである。×印をクリックすることで、ラダーモニタ450のみを非表示にすることも可能である。一方で、ログ再生モードでは、プログラム表示部332によって、運転記録を保存した際のプロジェクトに含まれるラダープログラムを再現することができるようになっている。また、プログラム表示部332は、ログ再生モードにおいて、デバイス値取得部333aを介してログデータ73に含まれるデバイス値を、Mainプログラムに記述されているデバイスと関連付けて表示する。表示対象となるデバイス値は、時刻指定カーソル404によって指定された時刻に対応するデバイス値となる(より詳細は、後述する図38を用いて説明する)。 Here, the program display area 410 is a part of the so-called ladder monitor 450, and can be operated independently in the real-time playback mode. It is also possible to hide only the ladder monitor 450 by clicking the x mark. On the other hand, in the log playback mode, the program display unit 332 can reproduce the ladder program included in the project when the driving record was saved. Also, in the log reproduction mode, the program display unit 332 displays the device values included in the log data 73 via the device value acquisition unit 333a in association with the devices described in the Main program. The device value to be displayed is the device value corresponding to the time designated by the time designation cursor 404 (details will be described later with reference to FIG. 38).

図35Bでいえば、時刻表示領域409に表示されている20XX/10/01の18:52:54と対応付けられたデバイス値が、Mainプログラムに記述されているデバイスと関連付けて表示される。この日付の右側に表示された[35000/74286]は、全スキャン回数74286に対する現在のスキャン回数35000を示している。ユーザは、時刻指定カーソル404をドラッグして移動させることで、表示時刻及びスキャン回数の更新とともに、デバイス値の表示も更新される。例えば、更新後の表示時刻において、ONしているリレーデバイスの箇所にはON表示(例えば色で塗潰す等)がなされ、OFFしているリレーデバイスの箇所にはOFF表示(例えば色抜き等)がなされる。再生ボタン406の機能等の詳細については、図38を用いて後述する。 In FIG. 35B, the device value associated with 18:52:54 on 20XX/10/01 displayed in the time display area 409 is displayed in association with the device described in the Main program. [35000/74286] displayed to the right of this date indicates the current number of scans of 35000 relative to the total number of scans of 74286. By dragging and moving the time designation cursor 404, the user updates the display time and the number of scans, and also updates the display of the device value. For example, at the display time after the update, ON display (for example, blacked out in color) is performed for relay devices that are ON, and OFF display (for example, color is not displayed) for relay devices that are OFF. is done. Details such as the function of the playback button 406 will be described later with reference to FIG.

図35Bにおいて、右上欄には、カメラモニタ430の画像表示領域が設けられている。画像表示モジュール323は、プログラム表示モジュール321によってラダーモニタ450に表示された表示時刻と同期して、ログデータ73から画像データを読み出してカメラモニタ430の画像表示領域に表示する。図35Bでは、表示時刻である20XX/10/01の18:52:54と対応付けられた画像データが、カメラモニタ430に表示されている。また、この表示時刻の右側には、282/601と表示されているが、これは、全撮像枚数601に対する現在の画像データの順番(282枚目)を表している。ユーザは、カメラモニタ430において、時刻指定カーソル404aをドラッグして移動させることで、表示時刻及び現在の画像データの順番を更新させることができる。 In FIG. 35B, the image display area of the camera monitor 430 is provided in the upper right column. The image display module 323 reads image data from the log data 73 and displays it in the image display area of the camera monitor 430 in synchronization with the display time displayed on the ladder monitor 450 by the program display module 321 . In FIG. 35B , image data associated with the display time of 20XX/10/01 18:52:54 is displayed on the camera monitor 430 . Also, 282/601 is displayed to the right of this display time, which indicates the current image data order (282nd image) with respect to the total number of captured images 601 . By dragging and moving the time designation cursor 404a on the camera monitor 430, the user can update the display time and the order of the current image data.

このとき、時刻指定カーソル404aの移動に伴って、上述したラダーモニタ450における時刻指定カーソル404も連動して移動する。例えば、時刻指定カーソル404aを、表示時刻20XX/10/01の19:00:00に合わせた場合には、ラダーモニタ450における時刻指定カーソル404も、表示時刻20XX/10/01の19:00:00の位置に追従して移動する。そして、時刻指定カーソル404の移動に伴って、ラダーモニタ450におけるデバイス値も更新される。ここでは時刻指定カーソル404aを移動させたが、逆も同様である。例えば、ラダーモニタ450における時刻指定カーソル404を移動させると、それに応じて、カメラモニタ430における時刻指定カーソル404aも移動する。このような処理動作が可能になるのは、プログラム表示モジュール321と、画像表示モジュール323とが、再生制御モジュール324を介して表示時刻に関する同期制御を実行しているからである。 At this time, as the time designation cursor 404a moves, the time designation cursor 404 on the ladder monitor 450 described above also moves. For example, when the time designation cursor 404a is set at 19:00:00 at the display time 20XX/10/01, the time designation cursor 404 on the ladder monitor 450 also moves at 19:00 at the display time 20XX/10/01: It moves following the position of 00. As the time designation cursor 404 moves, the device value on the ladder monitor 450 is also updated. Although the time designation cursor 404a is moved here, the reverse is also true. For example, when the time designation cursor 404 on the ladder monitor 450 is moved, the time designation cursor 404a on the camera monitor 430 is also moved accordingly. Such a processing operation becomes possible because the program display module 321 and the image display module 323 execute synchronization control regarding display time via the reproduction control module 324 .

また、図35Bにおいて、右下欄には、ユニットモニタ440が表示されている。例えば、図10Aを用いて説明したように、ユニットモニタ440は、モーションユニットにおけるバッファメモリ(UG)のデバイス値を表示する。より具体的には、ログ表示部61のユニット表示モジュール325は、再生制御モジュール324から現在再生すべき表示時刻を受け取ると、その時刻と対応付けられたデバイス値をメモリカード36から読み出して、ユニットモニタ440に表示させる。したがって、例えば図35Bでいえば、表示時刻20XX/10/01の18:52:54と対応付けられたデバイス値の一覧が、ユニットモニタ440に表示される。 In FIG. 35B, a unit monitor 440 is displayed in the lower right column. For example, as described using FIG. 10A, the unit monitor 440 displays the device value of the buffer memory (UG) in the motion unit. More specifically, when the unit display module 325 of the log display unit 61 receives the display time to be currently reproduced from the reproduction control module 324, it reads the device value associated with that time from the memory card 36, and displays the unit Display on monitor 440 . Therefore, for example, referring to FIG. 35B, a list of device values associated with 18:52:54 of display time 20XX/10/01 is displayed on the unit monitor 440 .

図35Cは、ログ再生モードにおけるGUIを表示するためのデータソースを模式化した図である。図35Cに示すように、プロジェクト表示領域420は、プロジェクトデータ71に含まれるユニット構成、機能設定、プログラム構成、プログラム部品をメモリから読み出して、これらをツリー形式で表示する。ラダーモニタ450は、プログラム構成(どのようなプログラム部品からなるか)、プログラム部品をメモリから読み出して、ユーザによって指定されたプログラム部品を表示するとともに、ログデータ73から表示時刻に対応するデバイス値を読み出して表示する。カメラモニタ430は、ユニット構成(カメラモニタがあるか否か)と機能設定(カメラモニタの機能。例えば複数ポートある場合にはポート番号、撮像周期やゲイン設定など)などの情報に基づいて、ログデータ73から表示時刻に対応する画像データを読み出して表示する。ユニットモニタ440は、ユニット構成(どのようなユニットがあるか)と機能設定(モーションユニットであれば軸構成や軸制御など)などの情報に基づいて、ログデータ73から表示時刻に対応するデバイス値を読み出して表示する。 FIG. 35C is a schematic diagram of a data source for displaying a GUI in log playback mode. As shown in FIG. 35C, the project display area 420 reads the unit configuration, function settings, program configuration, and program parts included in the project data 71 from the memory and displays them in a tree format. The ladder monitor 450 reads the program configuration (what program parts consist of) and program parts from the memory, displays the program parts specified by the user, and retrieves the device value corresponding to the display time from the log data 73. Read and display. The camera monitor 430 is based on information such as unit configuration (whether or not there is a camera monitor) and function settings (functions of the camera monitor; for example, if there are multiple ports, port number, imaging cycle, gain setting, etc.). Image data corresponding to the display time is read from the data 73 and displayed. The unit monitor 440 retrieves the device value corresponding to the display time from the log data 73 based on information such as unit configuration (what kind of units are there) and function settings (axis configuration, axis control, etc. for motion units). is read and displayed.

図35Bや図35Cから分かるように、再生制御モジュール324の機能によって、プログラム表示モジュール321、画像表示モジュール323、ユニット表示モジュール325を同期制御して、連携させることができる。なお、波形表示モジュール322の連携の詳細については後述する。 As can be seen from FIGS. 35B and 35C, the function of the reproduction control module 324 allows the program display module 321, the image display module 323, and the unit display module 325 to be synchronously controlled and linked. The details of cooperation of the waveform display module 322 will be described later.

ここで、本実施形態では、現在のプロジェクトデータが、実際のトラブル発生時のプロジェクトデータ71と一致するか否かを検証できるようにしている。より具体的には、図35に示すプログラム表示モジュール321のうちの照合部334は、PLC1から出力されるプロジェクトデータ71(ユーザプログラム)の識別情報と、記憶装置22に記憶されているプロジェクトデータ71(ユーザプログラム)の識別情報とを照合し、照合結果を警告部335に出力する。警告部335は、PLC1から出力される、運転記録を保存した時のプロジェクトデータ71(ユーザプログラム)の識別情報と、記憶装置22に記憶されているプロジェクトデータ(ユーザプログラム)の識別情報とが不一致である場合に、警告を表示部7に表示させる。 Here, in this embodiment, it is possible to verify whether or not the current project data matches the project data 71 when the actual trouble occurred. More specifically, the matching unit 334 of the program display module 321 shown in FIG. (user program) and the identification information, and outputs the result of the comparison to the warning unit 335 . The warning unit 335 detects that the identification information of the project data 71 (user program) output from the PLC 1 when the driving record was saved does not match the identification information of the project data (user program) stored in the storage device 22. , a warning is displayed on the display unit 7 .

例えば、警告部335は、図35Dに示すような警告画面470を表示部7に表示させる。具体例を挙げると、運転記録を保存した時のプロジェクトデータ71の識別情報と、現在の(リプレイ対象にしようとしている)プロジェクトデータの識別情報とは、不一致であると仮定する。例えば、プロジェクトデータをPLC1に転送した後、ユーザがそのプロジェクトデータ(プログラムや機能設定など)を編集したような場合である。この場合に、ユーザ操作に基づいて、リアルタイム再生モードからログ再生モードに移行したとき、図35Dに示す警告画面470が表示される。 For example, the warning unit 335 causes the display unit 7 to display a warning screen 470 as shown in FIG. 35D. To give a specific example, it is assumed that the identification information of the project data 71 when the driving record was saved does not match the identification information of the current project data (to be replayed). For example, after transferring the project data to the PLC 1, the user edits the project data (programs, function settings, etc.). In this case, a warning screen 470 shown in FIG. 35D is displayed when the real-time playback mode is shifted to the log playback mode based on the user's operation.

図35Dに示す警告画面470では、ユーザに対し、現在のプロジェクトデータをそのまま使用してログ再生を行うか、或いは、運転記録のプロジェクトを使用してログ再生を行うか、を選択させる。前者の場合には、ユーザは、現在のプロジェクトデータが、実際のトラブル発生時のプロジェクトデータ71とは異なることを認識した上で、ログ再生を行う。一方、後者の場合には、例えばユーザは、運転記録のプロジェクトが格納されている記憶装置22内のパス(フォルダやディレクトリ)を指定することで、運転記録のプロジェクトを使用してログ再生を行うことができる。 A warning screen 470 shown in FIG. 35D prompts the user to select whether to perform log playback using the current project data as is, or to perform log playback using the driving record project. In the former case, the user recognizes that the current project data is different from the actual project data 71 at the time of trouble occurrence, and then reproduces the log. On the other hand, in the latter case, for example, the user designates the path (folder or directory) in the storage device 22 in which the driving record project is stored, and performs log playback using the driving record project. be able to.

なお、本実施形態では、2つのプロジェクトデータの識別情報を比較して、一致・不一致を検証することとした。より詳細には、プロジェクトデータに含まれるプログラム構成、複数のプログラム部品、ユニット構成、ユニット毎に機能設定に対し、それぞれ識別情報が付加されており、それら全てが一致するか否かにより検証することとした。しかし、本発明はこれに限られず、少なくとも、複数のプログラム部品から構成されるユーザプログラムの識別情報を比較して、一致・不一致を検証すればよい。 In this embodiment, the identification information of two pieces of project data are compared to verify whether they match or not. More specifically, identification information is added to the program configuration, multiple program parts, unit configuration, and function settings for each unit included in the project data, and verification is performed by checking whether all of them match. and However, the present invention is not limited to this, and at least it suffices to compare the identification information of the user program composed of a plurality of program parts to verify match/mismatch.

●波形表示モジュール
図36Aは波形表示モジュール322の詳細を示している。時刻UI330bは、ユーザプログラムとともに表示されるデバイスの取得時刻(表示時刻)を操作するためのUI(例:スライドバーなど)を提供する。図28に示されているように、時刻UI330bは、基本的に、再生制御モジュール324から提供される表示時刻にしたがってバー103を左から右へ移動させる。ただし、時刻UI330bは、操作部8を通じたバー103の操作を受け付け、表示時刻制御部331bを通じて再生制御モジュール324にバー103の操作量を渡す。表示時刻制御部331bは時刻UI330bにより指定された表示時刻を再生制御モジュール324に送出したり、再生制御モジュール324から通知された表示時刻を時刻UI330bに設定したりする。デバイス値取得部333bは、リアルタイム再生モードとログ再生モードとを有している。デバイス値取得部333bは、リアルタイム再生モードにおいて、PLC1のリアルタイム送信部304にアクセスし、デバイス値を取得し、波形表示部336に渡す。デバイス値取得部333bは、ログ再生モードにおいて、再生制御モジュール324にアクセスし、表示時刻とデバイス値を取得し、波形表示部336に渡す。図28に示したように、波形表示部336は、デバイス値取得部333bにより取得されたデバイス値を波形化して表示部7に表示する。デバイス値を波形化は必須ではなく、デバイス値は数値のまま表示されてもよい。図28に示したように、画像表示モジュール323は再生制御モジュール324から出力される画像データを表示部7に表示する。なお、上述したように、画像表示モジュール323は、波形表示モジュール322の一機能として実現されてもよいが、図34に示すように、画像表示モジュール323(カメラモニタ)として別機能であってもよい。
● Waveform Display Module FIG. 36A shows the details of the waveform display module 322 . The time UI 330b provides a UI (eg, slide bar, etc.) for operating the acquisition time (display time) of the device displayed together with the user program. As shown in FIG. 28, the time UI 330b basically moves the bar 103 from left to right according to the display time provided by the playback control module 324. FIG. However, the time UI 330b receives the operation of the bar 103 through the operation unit 8, and passes the operation amount of the bar 103 to the reproduction control module 324 through the display time control unit 331b. The display time control unit 331b sends the display time specified by the time UI 330b to the reproduction control module 324, or sets the display time notified from the reproduction control module 324 in the time UI 330b. The device value acquisition unit 333b has a real-time playback mode and a log playback mode. The device value acquisition unit 333 b accesses the real time transmission unit 304 of the PLC 1 in the real time reproduction mode, acquires the device value, and passes it to the waveform display unit 336 . The device value acquisition unit 333 b accesses the playback control module 324 in the log playback mode, acquires the display time and device value, and passes them to the waveform display unit 336 . As shown in FIG. 28, the waveform display section 336 waveforms the device values acquired by the device value acquisition section 333b and displays them on the display section 7 . It is not essential to waveform the device values, and the device values may be displayed as they are. As shown in FIG. 28, the image display module 323 displays the image data output from the reproduction control module 324 on the display section 7. FIG. As described above, the image display module 323 may be realized as one function of the waveform display module 322, but as shown in FIG. good.

図36Bは、波形表示モジュール322等によって表示部7に表示されるGUIの一例を示す模式図である。特に、波形表示モジュール322によって表示されるGUIは、右下のポップアップウィンドウで表示された、いわゆるリアルタイムチャートモニタ460である。 FIG. 36B is a schematic diagram showing an example of a GUI displayed on the display unit 7 by the waveform display module 322 or the like. In particular, the GUI displayed by the waveform display module 322 is the so-called real-time chart monitor 460 displayed in the bottom right pop-up window.

図36Bにおいて、左欄のプロジェクト表示領域420、中央のプログラム表示領域410(ラダーモニタ450)、右上欄の画像表示領域(カメラモニタ430)は、図35Bに示したものと同様である。つまり、プログラム表示モジュール321や画像表示モジュール323によって、これらの表示がなされる。なお、図36Bでは、ユニット表示モジュール325によるユニットモニタ440は表示を省略しているが、これが表示されていてもよい。 In FIG. 36B, the project display area 420 in the left column, the program display area 410 (ladder monitor 450) in the center, and the image display area (camera monitor 430) in the upper right column are the same as those shown in FIG. 35B. That is, these displays are performed by the program display module 321 and the image display module 323 . In FIG. 36B, display of the unit monitor 440 by the unit display module 325 is omitted, but this may be displayed.

図36Bに示すリアルタイムチャートモニタ460について、その概要は、図28を用いて説明したとおりである。図36Bでは、リレーデバイスR000の波形データと、データメモリDM100の波形データとがメモリから読みだされ、表示されている。リアルタイムチャートモニタ460に表示させるべきデバイスは、図示しない設定画面を通じて、ユーザは自由に加減させることができる。 The outline of the real-time chart monitor 460 shown in FIG. 36B is as explained using FIG. In FIG. 36B, the waveform data of relay device R000 and the waveform data of data memory DM100 are read from the memory and displayed. The device to be displayed on the real-time chart monitor 460 can be freely adjusted by the user through a setting screen (not shown).

リアルタイムチャートモニタ460の下方には、時刻指定カーソル404b(図28に示すバー103に相当。再生位置カーソルと呼んでもよい)が表示されており、ユーザは、この時刻指定カーソル404bの位置をクリックして移動させることができるようになっている。このとき、時刻指定カーソル404bの位置が移動すると、再生制御モジュール324の機能によって、ラダーモニタ450における時刻指定カーソル404、カメラモニタ430における時刻指定カーソル404aが、連動して移動するようになっている。具体的には、図36Bにおいて、リアルタイムチャートモニタ460の波形表示領域における横軸はスキャン回数(時刻に切り替え表示してもよい)を示しているが、ユーザが時刻指定カーソル404bをクリックして所定のスキャン回数の位置へスライド移動させると、ラダーモニタ450における時刻指定カーソル404及びカメラモニタ430における時刻指定カーソル404aは、それぞれ、そのスキャン回数に対応する表示時刻の位置へ移動する。そして、移動後の表示位置に対応するデバイス値や画像データが表示される。もちろん、逆も同様である。すなわち、ラダーモニタ450における時刻指定カーソル404又はカメラモニタ430における時刻指定カーソル404aをクリックして所望位置へスライドさせると、時刻指定カーソル404bも、その所望位置に対応するスキャン回数の位置へと移動する。このとき、時刻指定カーソル404又は時刻指定カーソル404aを一定量以上動かすと、時刻指定カーソル404bが示す位置が、現在のリアルタイムチャートモニタ460の表示範囲外となるが、本実施形態では、この位置が常に表示範囲内になるよう、表示範囲が追従していく。 A time designation cursor 404b (corresponding to the bar 103 shown in FIG. 28, which may be called a playback position cursor) is displayed below the real-time chart monitor 460, and the user clicks the position of the time designation cursor 404b. can be moved by pressing At this time, when the position of the time designation cursor 404b is moved, the time designation cursor 404 on the ladder monitor 450 and the time designation cursor 404a on the camera monitor 430 are moved together by the function of the reproduction control module 324. . Specifically, in FIG. 36B, the horizontal axis in the waveform display area of the real-time chart monitor 460 indicates the number of scans (which may be displayed by switching to the time). , the time designation cursor 404 on the ladder monitor 450 and the time designation cursor 404a on the camera monitor 430 move to the position of the display time corresponding to the number of scans. Then, the device value and image data corresponding to the display position after movement are displayed. Of course, the reverse is also true. That is, when the time designation cursor 404 on the ladder monitor 450 or the time designation cursor 404a on the camera monitor 430 is clicked and slid to a desired position, the time designation cursor 404b also moves to the scan count position corresponding to the desired position. . At this time, if the time designation cursor 404 or the time designation cursor 404a is moved by a certain amount or more, the position indicated by the time designation cursor 404b will be outside the current display range of the real-time chart monitor 460. The display range follows so that it is always within the display range.

ここで、図36Bに示すように、リアルタイムチャートモニタ460においては、時刻指定カーソル404bは、波形表示エリアに重畳表示された縦線と、その縦線の下端に付加された三角印の図形と、から構成されているが、さらに、この時刻指定カーソル404bの下方には、表示エリアバー404cが表示されている。表示エリアバー404cの中央には、現在位置を示す四角のインジケータが表示されている。ユーザは、このインジケータをドラッグして左右に動かすことで、リアルタイムチャートモニタ460に表示される範囲を変更することができる。そして、ユーザは、この表示エリアバー404cを上手く活用することで、トラブル原因を追究するトラブルシューティングを行うことができる。この点につき、図36Cを用いてより詳細に説明する。 Here, as shown in FIG. 36B, in the real-time chart monitor 460, the time designation cursor 404b consists of a vertical line superimposed on the waveform display area, a triangular figure attached to the bottom end of the vertical line, , and a display area bar 404c is displayed below the time designation cursor 404b. A square indicator indicating the current position is displayed in the center of the display area bar 404c. The user can change the range displayed on the real-time chart monitor 460 by dragging this indicator and moving it left or right. By effectively utilizing the display area bar 404c, the user can perform troubleshooting to investigate the cause of the trouble. This point will be described in more detail with reference to FIG. 36C.

図36Cは、リアルタイムチャートモニタ460で表示される表示範囲と時刻指定カーソル404bとの関係性を説明するための説明図である。 FIG. 36C is an explanatory diagram for explaining the relationship between the display range displayed on the real-time chart monitor 460 and the time designation cursor 404b.

図36Cでは、リアルタイムチャートモニタ460には、リレーデバイスR000及びR001、データメモリDM100及びDM101が表示されるものとする。図36Cでは、説明の便宜上、各デバイスについて15個分(黒丸)のデバイス値がリアルタイムチャートモニタ460に表示されているものとする。また、これらのデバイス値のうち、各デバイスについて特定の一時刻に対応するデバイス値が、時刻指定カーソル404bによって指定されたデバイス値となる。図36Cでは、リアルタイムチャートモニタ460で表示される範囲の中央の時刻に対応するデバイス値となっている。ユーザは、時刻指定カーソル404bをドラッグして、例えば右方向へ移動させると、上述した時刻指定カーソル404や時刻指定カーソル404aと同様に、時刻指定カーソル404bが表示範囲内に収まるように、表示範囲が追従していく。一方で、ユーザは、表示エリアバー404cの四角インジケータをドラッグして、例えば右方向へ移動させると、リアルタイムチャートモニタの表示範囲が右方向に移っていき、一定量だけ移ると(デバイス値8個分だけ右へ移ると)、時刻指定カーソル404bが非表示となる。しかし、本実施形態では、時刻指定カーソル404bが非表示になっても、トラブルシューティングしやすいように、波形表示領域の所望位置をダブルクリックすることで、時刻指定カーソル404bが、その所望位置にジャンプするようになっている。言い換えると、図36Aに示す波形表示部336は、波形表示領域においてユーザから所望位置の指定を受け付けて、受け付けた指定位置に時刻指定カーソル404bを移動させる機能を有している。 In FIG. 36C, it is assumed that real-time chart monitor 460 displays relay devices R000 and R001 and data memories DM100 and DM101. In FIG. 36C, for convenience of explanation, it is assumed that 15 device values (black circles) are displayed on the real-time chart monitor 460 for each device. Among these device values, the device value corresponding to a specific time for each device is the device value designated by the time designation cursor 404b. In FIG. 36C , the device value corresponds to the central time of the range displayed on the real-time chart monitor 460 . When the user drags the time designation cursor 404b to move it, for example, to the right, the display range is adjusted so that the time designation cursor 404b falls within the display range in the same manner as the time designation cursor 404 and the time designation cursor 404a described above. will follow. On the other hand, when the user drags the square indicator of the display area bar 404c and moves it, for example, to the right, the display range of the real-time chart monitor moves to the right, and when it moves by a certain amount (eight device values When it moves to the right by minutes), the time designation cursor 404b disappears. However, in this embodiment, even if the time designation cursor 404b is hidden, by double-clicking a desired position in the waveform display area, the time designation cursor 404b jumps to the desired position so as to facilitate troubleshooting. It is designed to In other words, the waveform display section 336 shown in FIG. 36A has a function of receiving a desired position designation from the user in the waveform display area and moving the time designation cursor 404b to the received designated position.

図36Cに示すGUIを使ったトラブルシューティングの手順(一例)について、より具体的に説明する。 A more specific description will be given of the troubleshooting procedure (one example) using the GUI shown in FIG. 36C.

(1)ユーザは、まず、リアルタイムチャートモニタ460の表示エリアバー404cにおいて、四角インジケータをドラッグして左右に移動させることで、波形表示領域に表示されたデバイス波形を視認しながら、トラブルの原因究明に役立ちそうな時刻を探す。このとき、上述したように、時刻指定カーソル404bは、リアルタイムチャートモニタ460の表示範囲から非表示になってもよい。 (1) First, the user investigates the cause of the trouble while viewing the device waveform displayed in the waveform display area by dragging and moving the square indicator left and right on the display area bar 404c of the real-time chart monitor 460. Find a time that might be useful for At this time, the time designation cursor 404b may disappear from the display range of the real-time chart monitor 460, as described above.

(2)デバイス波形のうち、異常なデバイス値をとる時刻が見つかったら、波形表示領域において、その時刻をダブルクリックする。そうすると、時刻指定カーソル404bがその時刻にジャンプするとともに、ラダーモニタ450における時刻指定カーソル404、及び、カメラモニタ430における時刻指定カーソル404aが、いずれもその時刻にジャンプする。 (2) If a time at which an abnormal device value is found in the device waveform, double-click that time in the waveform display area. Then, the time designation cursor 404b jumps to that time, and the time designation cursor 404 on the ladder monitor 450 and the time designation cursor 404a on the camera monitor 430 both jump to that time.

(3)その結果、再生制御モジュール324によって、ラダーモニタ450では、その時刻に対応するデバイス値が表示され、カメラモニタ430では、その時刻に対応する画像データが表示される。したがって、ユーザは、これらのデバイス値や画像データを視認しながら、トラブルの原因を究明していくことができる。 (3) As a result, the reproduction control module 324 displays the device value corresponding to that time on the ladder monitor 450 and the image data corresponding to that time on the camera monitor 430 . Therefore, the user can investigate the cause of the trouble while viewing these device values and image data.

●再生制御モジュール324
図37は再生制御モジュール324の詳細を示している。デバイス値提供部341は、ログデータ取得部344によりログデータ73から取得されたデバイス値をプログラム表示モジュール321と波形表示モジュール322とに提供する。また、デバイス値提供部341は、ユニット表示モジュール325にも、ログデータ73から取得されたデバイス値を提供する。なお、ログデータ73から取得されたデバイス値は一時的にログデバイス345に格納されてもよい。プログラム表示モジュール321と波形表示モジュール322のデバイス値取得部333はデバイス値提供部341にデバイス値を要求する。デバイス値取得部333はログデバイス345からデバイス値を取得し、デバイス値取得部333に送信する。時刻デバイス342は再生制御部343により設定された表示時刻を保持するデバイスである。時刻デバイス342に保持されているデバイス値(時刻情報)もデバイス値提供部341がデバイス値取得部333へ送信してもよい。あるいは、再生制御部343が表示時刻制御部331a、331bに時刻情報を提供してもよい。再生制御部343は、表示時刻を計時するための仮想的な内部時計を有し、この内部時計にしたがって時刻デバイス342に保持されている時刻情報を更新する。再生制御部343は、表示時刻制御部331a、331bに時刻デバイス342に保持されている時刻情報を送信する。再生制御部343は、表示時刻制御部331a、331bから表示時刻の指定を受信すると、受信した表示時刻を内部時計に設定する(時刻合わせ)。よって、表示時刻制御部331aから表示時刻が指定されると、この表示時刻は再生制御部343を介して表示時刻制御部331bに伝達される。同様に、表示時刻制御部331bから表示時刻が指定されると、この表示時刻は再生制御部343を介して表示時刻制御部331aに伝達される。これによりプログラム表示モジュール321の表示時刻と波形表示モジュール322の表示時刻とが同期する。スロー再生、早送り再生、巻き戻し再生などを実現するために、再生制御部343は、操作部8からのユーザ入力にしたがって内部時計の更新速度を変更する。再生制御部343は、ログデータ73に含まれている最も古いレコードの時刻情報を内部時計の初期値に設定してもよい。ログデータ取得部344は時刻デバイス342に保持されている表示時刻に関連付けられているデバイス値をログデータ73から取得して、デバイス値提供部341に渡す。
Playback control module 324
FIG. 37 shows details of the playback control module 324 . The device value providing unit 341 provides the program display module 321 and the waveform display module 322 with device values obtained from the log data 73 by the log data obtaining unit 344 . The device value providing unit 341 also provides the device value acquired from the log data 73 to the unit display module 325 as well. Note that the device value acquired from the log data 73 may be temporarily stored in the log device 345 . The device value acquiring unit 333 of the program display module 321 and waveform display module 322 requests the device value providing unit 341 for the device value. The device value acquisition unit 333 acquires device values from the log device 345 and transmits them to the device value acquisition unit 333 . The time device 342 is a device that holds the display time set by the reproduction control section 343 . The device value (time information) held in the time device 342 may also be transmitted by the device value providing section 341 to the device value obtaining section 333 . Alternatively, the reproduction control section 343 may provide time information to the display time control sections 331a and 331b. The playback control unit 343 has a virtual internal clock for measuring display time, and updates the time information held in the time device 342 according to this internal clock. The reproduction control section 343 transmits the time information held in the time device 342 to the display time control sections 331a and 331b. Upon receiving the designation of the display time from the display time control units 331a and 331b, the reproduction control unit 343 sets the received display time to the internal clock (time adjustment). Therefore, when the display time is designated by the display time control section 331a, the display time is transmitted to the display time control section 331b via the reproduction control section 343. FIG. Similarly, when the display time is designated by the display time control section 331b, this display time is transmitted to the display time control section 331a via the reproduction control section 343. FIG. As a result, the display time of the program display module 321 and the display time of the waveform display module 322 are synchronized. In order to realize slow playback, fast-forward playback, rewind playback, etc., the playback control unit 343 changes the update speed of the internal clock according to user input from the operation unit 8. FIG. The playback control unit 343 may set the time information of the oldest record included in the log data 73 as the initial value of the internal clock. The log data acquisition unit 344 acquires the device value associated with the display time held in the time device 342 from the log data 73 and transfers it to the device value provision unit 341 .

同様にして、再生制御部343は、プログラム表示モジュール321の表示時刻と波形表示モジュール322の表示時刻に加えて、画像表示モジュール323やユニット表示モジュール325の時刻を同期させるようにしてもよい。 Similarly, the reproduction control section 343 may synchronize the display time of the program display module 321 and the display time of the waveform display module 322 , as well as the time of the image display module 323 and the unit display module 325 .

なお、本実施形態では、ログ再生モードにおいて、プログラム表示モジュール321、波形表示モジュール322、画像表示モジュール323、ユニット表示モジュール325の各表示時刻を常に同期させることとしたが、本発明はこれに限られず、例えば、同期させるか否かをユーザが選択できるようにしてもよい。例えば、各モニタ画面上に同期有無のチェックボックスを設け、デフォルトでチェック有の状態にしてもよい。そして、ユーザは、同期したくないモジュールについて、チェックを外すことにより、そのモジュールについてだけ同期させないことも可能である。このように、ログ表示部61は、再生制御モジュールによって同期制御(追従制御)されるモジュールを選択する、選択機能を有していてもよい。 In the present embodiment, the display times of the program display module 321, waveform display module 322, image display module 323, and unit display module 325 are always synchronized in the log playback mode, but the present invention is not limited to this. For example, the user may be allowed to select whether or not to synchronize. For example, a check box for synchronization may be provided on each monitor screen and checked by default. By unchecking a module that the user does not want to synchronize, it is also possible for the user not to synchronize only that module. In this way, the log display section 61 may have a selection function of selecting a module to be synchronously controlled (follow-up controlled) by the reproduction control module.

<プログラムの表示UI>
図38はプログラム表示モジュール321によって提供される表示UI400を示している。図35Bや図36Aで説明した表示UI400を別の観点から、更に詳述する。プログラム表示領域410は、プロジェクトデータ71のユーザプログラムを表示する領域である。この例ではプログラム表示領域410はラダープログラム(ラダー図)を表示している。プログラム表示部332は、ユーザプログラムに使用または記述されているデバイスのデバイス値をデバイス値取得部333aにより取得し、ユーザプログラムとともに表示する。たとえば、プログラム表示部332は、リレーデバイスがONであればONを示すアイコン401aをユーザプログラム上に重ねて表示してもよい。プログラム表示部332は、リレーデバイスがOFFであればOFFを示すアイコン401bをユーザプログラム上に重ねて表示してもよい。プログラム表示部332は、出力系のデバイスであるDM100のデバイス値をデバイス値取得部333aにより取得し、ユーザプログラムにおけるDM100の記述と重ねて表示してもよい。この例では、DM100の記述の下にデバイス値の表示領域403が設けられている。プログラム表示部332は表示領域403にデバイス値を表示する。なお、再生制御モジュール324は表示時刻の更新とともにデバイス値も更新するため、プログラム表示部332は、ユーザプログラムとともに表示されているデバイス値を更新する。時刻UI330aは時刻デバイス342から取得した表示時刻に応じて時刻指定カーソル404を右から左へ移動させる。時刻指定カーソル404はポインタ101によりドラッグ可能である。時刻指定カーソル404がポインタ101によりドラッグされたことを時刻UI330aが検知すると、表示時刻制御部331aは再生制御部343に表示時刻の更新を停止させ、時刻指定カーソル404のドラッグ量を再生制御部343に通知する。再生制御部343は、ドラッグ量に応じて内部時計のカウント値(表示時刻)を調整する。時刻UI330aは、表示時刻の更新速度(例:・・・、2.0倍、1.0倍、0.5倍、0.1倍、・・・)を速度指定部405に表示してもよい。なお、速度指定部405は、複数の更新速度のリストを表示し、そのうちの一つの更新速度を選択可能なプルダウメニューによって実現されてもよい。時刻UI330aは、速度指定部405に対するポインタ101によるクリックを検知すると、このようなプルダウメニューを表示し、更新速度の選択を受け付けてもよい。再生ボタン406はデバイス値の時系列的な表示を指示するためのボタンである。時刻UI330aは再生ボタン406がポインタ101によりクリックされたことを検知すると、表示時刻制御部331aに表示時刻の更新を開始するよう再生制御部343に指示する。この指示はデバイス値の表示の開始の指示または表示の再開の指示に相当する。ワンステップ逆再生ボタン407は、表示時刻をワンステップずつ更新(巻き戻し)しながらデバイス値を時系列的に表示することを指示するためのボタンである。時刻UI330aはワンステップ逆再生ボタン407がポインタ101によりクリックされたことを検知すると、表示時刻制御部331aに表示時刻を一ステップ戻すように指示する。ワンステップ再生ボタン408は、表示時刻をワンステップずつ更新しながらデバイス値を時系列的に表示することを指示するためのボタンである。時刻UI330aはワンステップ再生ボタン408がポインタ101によりクリックされたことを検知すると、表示時刻制御部331aに表示時刻を一ステップ進めるように指示する。なお、ワンステップ再生が実行されているときは、ワンステップ逆再生ボタン407またはワンステップ再生ボタン408が操作されない限り、再生制御部343は表示時刻を更新しない。ワンステップ再生が実行されているときに、再生ボタン406が操作されると、再生制御部343は速度指定部405により指定された更新速度で表示時刻の更新を再開する。時刻表示領域409は時刻デバイス342に保持されている表示時刻を表示する領域である。表示時刻制御部331aは、時刻デバイス342から取得された表示時刻を時刻表示領域409に表示する。
<Program display UI>
FIG. 38 shows a display UI 400 provided by the program display module 321. As shown in FIG. The display UI 400 described with reference to FIGS. 35B and 36A will be described in further detail from another viewpoint. A program display area 410 is an area for displaying the user program of the project data 71 . In this example, the program display area 410 displays a ladder program (ladder diagram). The program display unit 332 acquires the device value of the device used or described in the user program by the device value acquisition unit 333a, and displays it together with the user program. For example, if the relay device is ON, the program display unit 332 may display an icon 401a indicating ON on the user program. If the relay device is OFF, the program display unit 332 may display an icon 401b indicating OFF over the user program. The program display unit 332 may acquire the device value of the DM 100, which is an output system device, by the device value acquisition unit 333a, and display the device value superimposed on the description of the DM 100 in the user program. In this example, a device value display area 403 is provided under the description of DM100. The program display unit 332 displays device values in the display area 403 . Since the reproduction control module 324 updates the device value together with the display time, the program display unit 332 updates the device value displayed together with the user program. The time UI 330 a moves the time designation cursor 404 from right to left according to the display time acquired from the time device 342 . The time designation cursor 404 can be dragged by the pointer 101 . When the time UI 330a detects that the time designation cursor 404 has been dragged by the pointer 101, the display time control unit 331a causes the reproduction control unit 343 to stop updating the display time, and causes the reproduction control unit 343 to change the drag amount of the time designation cursor 404. to notify. The playback control unit 343 adjusts the count value (display time) of the internal clock according to the drag amount. Even if the time UI 330a displays the update speed of the display time (eg, 2.0 times, 1.0 times, 0.5 times, 0.1 times, . good. Note that the speed designation unit 405 may be implemented by a pull-down menu that displays a list of multiple update speeds and allows selection of one of the update speeds. When the time UI 330a detects a click of the pointer 101 on the speed designation portion 405, the pull-down menu may be displayed to accept the selection of the update speed. A play button 406 is a button for instructing display of device values in chronological order. When the time UI 330a detects that the playback button 406 has been clicked by the pointer 101, it instructs the playback control section 343 to start updating the display time in the display time control section 331a. This instruction corresponds to an instruction to start displaying device values or an instruction to resume displaying. A one-step reverse playback button 407 is a button for instructing display of device values in chronological order while updating (rewinding) the display time step by step. When the time UI 330a detects that the one-step reverse playback button 407 has been clicked by the pointer 101, it instructs the display time control unit 331a to return the display time by one step. A one-step playback button 408 is a button for instructing to display the device values in chronological order while updating the display time step by step. When the time UI 330a detects that the one-step playback button 408 has been clicked by the pointer 101, it instructs the display time control unit 331a to advance the display time by one step. Note that while the one-step playback is being performed, the playback control unit 343 does not update the display time unless the one-step reverse playback button 407 or the one-step playback button 408 is operated. When the playback button 406 is operated while the one-step playback is being executed, the playback control unit 343 resumes updating the display time at the update speed specified by the speed specifying unit 405 . A time display area 409 is an area for displaying the display time held in the time device 342 . The display time control unit 331 a displays the display time acquired from the time device 342 in the time display area 409 .

<HMIのエミュレータ>
PLC1はHMIと呼ばれる外付けの表示装置を接続可能である。HMIはタッチパネル式の入力装置を有していてもよい。HMIはPLC1のデバイス部34に保持されているデバイス値を読み出して表示装置に表示する。プロジェクト作成部50はHMIに表示されるUIと、UIに表示されるデバイス値を設定し、プロジェクトデータ71に保存する。デバッグ部314は、HMIのエミュータを有しており、プロジェクトデータ71にしたがってエミュータを動作させることで、HMIの動作を確認する。ログ表示部61は、HMIのエミュレータに対してログデータ73のデバイス値を供給する。HMIのエミュレータは、時系列的に提供されたデバイス値をUIに表示する。
<HMI emulator>
PLC1 can be connected to an external display device called HMI. The HMI may have a touch panel type input device. The HMI reads the device values held in the device unit 34 of the PLC 1 and displays them on the display device. The project creation unit 50 sets the UI displayed on the HMI and the device values displayed on the UI, and saves them in the project data 71 . The debug unit 314 has an HMI emulator and operates the emulator according to the project data 71 to confirm the operation of the HMI. The log display unit 61 supplies the device value of the log data 73 to the HMI emulator. The HMI emulator displays the provided device values in chronological order on the UI.

図39はHMIのエミュレータのUI490を示している。この例では、HMIのエミュレータはプログラム表示モジュール321に含まれている。プログラム表示部332は、再生制御部343により提供されるデバイス値をUI490の表示領域に反映させる。UI490は、時刻指定カーソル404や再生ボタン406など、UI400に含まれている再生制御に関連した時刻制御オブジェクトを有していてもよい。UI490における時刻制御オブジェクトの操作は再生制御部343を通じてUI400や図28に示されたUIに反映される。たとえば、UI490において時刻指定カーソル404が左に操作されると、再生制御部343から提供される表示時刻に連動して、UI400の時刻指定カーソル404も左に移動し、図28に示されたバー103も左に移動する。また、図28に示されたバー103が左に操作されれば、再生制御部343から提供される表示時刻に連動して、UI400、450の時刻指定カーソル404も左に移動する。これらはいずれも時刻デバイス342に保持されている同一の表示時刻に同期しているからである。 FIG. 39 shows the UI 490 of the HMI emulator. In this example, the HMI emulator is included in program display module 321 . The program display unit 332 reflects the device value provided by the reproduction control unit 343 in the display area of the UI490. UI 490 may have time control objects associated with playback controls included in UI 400 , such as time cursor 404 and play button 406 . The operation of the time control object in the UI490 is reflected in the UI400 and the UI shown in FIG. For example, when the time designation cursor 404 on the UI 490 is operated to the left, the time designation cursor 404 on the UI 400 also moves left in conjunction with the display time provided from the reproduction control unit 343, and the bar shown in FIG. 103 also moves to the left. Further, when the bar 103 shown in FIG. 28 is operated to the left, the time designation cursor 404 of the UIs 400 and 450 also moves to the left in conjunction with the display time provided from the reproduction control unit 343. This is because they are all synchronized with the same display time held in the time device 342 .

<ログ表示に関するフローチャート>
●プログラム表示モジュール
図40はプログラム表示モジュール321によって実行される表示処理を示している。なお、S50、S51およびS60はPLC1からプロジェクトデータ71を取得できない場合にのみ実行されてもよい。PLC1からプロジェクトデータ71を取得できる場合、PLC1からプロジェクトデータ71が使用される。PLC1からプロジェクトデータ71を取得できない場合、PC2に保持されているプロジェクトデータ71が使用される。
<Flowchart for log display>
●Program Display Module FIG. 40 shows display processing executed by the program display module 321. FIG. Note that S50, S51 and S60 may be executed only when the project data 71 cannot be obtained from the PLC1. If project data 71 can be obtained from PLC1, project data 71 from PLC1 is used. If the project data 71 cannot be acquired from the PLC1, the project data 71 held in the PC2 is used.

S50でCPU21(照合部334)はPLC1に保持されているプロジェクトデータ71の識別情報と、PC2に保持されているプロジェクトデータ71の識別情報とを取得する。 In S50, the CPU 21 (verification unit 334) acquires the identification information of the project data 71 held in the PLC1 and the identification information of the project data 71 held in the PC2.

S51でCPU21(照合部334)はPLC1に保持されているプロジェクトデータ71の識別情報と、PC2に保持されているプロジェクトデータ71の識別情報とが一致するかどうかを判定する。両者が一致しなければ、CPU21はS60に進む。S60でCPU21(警告部335)はPLC1に保持されているプロジェクトデータ71の識別情報と、PC2に保持されているプロジェクトデータ71の識別情報とが一致しないことを示す警告を表示部7に表示する。両者が一致する場合、CPU21はS52に進む。 In S51, the CPU 21 (collation unit 334) determines whether or not the identification information of the project data 71 held in the PLC 1 and the identification information of the project data 71 held in the PC 2 match. If the two do not match, the CPU 21 proceeds to S60. In S60, the CPU 21 (warning unit 335) displays a warning on the display unit 7 indicating that the identification information of the project data 71 held in the PLC 1 does not match the identification information of the project data 71 held in the PC 2. . If both match, the CPU 21 proceeds to S52.

S52でCPU21(プログラム表示部332)はPLC1または記憶装置22からプロジェクトデータ71を取得する。 The CPU 21 (program display unit 332) acquires the project data 71 from the PLC 1 or the storage device 22 in S52.

S53でCPU21(プログラム表示部332)は操作部8から入力された情報に基づきログ再生モードが選択されているのか、それともリアルタイム再生モードが選択されているのかを判定する。リアルタイム再生モードが選択されていれば、CPU21はS58に進む。S58でCPU21(デバイス値取得部333a)は再生制御モジュール324を介さずにPLC1のリアルタイム送信部304からデバイス値を取得する。S59でCPU21(プログラム表示部332)はプロジェクトデータ71に含まれるユーザプログラムとともにデバイス値を表示部7に表示する。ログ再生モードが選択されていれば、CPU21はS54に進む。 At S53, the CPU 21 (program display unit 332) determines whether the log reproduction mode or the real-time reproduction mode is selected based on the information input from the operation unit 8. FIG. If the real-time reproduction mode has been selected, the CPU 21 proceeds to S58. In S<b>58 , the CPU 21 (device value acquisition section 333 a ) acquires the device value from the real-time transmission section 304 of the PLC 1 without going through the reproduction control module 324 . In S59, the CPU 21 (program display unit 332) displays the device value on the display unit 7 together with the user program included in the project data 71. FIG. If the log reproduction mode has been selected, the CPU 21 proceeds to S54.

S54でCPU21(デバイス値取得部333a)は再生制御モジュール324を起動し、再生制御モジュール324から表示時刻とログデータ73のデバイス値と取得する。 In S<b>54 , the CPU 21 (device value acquisition unit 333 a ) activates the playback control module 324 and acquires the display time and the device value of the log data 73 from the playback control module 324 .

S55でCPU21(プログラム表示部332)はプロジェクトデータ71に含まれるユーザプログラムとともにデバイス値と表示時刻を表示部7に表示する。 In S55, the CPU 21 (program display unit 332) displays the device value and the display time together with the user program included in the project data 71 on the display unit 7. FIG.

S56でCPU21(表示時刻制御部331a)は時刻UI330aにより時刻指定が検知されたかどうかを判定する。上述したように時刻指定は時刻指定カーソル404の操作によって実行される。時刻指定が検知されていなければ、CPU21はS54に戻る。時刻指定が検知されていれば、CPU21はS57に進む。 In S56, the CPU 21 (display time control unit 331a) determines whether or not the time designation is detected by the time UI 330a. As described above, time specification is executed by operating the time specification cursor 404 . If the time specification is not detected, the CPU 21 returns to S54. If the time designation has been detected, the CPU 21 proceeds to S57.

S57でCPU21(表示時刻制御部331a)は再生制御モジュール324の再生制御部343に、時刻指定カーソル404により入力された指定時刻を通知する。CPU21はS54に戻る。 In S57, the CPU 21 (display time control section 331a) notifies the reproduction control section 343 of the reproduction control module 324 of the designated time input by the time designation cursor 404. FIG. The CPU 21 returns to S54.

●波形表示モジュール
図41は波形表示モジュール322によって実行される表示処理を示している。
●Waveform Display Module FIG. 41 shows display processing executed by the waveform display module 322 .

S61でCPU21(波形表示部336)は操作部8から入力された情報に基づきログ再生モードが選択されているのか、それともリアルタイム再生モードが選択されているのかを判定する。リアルタイム再生モードが選択されていれば、CPU21はS66に進む。S66でCPU21(デバイス値取得部333b)は再生制御モジュール324を介さずにPLC1のリアルタイム送信部304からデバイス値を取得する。S67でCPU21(波形表示部336)はデバイス値を表示部7に表示する。ログ再生モードが選択されていれば、CPU21はS62に進む。 In S61, the CPU 21 (waveform display section 336) determines whether the log reproduction mode or the real-time reproduction mode is selected based on the information input from the operation section 8. FIG. If the real-time reproduction mode has been selected, the CPU 21 proceeds to S66. In S<b>66 , the CPU 21 (device value acquisition section 333 b ) acquires the device value from the real-time transmission section 304 of the PLC 1 without going through the reproduction control module 324 . The CPU 21 (waveform display section 336) displays the device value on the display section 7 in S67. If the log reproduction mode has been selected, the CPU 21 proceeds to S62.

S62でCPU21(デバイス値取得部333b)は再生制御モジュール324を起動し、再生制御モジュール324からデバイス値と表示時刻を取得する。 In S<b>62 , the CPU 21 (device value acquisition unit 333 b ) activates the playback control module 324 and acquires the device value and display time from the playback control module 324 .

S63でCPU21(波形表示部336)はデバイス値と表示時刻を表示部7に表示する。 In S63, the CPU 21 (waveform display section 336) displays the device value and the display time on the display section 7. FIG.

S64でCPU21(表示時刻制御部331b)は時刻UI330bにより時刻指定が検知されたかどうかを判定する。上述したように時刻指定はバー103によって実行される。時刻指定が検知されていなければ、CPU21はS62に戻る。時刻指定が検知されていれば、CPU21はS65に進む。 In S64, the CPU 21 (display time control unit 331b) determines whether the time designation is detected by the time UI 330b. Time specification is performed by the bar 103 as described above. If the time specification is not detected, the CPU 21 returns to S62. If the time designation has been detected, the CPU 21 proceeds to S65.

S65でCPU21(表示時刻制御部331b)は再生制御モジュール324の再生制御部343に、バー103により入力された指定時刻を通知する。CPU21はS62に戻る。 In S65, the CPU 21 (display time control section 331b) notifies the reproduction control section 343 of the reproduction control module 324 of the specified time input via the bar 103. FIG. The CPU 21 returns to S62.

●再生制御モジュール
図42は再生制御モジュール324によって実行される再生制御を示している。
● Playback Control Module FIG. 42 shows playback control executed by the playback control module 324 .

S71でCPU21(ログデータ取得部344)はPLC1からログデータ73を取得し、記憶装置22に格納する。 In S<b>71 , the CPU 21 (log data acquisition unit 344 ) acquires the log data 73 from the PLC 1 and stores it in the storage device 22 .

S72でCPU21(再生制御部343)は内部時計の時刻を初期化する。 In S72, the CPU 21 (playback control unit 343) initializes the time of the internal clock.

S73でCPU21(再生制御部343)は内部時計の時刻を取得し、時刻を時刻デバイス342に格納する。 In S<b>73 , the CPU 21 (playback control unit 343 ) acquires the time of the internal clock and stores the time in the time device 342 .

S74でCPU21(再生制御部343)は時刻デバイス342に保持されている表示時刻に対応するデバイス値をログデータ73から取得し、ログデバイス345に格納する。これにより、デバイス値提供部341はプログラム表示モジュール321や波形表示モジュール322に対してデバイス値と表示時刻とを提供可能となる。 In S<b>74 , the CPU 21 (playback control unit 343 ) acquires the device value corresponding to the display time held in the time device 342 from the log data 73 and stores it in the log device 345 . This enables the device value providing unit 341 to provide device values and display times to the program display module 321 and waveform display module 322 .

S75でCPU21(再生制御部343)は表示時刻制御部331から時刻指定を受信したかどうかを判定する。時刻指定を受信していれば、CPU21はS76に進む。時刻指定を受信していなければ、CPU21はS77に進む。 In S<b>75 , the CPU 21 (playback control unit 343 ) determines whether or not the time specification has been received from the display time control unit 331 . If the time designation has been received, the CPU 21 proceeds to S76. If the time designation has not been received, the CPU 21 proceeds to S77.

S76でCPU21(再生制御部343)は表示時刻制御部331からの時刻指定にしたがって内部時計の時刻を変更する。 In S76, the CPU 21 (reproduction control section 343) changes the time of the internal clock according to the time designation from the display time control section 331. FIG.

S77でCPU21(再生制御部343)は表示時刻制御部331から更新速度の変更指示を受信したかどうかを判定する。変更指示を受信していれば、CPU21はS78に進む。変更指示を受信していなければ、CPU21はS73に進む。 In S<b>77 , the CPU 21 (playback control unit 343 ) determines whether or not an update speed change instruction has been received from the display time control unit 331 . If the change instruction has been received, the CPU 21 proceeds to S78. If no change instruction has been received, the CPU 21 proceeds to S73.

S78でCPU21(再生制御部343)は表示時刻制御部331から指定された更新速度にしたがって内部時計の更新速度を変更する。その後、CPU21はS73に進む。 In S78, the CPU 21 (playback control unit 343) changes the update speed of the internal clock according to the update speed specified by the display time control unit 331. FIG. After that, the CPU 21 proceeds to S73.

<プログラム部品の絞り込み>
PC2はログ設定に際してロギング対象となるデバイスを抽出したり、ログを表示する際に特定のデバイスに関連した他のデバイスを抽出したりする。この抽出処理を説明するために、以下のような例が採用される。
<Narrowing down program parts>
The PC 2 extracts devices to be logged when setting logs, and extracts other devices related to a specific device when displaying logs. To explain this extraction process, the following example is taken.

図43はラダープログラムを構成する複数のモジュールを示している。この例では、次のようなPLC1が想定されている。ワークが搬送ベルトにより搬送される。ワーク検知センサがワークを検知すると、高さセンサがワークの高さを計測し、奥行センサがワークの奥行を計測する。ワークの高さが所定範囲内になければ、測定NGと判定される。同様に、ワークの奥行が所定範囲内になければ、測定NGと判定される。図43にはこれらの一連の処理を実現するためのプログラムモジュールが記載されている。各モジュールは接点系命令(入力系命令)と出力系命令とを含む。接点系命令は、出力系命令を実行するための条件である。 FIG. 43 shows a plurality of modules that constitute a ladder program. In this example, the following PLC1 is assumed. A work is conveyed by a conveying belt. When the work detection sensor detects the work, the height sensor measures the height of the work, and the depth sensor measures the depth of the work. If the height of the work is not within the predetermined range, it is determined that the measurement is NG. Similarly, if the depth of the work is not within the predetermined range, it is determined that the measurement is NG. FIG. 43 describes program modules for realizing a series of these processes. Each module includes contact system commands (input system commands) and output system commands. A contact system command is a condition for executing an output system command.

ワーク検知モジュールB1においてデバイスMR000はワークを検知するとONとなるリレーデバイスである。デバイスMR0002PLC1が自動運転中である場合にONとなるリレーデバイスである。デバイスMR001は、拡張ユニット4に測定開始を指示するためのリレーデバイスである。デバイスMR000は、自動運転中にワークが検知されると、ONとなる。 Device MR000 in workpiece detection module B1 is a relay device that turns ON when a workpiece is detected. It is a relay device that is turned ON when the device MR0002PLC1 is in automatic operation. Device MR001 is a relay device for instructing expansion unit 4 to start measurement. The device MR000 is turned ON when a workpiece is detected during automatic operation.

測定モジュールB2において接点系命令にはMR001がONになると、出力系命令を実行することが記述されている。この例では、拡張ユニット4により取得された高さの計測値がデバイスEM0に格納されており、これをデバイスTM100にコピーすることが記述されている。同様に、拡張ユニット4により取得された奥行の計測値がデバイスEM2に格納されており、これをデバイスTM101にコピーすることが記述されている。さらに、測定完了を管理するためのデバイスMR003がONに設定される。 In the measurement module B2, the contact system command describes that when MR001 is turned ON, the output system command is executed. In this example, it is described that the height measurement value acquired by the expansion unit 4 is stored in the device EM0 and copied to the device TM100. Similarly, it describes that the depth measurement value acquired by the expansion unit 4 is stored in the device EM2 and is copied to the device TM101. Furthermore, the device MR003 for managing the completion of measurement is set to ON.

判定モジュールB3は、デバイスMR003がONになると、つまり測定が完了されると実行されるモジュールである。ここでは、測定結果が合格条件を満たさなければ、デバイスMR010がONになる。これは測定NGを意味する。より具体的には、デバイスTM100に格納されている高さの計測値が95未満であれば、MR010がONになる。デバイスTM100に格納されている高さの計測値が105を超えていれば、MR010がONになる。デバイスTM101に格納されている奥行の計測値が35未満であれば、MR010がONになる。デバイスTM100に格納されている奥行の計測値が45を超えていれば、MR010がONになる。 The determination module B3 is a module that is executed when the device MR003 is turned ON, that is, when the measurement is completed. Here, the device MR010 is turned ON if the measurement result does not satisfy the acceptance condition. This means measurement NG. More specifically, if the measured height value stored in device TM100 is less than 95, MR010 is turned ON. If the height measurement stored in device TM100 exceeds 105, MR010 is turned ON. If the depth measurement value stored in the device TM101 is less than 35, MR010 is turned ON. If the depth measurement value stored in device TM100 exceeds 45, MR010 is turned ON.

エラー処理モジュールB4は何らかのエラーが発生すると、搬送ベルトの搬送を停止するためのモジュールである。この例では、MR010がON(測定NG)になるか、または、MR012がON(強制停止)になるか、または、MR013がON(搬送NG)になると、MR011がオン(搬送停止)になる。 The error processing module B4 is a module for stopping the conveying of the conveying belt when an error occurs. In this example, when MR010 turns ON (measurement NG), MR012 turns ON (forced stop), or MR013 turns ON (conveyance NG), MR011 turns ON (conveyance stop).

図43からわかるように、あるモジュールの接点系命令に記述されているデバイスは、他のモジュールの出力系命令に記述されている。逆に、あるモジュールの出力系命令に記述されているデバイスは、他のモジュールの接点系命令に記述されている。たとえば、ワーク検知モジュールB1の出力系命令に記述されているデバイスMR001は、測定モジュールB2の接点系命令に記述されている。よって、ワーク検知モジュールB1と測定モジュールB2とは相互に関連したモジュールとして抽出される。次に、測定モジュールB2の出力系命令に記述されているデバイスMR003に着目すると、MR003は判定モジュールB3の接点系命令に記述されていることがわかる。よって、測定モジュールB2と判定モジュールB3とは相互に関連したモジュールとして抽出される。次に、判定モジュールB3の出力系命令に記述されているデバイスMR010に着目すると、MR010はエラー処理モジュールB4の接点系命令に記述されていることがわかる。よって、判定モジュールB3とエラー処理モジュールB4とは相互に関連したモジュールとして抽出される。このようにある特定処理に関与する複数のモジュールと、複数のモジュールの内部に記述されている複数のデバイスが抽出される。これらの抽出処理はデバイス抽出部53によって実行される。デバイス抽出部53は、ログ表示部61に実装されてもよい。つまり、ログ表示部61は、相互に関連した複数のモジュールを抽出し、さらに、抽出された複数のモジュールに記述されている複数のデバイスを抽出し、抽出された複数のデバイスの各デバイス値をログデータ73から取得して、表示部7に表示してもよい。 As can be seen from FIG. 43, a device described in a contact system command of a certain module is described in an output system command of another module. Conversely, a device described in an output system command of one module is described in a contact system command of another module. For example, the device MR001 described in the output system command of the workpiece detection module B1 is described in the contact system command of the measurement module B2. Therefore, the workpiece detection module B1 and the measurement module B2 are extracted as mutually related modules. Focusing on the device MR003 described in the output system command of the measurement module B2, it can be seen that MR003 is described in the contact system command of the determination module B3. Therefore, the measurement module B2 and the determination module B3 are extracted as mutually related modules. Next, focusing on the device MR010 described in the output system command of the determination module B3, it can be seen that MR010 is described in the contact system command of the error processing module B4. Therefore, the determination module B3 and the error processing module B4 are extracted as mutually related modules. In this way, a plurality of modules involved in a specific process and a plurality of devices described inside the plurality of modules are extracted. These extraction processes are executed by the device extraction unit 53 . The device extraction section 53 may be implemented in the log display section 61 . That is, the log display unit 61 extracts a plurality of mutually related modules, further extracts a plurality of devices described in the plurality of extracted modules, and displays each device value of the plurality of extracted devices. It may be acquired from the log data 73 and displayed on the display unit 7 .

図44は抽出結果を表示するUI500を示している。ログ表示部61やデバイス抽出部53は、ユーザプログラムから抽出されたデバイスとブロック(プログラム部品)とを表示するUI500を作成し、表示部7に表示してもよい。UI500はデバイスとプログラム部品の抽出結果を簡易に表示することができる。よって、ユーザは、抽出結果の全体像を把握しやすいであろう。ログ表示部61やデバイス抽出部53は、UI500に含まれているいずれかブロックがポインタ101によりクリックされると、クリックされたブロックの詳細をUI501に表示してもよい。これにより、ユーザは抽出されたブロックの詳細に迅速にアクセスできるようになろう。ログ表示部61やデバイス抽出部53は、図43に例示されたUIを使用して抽出結果を表示してもよい。 FIG. 44 shows a UI 500 displaying extraction results. The log display unit 61 and the device extraction unit 53 may create a UI 500 that displays the devices and blocks (program parts) extracted from the user program, and display the UI 500 on the display unit 7 . The UI 500 can simply display the results of extracting devices and program parts. Therefore, the user can easily grasp the overall image of the extraction result. When any block included in the UI 500 is clicked by the pointer 101 , the log display unit 61 and the device extraction unit 53 may display the details of the clicked block on the UI 501 . This would allow the user to quickly access the details of the extracted block. The log display unit 61 and the device extraction unit 53 may display the extraction result using the UI illustrated in FIG.

<ブロックおよびデバイスの抽出処理>
図45はデバイス抽出部53が実行するブロックおよびデバイスの抽出処理を示している。ここではプロジェクトデータ71には、複数のブロック(プログラム部品)が含まれている。よって、デバイス抽出部53はプロジェクトデータ71を参照し、ブロックやデバイスを抽出する。
<Block and device extraction processing>
FIG. 45 shows block and device extraction processing executed by the device extraction unit 53 . Here, the project data 71 includes multiple blocks (program parts). Therefore, the device extraction unit 53 refers to the project data 71 and extracts blocks and devices.

S81でCPU21(デバイス抽出部53)は操作部8を通じたブロックの選択を受け付ける。なお、デバイス抽出部53は操作部8を通じたデバイスの指定を受け付けてもよい。この場合、デバイス抽出部53は、指定されたデバイスを記述している一つ以上のブロックを抽出してもよい。複数のブロックが抽出された場合、デバイス抽出部53は、複数のブロックから一つのブロックについてのユーザ選択を受け付けてもよい。このようなデバイスとしては、たとえば、デバッグにおいてユーザが着目するデバイスであろう。ユーザはログ設定部51を通じて、PLC1の出力部84にログデータ73を出力するための条件(例:保存トリガ)を設定する。より具体的には、特定のリレーデバイスがオンになったことなどを条件として設定する。よって、デバイス抽出部53は、保存トリガーとして設定されたリレーデバイスを指定してもよい。 In S<b>81 , the CPU 21 (device extraction unit 53 ) accepts block selection through the operation unit 8 . Note that the device extraction unit 53 may accept device designation through the operation unit 8 . In this case, the device extractor 53 may extract one or more blocks describing the specified device. When multiple blocks are extracted, the device extraction unit 53 may accept user selection of one block from the multiple blocks. Such a device is, for example, a device that the user pays attention to during debugging. The user sets conditions (eg, save trigger) for outputting the log data 73 to the output unit 84 of the PLC 1 through the log setting unit 51 . More specifically, the condition is set such that a specific relay device is turned on. Therefore, the device extraction unit 53 may designate a relay device set as a save trigger.

S82でCPU21(デバイス抽出部53)は選択されたブロックの接点系命令に記述されているデバイスを抽出する。 In S82, the CPU 21 (device extraction unit 53) extracts the device described in the contact system command of the selected block.

S83でCPU21(デバイス抽出部53)は抽出されたデバイスを出力系命令に記述されている他のブロックを検索する。 In S83, the CPU 21 (device extraction unit 53) searches for the extracted device in another block described in the output system command.

S84でCPU21(デバイス抽出部53)は抽出されたデバイスを出力系命令に記述されている他のブロックが発見されたかどうかを判定する。他のブロックが発見されなければ、CPU21は抽出処理を終了する。他のブロックが発見されると、CPU21はS85に進む。 In S84, the CPU 21 (device extraction unit 53) determines whether or not another block in which the extracted device is described in the output system command is found. If no other block is found, the CPU 21 terminates the extraction process. If another block is found, the CPU 21 proceeds to S85.

S85でCPU21(デバイス抽出部53)は発見されたブロックを関連ブロックとして抽出する。たとえば、デバイス抽出部53は、関連ブロックを管理するためのリストに、発見されたブロックの識別情報(例:名称やファイル名など)を登録する。 In S85, the CPU 21 (device extraction unit 53) extracts the found block as a related block. For example, the device extraction unit 53 registers identification information (eg, name, file name, etc.) of the found block in a list for managing related blocks.

S86でCPU21(デバイス抽出部53)はデバイスを抽出されるブロックとして関連ブロックを選択する。その後、新たに選択されたブロックについて抽出処理を実行するために、CPU21はS82に戻る。S86で、選択される関連ブロックは、まだデバイス抽出対象として選択されたことがないブロックである。リストに登録されているすべてのブロックについてデバイス抽出処理が完了していれば、デバイス抽出部53は抽出処理を終了する。CPU21(デバイス抽出部53)は、抽出したデバイスと、当該デバイスを抽出されたブロックとの関係を示すリストを作成してもよい。デバイス抽出部53またはログ表示部61はこれらのリストを参照し、図43に示されたUIや、図44に示されたUI500、501を作成してもよい。 In S86, the CPU 21 (device extraction unit 53) selects a related block as a block from which the device is extracted. After that, the CPU 21 returns to S82 in order to execute the extraction process for the newly selected block. In S86, the related blocks selected are blocks that have not yet been selected as devices to be extracted. If the device extraction process has been completed for all blocks registered in the list, the device extraction unit 53 ends the extraction process. The CPU 21 (device extraction unit 53) may create a list showing the relationship between the extracted devices and the blocks from which the devices are extracted. The device extraction unit 53 or the log display unit 61 may refer to these lists to create the UI shown in FIG. 43 and the UIs 500 and 501 shown in FIG.

<デバッグの具体例>
図46はユーザが実行するデバッグ処理を示している。
<Specific example of debugging>
FIG. 46 shows the debugging process executed by the user.

S91でユーザはログ設定部51を通じてログデータ73の保存条件としてNG判定を設定する。図43によれば、NG判定を管理するデバイスMR010がONになったことがログデータ73の保存条件に決定される。ユーザはプロジェクトデータ71とログ設定データ72をPLC1に転送する。 In S<b>91 , the user sets the NG determination as a storage condition for the log data 73 through the log setting unit 51 . According to FIG. 43, it is determined as the storage condition of the log data 73 that the device MR010 that manages the NG determination is turned ON. The user transfers project data 71 and log setting data 72 to PLC1.

S92でユーザはPLC1を稼働させる。PLC1はプロジェクトデータ71を実行し、ログ設定データ72における保存条件が満たされるとログデータ73をメモリカード36に保存する。図43に示された例ではNG判定が発生すると、搬送ベルトが停止するため、ユーザは何らかのエラーが発生したことを知る。 At S92, the user activates the PLC1. The PLC 1 executes the project data 71 and saves the log data 73 in the memory card 36 when the saving conditions in the log setting data 72 are satisfied. In the example shown in FIG. 43, when an NG judgment occurs, the conveyor belt stops, so the user knows that some kind of error has occurred.

S93でユーザはワークを確認し、NG判定が誤検知かどうかを判断する。たとえば、ユーザはワークの高さや奥行を実測し、合格条件を満たしているかどうかを判断する。ワークが合格条件を満たしていなければ、ユーザはNG判定を誤検知と判断する。 In S93, the user checks the work and determines whether the NG determination is an erroneous detection. For example, the user actually measures the height and depth of the workpiece and determines whether or not the acceptance conditions are met. If the workpiece does not meet the pass conditions, the user judges the NG judgment as an erroneous detection.

S94でユーザはPLC1からメモリカード36を取り外し、メモリカード36をPC2に接続し、メモリカード36に保存されているログデータ73を再生する。プログラム表示モジュール321はログデータ73に含まれているデバイス値をユーザプログラムと関連付けて表示する。より具体的には、プログラム表示モジュール321は、保存条件として採用されたデバイスMR010を指定し、デバイス抽出部53にブロックとデバイスの抽出処理を実行させ、図43に示されたUIや、図44に示されたUI500、501を表示する。さらに、波形表示モジュール322は、プログラム表示モジュール321により表示されているデバイス値を波形化して表示する。たとえば、EM0に保持されているワークの高さの計測値やEM2に保持されているワークの奥行が波形化されて表示部7に表示される。また、ワーク検知を管理するデバイスMR000のデバイス値も波形化されて表示される。ユーザはこれらの波形を観察し、ワーク検知センサのチャタリングが誤検知の原因であることを突き止める。ユーザは、チャタリング対策のために編集部311を操作し、図47が示すようにワーク検知モジュールB1を修正する。この修正によれば、ワーク検知センサにより1秒以上にわたり連続してワークが検知されたときに、測定開始のためのデバイスMR001がオンになる。ユーザは、更新されたプロジェクトデータ71をPLC1に転送し、PLC1を稼働させ、チャタリング対策が成功したかどうかを判断する。 In S94, the user removes the memory card 36 from the PLC 1, connects the memory card 36 to the PC 2, and reproduces the log data 73 stored in the memory card 36. FIG. The program display module 321 displays the device values included in the log data 73 in association with the user program. More specifically, the program display module 321 designates the device MR010 adopted as the storage condition, causes the device extraction unit 53 to execute block and device extraction processing, and displays the UI shown in FIG. 43 and the UI shown in FIG. to display the UIs 500 and 501 shown in . Further, the waveform display module 322 converts the device values displayed by the program display module 321 into waveforms and displays them. For example, the measured value of the height of the work held in EM0 and the depth of the work held in EM2 are displayed on the display unit 7 in waveform form. Also, the device value of the device MR000 that manages workpiece detection is displayed as a waveform. The user observes these waveforms and finds out that the chattering of the workpiece detection sensor is the cause of the erroneous detection. The user operates the editing unit 311 for chattering countermeasures, and corrects the workpiece detection module B1 as shown in FIG. According to this modification, the device MR001 for starting measurement is turned on when the work detection sensor continuously detects a work for one second or longer. The user transfers the updated project data 71 to the PLC 1, activates the PLC 1, and determines whether or not chattering countermeasures have succeeded.

このようにユーザプログラムとデバイス値の波形とを同期して表示することで、誤検知の原因の特定と、原因を解消するためのユーザプログラムのデバッグとをユーザは効率よく実行できるようになる。 By synchronously displaying the user program and the waveform of the device value in this way, the user can efficiently identify the cause of the false detection and debug the user program to eliminate the cause.

<まとめ>
図17に示したように実行部80はユーザプログラムを繰り返し実行するプログラム実行部の一例である。デバイス部34はプログラム実行部により参照される記憶領域である複数のデバイスを有するデバイス記憶部の一例である。記録部81は複数のデバイスのいずれかに記憶されているデバイス値を時系列に記録するデバイス記録部の一例である。PC2はプログラマブルロジックコントローラに接続され、ユーザプログラムの作成を支援するプログラム作成支援装置の一例である。
<Summary>
As shown in FIG. 17, the execution unit 80 is an example of a program execution unit that repeatedly executes a user program. The device section 34 is an example of a device storage section having a plurality of devices, which are storage areas referenced by the program execution section. The recording unit 81 is an example of a device recording unit that chronologically records device values stored in any one of a plurality of devices. The PC 2 is an example of a program creation support device that is connected to a programmable logic controller and supports creation of user programs.

図6に示したようにプロジェクト作成部50は、表示部7を介したユーザ入力に基づいて、ユーザプログラムを構成する複数のプログラム部品であって複数のデバイスのいずれかに関する命令語を含むプログラム部品を作成するプログラム作成部の一例である。部品指定部52は、複数のプログラム部品のうちデバイス記録部による記録対象となる特定のデバイスを抽出されるプログラム部品を指定するプログラム部品指定部の一例である。デバイス抽出部53はプログラム部品指定部により指定されたプログラム部品を解析して当該プログラム部品に記述されているデバイスを抽出するデバイス抽出部の一例である。基本ユニット3の記録部81は、デバイス抽出部により記録対象として抽出された特定のデバイスに記憶されているデバイス値を時系列に記録するように構成されている。 As shown in FIG. 6, the project creating unit 50 generates a plurality of program parts constituting a user program, which include instruction words related to one of a plurality of devices, based on a user input through the display unit 7. is an example of a program creation unit that creates The component specifying unit 52 is an example of a program component specifying unit that specifies a program component from which a specific device to be recorded by the device recording unit is extracted from among a plurality of program components. The device extractor 53 is an example of a device extractor that analyzes a program part specified by the program part specification part and extracts a device described in the program part. The recording unit 81 of the basic unit 3 is configured to chronologically record the device values stored in the specific devices extracted as recording targets by the device extraction unit.

このようにユーザはプログラム部品を指定することで、指定されたプログラム部品からデバイスが抽出される。また、ユーザは、特定のプログラム部品を、デバイスの抽出対象から除外することもできる。よって、PLCにおいてロギングの対象となるデバイスのユーザによる登録負担が軽減される。 By designating a program part by the user in this way, a device is extracted from the designated program part. The user can also exclude specific program parts from devices to be extracted. Therefore, the registration burden on the user of the device to be logged in the PLC is reduced.

なお、抽出部53はプログラム作成部63により作成されたプログラム部品を解析して、当該プログラム部品に記述されているデバイスを抽出してもよい。部品指定部52は、プログラム作成部63により作成された複数のプログラム部品のうち、記録部81の記録対象となる特定のデバイスが使用または記述されたプログラム部品を、プログラム部品を単位として(プログラム部品ごとに)指定してもよい。この場合、記録部81は、抽出部53により抽出されたデバイスであって、かつ、部品指定部52により指定されたプログラム部品に使用または記述される特定のデバイスに記憶されているデバイス値を時系列に記録する。 Note that the extraction unit 53 may analyze the program parts created by the program creation part 63 and extract the devices described in the program parts. The component designation unit 52 selects, among the plurality of program components created by the program creation unit 63, program components in which a specific device to be recorded by the recording unit 81 is used or described in units of program components (program components per) may be specified. In this case, the recording unit 81 stores the device value stored in the specific device extracted by the extracting unit 53 and used or described in the program part specified by the part specifying unit 52 at a time. Record in series.

抽出部53は、プログラム作成部63により作成された複数のプログラム部品を解析して、各プログラム部品ごとに使用または記述されているデバイスを抽出してもよい。部品指定部52は、プログラム作成部63により作成された複数のプログラム部品のうち少なくとも一つのプログラム部品を指定してもよい。記録部81は、抽出部53により解析された複数のプログラム部品のうち、部品指定部52により指定されたプログラム部品に使用または記述されるデバイスに記憶されているデバイス値を時系列に記録する。たとえば、予め複数のプログラム部品が解析されて、複数のデバイスが抽出されてもよい。つまり、各プログラム部品ごとに、抽出されたデバイスを示すリストが作成されてもよい。さらにユーザがいずれかのプログラム部品を指定すると、指定されたプログラム部品についてのリストが読み出され、そのリストに掲載されているデバイスが記録対象として選択されてもよい。 The extraction unit 53 may analyze a plurality of program parts created by the program creation part 63 and extract devices used or described for each program part. The component specifying unit 52 may specify at least one program component among the plurality of program components created by the program creating unit 63 . The recording unit 81 chronologically records the device values stored in the devices used or described in the program parts specified by the component specifying unit 52 among the plurality of program components analyzed by the extracting unit 53 . For example, multiple program parts may be analyzed in advance to extract multiple devices. That is, a list showing the extracted devices may be created for each program part. Furthermore, when the user designates any program part, a list of the designated program parts may be read, and devices listed on the list may be selected as recording targets.

部品指定部52は、プログラム作成部63により作成された複数のプログラム部品のうち少なくとも一つのプログラム部品を指定するように構成されていてもよい。抽出部53は、部品指定部52により指定されたプログラム部品を解析して、当該プログラム部品ごとに使用または記述されるデバイスを抽出してもよい。記録部81は、抽出部53により抽出された特定のデバイスに記憶されているデバイス値を時系列に記録する。このように、プログラム部品が指定された後でデバイスの抽出が実行されてもよい。これにより抽出処理が軽くなろう。 The component specifying unit 52 may be configured to specify at least one program component among the plurality of program components created by the program creating unit 63 . The extraction unit 53 may analyze the program components specified by the component specification unit 52 and extract devices used or described for each program component. The recording unit 81 chronologically records the device values stored in the specific device extracted by the extraction unit 53 . In this way, device extraction may be performed after program parts are specified. This will lighten the extraction process.

抽出部53は、プログラム作成部63により作成された複数のプログラム部品を解析して、各プログラム部品ごとに使用又は記述されるデバイスを抽出してもよい。部品指定部52は、プログラム作成部63により作成された複数のプログラム部品のうち記録対象または除外対象となる少なくとも一つのプログラム部品を指定してもよい。記録部81は、抽出部53により複数のプログラム部品から抽出されたデバイスのうち、部品指定部52により記録対象として指定されたプログラム部品に使用または記述されている特定のデバイスに記憶されているデバイス値を時系列に記録し、部品指定部52により除外対象として指定されたプログラム部品以外のプログラム部品に使用されているデバイスを記録するように構成されていてもよい。たとえば、モジュールAがデバイスメモリDM0、DM1を使用し、モジュールBがデバイスメモリDM1、DM2を使用する場合、モジュールA、BからデバイスメモリDM0、DM1、DM2が抽出される。ここで、モジュールBが除外対象として指定されると、DM2が除外されるものの、DM1はモジュールAでも使用されるため、DM1は記録対象として残る。このようにプログラム部品を単位として(つまりプログラム部品ごとに)、デバイスの加除が実行されてもよい。また、すべてのプログラム部品からデバイスが抽出された後で記録対象となるプログラム部品や除外対象となるプログラム部品が指定されてもよい。 The extraction unit 53 may analyze a plurality of program components created by the program creation unit 63 and extract devices used or described for each program component. The component specifying unit 52 may specify at least one program component to be recorded or excluded among the plurality of program components created by the program creating unit 63 . The recording unit 81 selects a device stored in a specific device used or described in a program part specified as a recording target by the part specifying unit 52 from among the devices extracted from the plurality of program parts by the extracting unit 53. Values may be recorded in chronological order, and devices used in program parts other than program parts specified as exclusion targets by the part specifying unit 52 may be recorded. For example, if module A uses device memories DM0 and DM1 and module B uses device memories DM1 and DM2, then from modules A and B device memories DM0, DM1 and DM2 are extracted. Here, when module B is designated as an exclusion target, DM2 is excluded, but DM1 is also used in module A, so DM1 remains as a recording target. In this way, device addition/removal may be performed in units of program parts (that is, for each program part). Alternatively, program parts to be recorded or excluded may be specified after devices have been extracted from all program parts.

部品指定部52は、複数のプログラム部品のうち、特定のデバイスを抽出されないプログラム部品を除外対象として指定するように構成されていてもよい。デバイス抽出部53は、部品指定部52によりデバイスの抽出対象として指定されたプログラム部品を解析して当該プログラム部品に使用または記述されるデバイスを抽出し、除外対象として指定されたプログラム部品からデバイスを抽出しないように構成されてもよい。つまり、削除部55や追加部54はデバイス抽出部により抽出された特定のデバイスのうち一部の特定のデバイスを、プログラム部品ごとに削除するか、または、デバイス抽出部により抽出されなかったデバイスをプログラム部品ごとに追加するデバイス加除部として機能してもよい。 The component specifying unit 52 may be configured to specify a program component from which a specific device is not extracted among a plurality of program components as an exclusion target. The device extracting unit 53 analyzes the program parts specified as devices to be extracted by the parts specifying unit 52, extracts the devices used or described in the program parts, and extracts the devices from the program parts specified as exclusion targets. It may be configured not to extract. In other words, the deletion unit 55 and the addition unit 54 delete some specific devices among the specific devices extracted by the device extraction unit for each program part, or delete devices that were not extracted by the device extraction unit. It may function as a device addition/removal unit that is added for each program part.

プログラム部品は、たとえば、再利用可能なプログラムモジュールであってもよい。複数のプログラム部品は、それぞれ個別のファイルに格納されていてもよい。複数のプログラム部品は、それぞれ個別にアクセス権限(編集権限)が設定されてもよい。 A program part may be, for example, a reusable program module. A plurality of program parts may be stored in separate files. Access authority (edit authority) may be set individually for each of the plurality of program parts.

ユーザプログラムは、たとえば、ラダープログラムであってもよい。この場合、複数のプログラム部品は、ラダープログラム内で使用または記述される複数のファンクションブロックであってもよい。 A user program may be, for example, a ladder program. In this case, the multiple program parts may be multiple function blocks used or described within the ladder program.

検知部82は、複数のデバイスのうちのいずれかのデバイスに対する外部機器からのデバイス値の書き換えを検知する検知部の一例である。記録部81は、検知部82によりデバイス値の書き換えが検知されたデバイスを記録対象に追加してもよい。 The detection unit 82 is an example of a detection unit that detects rewriting of a device value from an external device to any one of a plurality of devices. The recording unit 81 may add a device whose device value has been detected by the detection unit 82 to be recorded.

PLC1は、着脱可能なメモリカード36と、メモリカード36に対する命令を検知し、当該命令の対象となっているデバイスを特定する特定部57とをさらに有してもよい。図6においては特定部57がPC2に設けられているが、基本ユニット3のCPU31に実装されてもよい。記録部81は、特定部57により特定されたデバイスを記録対象に追加してもよい。 The PLC 1 may further include a detachable memory card 36 and an identification unit 57 that detects commands to the memory card 36 and identifies the device that is the target of the command. Although the identification unit 57 is provided in the PC 2 in FIG. 6, it may be mounted in the CPU 31 of the basic unit 3. The recording unit 81 may add the device identified by the identifying unit 57 to the recording target.

PLC1の拡張ユニット4は位置決め機能を有するモーションユニット(位置決めユニット)であってもよい。記録部81またはデバイス抽出部53は、位置決め機能に利用されるデバイスであってユーザプログラムにおいて記述されていないデバイス(例:モーションユニット内のバッファメモリなど)を記録対象に追加してもよい。 The extension unit 4 of the PLC 1 may be a motion unit (positioning unit) having a positioning function. The recording unit 81 or the device extraction unit 53 may add a device that is used for the positioning function and is not described in the user program (eg, buffer memory in the motion unit, etc.) to the recording target.

推定部59は、デバイス抽出部53により記録対象として抽出されたデバイスの数に基づき記録部81によるデバイス値の記録がユーザプログラムの実行に与える影響を推定する推定部の一例である。表示部7は、この影響を表示するように構成されていてもよい。これにより、ユーザは、スキャンタイムへの影響を加味しつつ、デバイスを加除することが可能となる。 The estimating unit 59 is an example of an estimating unit that estimates the effect of the recording of device values by the recording unit 81 on the execution of the user program based on the number of devices extracted as recording targets by the device extracting unit 53 . The display 7 may be arranged to display this effect. This allows the user to add or remove devices while considering the impact on scan time.

図7においては、選択されたプログラム部品からのデバイスの抽出と、選択された機能からのデバイスの抽出と、ユーザによるデバイスの手動追加とが記載されている。しかし、これらのすべてが必須というわけではない。これらのうち二つ以上が採用されれば十分であろう。あるいは、選択されたプログラム部品からのデバイスの抽出だけが採用されてもよいし、選択された機能からのデバイスの抽出だけが採用されてもよい。 In FIG. 7, extraction of devices from selected program parts, extraction of devices from selected functions, and manual addition of devices by the user are described. However, not all of these are required. It would be sufficient if two or more of these were employed. Alternatively, only device derivation from selected program parts may be employed, or device derivation only from selected functions may be employed.

CPU31や実行部80は、ユーザプログラムを繰り返し実行するプログラム実行エンジンの一例である。CPU31や実行部80、CPU41は、ユーザプログラムからの指令に基づいて、各々がユーザプログラムに関する異なる機能(例:機能プログラム)を実行する複数の機能実行エンジンの一例である。これは、基本ユニット3が拡張ユニット4の機能を内包してもよいことを示唆している。機能プログラムは、たとえば、モーション制御プログラムである。プログラム実行エンジンや複数の機能実行エンジンは、単一のCPUにより実行されてもよいし、複数のCPUにより実行されてもよいし、ASICまたはFPGAにより実現されてもよい。また、単一のCPUがマルチコアを搭載しており、各コアがそれぞれ異なる機能を担当していてもよい。 The CPU 31 and the execution unit 80 are examples of a program execution engine that repeatedly executes the user program. The CPU 31, the execution unit 80, and the CPU 41 are examples of a plurality of function execution engines that each execute different functions (eg, function programs) related to the user program based on instructions from the user program. This suggests that the base unit 3 may contain the functionality of the expansion unit 4 . A function program is, for example, a motion control program. A program execution engine and a plurality of function execution engines may be executed by a single CPU, may be executed by a plurality of CPUs, and may be realized by ASIC or FPGA. Also, a single CPU may be equipped with multiple cores, and each core may be in charge of a different function.

デバイス部34はログラム実行エンジンと複数の機能実行エンジンにより参照される記憶領域である複数のデバイスを有するデバイス記憶部の一例である。記録部81は、複数のデバイスのいずれかに記憶されているデバイス値を時系列に記録するデバイス記録部の一例である。機能設定部62は、複数の機能実行エンジンの各々にて使用される複数のデバイスを割り付ける割付部として機能してもよい。機能指定部60は、複数の機能実行エンジンに対応する複数の機能のうち一つ以上の機能を指定する指定部として機能してもよい。デバイス抽出部53は、割付部により割り付けられた複数のデバイスから、指定部により指定された一つ以上の機能のために使用されるデバイスをデバイス記録部の記録対象として抽出してもよい。 The device section 34 is an example of a device storage section having a plurality of devices, which are storage areas referenced by a program execution engine and a plurality of function execution engines. The recording unit 81 is an example of a device recording unit that chronologically records device values stored in any one of a plurality of devices. The function setting section 62 may function as an allocating section that allocates a plurality of devices to be used in each of the plurality of function execution engines. The function designation unit 60 may function as a designation unit that designates one or more of a plurality of functions corresponding to a plurality of function execution engines. The device extraction unit 53 may extract devices used for one or more functions specified by the specification unit from the plurality of devices assigned by the assignment unit as recording targets of the device storage unit.

プログラム実行エンジンは、メインユニットに設けられてもよい。複数の機能実行エンジンのうちの少なくとも一つは、メインユニットの機能を拡張するために該メインユニットと電気的に接続される機能拡張ユニットに設けられていてもよい。複数の機能実行エンジンのすべてがメインユニットに設けられてもよい。 The program execution engine may be provided in the main unit. At least one of the plurality of function execution engines may be provided in a function expansion unit electrically connected to the main unit to expand the function of the main unit. All of the multiple function execution engines may be provided in the main unit.

基本ユニット3は、プログラム実行部と、デバイス記憶部と、デバイス記録部とを有するメインユニットの一例である。拡張ユニット4は、メインユニットの機能を拡張するために該メインユニットと電気的に接続される機能拡張ユニットの一例である。 The basic unit 3 is an example of a main unit having a program execution section, a device storage section, and a device recording section. The expansion unit 4 is an example of a function expansion unit electrically connected to the main unit to expand the function of the main unit.

機能設定部62は、表示部7を介したユーザ入力に基づいて、メインユニットの機能のために使用されるデバイスと、機能拡張ユニットの機能のために使用されるデバイスとを割り付ける割付部として機能する。機能設定部62は、機能に対してデバイスを割り付けるためのUIを表示部7に表示してもよい。 The function setting unit 62 functions as an allocating unit that allocates devices used for the functions of the main unit and devices used for the functions of the function expansion unit based on user input through the display unit 7. do. The function setting unit 62 may display a UI for assigning devices to functions on the display unit 7 .

機能指定部60は、メインユニットに設けられた機能と機能拡張ユニットに設けられた機能とを含む複数の機能のうち一つ以上の機能を指定する指定部の一例である。デバイス抽出部53の追加部54は、指定部により指定された機能のために使用されるデバイスをデバイス記録部の記録対象として抽出する。デバイス抽出部53の削除部55は、指定部により指定された機能のために使用されるデバイスをデバイス記録部の記録対象から除外する。通信部23は、記録対象として抽出された特定のデバイスに記憶されているデバイス値を時系列にデバイス記録部に記録させるための設定データをPLC1に送信する送信部として機能する。記録部81は、デバイス抽出部53により記録対象として抽出されたデバイスに記憶されているデバイス値を時系列に記録するように構成されている。 The function designation unit 60 is an example of a designation unit that designates one or more of a plurality of functions including functions provided in the main unit and functions provided in the function expansion unit. The adding unit 54 of the device extracting unit 53 extracts the device used for the function specified by the specifying unit as a recording target of the device recording unit. The deletion unit 55 of the device extraction unit 53 excludes the device used for the function designated by the designation unit from the recording target of the device recording unit. The communication unit 23 functions as a transmission unit that transmits to the PLC 1 setting data for recording device values stored in a specific device extracted as a recording target in time series in the device recording unit. The recording unit 81 is configured to chronologically record the device values stored in the devices extracted as recording targets by the device extraction unit 53 .

プロジェクト作成部50は、表示部7を介したユーザ入力に基づいて、複数のデバイスのいずれかに関する命令語を含むユーザプログラムを作成するプログラム作成部として機能する。デバイス抽出部53は、ユーザプログラムを解析し、ユーザプログラムに使用または記述されているデバイスを抽出し、抽出されたデバイスを含むデバイスリスト(抽出リスト)を作成してもよい。さらに、デバイス抽出部53は、機能指定部60により記録対象(抽出対象)として指定された機能のために使用されるデバイスをデバイスリストに追加してもよい。また、削除部55は、機能指定部60により除外対象として指定された機能のために使用されるデバイスをデバイスリストから削除するように構成されていてもよい。デバイスリストはログ設定データ72に含まれている。記録部81は、デバイスリストに登録されているデバイスに記憶されているデバイス値を時系列に記録するように構成されている。 The project creation unit 50 functions as a program creation unit that creates a user program including command words related to any one of a plurality of devices based on user input via the display unit 7 . The device extraction unit 53 may analyze the user program, extract devices used or described in the user program, and create a device list (extraction list) including the extracted devices. Furthermore, the device extraction unit 53 may add to the device list devices used for functions specified as recording targets (extraction targets) by the function specifying unit 60 . Further, the deletion unit 55 may be configured to delete from the device list the device used for the function specified as an exclusion target by the function specifying unit 60 . A device list is included in the log setting data 72 . The recording unit 81 is configured to chronologically record the device values stored in the devices registered in the device list.

機能指定部60は、さらに、メインユニットと機能拡張ユニットとのうちのいずれかユニットを指定するように構成されていてもよい。つまり、機能が選択されてもよいし、ユニットが選択されてもよい。一つのユニットが複数の機能を有している場合、ユーザは一つの機能を選択することで、そのユニットに含まれているすべての機能がデバイスの抽出対象として選択される。デバイス抽出部53は、機能指定部60により記録対象(抽出対象)として指定されたユニットのために使用されるデバイスをデバイス記録部の記録対象として抽出してもよい。また、デバイス抽出部53は、機能指定部60により除外対象として指定されたユニットのために使用されるデバイスをデバイス記録部の記録対象から除外するように構成されてもよい。このようにメインユニットと機能拡張ユニットを単位として抽出対象や除外対象が指定されてもよい。 The function designating section 60 may be further configured to designate either the main unit or the function expansion unit. That is, a function may be selected, or a unit may be selected. When one unit has multiple functions, the user selects one function, and all the functions included in the unit are selected as devices to be extracted. The device extraction section 53 may extract devices used for units specified as recording targets (extraction targets) by the function specifying section 60 as recording targets of the device recording section. Further, the device extracting section 53 may be configured to exclude devices used for units specified as exclusion targets by the function specifying section 60 from recording targets of the device recording section. In this way, extraction targets and exclusion targets may be specified in units of main units and function expansion units.

図14が示すように、機能指定部60は、さらに、記録対象となるデバイスのデバイス種別または除外対象となるデバイスのデバイス種別を指定するように構成されていてもよい。デバイス抽出部53は、機能指定部60により記録対象として指定されたデバイス種別のデバイスをデバイス記録部の記録対象として抽出する。デバイス抽出部53は、指定部により除外対象として指定されたデバイス種別のデバイスをデバイス記録部の記録対象から除外するように構成されていてもよい。 As shown in FIG. 14, the function specifying unit 60 may be further configured to specify the device type of the device to be recorded or the device type of the device to be excluded. The device extraction unit 53 extracts devices of the device type specified as recording targets by the function specifying unit 60 as recording targets of the device recording unit. The device extraction unit 53 may be configured to exclude devices of device types specified as exclusion targets by the specification unit from recording targets of the device recording unit.

図19を用いて説明されたように、収集部92aは複数のデバイスのいずれかに記憶されているデバイス値を収集し、当該デバイス値の収集時刻に関する情報と当該デバイス値とを関連付けて第一バッファに記憶する第一収集部の一例である。なお、収集対象のデバイス値は、ログ設定データ72によって予め設定されてもよい。リングバッファ91aは第一バッファの一例である。収集時刻に関する情報は、たとえば、時刻管理部83aから供給される時刻情報であってもよい。IF99a、99fは拡張ユニット4と通信する第一インタフェースの一例である。通信部33は外部設定機器からユーザプログラムと設定情報とを受け付ける第一の外部インタフェースの一例である。 As described with reference to FIG. 19, the collection unit 92a collects device values stored in one of a plurality of devices, associates the device value with the information on the collection time of the device value, and performs the first It is an example of a first collecting unit that stores in a buffer. Note that the device values to be collected may be set in advance by the log setting data 72 . Ring buffer 91a is an example of a first buffer. The information about the collection time may be, for example, time information supplied from the time management section 83a. The IFs 99a and 99f are examples of first interfaces that communicate with the expansion unit 4. FIG. The communication unit 33 is an example of a first external interface that receives a user program and setting information from an external setting device.

IF99b、99d、99h、99jなどは、メインユニットと通信する第二インタフェースの一例である。画像受信部96aや接続ポート97は二次元データを取得する監視機器に接続され、当該監視機器から当該二次元データを受信する第三インタフェース(二次元データ受信部)の一例である。接続ポート97は、監視機器と接続され、当該監視機器からデータが入力される第二の外部インタフェースとして機能してもよい。カメラ98は監視機器の一例である。監視機器はバーコードリーダであってもよい。この場合、バーコードの読み取り結果は二次元データの一例である。監視機器は、ワークの高さ画像や距離画像を生成する画像処理装置であってもよい。高さ画像や距離画像は二次元データの一例である。二次元データは動画データであってもよい。また、デバイス値と比較してサイズの大きな大容量データも二次元データの一例である。たとえば、高速アナログ入力ユニットによって取得される数値データも二次元データの一例である。機能実行部96は第二の外部インタフェースを介して監視機器からのデータの入力を伴う機能を、受け付けた設定情報に基づいて実行する機能実行部として機能してもよい。 IFs 99b, 99d, 99h, 99j, etc. are examples of second interfaces that communicate with the main unit. The image receiving section 96a and the connection port 97 are examples of a third interface (two-dimensional data receiving section) that is connected to monitoring equipment that acquires two-dimensional data and receives the two-dimensional data from the monitoring equipment. The connection port 97 may be connected to monitoring equipment and function as a second external interface through which data is input from the monitoring equipment. Camera 98 is an example of surveillance equipment. The monitoring device may be a bar code reader. In this case, the bar code reading result is an example of two-dimensional data. The monitoring device may be an image processing device that generates a height image or a distance image of the work. Height images and distance images are examples of two-dimensional data. The two-dimensional data may be video data. Also, large-capacity data that is larger in size than the device value is also an example of two-dimensional data. For example, numerical data obtained by a high-speed analog input unit is also an example of two-dimensional data. The function execution unit 96 may function as a function execution unit that executes a function involving data input from the monitoring device via the second external interface, based on received setting information.

収集部92bは第三インタフェースを介して受信した二次元データを収集し、当該二次元データが取得された取得時刻に関する情報と当該二次元データとを関連付けて第二バッファに記憶する第二収集部の一例である。時刻管理部83が提供する時刻情報は取得時刻に関する情報の一例である。リングバッファ91bは第二バッファの一例である。 The collecting unit 92b collects the two-dimensional data received via the third interface, associates the information about the acquisition time when the two-dimensional data was acquired with the two-dimensional data, and stores the two-dimensional data in the second buffer. is an example. The time information provided by the time management unit 83 is an example of information regarding acquisition time. Ring buffer 91b is an example of a second buffer.

保存部93は所定の保存条件が満たされると、第一バッファに記憶されているデバイス値と収集時刻に関する情報と、第二バッファに記憶されている二次元データと取得時刻に関する情報とを保存する保存部の一例である。 When a predetermined saving condition is satisfied, the saving unit 93 saves the device value and the collection time information stored in the first buffer, and the two-dimensional data and the acquisition time information stored in the second buffer. It is an example of a storage unit.

このようにデバイス値および二次元データにはそれぞれ取得時刻に関する情報が紐付けられている。そのため、二次元データなどの比較的に大容量のデータとデバイス値との時間的な関係を特定しやすくなる。 In this way, the device value and the two-dimensional data are each associated with information about the acquisition time. Therefore, it becomes easier to specify the temporal relationship between relatively large-capacity data such as two-dimensional data and the device value.

監視機器は、静止画又は動画の画像データを取得するカメラで98あってもよい。機能実行部96は、カメラ98から画像データの入力を伴う機能を実行する。第二収集部である収集部92bは、画像データが取得された取得時刻に関する情報と当該画像データとを関連付けて第二バッファに記憶する。保存部93は、デバイス値と、収集時刻に関する情報と、第二バッファに記憶されている画像データと、取得時刻に関する情報とを対応付けて保存してもよい。機能実行部96は、ユーザプログラムの実行周期とは非同期で、監視機器からのデータの入力を伴う機能を実行してもよい。保存部93は、ユーザプログラム及び設定情報を含むプロジェクトデータを併せて保存してもよい。保存部93は、デバイス値、収集時刻に関する情報と、第二バッファに記憶されているデータと、取得時刻に関する情報とを、共通フラグにより識別される複数のファイルに格納し、当該複数のファイルを保存してもよい。 The monitoring equipment may be a camera 98 that captures image data, either still or moving. The function execution unit 96 executes functions associated with input of image data from the camera 98 . The collection unit 92b, which is the second collection unit, associates the information about the acquisition time when the image data was acquired with the image data and stores them in the second buffer. The storage unit 93 may store the device value, the information about the collection time, the image data stored in the second buffer, and the information about the acquisition time in association with each other. The function execution unit 96 may execute a function that involves data input from the monitoring device asynchronously with the execution cycle of the user program. The storage unit 93 may also store project data including user programs and setting information. The storage unit 93 stores the device value, the information about the collection time, the data stored in the second buffer, and the information about the acquisition time in a plurality of files identified by the common flag, and saves the plurality of files. You may save.

収集時刻に関する情報は、時系列に収集された複数のデバイス値の各々について収集時刻を特定可能な情報であればよい。複数のデバイス値の各々について収集時刻が関連付けられていてもよい。あるいは、たとえば、最初のデバイス値についてのみ収集時刻が関連付けられていてもよい。後者の場合、他の情報(スキャン回数やスキャンタイム等)に基づいて、最初のデバイス値以外のデバイス値についての収集時刻が算出されてもよい。デバイス値は、スキャン回数と同じ数だけ記録されることから、それぞれのスキャンにおける処理時間(スキャンタイム)を記憶しておくことで、任意のデバイス値の収集時刻が特定可能となる。例えば、100回目のスキャンで記録されたデバイス値の収集時刻を特定しようとするとき、1回目のスキャンで記録されたデバイス値の収集時刻が10時10分00秒であり、2~100回目の各スキャンは全て100マイクロ秒かかったと仮定する。この場合、10時10分00秒から、100マイクロ秒×99を経過した時刻が、100回目のスキャンで記録されたデバイス値の収集時刻として算出される。このように、全てのデバイス値に収集時刻を関連付けて記録することは必須ではない。 The information about the collection time may be any information that can specify the collection time for each of the plurality of device values collected in chronological order. A collection time may be associated with each of the plurality of device values. Alternatively, for example, only the first device value may have an associated collection time. In the latter case, collection times for device values other than the first device value may be calculated based on other information (number of scans, scan time, etc.). Since the same number of device values as the number of scans is recorded, storing the processing time (scan time) in each scan makes it possible to specify the collection time of any device value. For example, when trying to identify the collection time of the device values recorded in the 100th scan, the collection time of the device values recorded in the 1st scan is 10:10:00, and the 2nd to 100th scans Assume that each scan took 100 microseconds. In this case, the time after 100 microseconds×99 have elapsed from 10:10:00 is calculated as the collection time of the device value recorded in the 100th scan. Thus, it is not essential to record all device values in association with collection times.

取得時刻に関する情報は、時系列に取得された複数の二次元データの各々について取得時刻を特定するための情報であればよい。複数の二次元データの各々について取得時刻が関連付けられていてもよい。あるいは、例えば、最初の二次元データについてのみ取得時刻が関連付けられていてもよい。後者の場合、他の情報(撮像回数や撮像周期等)に基づいて、最初の二次元データ以外の二次元データについての取得時刻を算出することができる。具体的には、複数の二次元データのうち、最初の二次元データのみに、取得時刻を関連付けられる。二次元データを取得する周期(撮像周期)は、ほぼ一定である。したがって、任意の二次元データの取得時刻を特定できる。例えば、10回目の撮像で記録された画像データの取得時刻を特定しようとするとき、1回目の撮像で記録された画像データの取得時刻が10時10分00秒であり、2~10回目の各撮像は全て100ミリ秒掛かったと仮定する。この場合、10回目の撮像で記録された画像データの取得時刻は、10時10分00秒から、100ミリ秒×9を経過した時刻である。このように、全ての二次元データに取得時刻を関連付けて記録することは必須ではない。 The information about the acquisition time may be information for specifying the acquisition time for each of the plurality of two-dimensional data acquired in chronological order. An acquisition time may be associated with each of the plurality of two-dimensional data. Alternatively, for example, only the first two-dimensional data may be associated with the acquisition time. In the latter case, it is possible to calculate the acquisition time of the two-dimensional data other than the first two-dimensional data based on other information (the number of times of imaging, the imaging cycle, etc.). Specifically, only the first two-dimensional data among the plurality of two-dimensional data can be associated with the acquisition time. The cycle (imaging cycle) for acquiring two-dimensional data is substantially constant. Therefore, the acquisition time of arbitrary two-dimensional data can be specified. For example, when trying to specify the acquisition time of the image data recorded in the 10th imaging, the acquisition time of the image data recorded in the 1st imaging is 10:10:00, and the 2nd to 10th imaging Assume that each image took all 100 milliseconds. In this case, the acquisition time of the image data recorded in the tenth imaging is the time after 100 milliseconds×9 have passed from 10:10:00. In this way, it is not essential to record all two-dimensional data in association with the acquisition time.

保存部93はメインユニットから着脱可能なメモリカード36を含んでもよい。保存部93は第一バッファに記憶されているデバイス値と収集時刻に関する情報と、第二バッファに記憶されている二次元データと取得時刻に関する情報とをメモリカード36に保存してもよい。これにより、ログデータ73をPC2へ搬送しやすくなる。図19が示すように、第一バッファはメインユニットに設けられていてもよい。図20が示すように、第二バッファは拡張ユニットに設けられていてもよい。 The storage unit 93 may include a memory card 36 removable from the main unit. The storage unit 93 may store in the memory card 36 the information about the device value and collection time stored in the first buffer and the two-dimensional data and information about the acquisition time stored in the second buffer. This makes it easier to transport the log data 73 to the PC 2 . As shown in FIG. 19, the first buffer may be provided in the main unit. As shown in FIG. 20, the second buffer may be provided in the expansion unit.

図24が示すように、第一インタフェースはメインユニットの側面であって、拡張ユニットの側面に対して対向する側面に配置されていてもよい。第二インタフェースは第一インタフェースと接続されるように拡張ユニットの側面に設けられていてもよい。 As shown in FIG. 24, the first interface may be located on the side of the main unit and on the side opposite to the side of the expansion unit. The second interface may be provided on the side of the expansion unit so as to be connected with the first interface.

図25が示すようにバックプレーン200はメインユニットと拡張ユニットとを支持する支持プレートの一例である。この場合、第一バッファ、第二バッファおよび保存部のうちの少なくとも一つが支持プレートに設けられていてもよい。 As shown in FIG. 25, the backplane 200 is an example of a support plate that supports the main unit and expansion units. In this case, at least one of the first buffer, the second buffer and the storage section may be provided on the support plate.

送信部94は、記憶装置32に保存されているデバイス値、収集時刻に関する情報、二次元データ、および取得時刻に関する情報を外部機器に送信する送信部の一例である。外部機器はクラウドであってもよいし、PC2であってもよい。PC2は、ログデータ73をリアルタイムで受信して表示部7にログデータ73を表示してもよい。 The transmission unit 94 is an example of a transmission unit that transmits the device values stored in the storage device 32, the information on the collection time, the two-dimensional data, and the information on the acquisition time to the external device. The external device may be the cloud or may be the PC2. The PC 2 may receive the log data 73 in real time and display the log data 73 on the display section 7 .

第一バッファまたは第二バッファは、ユーザプログラムの実行周期(例:スキャン周期)よりも短い周期で発生する情報をさらに記憶するように構成されていてもよい。 The first buffer or the second buffer may be configured to further store information generated in a cycle shorter than the user program execution cycle (eg, scan cycle).

保存部93は、メインユニットにおいてユーザプログラムに関するエンド処理(END処理)が実行されている期間において、第二バッファから二次元データと取得時刻に関する情報を読み出して保存するように構成されていてもよい。 The storage unit 93 may be configured to read and store the two-dimensional data and the information about the acquisition time from the second buffer while the end processing (END processing) related to the user program is being executed in the main unit. .

時刻管理部83a、83bに関して説明されたように、収集時刻を計時するメインユニットの時計と取得時刻を計時する拡張ユニットの時計とは同期している。この同期は、たとえば、ユニット間同期によって実現されてもよい。 As described with respect to the time management units 83a and 83b, the clock of the main unit that measures the collection time and the clock of the expansion unit that measures the acquisition time are synchronized. This synchronization may be achieved, for example, by inter-unit synchronization.

図29が示すように、保存部93は、予め設定された保存トリガーの前後にわたる所定の収集時間に収集されたデバイス値、収集時刻に関する情報、二次元データ、および取得時刻に関する情報をメモリカード36に保存するように構成されていてもよい。 As shown in FIG. 29, the storage unit 93 saves the device values, the information on the collection time, the two-dimensional data, and the information on the acquisition time collected at a predetermined collection time before and after a preset save trigger to the memory card 36 . may be configured to store in

図30が示すように、保存部93は、予め設定された開始リレーがオンになったタイミングを起点とした所定の収集時間に収集されたデバイス値、収集時刻に関する情報、二次元データ、および取得時刻に関する情報をメモリカード36に保存するように構成されていてもよい。 As shown in FIG. 30, the storage unit 93 stores device values collected at a predetermined collection time starting from the timing at which a preset start relay is turned on, information about the collection time, two-dimensional data, and acquired data. The memory card 36 may be configured to store information about time.

図32に関連して説明したように、保存部93は、所定の保存条件が満たされると、デバイス記録部に記録されているデバイス値と、プログラム記憶部に記憶されているユーザプログラムまたはユーザプログラムの識別情報とを対応付けてメモリ(例:メモリカード36や内部メモリ37)に保存してもよい。また、出力部84は所定の出力条件が満たされると、デバイス記録部に記録されているデバイス値と、プログラム記憶部に記憶されているユーザプログラムまたは当該ユーザプログラムの識別情報とを外部メモリ(例:メモリカード36)に出力してもよい。上述したように、ログデータ73がどのプロジェクトデータ71を使用することで取得されたかは重要である。したがって、ログデータ73を取得するため使用されたプロジェクトデータ71そのもの、または、その識別情報を出力部84が出力する。つまり、ログデータ73と、プロジェクトデータ71またはその識別情報を出力することで、ログデータ73とプロジェクトデータ71と関係を特定しやすくなる。これにより、ユーザは、プロジェクトデータ71のデバッグを効率よく進めることが可能となる。 As described with reference to FIG. 32, the storage unit 93 saves the device value recorded in the device storage unit and the user program or user program stored in the program storage unit when a predetermined storage condition is satisfied. may be stored in a memory (eg, memory card 36 or internal memory 37) in association with the identification information. Further, when a predetermined output condition is satisfied, the output unit 84 outputs the device value recorded in the device recording unit, the user program stored in the program storage unit, or the identification information of the user program to an external memory (e.g. : You may output to the memory card 36). As described above, it is important which project data 71 is used to acquire the log data 73 . Therefore, the output unit 84 outputs the project data 71 itself used to acquire the log data 73 or its identification information. That is, by outputting the log data 73 and the project data 71 or their identification information, it becomes easier to identify the relationship between the log data 73 and the project data 71 . This allows the user to proceed with debugging of the project data 71 efficiently.

ユーザプログラムは複数のプログラム部品から構成されている。また、プロジェクトデータは複数のプログラム部品を管理している。記憶装置32はプロジェクトデータ71の一部としてユーザプログラムを記憶するプログラム記憶部として機能する。出力部84は、ユーザプログラムを含むプロジェクトデータ71を出力するとともに、ユーザプログラムの識別情報としてプロジェクトデータ71の識別情報を出力するように構成されていてもよい。これにより、PC2に記憶されているプロジェクトデータ71(マスタデータ)と、PLC1に記憶されているプロジェクトデータ71とが一致しているかどうかを判定しやすくなる。 A user program is composed of a plurality of program parts. In addition, the project data manages multiple program parts. The storage device 32 functions as a program storage unit that stores user programs as part of the project data 71 . The output unit 84 may be configured to output the project data 71 including the user program and to output the identification information of the project data 71 as the identification information of the user program. This makes it easier to determine whether the project data 71 (master data) stored in the PC 2 and the project data 71 stored in the PLC 1 match.

プロジェクトデータ71は、拡張ユニット4の設定情報を含んでもよい。これは、プロジェクトデータ71をデバッグする際に拡張ユニット4の設定情報が必要になることがあるからである。たとえば、複数の拡張ユニット4が基本ユニット3に接続されている場合、複数の拡張ユニット4の接続順番が拡張ユニット4の設定情報に含まれている。この接続順番に関する情報がデバッグの際に必要となることがある。 The project data 71 may include setting information for the expansion unit 4 . This is because setting information of the expansion unit 4 may be required when debugging the project data 71 . For example, when a plurality of extension units 4 are connected to the basic unit 3, the connection order of the plurality of extension units 4 is included in the setting information of the extension unit 4. FIG. Information about this connection order may be required during debugging.

判定部301はユーザプログラム(プロジェクトデータ71)の出力が禁止されているかどうかを判定する判定部として機能する。出力部84は、判定部301によりユーザプログラムの出力が禁止されていると判定された場合、デバイス記録部に記録されているデバイス値と、プログラム記憶部に記憶されているユーザプログラムの識別情報とを外部メモリに出力してもよい。これにより、ユーザプログラムをプロテクトしつつ、識別情報に基づきPC2のマスタデータが利用可能となる。 The determination unit 301 functions as a determination unit that determines whether or not output of the user program (project data 71) is prohibited. When the determination unit 301 determines that the output of the user program is prohibited, the output unit 84 outputs the device value recorded in the device recording unit and the identification information of the user program stored in the program storage unit. may be output to external memory. As a result, the master data of the PC 2 can be used based on the identification information while protecting the user program.

付加部312に関連して説明されたように、ユーザプログラムの識別情報は、ユーザプログラムが変更されると更新される識別情報である。よって、PLC1に保持されているプロジェクトデータ71と異なる他のバージョンのプロジェクトデータ71が誤ってデバッグに利用されないようになろう。 As described with respect to appending portion 312, the identification information of the user program is identification information that is updated when the user program is changed. Therefore, the project data 71 of a different version from the project data 71 held in the PLC 1 will not be mistakenly used for debugging.

演算部313に関連して説明されたように、ユーザプログラムの識別情報は、ユーザプログラムから演算される誤り検出符号またはハッシュ値であってもよい。このように、プロジェクトデータ71が更新されると、識別情報も更新されるような識別情報の演算方法が採用されてもよい。識別情報はタイムスタンプなどであってもよい。 As described with respect to the computing unit 313, the user program identification information may be an error detection code or hash value computed from the user program. In this way, a method of calculating identification information may be employed in which the identification information is also updated when the project data 71 is updated. The identification information may be a timestamp or the like.

PC2の記憶装置22はユーザプログラムと当該ユーザプログラムの識別情報を記憶するプログラムメモリの一例である。照合部334はプログラマブルロジックコントローラから出力されるユーザプログラムの識別情報と、プログラムメモリに記憶されているユーザプログラムの識別情報とを照合し、照合結果を表示部に表示させる照合部の一例である。警告部335は両者が不一致であった場合に警告を出力するが、両者が一致していた場合には一致していることを示すメッセージまたは画像を表示部7に表示してもよい。 The storage device 22 of the PC 2 is an example of a program memory that stores user programs and identification information of the user programs. The collation unit 334 is an example of a collation unit that collates the user program identification information output from the programmable logic controller with the user program identification information stored in the program memory and displays the collation result on the display unit. The warning unit 335 outputs a warning when the two do not match, but may display a message or an image indicating that they match on the display unit 7 when the two match.

図38が示すように、表示部7は、プログラマブルロジックコントローラから出力されたデバイス値を、ユーザプログラムのうち当該デバイス値に関連した命令語が記述されている部分と関連付けて表示してもよい。これにより、ユーザは、デバイス値の変化とユーザプログラムとの関係を理解しやすくなる。これはデバッグの効率を向上させるであろう。 As shown in FIG. 38, the display unit 7 may display the device value output from the programmable logic controller in association with the portion of the user program in which the instruction word related to the device value is described. This makes it easier for the user to understand the relationship between changes in device values and user programs. This will improve debugging efficiency.

記憶装置22やメモリカード36はプログラマブルロジックコントローラにおいて収集された時系列の複数のデバイス値と、各デバイス値の収集時刻を示す時刻データとを保存する保存手段の一例である。プログラム表示モジュール321はデバイス値をラダー図上に表示する第一エンジニアリングソフトウェアモジュールの一例である。波形表示モジュール322はデバイス値を時系列波形として表示する第二エンジニアリングソフトウェアモジュールの一例である。再生制御モジュール324は第一エンジニアリングソフトウェアモジュールにおける表示対象時刻と第二エンジニアリングソフトウェアモジュールにおける表示対象時刻とを同期させる同期ソフトウエアモジュールの一例である。これにより、ユーザは、特定のデバイス値の変化とプログラムの関係とを理解しやすくなろう。 The storage device 22 and the memory card 36 are examples of storage means for storing a plurality of time-series device values collected by the programmable logic controller and time data indicating the collection time of each device value. The program display module 321 is an example of a first engineering software module that displays device values on a ladder diagram. Waveform display module 322 is an example of a second engineering software module that displays device values as time series waveforms. The playback control module 324 is an example of a synchronization software module that synchronizes the display target time in the first engineering software module and the display target time in the second engineering software module. This will help the user understand the program's relationship to changes in specific device values.

第一エンジニアリングソフトウェアモジュールは、リアルタイム再生モードにおいてプログラマブルロジックコントローラからデバイス値を取得してラダー図上に当該デバイス値を表示し、履歴再生モードにおいて時刻データに基づき表示対象時刻に対応するデバイス値を保存手段から取得してラダー図上に表示する第一表示制御手段を有してもよい。プログラム表示部332、表示時刻制御部331およびデバイス値取得部333は第一表示制御手段として機能する。ログ再生モードは履歴再生モードの一例である。 The first engineering software module acquires device values from the programmable logic controller in real-time playback mode, displays the device values on the ladder diagram, and stores the device values corresponding to the display target time based on the time data in history playback mode. It may have a first display control means for acquiring from the means and displaying it on the ladder diagram. The program display unit 332, the display time control unit 331, and the device value acquisition unit 333 function as first display control means. The log replay mode is an example of a history replay mode.

第二エンジニアリングソフトウェアモジュールは、リアルタイム再生モードにおいてプログラマブルロジックコントローラからデバイス値を取得して時系列波形を表示し、履歴再生モードにおいて時刻データに基づき表示対象時刻に対応するデバイス値を保存手段から取得して時系列波形を表示する第二表示制御手段を有してもよい。波形表示部336、表示時刻制御部331およびデバイス値取得部333は第二表示制御手段の一例である。 The second engineering software module acquires device values from the programmable logic controller in the real-time playback mode and displays the time-series waveform, and in the history playback mode acquires the device values corresponding to the time to be displayed based on the time data from the storage means. and second display control means for displaying the time series waveform. The waveform display section 336, the display time control section 331, and the device value acquisition section 333 are examples of second display control means.

同期ソフトウエアモジュールは、履歴再生モードにおいて第一エンジニアリングソフトウェアモジュールにおける表示対象時刻と第二エンジニアリングソフトウェアモジュールにおける表示対象時刻とを同期させる同期手段を有してもよい。再生制御部343は同期手段の一例である。 The synchronization software module may have synchronization means for synchronizing the display target time in the first engineering software module and the display target time in the second engineering software module in the history playback mode. The reproduction control section 343 is an example of synchronization means.

第一エンジニアリングソフトウェアモジュールは、さらに、履歴再生モードにおいて表示対象時刻を更新する第一更新手段をさらに有してもよい。時刻指定カーソル404、時刻UI330および表示時刻制御部331は第一更新手段の一例である。同期手段である再生制御部343は、第一更新手段により更新された表示対象時刻を第二エンジニアリングソフトウェアモジュールの表示対象時刻へ反映させる。 The first engineering software module may further have a first update means for updating the display target time in the history playback mode. The time designation cursor 404, the time UI 330 and the display time control section 331 are examples of first updating means. The reproduction control unit 343, which is a synchronizing means, reflects the display target time updated by the first update means to the display target time of the second engineering software module.

第二エンジニアリングソフトウェアモジュールは、履歴再生モードにおいて表示対象時刻を更新する第二更新手段をさらに有してもよい。バー103、時刻UI330および表示時刻制御部331は第二更新手段の一例である。同期手段である再生制御部343は、第二更新手段により更新された表示対象時刻を第一エンジニアリングソフトウェアモジュールの表示対象時刻へ反映させる。 The second engineering software module may further have second updating means for updating the display target time in the history playback mode. The bar 103, the time UI 330, and the display time control section 331 are examples of second update means. The reproduction control unit 343, which is a synchronizing means, reflects the display target time updated by the second update means to the display target time of the first engineering software module.

図43が示すように、第一表示制御手段は、プログラマブルロジックコントローラにおいて参照される複数のデバイスのうち第二エンジニアリングソフトウェアモジュールにおいて表示対象とされているデバイスに関連する命令語を、ラダー図において検索してもよい。たとえば、図28に示されているデバイス(例:R000やDM100など)をポインタ101により指定することで、デバイスが指定されてもよい。図38が示すように、第一表示制御手段は、ラダー図において見つかった命令語とともに当該デバイスのデバイス値を表示するように構成されていてもよい。また、ポインタ101は、任意のデバイスを指定する指定手段の一例である。第一表示制御手段は、プログラマブルロジックコントローラにおいて参照される複数のデバイスのうち指定手段により指定されたデバイスに関連する命令語を、ラダー図において検索し、ラダー図において見つかった命令語とともに当該デバイスのデバイス値を表示してもよい。 As shown in FIG. 43, the first display control means searches the ladder diagram for instruction words related to the device to be displayed in the second engineering software module among the plurality of devices referenced in the programmable logic controller. You may For example, a device may be designated by designating a device (eg, R000, DM100, etc.) shown in FIG. As FIG. 38 shows, the first display control means may be arranged to display the device values of the device in question along with the commands found in the ladder diagram. Also, the pointer 101 is an example of specifying means for specifying an arbitrary device. The first display control means searches the ladder diagram for an instruction related to the device specified by the specifying means among the plurality of devices referenced in the programmable logic controller, and displays the instruction of the device together with the instruction found in the ladder diagram. May display device values.

図43が示すように、プログラマブルロジックコントローラにおいてラダープログラムは複数のプログラム部品から構成されていてもよい。第一表示制御手段(例:ログ表示部61やデバイス抽出部53)は、デバイスに関連する命令語を含む一つ以上のブロックを複数のプログラム部品の中から検索し、見つかったブロックをラダー図として表示するように構成されていてもよい。 As shown in FIG. 43, a ladder program may consist of a plurality of program parts in a programmable logic controller. The first display control means (eg, log display unit 61 and device extraction unit 53) searches a plurality of program parts for one or more blocks containing command words related to devices, and displays the found blocks in a ladder diagram. may be configured to be displayed as

図43が示すように、第一表示制御手段は、デバイスに関連する命令語を含む複数のブロックを見つけると、当該複数のブロックに対応するラダー図を並べて表示してもよい。 As shown in FIG. 43, when the first display control means finds a plurality of blocks containing command words related to the device, it may display the ladder diagrams corresponding to the plurality of blocks side by side.

図43が示すように、第一表示制御手段は、ラダープログラムにおいて、第一ブロック(例:測定モジュールB2)において第一デバイス(例:MR001)に関連する命令語が入力系の命令語である場合に、当該入力系の命令語に対応して記述されている出力系の命令語の対象とされている第二デバイス(例:MR003)を特定し、当該第二デバイスを対象とする入力系の命令語を記述された第二ブロック(例:判定モジュールB3)を特定してもよい。 As shown in FIG. 43, the first display control means is such that in the ladder program, the instruction related to the first device (eg, MR001) in the first block (eg, measurement module B2) is the input system instruction. In this case, specify the second device (e.g. MR003) that is the target of the output system command written corresponding to the input system command, and input system that targets the second device A second block (eg, determination module B3) in which the instruction word of is described may be specified.

第一表示制御手段は、ラダープログラムにおいて、第一ブロック(例:判定モジュールB3)において第一デバイス(例:MR010)に関連する命令語が出力系の命令語である場合に、当該出力系の命令語に対応して記述されている入力系の命令語の対象とされている第二デバイス(例:MR001)を特定し、当該第二デバイスを対象とする出力系の命令語を記述された第二ブロック(例:測定モジュールB2)を特定してもよい。 The first display control means, in the ladder program, when the command associated with the first device (eg MR010) in the first block (eg determination module B3) is the command for the output system Identify the second device (example: MR001) that is the target of the input system command that is written corresponding to the command, and describe the output system command that targets the second device A second block (eg measurement module B2) may be specified.

同期手段は、表示対象時刻の更新速度を設定する設定手段を有してもよい。速度指定部405は設定手段の一例である。これによりスロー再生や早送り再生などが実現されてもよい。 The synchronizing means may have setting means for setting an update speed of the display target time. The speed designation unit 405 is an example of setting means. This may realize slow playback, fast forward playback, and the like.

第一表示制御手段および第二表示制御手段は、プログラマブルロジックコントローラに関する情報を表示するヒューマンインタフェース(HMI)から入力されたユーザ入力に基づき設定されたデバイス値をさらに表示するように構成されていてもよい。HMIはエミュレータにより実現されてもよい。図39に関連して説明されたようにUI490は複数のデバイス値を表示している。いずれのデバイス値がポインタ101によりクリックされると、ログ表示部61は、クリックされたデバイス値をプログラム表示部332の表示対象として追加したり、波形表示部336の表示対象として追加したりしてもよい。これにより、HMI、ユーザプログラムおよびデバイス値の波形を連携および同期させて表示することが可能となる。 The first display control means and the second display control means may further display device values set based on user input from a human interface (HMI) that displays information about the programmable logic controller. good. HMI may be implemented by an emulator. UI 490 displays multiple device values as described in connection with FIG. When any device value is clicked by the pointer 101, the log display unit 61 adds the clicked device value as a display target of the program display unit 332 or adds it as a display target of the waveform display unit 336. good too. This allows the waveforms of the HMI, user program and device values to be displayed in a coordinated and synchronized manner.

保存手段は、カメラユニットより取得された時系列の複数の画像データと、各画像データの取得時刻を示す時刻データとをさらに保存していてもよい。図28が示すように、第二エンジニアリングソフトウェアモジュールは、リアルタイム再生モードにおいてプログラマブルロジックコントローラからデバイス値を取得して時系列波形を表示するとともにカメラユニットから取得された画像データを表示してもよい。同様に、第二エンジニアリングソフトウェアモジュールは、履歴再生モードにおいて保存手段から表示対象時刻に対応するデバイス値と画像データとを取得して表示してもよい。画像データは数値よりも多くの情報を有している。そのため、画像データを表示することで、ユーザは、問題点を早期に見つけることが可能となろう。 The storage means may further store a plurality of time-series image data acquired from the camera unit and time data indicating acquisition time of each image data. As FIG. 28 shows, the second engineering software module may acquire device values from the programmable logic controller to display time-series waveforms and display image data acquired from the camera unit in real-time playback mode. Similarly, the second engineering software module may acquire and display the device value and the image data corresponding to the display target time from the storage means in the history reproduction mode. Image data has more information than numerical values. Therefore, by displaying the image data, the user will be able to find the problem at an early stage.

また、第一エンジニアリングソフトウェアモジュールは、リアルタイム再生モードにおいてプログラマブルロジックコントローラからデバイス値を取得してラダー図上に当該デバイス値を表示するとともにカメラユニットから取得された画像データを表示してもよい。第一エンジニアリングソフトウェアモジュールは、履歴再生モードにおいて保存手段から表示対象時刻に対応するデバイス値と画像データとを取得してラダー図上に表示してもよい。 Also, the first engineering software module may acquire device values from the programmable logic controller in the real-time playback mode, display the device values on the ladder diagram, and display image data acquired from the camera unit. The first engineering software module may acquire the device value and the image data corresponding to the display target time from the storage means in the history reproduction mode and display them on the ladder diagram.

複数の拡張ユニット4のそれぞれ異なる内部制御周期にしたがって動作している。よって、複数の拡張ユニット4から取得されるデバイス値の取得時刻や画像データの取得時刻が一致しないことが多い。そこで、図26~図28に関連して説明されたように、第一表示制御手段および第二表示制御手段は、履歴再生モードにおいて、表示対象時刻に最も近い時刻データに関連付けられているデバイス値を読み出すように構成されていてもよい。 The expansion units 4 operate according to different internal control cycles. Therefore, the acquisition times of device values and the acquisition times of image data acquired from a plurality of expansion units 4 often do not match. Therefore, as described with reference to FIGS. 26 to 28, the first display control means and the second display control means control the device value associated with the time data closest to the display target time in the history reproduction mode. may be configured to read the

Claims (13)

プログラマブルロジックコントローラに接続される外部設定機器であって、 An external setting device connected to a programmable logic controller,
ユーザから受け付けられた命令語であって、先頭デバイスおよび当該先頭デバイスを基準としたデバイスの個数を引数とする命令語を含むラダープログラムを記憶する記憶部と、 a storage unit for storing a ladder program including an instruction received from a user and having as arguments a head device and the number of devices based on the head device;
前記記憶部に記憶されたラダープログラムを解析することにより、前記命令語の引数から特定されるデバイス範囲に対応する複数の異なるデバイスを抽出するデバイス抽出部と、 a device extraction unit that extracts a plurality of different devices corresponding to the device range specified from the argument of the instruction word by analyzing the ladder program stored in the storage unit;
前記デバイス抽出部により抽出された複数の異なるデバイスを用いて、前記プログラマブルロジックコントローラでロギングされるデバイスを設定するログ設定データを作成するログ設定部と a log setting unit that uses a plurality of different devices extracted by the device extraction unit to create log setting data for setting devices to be logged by the programmable logic controller;
を備える外部設定機器。 external setting device.
前記デバイス抽出部は、前記記憶部に記憶されたラダープログラムを解析することにより、前記デバイス範囲に対応する複数の異なるデバイスとともに、前記命令語の実行開始トリガとなるリレーデバイスを抽出することを特徴とする請求項1に記載の外部設定機器。 The device extraction unit analyzes the ladder program stored in the storage unit to extract a plurality of different devices corresponding to the device range and a relay device that triggers execution of the instruction word. 2. The external setting device according to claim 1. 前記デバイス抽出部は、前記リレーデバイスが含まれる、予め定められたワード単位のデバイスをまとめて抽出することを特徴とする請求項2に記載の外部設定機器。 3. The external setting device according to claim 2, wherein the device extraction unit collectively extracts devices in units of predetermined words that include the relay device. 前記命令語は、ユーザにより指定された指定値を、前記デバイス範囲に対応する複数の異なるデバイスに代入する命令語であって、 The command is a command for substituting a specified value specified by a user into a plurality of different devices corresponding to the device range,
前記デバイス抽出部は、前記記憶部に記憶されたラダープログラムを解析することにより、前記命令語により前記指定値が代入される複数の異なるデバイスを抽出することを特徴とする請求項1から3のいずれか一項に記載の外部設定機器。 4. The device extraction unit extracts a plurality of different devices to which the specified value is substituted by the instruction word by analyzing the ladder program stored in the storage unit. An external setting device according to any one of the clauses.
前記ラダープログラムは、マトリックス状に配置された複数のセル上に複数行に亘って記述されており、 The ladder program is written over a plurality of lines on a plurality of cells arranged in a matrix,
前記デバイス抽出部は、前記ラダープログラムの先頭行から終端行まで行ごとにデバイスを抽出することを特徴とする請求項1から4のいずれか一項に記載の外部設定機器。 5. The external setting device according to claim 1, wherein the device extraction unit extracts the device for each line from the top line to the end line of the ladder program.
前記デバイス抽出部は、前記プログラマブルロジックコントローラで同一のデバイスが重複してロギングされないようマージ処理を実行するマージ部を備えることを特徴とする請求項1から5のいずれか一項に記載の外部設定機器。 6. The external setting according to any one of claims 1 to 5, wherein the device extraction unit includes a merge unit that performs merge processing so that the same device is not logged redundantly in the programmable logic controller. device. 前記外部設定機器は、さらに、前記デバイス抽出部により抽出されたデバイスを表示する表示部を備えることを特徴とする請求項1から6のいずれか一項に記載の外部設定機器。 7. The external setting device according to claim 1, further comprising a display section for displaying the devices extracted by the device extraction section. 前記外部設定機器は、さらに、前記表示部を介したユーザ入力に基づいて、前記デバイス抽出部により抽出されたデバイスのうち一部のデバイスを削除する削除部を備えることを特徴とする請求項7に記載の外部設定機器。 8. The external setting device further comprises a deletion unit that deletes some of the devices extracted by the device extraction unit based on user input through the display unit. external setting device described in . 外部メモリにアクセス可能なプログラマブルロジックコントローラに接続される外部設定機器であって、 An external setting device connected to a programmable logic controller capable of accessing external memory,
ユーザから受け付けられた命令語であって、先頭デバイスおよび当該先頭デバイスを基準としたデバイスの個数を引数とする命令語を含むラダープログラムを記憶する記憶部と、 a storage unit for storing a ladder program including an instruction received from a user and having as arguments a head device and the number of devices based on the head device;
前記記憶部に記憶されたラダープログラムを解析することにより、前記命令語の引数から特定されるデバイス範囲に対応する複数の異なるデバイスを抽出するデバイス抽出部と、 a device extraction unit that extracts a plurality of different devices corresponding to the device range specified from the argument of the instruction word by analyzing the ladder program stored in the storage unit;
前記デバイス抽出部により抽出された複数の異なるデバイスを用いて、前記プログラマブルロジックコントローラでロギングされるデバイスを設定し、当該設定されたデバイスからロギングされたデバイス値を前記外部メモリに読み出す条件を設定するログ設定データを作成するログ設定部と、 Using a plurality of different devices extracted by the device extraction unit, a device to be logged by the programmable logic controller is set, and a condition for reading the device value logged from the set device to the external memory is set. a log setting unit that creates log setting data;
前記ログ設定部により作成されたログ設定データを、前記プログラマブルロジックコントローラに送信する通信部と、 a communication unit that transmits log setting data created by the log setting unit to the programmable logic controller;
を備える外部設定機器。 external setting device.
前記外部メモリは、前記プログラマブルロジックコントローラに着脱可能なメモリカードであって、 The external memory is a memory card removable from the programmable logic controller,
前記ログ設定部は、前記プログラマブルロジックコントローラでロギングされるデバイスを設定するとともに、当該設定されたデバイスからロギングされたデバイス値を前記メモリカードに保存する条件を設定するログ設定データを作成することを特徴とする請求項9に記載の外部設定機器。 The log setting unit sets a device to be logged by the programmable logic controller, and creates log setting data for setting conditions for saving device values logged from the set device in the memory card. 10. An external setting device according to claim 9.
前記外部メモリに読み出す条件は、前記プログラマブルロジックコントローラでロギングされたデバイス値を前記外部メモリに読み出すタイミングと、当該ロギングされたデバイス値の時刻情報に基づき特定される対象期間と、を含むことを特徴とする請求項9または10に記載の外部設定機器。 The condition for reading to the external memory includes timing for reading the device value logged by the programmable logic controller to the external memory, and a target period specified based on time information of the logged device value. 11. The external setting device according to claim 9 or 10. プログラマブルロジックコントローラに接続される外部設定機器を用いたロギング設定方法であって、 A logging setting method using an external setting device connected to a programmable logic controller,
ユーザから受け付けられた命令語であって、先頭デバイスおよび当該先頭デバイスを基準としたデバイスの個数を引数とする命令語を含むラダープログラムを前記外部設定機器の記憶部に記憶するステップと、 a step of storing, in the storage unit of the external setting device, a ladder program including command words received from a user and having as arguments the head device and the number of devices based on the head device;
前記記憶部に記憶されたラダープログラムに基づいて、前記命令語の引数から特定されるデバイス範囲に対応する複数の異なるデバイスを抽出し、前記外部設定機器の表示部に表示するステップと、 a step of extracting a plurality of different devices corresponding to the device range specified from the argument of the command word based on the ladder program stored in the storage unit and displaying them on the display unit of the external setting device;
前記表示部に表示された複数の異なるデバイスのうち一部のデバイスの削除を受け付け、前記プログラマブルロジックコントローラでロギングされる対象デバイスを特定するステップと、 receiving deletion of some of the plurality of different devices displayed on the display unit and identifying target devices to be logged by the programmable logic controller;
前記特定された対象デバイスに基づいて、ログ設定データを作成するステップと、 creating log configuration data based on the identified target device;
を含むことを特徴とするロギング設定方法。 A logging setting method comprising:
プログラマブルロジックコントローラに接続される外部設定機器としてコンピュータを機能させるプログラムであって、
ユーザから受け付けられた命令語であって、先頭デバイスおよび当該先頭デバイスを基準としたデバイスの個数を引数とする命令語を含むラダープログラムを記憶するステップと、
記憶されたラダープログラムを解析することにより、前記命令語の引数から特定されるデバイス範囲に対応する複数の異なるデバイスを抽出するステップと、
抽出された複数の異なるデバイスを用いて、前記プログラマブルロジックコントローラでロギングされるデバイスを設定するログ設定データを作成するステップと
を実行するように前記コンピュータを機能させるプログラム
A program that causes a computer to function as an external setting device connected to a programmable logic controller,
a step of storing a ladder program containing an instruction received from a user and having as arguments a leading device and the number of devices based on the leading device;
extracting a plurality of different devices corresponding to the device range specified from the argument of the instruction word by analyzing the stored ladder program;
using the extracted plurality of different devices to create log configuration data that configures devices logged by the programmable logic controller.
JP2021191970A 2018-10-23 2021-11-26 External setting device, logging setting method and program Active JP7273935B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2021191970A JP7273935B2 (en) 2018-10-23 2021-11-26 External setting device, logging setting method and program

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
JP2018199199A JP6757385B2 (en) 2018-10-23 2018-10-23 Programmable logic controller and main unit
JP2020143397A JP6986125B2 (en) 2018-10-23 2020-08-27 Programmable logic controller and main unit
JP2021191970A JP7273935B2 (en) 2018-10-23 2021-11-26 External setting device, logging setting method and program

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP2020143397A Division JP6986125B2 (en) 2018-10-23 2020-08-27 Programmable logic controller and main unit

Publications (2)

Publication Number Publication Date
JP2022016659A JP2022016659A (en) 2022-01-21
JP7273935B2 true JP7273935B2 (en) 2023-05-15

Family

ID=87884970

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2021191970A Active JP7273935B2 (en) 2018-10-23 2021-11-26 External setting device, logging setting method and program

Country Status (1)

Country Link
JP (1) JP7273935B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP7267519B1 (en) * 2022-07-13 2023-05-01 三菱電機株式会社 LOGGING DEVICE, LOG DATA ANALYSIS SUPPORT SYSTEM, INFORMATION PROVIDING METHOD AND PROGRAM
KR102501391B1 (en) 2022-11-17 2023-02-21 (주)기린컴퍼니 Composition for blanching Enteromorpha prolifera that can solve the color browning and taste changing problem

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2000043883A1 (en) 1999-01-25 2000-07-27 Mitsubishi Denki Kabushiki Kaisha Peripheral unit of programmable controller
JP2008293138A (en) 2007-05-22 2008-12-04 Fuji Electric Assets Management Co Ltd Software development support program and software development support method
WO2016189689A1 (en) 2015-05-27 2016-12-01 三菱電機株式会社 Program generation device, program generation method, and program generation program

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2000043883A1 (en) 1999-01-25 2000-07-27 Mitsubishi Denki Kabushiki Kaisha Peripheral unit of programmable controller
JP2008293138A (en) 2007-05-22 2008-12-04 Fuji Electric Assets Management Co Ltd Software development support program and software development support method
WO2016189689A1 (en) 2015-05-27 2016-12-01 三菱電機株式会社 Program generation device, program generation method, and program generation program

Also Published As

Publication number Publication date
JP2022016659A (en) 2022-01-21

Similar Documents

Publication Publication Date Title
JP6757385B2 (en) Programmable logic controller and main unit
JP6757386B2 (en) Programmable logic controller and program creation support device
US10983743B2 (en) Programmable display and programmable logic controller system including the same
JP7273935B2 (en) External setting device, logging setting method and program
JP7173826B2 (en) Programmable logic controller system, programming support device and computer program
JP2020134985A (en) Programmable logic controller and camera input expansion unit
JP7320953B2 (en) Programmable logic controller and its log data storage method
JP2023164999A (en) Program creation assistance device for programmable logic controller
JP7450471B2 (en) Programmable logic controller and PLC system
JP7212496B2 (en) Programmable logic controller system, programming support device and computer program
JP7466319B2 (en) Programmable display and programmable logic controller system equipped with the same
JP2022158228A (en) Monitoring device and programmable logic controller system
JP7405714B2 (en) programmable logic controller
JP6948450B2 (en) Programmable logic controller and main unit
JP6806946B2 (en) External setting devices and programs
JP7412076B2 (en) Engineering tools for programmable logic controllers
JP6986125B2 (en) Programmable logic controller and main unit
US11960379B2 (en) Simulation system, method for simulation system, and non-transitory computer-readable storage medium storing simulation program
JP7356778B2 (en) Program creation support device for programmable logic controllers
US20230004482A1 (en) Simulation system, method for simulation system, and non-transitory computer-readable storage medium storing simulation program
JP7536217B1 (en) PROGRAMMABLE CONTROLLER, TERMINAL DEVICE, INFORMATION PROVIDING METHOD AND PROGRAM
JP2022158229A (en) Programmable logic controller system
CN114490285A (en) System and method for replaying RPA flow execution process

Legal Events

Date Code Title Description
A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20211217

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20211217

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20221026

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20221118

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20230113

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20230428

R150 Certificate of patent or registration of utility model

Ref document number: 7273935

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150