JP7412076B2 - Engineering tools for programmable logic controllers - Google Patents

Engineering tools for programmable logic controllers Download PDF

Info

Publication number
JP7412076B2
JP7412076B2 JP2018199201A JP2018199201A JP7412076B2 JP 7412076 B2 JP7412076 B2 JP 7412076B2 JP 2018199201 A JP2018199201 A JP 2018199201A JP 2018199201 A JP2018199201 A JP 2018199201A JP 7412076 B2 JP7412076 B2 JP 7412076B2
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
JP2018199201A
Other languages
Japanese (ja)
Other versions
JP2020013528A (en
Inventor
真人 藤村
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Keyence Corp
Original Assignee
Keyence Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Keyence Corp filed Critical Keyence Corp
Priority to JP2018199201A priority Critical patent/JP7412076B2/en
Publication of JP2020013528A publication Critical patent/JP2020013528A/en
Priority to JP2023218370A priority patent/JP2024023867A/en
Application granted granted Critical
Publication of JP7412076B2 publication Critical patent/JP7412076B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Description

本発明は、プログラマブルロジックコントローラ用のエンジニアリングツールに関する。 The present invention relates to engineering tools for programmable logic controllers.

プログラマブル・ロジック・コントローラ(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. PLCs control various expansion units and controlled devices by executing user programs such as ladder programs created by users. When a user program is actually executed on a PLC, an event that was not anticipated 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 to identify correction points, but also refers to the log data generated by the PLC. The log data stores device values (device values) collected while the user program is being executed. In the field of PLC, a device means a storage area that stores information. Devices include relay devices that hold one bit of information, word devices that hold one word of information, and the like. According to Patent Document 1, logging device values is proposed.

特開平10-011118号公報Japanese Patent Application Publication No. 10-011118

ところで、ユーザプログラムを見るためのソフトウエアと、ログデータを見るためのソフトウエアとは独立している。そのため、ユーザは一方のログデータを見ながら、トラブルが発生したときのデバイス値を発見し、さらにそのデバイス値がユーザプログラムのどの部分に関連しているかを手作業で発見しなければならなかった。 By the way, the software for viewing user programs and the software for viewing log data are independent. Therefore, the user had to look at the log data on one side, discover the device value at the time the problem occurred, and then manually discover which part of the user program that device value was related to. .

そこで、本発明は、ログデータとプロジェクトデータとを関連付けて表示することを目的とする。 Therefore, an object of the present invention is to display log data and project data in association with each other.

本発明は、たとえば、
プログラマブルロジックコントローラにおいて収集された時系列の複数のデバイス値と、各デバイス値の収集時刻を示す時刻データとを保存する保存手段と、
前記デバイス値をラダー図上に表示する第一エンジニアリングソフトウェアモジュールと、
前記デバイス値を時系列波形として表示する第二エンジニアリングソフトウェアモジュールと、
前記第一エンジニアリングソフトウェアモジュールにおける表示対象時刻と前記第二エンジニアリングソフトウェアモジュールにおける表示対象時刻とを同期させる同期ソフトウェアモジュールと
を有し、
前記第一エンジニアリングソフトウェアモジュールは、
リアルタイム再生モードにおいて前記プログラマブルロジックコントローラからデバイス値を取得してラダー図上に当該デバイス値を表示し、履歴再生モードにおいて前記時刻データに基づき表示対象時刻に対応するデバイス値を前記保存手段から取得してラダー図上に表示する第一表示制御手段を有し、
前記第二エンジニアリングソフトウェアモジュールは、
前記リアルタイム再生モードにおいて前記プログラマブルロジックコントローラからデバイス値を取得して時系列波形を表示し、前記履歴再生モードにおいて前記時刻データに基づき前記表示対象時刻に対応するデバイス値を前記保存手段から取得して時系列波形を表示する第二表示制御手段を有し、
前記同期ソフトウェアモジュールは、前記履歴再生モードにおいて、前記第一エンジニアリングソフトウェアモジュールと前記第二エンジニアリングソフトウェアモジュールとの間で表示対象時刻を受け渡すことにより、前記第一エンジニアリングソフトウェアモジュールにおける表示対象時刻と前記第二エンジニアリングソフトウェアモジュールにおける表示対象時刻とを同期させる同期手段を有し、前記第一表示制御手段と前記第二表示制御手段のいずれによっても起動されることを特徴とするプログラマブルロジックコントローラ用のエンジニアリングツールを提供する。
The present invention includes, for example,
Storage means for storing a plurality of time-series device values collected in the programmable logic controller and time data indicating the collection time of each device value;
a first engineering software module that displays the device values on a ladder diagram;
a second engineering software module that displays the device values as a time series waveform;
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;
The first engineering software module includes:
In a real-time playback mode, a device value is obtained from the programmable logic controller and the device value is displayed on a ladder diagram, and in a history playback mode, a device value corresponding to a display target time is obtained from the storage means based on the time data. a first display control means for displaying on the ladder diagram;
The second engineering software module includes:
In the real-time playback mode, a device value is obtained from the programmable logic controller to display a time series waveform, and in the history playback mode, a device value corresponding to the display target time is obtained from the storage means based on the time data. comprising a second display control means for displaying a time series waveform;
The synchronization software module transfers the display target time between the first engineering software module and the second engineering software module in the history playback mode, thereby adjusting the display target time in the first engineering software module and the display target time. Engineering for a programmable logic controller , comprising synchronization means for synchronizing display target time in a second engineering software module, and activated by either the first display control means or the second display control means. Provide tools.

本発明によればログデータとプロジェクトデータとを関連付けて表示することが可能となる。 According to the present invention, log data and project data can be displayed in association with each other.

プログラマブルロジックコントローラシステムを示す図Diagram showing a programmable logic controller system ラダープログラムを説明する図Diagram explaining the ladder program プログラム作成支援装置を説明する図Diagram explaining the program creation support device PLCを説明する図Diagram explaining PLC ラダープログラムのスキャンを説明する図Diagram explaining ladder program scanning プログラム作成支援装置の機能を説明する図Diagram explaining the functions of the program creation support device ロギングの設定方法を説明するフローチャートFlowchart explaining how to configure logging プログラム部品の選択方法を説明する図Diagram explaining how to select program parts 機能の選択方法を説明する図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 extraction list merging スキャンタイムへの影響の推定結果を説明する図Diagram explaining the estimated effect on scan time デバイス種別の選択UIを説明する図Diagram explaining device type selection UI デバイスの抽出方法を示すフローチャートFlowchart showing how to extract devices ユーザプログラムの一例を示す図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 the expansion unit PLCの接続形態を示す図Diagram showing the connection form of PLC PLCの接続形態を示す図Diagram showing the connection form of PLC ロギングのタイミングを説明する図Diagram explaining logging timing ログデータの表示を説明する図Diagram explaining the display of log data ログデータの表示UIを説明する図Diagram explaining log data display UI 収集時間の設定方法を説明する図Diagram explaining how to set collection time 収集時間の設定方法を説明する図Diagram explaining how to set collection time デバッグ処理の概要を示すフローチャートFlowchart showing an overview of the debugging process 出力部を説明する図Diagram explaining the output section プロジェクト作成部を説明する図Diagram explaining the project creation section ログ表示部を説明する図Diagram explaining the log display section プログラム表示モジュールを説明する図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 real-time chart monitor 再生制御モジュールを説明する図Diagram explaining the playback control module ユーザプログラムとデバイス値とを表示するUIを説明する図Diagram explaining a UI that displays a user program and device values HMIのエミュレータを説明する図Diagram explaining HMI emulator ユーザプログラムとデバイス値とを表示する処理を示すフローチャートFlowchart showing the process of displaying user programs and device values デバイス値の波形を表示する処理を示すフローチャートFlowchart showing the process of displaying the waveform of device values 再生制御を示すフローチャートFlowchart showing playback control 相互に関連した複数のプログラム部品を説明する図Diagram explaining multiple interrelated program parts プログラム部品とデバイスの抽出結果を表示するUIを説明する図Diagram explaining the UI that displays the extraction results of program parts and devices プログラム部品とデバイスの抽出処理を示すフローチャートFlowchart showing program parts and device extraction processing デバッグの流れを説明するフローチャートFlowchart explaining the debugging process 修正されたプログラム部品を説明する図Diagram explaining modified program parts

以下に本発明の一実施形態を示す。以下で説明される個別の実施形態は、本発明の上位概念、中位概念および下位概念など種々の概念を理解するために役立つであろう。また、本発明の技術的範囲は、特許請求の範囲によって確定されるのであって、以下の個別の実施形態によって限定されるわけではない。 An embodiment of the present invention is shown below. The individual embodiments described below will be helpful for understanding various concepts such as general concepts, intermediate concepts, and sub-concepts of the present invention. Further, 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, in order to enable those skilled in the art to better understand a programmable logic controller (PLC, which may also be simply referred to as a programmable controller), the configuration and operation of a general PLC will be described.

図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 a configuration example of a programmable logic controller system according to an embodiment of the present invention. As shown in Figure 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 factories, etc. It is equipped with PC is an abbreviation for personal computer. The user program may be created using a graphical programming language such as a flowchart-style motion program such as a ladder language or SFC (sequential function chart), or may be created using a high-level programming language such as C language. . In the following, for convenience of explanation, the user program is assumed to be a ladder program. The PLC 1 includes a basic unit 3 with a built-in CPU and one or more expansion units 4. One or more expansion units 4 can be attached to and detached from the basic unit 3. For example, the extension unit 4a may be a positioning unit that positions a workpiece by driving a motor (field device 10a), and the extension 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. appended to the end of the reference numerals may be omitted. The basic unit 3 is sometimes called a CPU unit. Note that 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 equipped with a display section 5 and an operation section 6. The display section 5 can display the operating status of each expansion unit 4 attached to the basic unit 3. The display section 5 switches display contents according to the operation contents of the operation section 6. The display unit 5 normally displays current values (device values) of devices within the PLC 1, error information that has occurred within 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 also be called a device memory. The device value is information indicating the input state from the input device, the output state to the output device, and the state of internal relays (auxiliary relays), timers, counters, data memories, etc. set on the user program. There are two types of device values: bit type and word type. A bit device stores a 1-bit device value. A word device stores one word of device value.

拡張ユニット4は、PLC1の機能を拡張するために用意されている。各拡張ユニット4には、その拡張ユニット4の機能に対応するフィールドデバイス(被制御装置)10が接続され、これにより、各フィールドデバイス10が拡張ユニット4を介して基本ユニット3に接続される。フィールドデバイス10は、センサやカメラなどの入力機器であってもよいし、アクチュエータなどの出力機器であってもよい。また、一つの拡張ユニット4に対して複数のフィールドデバイスが接続されてもよい。 The expansion unit 4 is prepared to expand the functions of the PLC 1. Each expansion unit 4 is connected to a field device (controlled device) 10 corresponding to the function of the expansion unit 4, and thereby each field device 10 is connected to the basic unit 3 via the expansion unit 4. The field device 10 may be an input device such as a sensor or a camera, or may be an output device such as an actuator. Further, 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に送信してもよい。 The PC 2 may also be called a program creation support device. The PC 2 is, for example, a portable notebook-type or tablet-type personal computer, and includes a display section 7 and an operation section 8 . A ladder program, which is an example of a user program for controlling the PLC 1, is created using the PC 2. The created ladder program is converted into a mnemonic code within the PC 2. The PC 2 is connected to the basic unit 3 of the PLC 1 via a communication cable 9 such as a USB (Universal Serial Bus), and sends the ladder program converted into a mnemonic code to the basic unit 3. The basic unit 3 converts the ladder program into machine code and stores it in the memory provided in the basic unit 3. Note that although the mnemonic code is transmitted to the basic unit 3 here, the present invention is not limited to this. For example, the PC 2 may convert the mnemonic code into an intermediate code and send the intermediate code to the 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. Further, the PC 2 may be configured to be detachably connected to the basic unit 3 of the PLC 1 via a communication cable 9 other than the USB. Further, it may be configured such that it is connected wirelessly 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 a ladder diagram Ld displayed on the display unit 7 of the PC 2 when creating a ladder program. The PC 2 displays a plurality of cells arranged in a matrix on the display section 7. A symbol of a virtual device is arranged in each cell. Symbols indicate input relays, output relays, etc. A relay circuit is formed by multiple symbols. In the ladder diagram Ld, for example, 10 columns×N rows (N is any natural number) of cells are arranged. Then, symbols of virtual devices are appropriately arranged in the cells of each row.

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

各入力デバイスのシンボルの上方に表示されている文字(「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 that input device. The characters (“flag 1,” “flag 2,” and “flag 3”) displayed below the symbol of each input device represent the device comment associated with that input device. The characters (“return to origin”) displayed above the symbol of the output device are labels consisting of a character string representing the function of the output device.

図2が示す例では、デバイス名「R0001」および「R0002」にそれぞれ対応する2つの入力デバイスのシンボルが直列的に結合されることにより、AND回路が構成されている。また、これらの2つの入力デバイスのシンボルからなるAND回路に対して、デバイス名「R0003」に対応する入力デバイスのシンボルが並列的に結合されることにより、OR回路が構成されている。すなわち、このリレー回路では、一行目の2つのシンボルに対応する入力デバイスがいずれもオンした場合、または、二行目のシンボルに対応する入力デバイスがオンした場合にのみ、一行目のシンボルに対応する出力デバイスがオンになる。 In the example shown in FIG. 2, the symbols of two input devices corresponding to device names "R0001" and "R0002" are connected in series to form an AND circuit. Furthermore, an OR circuit is constructed by connecting in parallel the symbol of the input device corresponding to the device name "R0003" to the AND circuit composed of the symbols of these two input devices. In other words, this relay circuit responds to the symbol in the first row only when the input devices corresponding to the two symbols on the first row are both turned on, or when the input device corresponding to the symbol on the second row is turned on. The output device 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 PC 2. As shown in FIG. 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 23. The display section 7, the operation section 8, the storage device 22, and the communication section 23 are each electrically connected to the CPU 21. The storage device 22 includes a RAM and a 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 unit 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 the connection positions of multiple expansion units 4 to the basic unit 3, functions provided in the basic unit 3 (e.g. communication function and positioning function), and functions of the expansion unit 4 (e.g. shooting function). This is information that shows things like. Here, editing project data includes creating and changing project data. Project data created using editing software is stored in the storage device 22. Further, the user can read out the project data stored in the storage device 22 and change the project data using editing software, if 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 PLC 1. As shown in FIG. 4, the basic unit 3 includes a CPU 31, a display section 5, an operation section 6, a storage device 32, and a communication section 33. The display section 5, the operation section 6, the storage device 32, and the communication section 33 are each electrically connected to the CPU 31. The storage device 32 may include a RAM, ROM, memory card, etc. The storage device 32 has a plurality of storage areas such as a device section 34, a project storage section 35, and a removable memory card 36. The device section 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 PC 2. The storage device 32 also stores a control program for the 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 type of expansion bus. Note that the communication function regarding the unit internal bus 90 may be implemented as part of the communication section 33. The communication unit 33 may include a network communication circuit. The CPU 31 may transmit log data and the like to the PC 2, the cloud, etc. via the communication unit 33.

ここで、ユニット内部バス90について、補足説明する。このユニット内部バス90は、次に説明する入出力リフレッシュ等が行われるバスであって、ユニット内部バス90における通信制御は、いわゆるバスマスタ38によって実現される(なお、通信部33の一部としてバスマスタを設けてもよいし、CPU31の一部としてバスマスタ38を設けてもよい)。バスマスタ38は、ユニット内部バス90での通信を制御するための制御回路であって、CPU31からの通信要求を受けて、拡張ユニット4との間で、後述する入出力リフレッシュ等の通信を行う。 Here, a supplementary explanation will be given regarding the unit internal bus 90. This unit internal bus 90 is a bus on which input/output refresh, etc., which will be described next, is performed, and communication control on the unit internal bus 90 is realized by a so-called bus master 38 (note that a bus master 38 is used as part of the communication section 33). (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, and upon receiving a communication request from the CPU 31, performs communication such as input/output refreshing, which will be described later, with the expansion unit 4.

拡張ユニット4はCPU41とメモリ42を備えている。CPU41は、デバイスに格納された基本ユニット3からの指示(デバイス値)にしたがってフィールドデバイス10を制御する。また、CPU41は、フィールドデバイス10の制御結果をバッファメモリとよばれるデバイスに格納する。デバイスに格納された制御結果は入出力リフレッシュによって基本ユニット3に転送される。また、デバイスに格納されている制御結果は、基本ユニット3からの読み出し命令にしたがって、入出力リフレッシュとは異なるタイミングであっても、基本ユニット3に転送される。メモリ42はRAMやROMなどを含む。とりわけ、RAMにはバッファメモリとして使用される記憶領域が確保されている。メモリ42は、フィールドデバイス10によって取得されたデータ(例:静止画データや動画データ)を一時的に保持するバッファを有してもよい。 The expansion unit 4 includes 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. Further, the CPU 41 stores the control results of the field device 10 in a device called a buffer memory. The control results stored in the device are transferred to the basic unit 3 by input/output refresh. Furthermore, the control results stored in the device are transferred to the basic unit 3 in accordance with a read command from the basic unit 3 even if the timing is different from the input/output refresh. The memory 42 includes RAM, ROM, and the like. In particular, a storage area is reserved in the RAM to be used as a buffer memory. The memory 42 may have a buffer that temporarily holds data (eg, still image data or video 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. 5, one scan time T is composed of inter-unit communication 201 for refreshing input/output, program execution 202, and END processing 204. In inter-unit communication 201, the basic unit 3 transmits output data obtained by executing the ladder program from the storage device 32 within the basic unit 3 to an external device such as the expansion unit 4. Furthermore, the basic unit 3 captures input data received from an external device such as the expansion unit 4 into the storage device 32 within the basic unit 3 . In other words, the device value stored in the device of the basic unit 3 is reflected in the device of the expansion unit 4 by output refresh. Similarly, the device value stored in the device of the expansion unit 4 is reflected in the device of the basic unit 3 by input refresh. In this way, the devices of the basic unit 3 and the devices of the expansion unit 4 are synchronized by the input/output refresh. Note that a mechanism (inter-unit synchronization) in which device values are updated between units at a timing other than refresh may be adopted. However, the device of the basic unit 3 is rewritten by the basic unit 3 at any time, and similarly, the device of the expansion unit 4 is rewritten by the expansion unit 4 at any time. In other words, the devices in the basic unit 3 can be accessed at any time by devices inside the basic unit 3. Similarly, devices in the expansion unit 4 can be accessed at any time by devices inside the expansion unit 4. Basically, the basic unit 3 and the expansion unit 4 update and synchronize their device values with each other at refresh timing. In 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, a plurality of 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 a program. Note that the END processing refers to all processing related to peripheral services such as data communication with external devices such as a display (not shown) connected to the PC 2 and the basic unit 3, and system error checking.

このように、PC2はユーザの操作に応じたラダープログラムを作成し、作成したラダープログラムをPLC1に転送する。PLC1は、入出力リフレッシュ、ラダープログラムの実行およびEND処理を1サイクル(1スキャン)として、このサイクルを周期的、すなわちサイクリックに繰り返し実行する。これにより、各種の入力機器(センサ等)からのタイミング信号に基づいて、各種の出力機器(モータ等)を制御する。なお、スキャン周期とは別に、基本ユニット3や拡張ユニット4はそれぞれ内部制御周期を有している。基本ユニット3や拡張ユニット4は内部制御周期を基準としてフィールドデバイス10などの機能を制御する。 In this way, the PC 2 creates a ladder program according to the user's operation, and transfers the created ladder program to the PLC 1. The PLC 1 considers input/output refresh, ladder program execution, and END processing as one cycle (one scan), and repeatedly executes this cycle periodically, that is, cyclically. Thereby, various output devices (motors, etc.) are controlled based on timing signals from various input devices (sensors, etc.). Note that, in addition to the scan period, the basic unit 3 and the expansion unit 4 each have an internal control period. 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>
When a user improves or modifies a user program, the device values acquired while the PLC 1 is executing the user program may be useful. 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 used by user programs but also devices not used by user programs. Additionally, some devices are useful for improving or modifying user programs, while others are useless. Since the number of devices is generally in the thousands, it has been a heavy burden for users to specify the devices they need. 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 devices managed by the PLC 1 are targeted for logging, the scan time will become long. This is because logging is executed as one of the user programs or executed at the time of input/output refresh. Sometimes, the delay introduced by logging may prevent a user program from operating as desired by the user. Therefore, the number of devices to be logged should be maintained appropriately.

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

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

●ロギングの設定(自動抽出と加除)
図6はPC2のCPU21が記憶装置22に記憶されている編集ソフトウエアを実行することで実現される機能を示している。これらの機能の一部またはすべてはASICやFPGAなどのハードウエア回路により実現されてもよい。ASICは特定用途集積回路の略称である。FPGAはフィールドプログラマブルゲートアレイの略称である。
●Logging settings (automatic extraction and addition/subtraction)
FIG. 6 shows functions realized by the CPU 21 of the PC 2 executing editing software stored in the storage device 22. Some or all of these functions may be realized by a hardware circuit such as an ASIC or 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 realized on the PC 2, but the present invention is not limited to this, and may be realized on the PLC 1.

プロジェクト作成部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 in accordance with user instructions input from the operation unit 8 , and stores it in the storage device 22 . UI is an abbreviation for user interface. The project data 71 includes a user program, configuration information of the PLC 1, and the like. The program creation 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 regarding the functions of the basic unit 3 and the functions of the expansion unit 4. For example, the function setting section 62 assigns any device to the function provided in the basic unit 3, or assigns any device to the function provided in the expansion unit 4, and assigns the function and device. Write layout information indicating the relationship with the configuration information. Note that the project creation unit 50 also stores program configuration information indicating what kind of program parts the user program is composed of as the project data 71. Unit configuration information indicating what kind of units the entire PLC 1 is composed of is also stored as project data 71.

ログ設定部51は、プロジェクトデータ71を解析することでプロジェクトデータ71に記述されているデバイスを抽出し、抽出されたデバイスをロギング対象として設定するためのログ設定データ72を作成する。ログ設定部51は各種の機能を有している。部品指定部52は、操作部8から入力されるユーザ指示にしたがって、デバイスの抽出対象となるプログラム部品を指定する。また、部品指定部52は、操作部8から入力されるユーザ指示にしたがって、デバイスの抽出対象から除外されるプログラム部品を指定する。 The log setting unit 51 extracts the devices described in the project data 71 by analyzing the project data 71, and creates log setting data 72 for setting the extracted devices as logging targets. The log setting section 51 has various functions. The component designation unit 52 designates a program component from which a device is to be extracted in accordance with a user instruction input from the operation unit 8 . Furthermore, the component designation unit 52 designates program components to be excluded from device extraction targets in accordance with 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 extracts the devices described in the project data 71 by analyzing the project data 71, and creates log setting data 72. The adding unit 54 analyzes the program component specified as an extraction target by the component specifying unit 52, extracts the device described in the program component, and adds it to the extraction list. The deletion unit 55 analyzes the program component designated as an exclusion target by the component designation unit 52, extracts the device described in the program component, and deletes the extracted device from the extraction list. Alternatively, the deletion unit 55 adds the extracted device to the exclusion list. The merging unit 56 deletes duplicately extracted devices from the extraction list among the devices extracted from each of the plurality of program parts. The specifying unit 57 detects a command for a memory card in the project data 71, specifies the device targeted by the command, and adds the specified device to the extraction list.

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

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

なお、本実施形態では、説明の便宜上、追加部54と削除部55を分けているが、一つの機能ブロックであってもよいことは言うまでもない。 Note that in this embodiment, for convenience of explanation, the adding section 54 and the deleting section 55 are separated, but it goes without saying that 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 influence that the recording of device values by the PLC 1 has on the 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 time correlated to the number of device values to the scan time. Therefore, the estimation unit 59 may calculate the delay time by multiplying the number of device values by a predetermined coefficient, and display the delay time on the display unit 7 as the estimation result. This delay time may be referred to as scan time elongation.

機能指定部60は、操作部8から入力されるユーザ指示にしたがって、デバイスの抽出対象となる基本ユニット3の機能や拡張ユニット4の機能を指定する。また、機能指定部60は、操作部8から入力されるユーザ指示にしたがって、デバイスの抽出対象から除外される基本ユニット3の機能や拡張ユニット4の機能を指定する。追加部54は、機能指定部60により抽出対象として指定された機能の構成情報を解析し、構成情報により当該機能に割り付けられたデバイスを抽出し、抽出リストに追加する。 削除部55は、機能指定部60により除外対象として指定された機能の構成情報を解析し、構成情報により当該機能に割り付けられているデバイスを抽出し、抽出されたデバイスを抽出リストから削除する。マージ部56は、複数の機能のそれぞれについて抽出されたデバイスのうち、重複して抽出されたデバイスを抽出リストから削除する。特定部57は、プロジェクトデータ71においてメモリカードに対する命令語を検知し、当該命令語の対象となっているデバイスを特定し、特定されたデバイスを抽出リストに追加する。 The function specifying section 60 specifies the function of the basic unit 3 and the function of the expansion unit 4 from which devices are to be extracted, according to user instructions input from the operation section 8 . Further, the function specifying unit 60 specifies the functions of the basic unit 3 and the functions of the expansion unit 4 that are excluded from the device extraction target according to a user instruction inputted from the operation unit 8 . The adding unit 54 analyzes the configuration information of the function specified as an extraction target by the function specifying unit 60, extracts the device assigned to the function based on 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 specification unit 60, extracts the device assigned to the function based on the configuration information, and deletes the extracted device from the extraction list. The merging unit 56 deletes duplicately extracted devices from the extraction list among the devices extracted for each of the plurality of functions. The specifying unit 57 detects a command for a memory card in the project data 71, specifies the device targeted by the command, and adds the specified 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 section 61 may display the device values recorded in the log data 73 and the program components of the project data 71 in association with each other on the display section 7 . The log display section 61 forms the core of an engineering tool for programmable logic controllers.

図7はロギングの設定方法を示すフローチャートである。ここでは、すでにユーザプログラムを含むプロジェクトデータ71は完成しているものとする。 FIG. 7 is a flowchart 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 designation unit 52) receives designation of a program component from which a device is to be extracted.

図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 a program component whose device is to be 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 a tree shape based on their respective classifications (modules/function blocks/macro). Further, a check box 102 is displayed in association with each program component. When the pointer 101 ticks the checkbox 102 in response to the operation of the operating unit 8, the adding unit 54 adds the program component corresponding to the checked checkbox 102 to the extraction list. On the other hand, when the pointer 101 unchecks the checkbox 102 in response to an operation on the operation unit 8, the deletion unit 55 deletes (excludes) the program component corresponding to the unchecked checkbox 102 from the extraction list.

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

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

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

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

図9はデバイスを抽出される機能の選択を受け付けるためのUI110を示している。ログ設定部51は、ロギングの設定プログラムが起動されると、表示部7にUI110を表示する。なお、UI100とUI110は同時に表示されてもよいし、ユーザ操作にしたがって選択的に表示されてもよい。UI110において、複数の機能はそれぞれが属するユニットに基づいてツリー状に示されている。また、各機能にはチェックボックス102が関連付けて表示されている。操作部8の操作に応じてポインタ101がチェックボックス102にチェックを付与すると、追加部54は、チェックを付与されたチェックボックス102に対応する機能を抽出リストに追加する。一方、操作部8の操作に応じてポインタ101がチェックボックス102のチェックを外すと、削除部55は、チェックを外れたチェックボックス102に対応する機能を抽出リストから削除(除外)する。 FIG. 9 shows a UI 110 for receiving selection of a function to be extracted from a device. 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 displayed selectively according to user operations. In the UI 110, a plurality of functions are shown in a tree shape based on the unit to which each function belongs. Further, a check box 102 is displayed in association with each function. When the pointer 101 ticks the checkbox 102 in response to an operation on the operation unit 8, the adding unit 54 adds the function corresponding to the checked checkbox 102 to the extraction list. On the other hand, when the pointer 101 unchecks the checkbox 102 in response to an operation on the operation unit 8, the deletion unit 55 deletes (excludes) the function corresponding to the unchecked checkbox 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 to monitor communication errors in the communication section 33. The sensor I/O monitor is a function that monitors sensor input and output. The motion unit is also called a positioning unit and controls the position of a controlled object called an axis. Generally, a drive source such as a motor exists for each axis. The analog input unit is a unit that samples an input analog signal and converts it into a digital signal. The unit monitor is a function that monitors the operation of the expansion unit 4 such as a motion unit and an analog input unit.

ここで、ユニットモニタの一例として、モーションユニットのユニットモニタについて、更に詳述する。図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 more detail. FIG. 10A is a schematic diagram of the unit monitor 440 screen 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.

図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, commanded coordinates, current speed, commanded speed, feedback torque, load factor, and peak current are set as objects to be monitored by the unit monitor 440. A buffer memory (UG) is allocated to each item. For example, UG4 and UG5 are assigned to the current coordinates. In this embodiment, 16 bits are reserved for one UG, and two UGs are reserved to represent the current coordinates in 32 bits. The device value of UG is, for example, a numerical value such as 0PLS (pulse). Furthermore, UG8 and UG9 are assigned to the command coordinates. Two UGs are reserved for the same reason as mentioned above (to ensure 32-bit representation). Since the unit designer can freely allocate UGs, 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 commanded 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 confirmed as monitoring targets. Note that in FIGS. 10A and 10B, only the axis 1 of the motion unit has been described, but the same applies to the case where there are a plurality of axes 2 and 3. For each axis, the item selected by the user becomes the monitoring target.

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

しかし、PLCの運用時にトラブルが生じた場合に、その原因究明の為、トラブルが生じた時点でのモータの現在座標や現在速度を把握したいことがある。このようなときに、上述したようにモータの現在座標や現在速度は、基本的にはラダープログラムに記述されるものではないため、ロギング対象としての抽出リストに挙がっていないことが多く、その原因究明が容易でなかった。 However, if a trouble occurs during operation of the PLC, it may be desirable to know the current coordinates and current speed of the motor at the time the trouble occurred 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 written in the ladder program, so they are often not listed in the extraction list as logging targets. It was not easy to investigate.

そこで、本実施形態では、ユーザは、図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. Thereby, the adding unit 54 can automatically add the UG that is the target of monitoring by the unit monitor 440 of the motion unit to the extraction list, as described using 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は、ユーザ操作に基づいて一又は複数の機能を選択すると、その機能に対応付けられたテンプレートに従って、監視対象となるデバイスを抽出リストに追加する。 Note that other monitors are not shown in the drawings, but will be briefly described. The communication error monitor, which is a function of the basic unit 3, monitors devices assigned to cyclic communication establishment timeout errors, for example. A sensor I/O monitor that monitors input and output of a sensor monitors, for example, the output of one or more sensors and a 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 as defaults (initial settings) by the unit designer, but the monitoring target may be changed by the user, like the unit monitor of the motion unit described above. In short, the UI 110 shown in FIG. 9 is a setting screen that can accept 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 selected and input (the template is stored in the memory). The device specified by the template may be one that has been assigned in advance by default as described above, or one that has been added or removed (edited) by the user via the settings screen. When the function specifying unit 60 selects one or more functions based on the user's operation, the function specifying unit 60 adds devices to be monitored to the extraction list according to the template associated with the function.

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

図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 component among a plurality of program components included in the project data 71. According to FIG. 10C, the name of the program component from which the device was extracted, the name of the first device (device number), the number of devices extracted based on the first device, and the name of the device actually extracted as a logging target. is shown. Generally, a number of devices corresponding to a specified number are extracted based on the first device. However, the number of devices exceeding the specified number may be extracted. 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 bits of devices at once is more advantageous in terms of data processing speed. Note that in FIG. 10C, the number of R34000 is "1", which indicates 1 word (16 bits). Further, the number of CR4001 is also "1", which also indicates one word (16 bits of CR4001, CR4002, . . . , CR4015, CR4100). Global is a device that is 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 section 53 analyzes the configuration information of the function specified by the function specification section 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 designated function (unit) among a plurality of functions (basic unit 3 and expansion unit 4) provided in the PLC 1. In this example, several buffer memories (UG) are extracted from the motion unit specified by the function specifying section 60. According to FIG. 11, the name of the function that extracted the device, the name of the first device (device number), the number of devices extracted based on the first device, and the name of the device actually extracted as a 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 using 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 command speed of the motor. Descriptions of other UGs will be omitted.

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

S6でマージ部56は、プログラム部品から抽出されたデバイス、機能から抽出されたデバイスおよび手動で追加されたデバイスをマージしてロギング対象リストを作成する。ロギング対象リストはデバイスリストと呼ばれてもよい。 In S6, the merging unit 56 creates a logging target list by merging the devices extracted from the program parts, the devices extracted from the functions, and the manually added devices. The logging target list may be called 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 explaining the concept of merge processing. The device extraction unit 53 creates an extraction list L1 that describes devices extracted from the program parts. The device extraction unit 53 creates an extraction list L2 that describes devices extracted from the functions. The device extraction unit 53 creates an extraction list L3 that describes devices manually added by the user. The merging unit 56 merges the extraction lists L1 to L3 to create a logging target list L0. In the extraction lists L1 to L3, there is a possibility that there are devices that have been extracted redundantly. If the same device is logged multiple times, the log data will become large. Therefore, a merge process is performed to avoid duplicate logging for the same device. For example, in the extraction list L1, data memories DM0 to DM100, which are a type of device, are registered. Furthermore, data memories DM50 to DM200 are registered in the extraction list L3. In other words, DM50-DM100 overlap. The merging unit 56 merges DM0-DM100 and DM50-DM200 and writes DM0-DM200 in the logging target list L0.

S7で推定部59はロギング対象リストL0を解析し、スキャンタイムへの影響を推定し、推定結果を表示部7に表示する。 In S7, the estimation unit 59 analyzes the logging target list L0, estimates the influence on 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 a UI 140 for displaying estimation results. The UI 140 displays the device size and scan time increase. The device size indicates the total size of the devices described in the logging target list L0. The increase in scan time is the delay time caused by logging. The estimator 59 analyzes the logging target list L0 and calculates the device size and scan time increase. 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. The user considers the estimation results and determines whether to finalize 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 intention to confirm.

S8でログ設定部51はロギング対象を確定するかどうかを判定する。たとえば、ロギング対象リストL0を確定するためのボタンが操作されると、ログ設定部51はロギング対象を確定すると判定する。一方で、ロギング対象リストL0を修正するためのボタンが操作されると、ログ設定部51はロギング対象を修正すると判定する。ロギング対象を修正する場合、ログ設定部51はS3ないしS8を繰り返すことで、デバイスの抽出対象となるプログラム部品および機能の追加や削除を受け付け、ロギング対象リストL0を修正する。たとえば、スキャンタイムの伸びが許容閾値を超えると、いくつかのデバイスが削除される。スキャンタイムの伸びが許容閾値未満であれば、いくつかのデバイスが追加されてもよい。ロギング対象が確定すると、CPU21はS9に進む。 In S8, the log setting unit 51 determines whether to confirm the logging target. For example, when a button for confirming the logging target list L0 is operated, the log setting unit 51 determines to confirm 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 that the logging target is to be modified. When modifying the logging target, the log setting unit 51 repeats S3 to S8 to accept additions or deletions of program parts and functions to be extracted from devices, and modifies the logging target list L0. For example, some devices may be removed if the scan time growth exceeds an acceptable threshold. Some devices may be added if the increase in scan time is below an 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 S9, the log setting unit 51 creates log setting data 72 including the logging target list L0, 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 the operating status and function setting status of each function (eg, IP address, etc.) may also be added as a logging target.

図14はデバイスの抽出処理で使用されるフィルタの設定UI120を示している。PLC1に関連したデバイスとしては複数の種別のデバイスが存在する。ユーザは特定の種別のデバイスに着目し、他の種別のデバイスについては無視したいと考えることもある。そこで、ログ設定部51は、フィルタの設定UI120を表示部7に表示し、抽出対象とするデバイス種別と、除外対象とするデバイス種別とをチェックボックス102を通じて受け付けてもよい。たとえば、デバイス抽出部53は、チェックボックス102にチェックを付与されたデバイス種別をプログラム部品や機能から抽出する。デバイス抽出部53は、チェックボックス102からチェックを外されたデバイス種別をプログラム部品や機能から抽出しない。これにより、ユーザの意図に沿って用意にロギング対象となるデバイスを取捨選択することが可能となる。 FIG. 14 shows a filter setting UI 120 used in the device extraction process. There are multiple types of devices related to the PLC1. Users may want to focus on a specific 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 box 102. For example, the device extraction unit 53 extracts the device type whose check box 102 is checked from the program components and functions. The device extraction unit 53 does not extract device types whose check boxes 102 are unchecked from program parts and functions. This makes it possible to easily select devices to be logged according to the user's intentions.

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

デバイス抽出部53はPC2に実装されているが、基本ユニット3に実装されてもよい。CPU31は、プロジェクトデータ71のうちPC2により指定されたプログラム部品や機能からデバイスを抽出し、ログ設定データ72を作成する。この場合、推定部59も基本ユニット3に実装されることになろう
●デバイスの抽出処理
図15はデバイス抽出部53が実行するプログラム部品からのデバイスの抽出処理を示すフローチャートである。図16はラダープログラムの一例を示している。このラダープログラムは拡張ユニット4として4軸を駆動するモーションユニットを制御するためのものである。
Although the device extractor 53 is installed in the PC 2, it may also be installed in the basic unit 3. The CPU 31 extracts devices from the program parts and functions designated by the PC 2 from the project data 71 and creates log setting data 72. In this case, the estimation section 59 will also be implemented in the basic unit 3. Device extraction processing FIG. 15 is a flowchart showing the device extraction processing from the program component executed by the device extraction section 53. FIG. 16 shows an example of a ladder program. This ladder program is for controlling a motion unit that drives four axes as the expansion 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 component designated as the extraction target. The initial value of i is 001. As shown in FIG. 16, step numbers are assigned to the left end of the ladder program. In step 001, when a relay device called MR000 is turned on, a relay device called R34000 which gives permission to operate the motion unit is turned on, and a relay called R34305 is turned on to operate the servo of the first axis of the motion unit. It says to turn on the device. Therefore, the device extraction unit 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 a program to which the indirect reference destination or index value is assigned, and identifies the actual device number. Note that when the device extraction section 53 fails to extract the actual device number, it may display a message indicating the extraction failure on the display section 7. Further, the device extraction unit 53 may display a UI on the display unit 7 for allowing the user to input the actual device number, and may accept user input. Furthermore, considering the above-mentioned indirect references and index references, the device extraction unit 53 not only extracts specific devices directly described in the program, but also extracts specific devices used in the program (indirect references and index references). 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 the device number of the first device and the number of devices based on the first device as arguments. For example, step number 003 describes that when relay device MR000 is turned on, a command word FMOV is executed. In this example, FMOV is a command word (for initializing related devices) to assign a specified value (0) to a specified number (10) of devices based on the first device (@EM0). command word). In other words, the access range is defined by the start address and the designated 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 the indirect reference destination and the program to which the index value is assigned, and specifies the actual access range. Note that when the device extraction section 53 fails to extract the actual access range, it may display a message indicating the extraction failure on the display section 7. Furthermore, the device extraction unit 53 may display a UI on the display unit 7 for allowing the user to input the actual access range, and may accept user input.

S13でデバイス抽出部53は、先頭デバイス番号とデバイス範囲に基づきデバイスを抽出し、抽出したデバイスを抽出リストに追加する。たとえば、001番のステップからはMR000、R34000およびR34005が抽出され、抽出リストに追加される。003番のステップからは@EM0から@EM9が抽出され、抽出リストに追加される。 In S13, the device extraction unit 53 extracts devices based on the first device number and 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 designated program component has been completed up to the end of the program. If the device analysis has not been completed to the end of the program, the device extraction unit 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 has been completed up to the end of the program, the device extraction unit 53 ends the device extraction process.

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

004,005番のステップは、モータの原点復帰(動作)要求であり、R34310は、モータの原点復帰開始トリガーを示すリレーデバイスである。本ステップからは、MR001、R34310、R40905,R40910,R34310の各デバイスが抽出される。 Steps 004 and 005 are requests for the motor to return to its origin (operation), and R34310 is a relay device that indicates a trigger to start returning the motor to its origin. 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 processes for reading the origin return completion code from the motion unit and determining whether or not the origin return has been correctly completed when the motor has completed the return to origin. To explain more specifically, R40910 is a relay device that indicates a trigger for completing the return of the motor to its origin. The basic unit 3 does not recognize the specific processing operations of the return to origin in the motion unit in real time, and determines whether the return to origin has been completed by monitoring whether this flag R40910 is turned ON. 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 buffer memory No. 4060 in the unit with unit number 1 and assign one word to device @EM0. Here, the buffer memory No. 4060 stores a return-to-origin completion code, which is 0 if the return-to-origin has ended normally, and a value other than 0 (1 or 2 if the return-to-origin has ended abnormally). etc.) are now stored. Then, as shown in step 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, as shown in step 008, if the device value of @EM0 is 0, the basic unit 3 sets the device MR001 and recognizes that the 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 only one second when the return to origin is completed normally. The device T0 has a current count value of 10 (equivalent to 1 second since it is in units of 100 ms) as a set 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 is turned on, the function block "First_operation" is executed for the unit with unit number 1. 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 using Fig. 16, in a general ladder program, devices corresponding to the start of an operation, such as axis servo ON, origin return request, function block activation and result, etc., and devices corresponding to the completion of the operation, Only devices are described. However, when a problem occurs, having information on the operating status (such as the motor's current coordinates and current position) is useful for investigating the cause, so as mentioned above, UGs that are subject to monitoring by the unit monitor can also be extracted. I am trying to automatically add it to the list.

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

●ロギングの実行
図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 a hardware circuit such as an ASIC or 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 log setting data 72 received from the PC 2 in the storage device 32. The execution unit 80 includes 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 section 80 writes device values to output devices held in the basic unit device section 34a of the device section 34, and writes device values to output devices held in the basic unit device section 34a according to the user program. Read device values from input devices.

一方で、実行部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 input/output refresh into the expansion unit device section 34b. Further, 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 on this unit internal bus, that is, a so-called bus master function. When the unit control unit 80b functions as a bus master, it performs refresh control with each expansion unit based on the unit configuration information explained using FIG. communicate.

記録部81は、ログ設定データ72にしたがってデバイス部34(基本ユニットデバイス部34a又は拡張ユニットデバイス部34b)からデバイス値を取得したり、拡張ユニット4のバッファメモリからデバイス値を取得したりして、ログデータ73としてメモリ(例えばリングバッファ)に書き込む。上述されたように、記録部81は、END処理の際などに、ロギング処理を実行する。 The recording unit 81 acquires a device value from the device unit 34 (basic unit device unit 34a or expansion unit device unit 34b) or acquires a device value from the buffer memory of the expansion unit 4 according to the log setting data 72. , 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 and 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 explained using FIG. 10C and FIG. 11, the log setting data 72 includes devices written in program parts specified by the part specifying section 52 and functions specified by the function specifying section 60 (for example, unit monitor). Devices assigned to the monitoring target (monitoring target) are included as logging targets. For the former device, the device value of the target device (UG) is read from the expansion unit 4 during the END process, and for the latter device, the device value is written to the log data 73 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, since the device values of the UG are read out in synchronization with the scan cycle, not all current coordinates and command coordinates are written to the log data 73. However, the present invention is not limited to this, and for example, current coordinates and command coordinates are stored in the memory of the expansion unit 4 for each control cycle, and at the timing of the scan cycle, a plurality of previously stored current coordinates and command coordinates are stored in the memory of the expansion unit 4. It is also possible to configure it to read out coordinates and the like.

また、記録部81は、時刻管理部83により保持されている時刻情報をログデータ73の各レコードに付与する。これによりログデータ73には時系列にデバイス値が並べられる。 Furthermore, the recording unit 81 adds time information held by the time management unit 83 to each record of the log data 73. As a result, 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 designated by the logging target list L0 of the log setting data 72, but additional devices may be designated by the detection unit 82. The detection unit 82 may detect, for example, rewriting of a device value from an external device to any device included in the device unit 34. Generally, device values may be rewritten according to a user program or may be rewritten by an external device. Such rewriting cannot be detected in advance simply by analyzing the user program. The recording unit 81 may add a device whose device value has been detected to be rewritten by the detection unit 82 as a logging target. Generally, rewriting device values from an external device tends to cause unexpected events for the user. Therefore, the recording unit 81 will be useful for the user to improve the program by logging the device values rewritten by the external device.

ところで、END処理において、ユーザプログラムとは無関係に発行されるUG読み出し命令が発行されることがある。UGはバッファメモリを示すデバイス種別である。検知部82は、ユーザプログラムとは無関係に発行されるUG読み出し命令を検知してもよい。記録部81は、検知部82により検知されたUG読み出し命令の対象となっているバッファメモリを特定し、特定したバッファメモリを記録対象として追加してもよい。この拡張ユニット4がモーションユニットである場合、このようなバッファメモリには、トルク値や現在座標位置などが記憶されている。 By the way, in the END process, a UG read command may be issued regardless of the user program. UG is a device type indicating a buffer memory. The detection unit 82 may detect a UG read command issued regardless of the user program. The recording unit 81 may identify the buffer memory that is the target of the UG read command detected by the detection unit 82, and add the identified buffer memory as a recording target. When the 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 FPGA or the like. The execution unit 80 may be realized by ASIC. In this case, the execution unit 80 specifies the address of the device to be read/written to the storage device 32 using an address line. Therefore, the detection unit 82 may dynamically detect a device whose device value has been updated by monitoring this address line. This may be useful when adding a device that is not described in the user program as a recording target.

検知部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 in the device unit 34, and may also write this device value and the device name (device number) to the log data 73. This method is useful when adding a device that is not described in the user program and can be dynamically allocated as a recording target.

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

ところで、記録部81はスキャン周期ごと、または、所定の収集周期ごとにデバイス値をログデータ73に書き込んでもよい。たとえば、一周期内で検知部82が複数回にわたるデバイスへのアクセスを検知したとしても、記録部81は、最後のアクセスが検知されたときのデバイス値だけでログデータ73に書き込んでもよい。これにより、ログデータ73のデータサイズを削減することが可能となる。 By the way, the recording unit 81 may write the device value to the log data 73 every scan cycle or every 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 was detected. This makes it possible to reduce the data size of the log data 73.

実行部80はデバイスを保持するキャッシュを有していてもよい。この場合、検知部82はキャッシュを監視することで、デバイスの書き込みを検知してもよい。 The execution unit 80 may have a cache that holds devices. In this case, the detection unit 82 may detect writing by the device 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 an 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 by the execution unit 80 to the buffer memory of the expansion unit 4. In this case, the execution unit 80 writes the device value read from the buffer memory of the expansion unit 4 into 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 into 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 installed in the execution unit 80, when the execution unit 80 detects a command word to rewrite a device value, it outputs the device value together with the command word to the recording unit 81. The recording unit 81 may write the command word, the device value, and the time stamp (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などが、デバイスごとに設定されてもよい。このようなデータ形式はプログラム部品における命令語を解析することで判別可能である。 Incidentally, the log setting data 72 may include the data format (eg, binary format or text format) of the log data 73. Data formats include 16-bit decimal, 32-bit decimal, 16-bit decimal, 32-bit decimal, 16-bit hexadecimal, 32-bit hexadecimal, character string, Float, DoubleFloat, etc., and can be set for each device. may be done. Such a data format can be determined by analyzing the instruction words in the program component.

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

なお、本実施形態では、所定の出力条件が満たされたときに、ログデータ73等をメモリカード36に書き込むこととしたが、本発明はこれに限られず、例えば、内部メモリ37(フラッシュメモリやハードディスクなどの不揮発性メモリ)に保存しても構わない。また、少なくともログデータ73については、所定の出力条件が満たされたときにメモリカード36又は内部メモリ37に保存される必要がある一方、プロジェクトデータ71については、所定の出力条件が満たされたときに限られない。例えば、PLC1が設定モード(PROGRAMモード)から運転モード(RUNモード)になったタイミングで、予めメモリカード36や内部メモリ37に保存しておいてもよい。 Note that in this embodiment, the log data 73 and the like are written to the memory card 36 when a predetermined output condition is met, but the present invention is not limited to this, and for example, the internal memory 37 (flash memory or You can also save it to a non-volatile memory such as a hard disk. Furthermore, at least the log data 73 needs to be saved in the memory card 36 or internal memory 37 when predetermined output conditions are met, while the project data 71 needs to be saved when predetermined output conditions are met. Not limited to. For example, the information may be stored in the memory card 36 or 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 illustrating the creation process (unit setting) of configuration information executed by the function setting section 62. The function setting section 62 may be called a unit editor. When the function setting section 62 receives permission to start the unit editor, it displays the unit setting UI 150 on the display section 7. The name column 151 is a column for displaying the name (eg, model number, etc.) of each unit. Note that each unit is automatically assigned a unit number. In this example, "0" is assigned to the basic unit 3 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 output-related devices. 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. The end unit is a so-called termination unit. The user uses the operation unit 8 to set the type of expansion unit 4, the connection order, and the devices to be allocated. The function setting unit 62 stores information indicating the type of expansion unit 4, the connection order (unit number), and the devices allocated to each of the basic unit 3 and expansion unit 4 in the configuration information. The configuration information may be referred to as unit configuration information. Here, devices are assigned to each unit, but devices 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 devices assigned to each unit and information indicating devices assigned to each function. Therefore, by referring to the configuration information, the device extraction unit 53 can extract the devices assigned to each unit and the devices assigned to each function.

<大容量データのロギング>
フィールドデバイス10としてカメラが存在する。ユーザはワークや制御対象の状態をカメラにより取得し、画像とデバイス値とを対比しながら、ユーザプログラムを改良することを望むことがある。したがって、相互に関連した画像とデバイス値とをどのように管理するかが問題となる。なぜなら、画像は拡張ユニット4により取得され、デバイス値は基本ユニット3によって取得されることが一般的だからである。さらに、画像の取得周期と、デバイス値の取得周期とは異なることが一般的である。このような事情から画像などの大容量データと、デバイス値のような比較的に小容量のデータとをどのように紐付けて管理するかが問題となる。
<Logging large amounts of data>
A camera exists as the field device 10. A user may desire to improve a user program by capturing the state of a workpiece or a controlled object using a camera and comparing the image with device values. Therefore, the problem is how to manage images and device values that are related to each other. This is because images are generally acquired by the expansion unit 4 and device values are acquired by the basic unit 3. Furthermore, the image acquisition cycle and the device value acquisition cycle are generally different. Under these circumstances, the problem is how to link 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. The same reference numerals are given to parts that have already been explained. In this example, the recording section 81 has a collecting section 92a. When a predetermined collection start condition is met, the collection unit 92a reads out the device value specified by the log setting data 72 from among the device values held in the device unit 34, and also reads the device value from the time management unit 83a. Get time information. The collection unit 92a associates the device value and time information and stores them in the ring buffer 91a. Note that 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 data stored in the ring buffer 91a is stored in the memory card 36 as log data 73. For example, the storage unit 93 may read the device value and time information from the ring buffer 91a, 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 time information from the expansion unit 4, create log data 73, and store the log data 73 in the memory card 36 when a predetermined storage condition is met. The storage unit 93 stores the above-mentioned device value and time information, and the above-mentioned large-capacity data and time information in association with each other. Here, "storing in association" means that the files may be saved in a format that is easy to play on the PC 2, and 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 in which device values and time information are stored and a second subfolder in which large capacity data and time information are stored are placed under a specific folder. If so, the path (directory path) to a specific folder becomes a common flag, and this common flag can be used to "correspond" and save files in the first subfolder and files in the second subfolder. It becomes possible. Further, if there is another folder placed at the same level (directory) as the above-mentioned specific folder, that other folder means a data package saved at another time. Of course, subfolders similar to those described above are also placed under this other folder. In this way, the storage unit 93 stores the above-mentioned device value and time information, and the above-mentioned data (large capacity data) and time information in a plurality of files identified by the common flag (predetermined directory path). , you may save multiple files. In addition, for example, it is also possible to save files in a "corresponding manner" by using a file name as a common flag and generating files with the same or corresponding file names. For example, it is also possible to associate device values and data (large amount of data) using time information as a key, create a list, and compile them into a single file to save them in an "associated" manner. . In this embodiment, large-capacity data is considered as an example of data from the monitoring equipment, but it goes without saying that continuous data such as motion data, communication data, and audio data may also be used. The transmitter 94 may transmit the log data 73 to the PC 2, the 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 a buffer, this is only an example. It would be sufficient to use a FIFO format buffer as the buffer.

図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 illustrating the functions of the CPU 41 of the expansion unit 4 having a camera input function. The clock of the time management section 83b is synchronized with the clock of the time management section 83a of the basic unit 3. For example, the time management section 83a transmits time information to the time management section 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. The clock may be realized by a counter that counts time based on time information. The collection unit 92b outputs a trigger signal periodically, for example, when a predetermined collection condition (eg, a predetermined relay device is turned on) is satisfied. The time management unit 83b acquires time information from a 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. The connection port 97 is an interface for connecting the camera 98 to the expansion unit 4. The connection port 97 periodically outputs a trigger signal issued by the collection unit 92b to the camera 98, and outputs image data output by the camera 98 to the image reception unit 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 a monitoring device such as a camera 98 and receives data (image data) from the monitoring device. The image receiving section 96a is all or a part of the function execution section 96 that executes an imaging function that involves inputting image data from the camera 98 via the connection port 97. In this embodiment, the function execution unit 96 (image reception unit 96a) executes control of the camera 98 based on imaging parameters (an example of setting information) such as exposure time, gain, white balance, and contrast. For such imaging parameters, desired parameter values are set in the PC 2 and sent to the function execution unit 96 via the communication unit 33 and 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 a display. Note that the communication unit 33 serving as the first external interface also accepts user programs created on 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 the present embodiment, the collection unit 92b automatically and periodically outputs the imaging trigger signal to the camera 98; however, the present invention is not limited to this, and the collection unit 92b may output an imaging trigger signal to the camera 98 automatically and periodically, for example. An imaging trigger signal may be output to the camera 98 based on this.

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

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

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

S21でCPU31(収集部92a)はデバイス値の取得条件が満たされたかどうかを判定する。取得条件はリングバッファ91aに対するデバイス値と時刻情報の格納を開始するための条件である。取得条件は、ユーザプログラム中に記述されてもよいし(例:開始リレーがオンになったこと)、ログ設定データ72において記述されていてもよい。取得条件が満たされると、CPU31はS22に進む。 In S21, the CPU 31 (collection unit 92a) determines whether the device value acquisition conditions are satisfied. The acquisition condition is a condition for starting storing the device value and time information in the ring buffer 91a. The acquisition condition may be written in the user program (for example, that the start relay is turned on) or may be written in the log setting data 72. When the acquisition conditions are met, 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 one-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 the timing to acquire the device value has arrived. The acquisition timing is, for example, every scan cycle (for example, acquired during END processing in every scan), and is defined by the log setting data 72. When the acquisition timing arrives, 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 these 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 the storage timing has arrived. The save timing is the timing at which the information held in the ring buffer 91a is saved in the log data 73. The storage timing may be, for example, the occurrence of a predetermined event (eg, a storage trigger). The save timing is also defined by the log setting data 72. If the storage timing has not arrived, the CPU 31 returns to S23. If the storage timing has arrived, the CPU 31 proceeds to S26.

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

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

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

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

S31でCPU41(収集部92b)は画像データの取得条件(例:取得リレーがONになったこと)が満たされたかどうかを判定する。取得リレーがONになると、CPU41はS32に進む。なお、本実施形態では取得リレーがONになったときに、画像データの取得条件が満たされたと判定するようにしたが、これは一例に過ぎない。他にも例えば、PLC1のモードが運転モードに切り替えられたときに、画像データの取得条件が満たされたと判定されてもよい。より具体的には、PLC1には、各種設定を行うための設定モード(プログラムモード)と、ラダープログラムを繰り返し実行して実際の運転を行う運転モード(RUNモード)とを切り替えるモード切替スイッチが設けられてもよい。この場合、ユーザによって、このモード切替スイッチがプログラムモードからRUNモードに切り替えられたら、画像データの取得条件が満たされたと判定されてもよい。 In S31, the CPU 41 (collection unit 92b) determines whether the image data acquisition condition (eg, that the acquisition relay is turned on) is satisfied. When the acquisition relay is turned on, the CPU 41 proceeds to S32. Note that in this embodiment, when the acquisition relay is turned on, it is determined that the image data acquisition condition is satisfied, but this is only an example. In addition, for example, when the mode of the PLC 1 is switched to the driving mode, it may be determined that the image data acquisition condition is satisfied. More specifically, the PLC 1 is provided with a mode changeover switch that switches between a setting mode (program mode) for making various settings and an operation mode (RUN mode) for repeatedly executing a ladder program to perform actual operation. It's okay to be hit. In this case, when the user switches the mode changeover 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 the image data acquisition timing has arrived. The acquisition timing is, for example, every internal control cycle (imaging cycle) of the expansion unit 4. When the acquisition timing arrives, 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 (collection unit 92b) acquires the large amount of data and 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. Upon receiving the trigger signal, the time management section 83b reads time information from the internal clock and writes it into the time information buffer 95. The camera 98 performs imaging according to prespecified imaging conditions and outputs image data. The image receiving section 96a outputs image data to the collecting section 92b. The image receiving unit 96a may directly write 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 into the ring buffer 91b.

S34でCPU41(収集部92b)は、基本ユニット3からリングバッファ91bに対する読み出し要求(読み出し命令)が発行されたかどうかを判定する。読み出し要求を受信したのであれば、CPU41はS35に進む。読み出し要求が発行されていなければ、CPU41はS32に戻る。 In S34, the CPU 41 (collection unit 92b) determines whether the basic unit 3 has issued a read request (read command) to the ring buffer 91b. If a 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 S35, the CPU 41 (collection unit 92b) acquires image data and time information, which are large volumes of data, from the ring buffer 91b 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 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 met, the CPU 41 returns to S32. If the termination conditions are met, 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 the connection form of the building block type PLC1. An IF 99a for connecting and communicating with the expansion unit 4 is provided on the right side of the basic unit 3. IF is an abbreviation for interface. In this example, an expansion unit 4a is connected to the basic unit 3, and an expansion unit 4b is connected to the expansion unit 4a. The expansion unit 4 has an IF 99 on both the right side and the left side. The right side of the basic unit 3 faces the left side 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 of the expansion unit 4a faces the left side of the expansion unit 4b. Therefore, the IF 99c of the expansion unit 4a is connected to the IF 99d provided on the left side of the expansion unit 4b. Note that 99e provided on the right side of the expansion unit 4b may be connected to an end unit. In this way, the IFs 99a to 99e form the unit internal bus 90. For example, image data acquired by a camera 98a connected to the expansion unit 4a may be transferred to the base unit 3 via the unit internal bus 90. Image data acquired by a camera 98b connected to the expansion unit 4b can be transferred to the basic unit 3 via the unit internal bus 90.

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

図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 a connection form of a PLC 1 having a backplane 200. The backplane 200 is connected to the bottom surface of the base unit 3 and the bottom surface of the expansion unit 4, or to the back surface of the base unit 3 and the back surface of the expansion unit 4. The backplane 200 functions as a support plate (base plate) that supports the basic unit 3 and expansion unit 4. Here, as an example, the back surface will be explained as a connection surface. The back of the basic unit 3 faces the front of the backplane 200. Therefore, the IF 99f provided on the back surface of the basic unit 3 is connected to the IF 99g provided on the front surface of the backplane 200. The back side of the expansion unit 4 faces the front side of the backplane 200. The IF 99h provided on the back of the expansion unit 4a is connected to the IF 99i provided on the front of the backplane 200. The IF 99j provided on the back surface of the expansion unit 4b is connected to the IF 99k provided on the front surface of the backplane 200. IF99f to IF99k form a unit internal bus 90.

なお、バックプレーン200は、ユニット内部バス90を介したバス通信を制御するための通信制御部213を有していてもよい。また、バックプレーン200は、CPU211やメモリ212を有していてもよい。メモリ212はRAMやROMに加え、メモリカード36を有していてもよい。この場合、CPU211は収集部92aや保存部93して機能してもよい。また、メモリ212にはリングバッファ91aが設けられてもよい。あるいは、CPU211は時刻管理部83bおよび収集部92を有していてもよい。この場合、メモリ212はリングバッファ91bを有する。 Note that the backplane 200 may include a communication control section 213 for controlling bus communication via the unit internal bus 90. Further, the backplane 200 may include a CPU 211 and a memory 212. The memory 212 may include a memory card 36 in addition to RAM or ROM. In this case, the CPU 211 may function as the collection section 92a or the storage section 93. Further, the memory 212 may be provided with a ring buffer 91a. Alternatively, the CPU 211 may include a time management section 83b and a collection section 92. In this case, 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. In this example, the acquisition timings of device values d1 to d10, workpiece images i1 to i3 acquired by camera 98a, and other images j1 to j3 acquired by camera 98b are shown. Device values d1 to d10 are acquired every scan cycle. The workpiece images i1 to i3 are acquired at the timing when the trigger signal is generated. The workpiece images j1 to j3 are acquired at the timing when the trigger signal is generated. The position of each data indicates the respective time information. As shown in FIG. 26, the acquisition times and acquisition cycles 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 illustrating the display timing and display duration time of the log data 73. The log display section 61 displays each device value on the display section 7 according to the time information of each device value. For example, the log display unit 61 determines the difference 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 a display duration time elapses after starting to display the device value d1. Thereafter, the display duration time is determined in the same way, and the device values to be displayed are switched according to the time information and the display duration 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 workpiece image i1 with the acquisition times of the device values d1 to d10, and determines the acquisition time of the device value dx that is closest to the acquisition time of the workpiece 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 section 61 starts displaying the device value d1 and starts displaying the workpiece image i1. Next, the log display unit 61 determines the acquisition time of the device value dx that is 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 display timing of the device value d4 arrives, the log display section 61 starts displaying the device value d4 and the workpiece image i2. The log display unit 61 determines the acquisition time of the device value dx that is closest to the acquisition time of another 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 section 61 starts displaying the device value d2 and starts displaying the other image j1.

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

図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 illustrating a method of displaying log data 73. In this example, relay device R000 and data memory DM100 are obtained as device values dx (x takes a value from 1 to 10). In this way, a plurality of device values are linked to one workpiece image ix according to time information. The log display section 61 may display the device value dx, the work image ix, and the other image jx in one window, or may display each in separate windows. Further, the log display section 61 may read the user program from the project data 71, map the device value dx to the user program, and display the mapping. For example, the log display unit 61 may search for a step that includes a command word related to the device value dx to be displayed, display the found step, and display the device value below the command word in the step. . Note that the display target device may be a relay device. The log display unit 61 may change the display color or icon image (eg, arrow) of the command word depending on whether the relay device is turned on or off. There are icon images that indicate on and those that indicate off. Further, the log display section 61 may display device values in a graph form. In this case, the log display section 61 always displays the device values d1 to d10 in one window and displays the work image in the other window. The log display section 61 switches workpiece images as time passes. Here, the log display section 61 may display a bar 103 that is movable in the time axis direction. Bar 103 may also be called a timeline bar. The log display section 61 may display the bar 103 so as to move from left to right as time passes. Bar 103 may be moved by the user. In this case, the log display section 61 receives a movement operation of the bar 103 (eg, a drag operation using the pointer 101) through the operation section 8, and updates the display time according to the movement operation. The log display section 61 may extract device values, work images, and other images whose acquisition times are closest to the display time specified by the bar 103 from the log data 73 and display them on the display section 7 .

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

<収集期間の設定>
ログ設定部51はログデータ73の収集期間の設定を受け付けてもよい。
<Collection period settings>
The log setting unit 51 may accept settings for 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 the UI 160 for setting the collection period. Note that the UI 160, UI 110, and UI 100 may be switched by selecting respective tabs with the pointer 101. The UI 160 has a pull-down menu 161 for specifying a collection method. The collection method is a method for collecting the log data 73. In this example, a collection method called before and after save 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 a collection time Ta before the save trigger is turned on and at a collection time Tb after the save trigger is turned on. Text box 162 accepts input of collection time T. Collection time T is the total value of collection time Ta and collection time Tb. The text box 163 accepts input of the collection time Tb after the trigger. The storage trigger setting unit 164 receives settings for the 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 the 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 log data 73 is collected after the save trigger. The log setting unit 51 may also display information regarding the above-mentioned device size and scan time increase on the UI 160.

保存トリガー前後と呼ばれる収集方法では、リングバッファ91にはデバイス値や画像データが常時格納される。保存部93は、保存トリガーであるリレーデバイスR200がオンになると、収集時間として指定された20秒のログデータ73を作成する。保存部93は、リレーデバイスR200がオンになったタイミングから18秒前に記録されたデータから、当該タイミングから2秒後までに記録されたデータをリングバッファ91から読み出してログデータ73を作成する。 In a collection method called before and after storage trigger, device values and image data are always stored in the ring buffer 91. When the relay device R200, which is a storage trigger, is turned on, the storage unit 93 creates log data 73 for 20 seconds, which is specified as the collection time. The storage unit 93 reads from the ring buffer 91 data recorded 18 seconds before the timing when the relay device R200 was turned on, and data recorded up to 2 seconds after the timing, and creates 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 the 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 by 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 used as the starting relay. As shown by the guidance section 165, in a collection method called a start relay, the timing when the start relay is turned on is the starting point (starting point) of the collection time. For example, assume that it takes 30 seconds to press one workpiece coming down the production line. Further, it is assumed that the time during which trouble may occur is the first 20 seconds of the 30 second processing time. Relay device R000 is a relay that defines the timing to start press processing. When relay device R000 is turned on, collection unit 92 stores device values and image data in 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 the device values and image data in the ring buffer 91 for 20 seconds. When the relay device R200, which is a storage trigger, is turned on, the storage unit 93 acquires the latest 20 seconds of device values and image data stored in the ring buffer 91, and creates log data 73. Relay device R200, which is a storage trigger, is a relay device that is turned on when a trouble occurs.

ログ設定部51はUI160を通じて設定された情報をログ設定データ72に格納し、プロジェクトデータ71とともに基本ユニット3に転送する。 The log setting section 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 flowchart showing an overview of a user program debugging process executed by the 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 creates 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. The project data 71 includes identification information for identifying the project data 71 or the user program. The project creation unit 50 may perform calculations on the project data 71 or the user program to obtain a hash value or an error detection code, 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に書き込む。 In S42, the user operates the PC 2 to transfer the project data 71 to the PLC 1. The project creation unit 50 reads 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 into the storage device 32.

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 changeover switch for switching from PROGRAM mode to RUN mode) and instructs execution of the project. The execution unit 80 executes the user program included in the project data 71. 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 above-mentioned image data in the memory card 36 or internal memory 37 when a predetermined output condition is satisfied. , create log data 73.

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

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

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

また、本実施形態では、プロジェクトデータ71をメモリに保存しているが、本発明はこれに限られず、例えば、プロジェクトデータ71に代えて、プロジェクトデータ71の識別情報のみをメモリに保存するようにしてもよい。この場合、PC2における現在のプロジェクトデータは、実際のトラブル発生時のプロジェクトデータ71と一致することを前提としている。すなわち、プロジェクトデータをPLC1に転送した後、現在のプロジェクトデータは編集・改変されていないことを前提としている。仮に、両データが不一致と判定された場合には、ユーザは、現在のプロジェクトデータが、実際のトラブル発生時のプロジェクトデータ71とは異なることを認識した上でリプレイを行えばよいので、ユーザがこれを認識しない状態でリプレイ(不正確なトラブルシューティング)が行われるのを防ぐことができる。 Further, in this embodiment, the project data 71 is stored in the memory, but the present invention is not limited to this. For example, instead of the project data 71, only the identification information of the project data 71 may be stored in the memory. You can. In this case, it is assumed that the current project data on the PC 2 matches the project data 71 at the time of the actual trouble occurrence. That is, it is assumed that the current project data is not edited or modified after the project data is transferred to the PLC 1. If it is determined that the two data do not match, the user can perform a replay after recognizing that the current project data is different from the project data 71 at the time of the actual trouble. This can prevent replays (inaccurate troubleshooting) from being performed without being aware of 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 log data 73 to the PC 2. Alternatively, the project data 71 written in the memory card 36, the identification information of the project data 71, and the log data 73 may be read out by operating the operation unit 8 of the PC 2. The output unit 84 transmits the project data 71 and log data 73 to the PC 2. 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 executes 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, an error detection code, etc. may be obtained and added to the log data 73 as identification information. Note that any rule may be adopted as long as the identification information creation rule executed by the PC 2 and the identification information creation rule executed by the basic unit 3 match.

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 to investigate the cause of the trouble while replaying the log data 73, and debugs the user program forming the project data 71. 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 in association with the user program. This includes displaying time-series image data on the display unit 7. The log display section 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 section 7 . The project data 71 may not be transmitted from the PLC 1. 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. 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 obtain the log data 73 may be different from the version of the project data 71 held in the PC 2. In this case, it is possible that it becomes impossible to display the device value in association with the user program, or that the association between the user program and the device value becomes incorrect. In this case, the log display unit 61 uses the identification information of the project data to display that the version of the project data 71 used to obtain the log data 73 is 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 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. If 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 the version is managed using identification information. If the user confirms that there is no problem with the log data 73, debugging is unnecessary, and subsequent S46 and S47 are also unnecessary. The user analyzes the log data 73, discovers bugs in the user program, and corrects the user program. The project creation unit 50 modifies (updates) the project data 71 according to user input and stores it in the storage device 22.

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

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

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

なお、プロジェクトデータ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, the transfer of log data 73 may also be performed via the 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 section>
FIG. 32 shows the output section 84 mounted on the basic unit 3. In addition to the log data 73, the output unit 84 may transfer the project data 71 used when acquiring the log data 73 to the PC 2. However, in order to prevent information leakage of the project data 71, access authority (protection) may be set for the project data 71 to prohibit writing to the memory card 36 or transmitting to the PC 2. Therefore, the determination unit 301 refers to the access authority granted to the project data 71 and determines whether output of the project data 71 is prohibited. When outputting 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, if the output of the project data 71 is not prohibited, the output unit 84 outputs the log data 73 and the project data 71. If 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 part of the project data 71, or the identification information may be obtained by the calculation unit 303 performing a predetermined calculation on the project data 71 or the user program. The predetermined operation may be, for example, a hash operation or an error detection code operation. The real-time transmitting unit 304 transmits the device value 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 PC 2 or an 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 department 50>
FIG. 33 shows details of the project creation section 50. 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 information input from the operation unit 8, and creates configuration information indicating the settings. Functional settings of the basic unit 3 include IP address settings, FTP client settings, access authority settings for the project data 71, and the like. Settings for the functions of the expansion unit 4 include settings for input channels and settings for communication between PLCs. The configuration information is part of the 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. The calculation unit 313 calculates identification information (eg, a hash value or an error detection code) by calculation. Note that the output unit 84 may perform the same function as the identification information calculation function performed by the calculation unit 313.

<ログ表示部61>
図34はログ表示部61の詳細を示している。プログラム表示モジュール321はプロジェクトデータ71に含まれるユーザプログラムとともに、ログデータ73に含まれるデバイス値を表示部7に表示するモジュールである。また、プログラム表示モジュール321は、ユーザプログラムのみならず、プロジェクトデータ71に含まれるプログラム構成情報、複数のプログラム部品、ユニット構成、ユニット毎の機能設定など、ユーザがプロジェクトデータ71の設定内容を視認するための各種情報を表示可能となっている。画像表示モジュール323は、ログデータ73に含まれる時系列の画像データを表示部7に表示する。波形表示モジュール322は、ログデータ73に含まれる時系列のデバイス値を波形化して表示部7に表示するモジュールである。再生制御モジュール324は、プログラム表示モジュール321によって表示される情報と波形表示モジュール322によって表示される情報とを時間的に同期させる。これらのモジュールはエンジニアリングソフトウエアと呼ばれてもよい。なお、画像表示モジュール323は、プログラム表示モジュール321の一機能(画像表示部)として具現化されてもよいし、波形表示モジュール322の一機能(画像表示部)として具現化されてもよい。
<Log display section 61>
FIG. 34 shows details of the log display section 61. The program display module 321 is a module that displays the user program included in the project data 71 as well as device values included in the log data 73 on the display section 7 . In addition, the program display module 321 allows the user to visually check the setting contents of the project data 71, such as not only the user program but also program configuration information included in the project data 71, multiple program parts, unit configurations, and function settings for each unit. Various information can be displayed. The image display module 323 displays 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 a waveform and displays the waveform on the display unit 7. The reproduction 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. Note that the image display module 323 may be realized as one function (image display section) of the program display module 321, or may be realized 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, a slide bar, a cursor, etc.) for operating the device acquisition time (display time) displayed together with the user program. The display time control unit 331a sends the display time specified by the time UI 330a to the playback control module 324, and sets the display time notified from the playback control module 324 to the time UI 330a. The program display section 332 displays the project data 71 on the display section 7 or reads out the project data 71 corresponding to the identification information from the storage device 22 and displays it on the display section 7 . Further, the program display unit 332 displays the device value acquired by the device value acquisition unit 333a in association with the device 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 333a accesses the real-time transmission unit 304 of the PLC 1 in real-time playback mode, acquires the device value, and passes it to the program display unit 332. In the log playback mode, the device value acquisition unit 333a accesses the playback control module 324, acquires the display time and 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 section 7 by the program display section 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 information constituting the project data 71 is displayed in the project display area 420 in the left column. From the top, the unit configuration (basic unit, motion unit, analog input unit, camera unit) and program configuration (every scan module, fixed cycle module, inter-unit synchronization module, function block, macro) are displayed. Regarding the motion unit, the axis configuration and axis control setting parameters are displayed as function settings. By double-clicking on the axis configuration or axis control on the GUI shown in FIG. 35B, the user can check the settings for these setting parameters. Furthermore, in the project display area 420, Main and Sub are displayed for each scan module, and when the user clicks on Main, the Main program is displayed in the program display area 410 of the ladder monitor 450 at the center. In this way, the program display module 321 shown in FIG. 34 reads 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 a so-called ladder monitor 450, and can be operated independently in 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 reproduction mode, the program display section 332 can reproduce the ladder program included in the project when the driving record was saved. Furthermore, in the log playback mode, the program display section 332 displays the device value included in the log data 73 via the device value acquisition section 333a in association with the device described in the Main program. The device value to be displayed is the device value corresponding to the time specified by the time designation cursor 404 (more details will be explained using FIG. 38 described later).

図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 35,000 compared to the total number of scans of 74,286. By dragging and moving the time designation cursor 404, the user not only updates the display time and number of scans, but also updates the display of the device value. For example, at the updated display time, relay devices that are ON are displayed as ON (for example, by filling them in color), and relay devices that are OFF are displayed as OFF (for example, by removing color). will be done. Details of the function of the playback button 406 will be described later using FIG. 38.

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

このとき、時刻指定カーソル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 in conjunction with the movement. For example, when the time designation cursor 404a is set to the display time 19:00:00 on 20XX/10/01, the time designation cursor 404 on the ladder monitor 450 also moves to the display time 19:00:00 on 20XX/10/01. Moves to follow position 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 also moves accordingly. Such a processing operation is possible because the program display module 321 and the image display module 323 execute synchronized control regarding the display time via the playback control module 324.

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

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

図35Bや図35Cから分かるように、再生制御モジュール324の機能によって、プログラム表示モジュール321、画像表示モジュール323、ユニット表示モジュール325を同期制御して、連携させることができる。なお、波形表示モジュール322の連携の詳細については後述する。 As can be seen from FIGS. 35B and 35C, the function of the playback control module 324 allows the program display module 321, image display module 323, and unit display module 325 to be synchronously controlled and linked. Note that details of the 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 the current project data matches the project data 71 at the time of actual trouble occurrence. More specifically, the collation unit 334 of the program display module 321 shown in FIG. (user program) and outputs the comparison result to the warning section 335. The warning unit 335 detects a discrepancy between the identification information of the project data 71 (user program) output from the PLC 1 when the driving record was saved and the identification information of the project data (user program) stored in the storage device 22. If so, 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 and the identification information of the current project data (to be replayed) do not match. For example, this is a case where the user edits the project data (program, function settings, etc.) after transferring the project data to the PLC 1. In this case, when the real-time playback mode shifts to the log playback mode based on the user's operation, a warning screen 470 shown in FIG. 35D is displayed.

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

なお、本実施形態では、2つのプロジェクトデータの識別情報を比較して、一致・不一致を検証することとした。より詳細には、プロジェクトデータに含まれるプログラム構成、複数のプログラム部品、ユニット構成、ユニット毎に機能設定に対し、それぞれ識別情報が付加されており、それら全てが一致するか否かにより検証することとした。しかし、本発明はこれに限られず、少なくとも、複数のプログラム部品から構成されるユーザプログラムの識別情報を比較して、一致・不一致を検証すればよい。 Note that in this embodiment, the identification information of two pieces of project data are compared to verify whether they match or do not match. 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 so. However, the present invention is not limited to this, and at least the identification information of user programs composed of a plurality of program parts may be compared to verify whether they match or do not match.

●波形表示モジュール
図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 details of the waveform display module 322. The time UI 330b provides a UI (eg, a slide bar, etc.) for operating the device acquisition time (display time) 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 from the playback control module 324. However, the time UI 330b accepts the operation of the bar 103 through the operation unit 8, and passes the operation amount of the bar 103 to the playback 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 playback control module 324, and sets the display time notified from the playback control module 324 to 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 333b accesses the real-time transmission unit 304 of the PLC 1 in real-time playback mode, acquires the device value, and passes it to the waveform display unit 336. The device value acquisition section 333b accesses the reproduction control module 324 in the log reproduction mode, acquires the display time and the device value, and passes it to the waveform display section 336. As shown in FIG. 28, the waveform display unit 336 converts the device value acquired by the device value acquisition unit 333b into a waveform and displays it on the display unit 7. It is not essential to convert the device value into a waveform, and the device value may be displayed as a numerical value. 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. Note that, 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. 34, it may be realized as a separate function as the image display module 323 (camera monitor). 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 a so-called real-time chart monitor 460 displayed in a pop-up window at the bottom right.

図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. Note that although the unit monitor 440 by the unit display module 325 is not displayed in FIG. 36B, it 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 described using FIG. 28. In FIG. 36B, waveform data of relay device R000 and waveform data of data memory DM100 are read out from the memory and displayed. The user can freely adjust the number of devices to be displayed on the real-time chart monitor 460 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 also be called a playback position cursor) is displayed at the bottom of the real-time chart monitor 460, and the user can click the position of this time designation cursor 404b. It is now possible to move it. At this time, when the position of the time designation cursor 404b moves, the time designation cursor 404 on the ladder monitor 450 and the time designation cursor 404a on the camera monitor 430 move in conjunction with each other due to the function of the playback 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 (the display may be switched to time), but when the user clicks the time designation cursor 404b to When the slider moves to the position corresponding to the number of scans, 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, device values and image data corresponding to the display position after the 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 position of the number of scans 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, but in this embodiment, this position is 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 has a vertical line superimposed on the waveform display area, a triangular mark added to the bottom end of the vertical line, Furthermore, a display area bar 404c is displayed below the time designation cursor 404b. A square indicator indicating the current position is displayed at the center of the display area bar 404c. The user can change the range displayed on real-time chart monitor 460 by dragging this indicator and moving it left or right. By making good use of this display area bar 404c, the user can perform troubleshooting to investigate the cause of the trouble. This point will be explained in more detail using FIG. 36C.

図36Cは、リアルタイムチャートモニタ460で表示される表示範囲と時刻指定カーソル404bとの関係性を説明するための説明図である。 FIG. 36C is an explanatory diagram for explaining the relationship between the display range displayed on real-time chart monitor 460 and 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 relay devices R000 and R001 and data memories DM100 and DM101 are displayed on real-time chart monitor 460. In FIG. 36C, for convenience of explanation, it is assumed that 15 device values (black circles) for each device are displayed on the real-time chart monitor 460. Furthermore, among these device values, the device value corresponding to a specific time for each device becomes the device value designated by the time designation cursor 404b. In FIG. 36C, the device value corresponds to the time in the center of the range displayed on real-time chart monitor 460. When the user drags the time designation cursor 404b and moves it, for example, to the right, the display range is adjusted so that the time designation cursor 404b falls within the display range, similar to 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 on the display area bar 404c and moves it, for example, to the right, the display range of the real-time chart monitor shifts to the right, and when it moves by a certain amount (8 device values (move to the right by minutes), the time designation cursor 404b disappears. However, in this embodiment, even if the time designation cursor 404b is hidden, to facilitate troubleshooting, by double-clicking a desired position in the waveform display area, the time designation cursor 404b jumps to that desired position. It is supposed to be done. In other words, the waveform display unit 336 shown in FIG. 36A has a function of accepting a designation of a desired position from the user in the waveform display area and moving the time designation cursor 404b to the accepted designated position.

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

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

(2)デバイス波形のうち、異常なデバイス値をとる時刻が見つかったら、波形表示領域において、その時刻をダブルクリックする。そうすると、時刻指定カーソル404bがその時刻にジャンプするとともに、ラダーモニタ450における時刻指定カーソル404、及び、カメラモニタ430における時刻指定カーソル404aが、いずれもその時刻にジャンプする。 (2) If a time when an abnormal device value is found in the device waveform is found, 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 playback control module 324 causes the ladder monitor 450 to display the device value corresponding to that time, and the camera monitor 430 to display the image data corresponding to that time. Therefore, the user can investigate the cause of the trouble while visually checking 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に渡す。
●Reproduction 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 the device value acquired from the log data 73 by the log data acquisition unit 344. The device value providing unit 341 also provides the unit display module 325 with the device value acquired from the log data 73. Note that the device value acquired from the log data 73 may be temporarily stored in the log device 345. The device value acquisition section 333 of the program display module 321 and the waveform display module 322 requests a device value from the device value providing section 341. The device value acquisition unit 333 acquires a device value from the log device 345 and transmits it to the device value acquisition unit 333. The time device 342 is a device that holds the display time set by the playback control section 343. The device value providing section 341 may also transmit the device value (time information) held in the time device 342 to the device value obtaining section 333 . Alternatively, the playback 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 the displayed 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. When the playback control unit 343 receives the designation of the display time from the display time control units 331a and 331b, it sets the received display time in the internal clock (time adjustment). Therefore, when the display time is specified by the display time control section 331a, this display time is transmitted to the display time control section 331b via the playback control section 343. Similarly, when the display time is specified by the display time control section 331b, this display time is transmitted to the display time control section 331a via the playback control section 343. 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. 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 passes it to the device value providing unit 341.

同様にして、再生制御部343は、プログラム表示モジュール321の表示時刻と波形表示モジュール322の表示時刻に加えて、画像表示モジュール323やユニット表示モジュール325の時刻を同期させるようにしてもよい。 Similarly, the playback 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 this 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 able to select whether or not to synchronize. For example, a check box indicating whether synchronization is present may be provided on each monitor screen, and the check box may be set to a checked state by default. Then, by unchecking a module that the user does not want to synchronize, it is possible to prevent only that module from being synchronized. In this way, the log display section 61 may have a selection function for selecting a module to be synchronously controlled (followed control) by the playback 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. The display UI 400 described in FIG. 35B and FIG. 36A will be described in further detail from another perspective. The program display area 410 is an area where the user program of the project data 71 is displayed. In this example, the program display area 410 displays a ladder program (ladder diagram). The program display unit 332 uses the device value acquisition unit 333a to acquire the device value of the device used or described in the user program, 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 over 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 section 332 may obtain the device value of the DM 100, which is an output system device, using the device value obtaining section 333a, and display the obtained device value overlappingly with the description of the DM 100 in the user program. In this example, a device value display area 403 is provided below the description of DM 100. The program display section 332 displays device values in the display area 403. Note that since the playback control module 324 updates the device value as well as the display time, the program display section 332 updates the device value displayed together with the user program. The time UI 330a 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 playback control unit 343 to stop updating the display time, and adjusts the dragging amount of the time designation cursor 404 to the playback control unit 343. to notify. The playback control unit 343 adjusts the count value (display time) of the internal clock according to the drag amount. The time UI 330a may display the update speed of the display time (for example, ..., 2.0 times, 1.0 times, 0.5 times, 0.1 times, ...) in the speed specification section 405. good. Note that the speed designation unit 405 may be realized by a pull-down menu that displays a list of a plurality of update speeds and allows one of the update speeds to be selected. When the time UI 330a detects a click by the pointer 101 on the speed specification section 405, the time UI 330a may display such a pull-down menu and accept a selection of an update speed. A play button 406 is a button for instructing to display device values in chronological order. When the time UI 330a detects that the playback button 406 has been clicked by the pointer 101, the time UI 330a instructs the playback control unit 343 to start updating the display time in the display time control unit 331a. This instruction corresponds to an instruction to start displaying device values or an instruction to restart display. The one-step reverse playback button 407 is a button for instructing to display device values in chronological order while updating (rewinding) the display time one step at a time. 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 move the display time back one step. The one-step playback button 408 is a button for instructing to display device values in chronological order while updating the display time one step at a time. 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 when one-step playback is being executed, 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 one-step playback is being executed, the playback control unit 343 resumes updating the display time at the update speed specified by the speed designation unit 405. The time display area 409 is an area for displaying the display time held in the time device 342. The display time control unit 331a 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>
The PLC 1 can be connected to an external display device called HMI. The HMI may have a touch panel type input device. The HMI reads device values held in the device section 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 checks the operation of the HMI by operating the emulator according to the project data 71. The log display unit 61 supplies the device value of the log data 73 to the HMI emulator. The HMI emulator displays device values provided 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 the program display module 321. The program display section 332 reflects the device value provided by the playback control section 343 on the display area of the UI 490. The UI 490 may include time control objects related to playback control included in the UI 400, such as a time designation cursor 404 and a playback button 406. The operation of the time control object on the UI 490 is reflected on the UI 400 and the UI shown in FIG. 28 through the playback control unit 343. For example, when the time designation cursor 404 is operated to the left on the UI 490, the time designation cursor 404 of the UI 400 also moves to the left in conjunction with the display time provided from the playback 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 UI 400, 450 also moves to the left in conjunction with the display time provided from the playback 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 regarding log display>
●Program Display Module FIG. 40 shows display processing executed by the program display module 321. Note that S50, S51, and S60 may be executed only when the project data 71 cannot be acquired from the PLC 1. If the project data 71 can be acquired from the PLC 1, the project data 71 from the PLC 1 is used. If the project data 71 cannot be acquired from the PLC 1, the project data 71 held in the PC 2 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 PLC 1 and the identification information of the project data 71 held in the PC 2.

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

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

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

S54でCPU21(デバイス値取得部333a)は再生制御モジュール324を起動し、再生制御モジュール324から表示時刻とログデータ73のデバイス値と取得する。 In S54, the CPU 21 (device value acquisition unit 333a) starts the playback control module 324 and obtains 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 section 332) displays the user program included in the project data 71, as well as the device value and display time on the display section 7.

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

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

●波形表示モジュール
図41は波形表示モジュール322によって実行される表示処理を示している。
●Waveform Display Module FIG. 41 shows the 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 unit 336) determines whether the log playback mode or the real-time playback mode is selected based on the information input from the operation unit 8. If the real-time playback mode is selected, the CPU 21 proceeds to S66. In S66, the CPU 21 (device value acquisition unit 333b) acquires the device value from the real-time transmission unit 304 of the PLC 1 without going through the playback control module 324. In S67, the CPU 21 (waveform display section 336) displays the device value on the display section 7. If the log playback mode is selected, the CPU 21 proceeds to S62.

S62でCPU21(デバイス値取得部333b)は再生制御モジュール324を起動し、再生制御モジュール324からデバイス値と表示時刻を取得する。 In S62, the CPU 21 (device value acquisition unit 333b) starts 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 display time on the display section 7.

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

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

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

S71でCPU21(ログデータ取得部344)はPLC1からログデータ73を取得し、記憶装置22に格納する。 In S71, 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 S73, the CPU 21 (playback control unit 343) obtains 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 S74, the CPU 21 (playback control unit 343) obtains 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 allows the device value providing unit 341 to provide the program display module 321 and waveform display module 322 with device values and display times.

S75でCPU21(再生制御部343)は表示時刻制御部331から時刻指定を受信したかどうかを判定する。時刻指定を受信していれば、CPU21はS76に進む。時刻指定を受信していなければ、CPU21はS77に進む。 In S75, the CPU 21 (playback control unit 343) determines whether a time designation 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 (playback control unit 343) changes the time of the internal clock according to the time designation from the display time control unit 331.

S77でCPU21(再生制御部343)は表示時刻制御部331から更新速度の変更指示を受信したかどうかを判定する。変更指示を受信していれば、CPU21はS78に進む。変更指示を受信していなければ、CPU21はS73に進む。 In S77, the CPU 21 (playback control section 343) determines whether an update speed change instruction has been received from the display time control section 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 section 343) changes the update speed of the internal clock according to the update speed specified by the display time control section 331. Thereafter, the CPU 21 proceeds to S73.

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

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

ワーク検知モジュールB1においてデバイスMR000はワークを検知するとONとなるリレーデバイスである。デバイスMR0002PLC1が自動運転中である場合にONとなるリレーデバイスである。デバイスMR001は、拡張ユニット4に測定開始を指示するためのリレーデバイスである。デバイスMR000は、自動運転中にワークが検知されると、ONとなる。 In the workpiece detection module B1, the device MR000 is a relay device that turns on when a workpiece is detected. This is a relay device that turns ON when the device MR0002PLC1 is in automatic operation. Device MR001 is a relay device for instructing expansion unit 4 to start measurement. Device MR000 turns 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, the height measurement value acquired by the expansion unit 4 is stored in the device EM0, and it is described that this is to be copied to the device TM100. Similarly, it is described that the depth measurement value acquired by the expansion unit 4 is stored in the device EM2, and that this is to be copied to the device TM101. Furthermore, the device MR003 for managing measurement completion 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, if the measurement result does not satisfy the pass condition, device MR010 is turned on. This means that the measurement is NG. More specifically, if the measured height value stored in device TM100 is less than 95, MR010 is turned ON. If the measured height value stored in device TM100 exceeds 105, MR010 is turned ON. If the measured depth value stored in the device TM101 is less than 35, MR010 is turned ON. If the measured depth 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 conveyance of the conveyor belt when some kind of error occurs. In this example, when MR010 turns ON (measurement NG), MR012 turns ON (forced stop), or MR013 turns ON (transportation NG), MR011 turns on (transportation 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 type instruction of a certain module is described in an output type instruction of another module. Conversely, a device described in an output type instruction of a certain module is described in a contact type instruction 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. Next, 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 instruction of the determination module B3, it can be seen that MR010 is described in the contact system instruction 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 certain 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. In other words, 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 that displays the extraction results. The log display section 61 and the device extraction section 53 may create a UI 500 that displays devices and blocks (program parts) extracted from the user program, and display it on the display section 7. The UI 500 can easily display the extraction results of devices and program parts. Therefore, it will be easier for the user to grasp the overall picture of the extraction results. 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 details of the clicked block on the UI 501. This would allow users to quickly access details of extracted blocks. The log display section 61 and the device extraction section 53 may display the extraction results using the UI illustrated in FIG. 43.

<ブロックおよびデバイスの抽出処理>
図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 a plurality of 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 S81, the CPU 21 (device extraction section 53) accepts the selection of a block through the operation section 8. Note that the device extraction section 53 may accept a device specification through the operation section 8. In this case, the device extraction unit 53 may extract one or more blocks describing the specified device. When a plurality of blocks are extracted, the device extraction unit 53 may accept a user's selection of one block from the plurality of blocks. Such a device may be, for example, a device that a user focuses on during debugging. Through the log setting section 51, the user sets conditions (for example, a storage trigger) for outputting the log data 73 to the output section 84 of the PLC 1. More specifically, the condition is set such as that a specific relay device is turned on. Therefore, the device extraction unit 53 may specify a relay device set as a storage trigger.

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

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

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

S85でCPU21(デバイス抽出部53)は発見されたブロックを関連ブロックとして抽出する。たとえば、デバイス抽出部53は、関連ブロックを管理するためのリストに、発見されたブロックの識別情報(例:名称やファイル名など)を登録する。 In S85, the CPU 21 (device extraction unit 53) extracts the discovered block as a related block. For example, the device extraction unit 53 registers identification information (eg, name, file name, etc.) of the discovered 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. Thereafter, the CPU 21 returns to S82 in order to perform extraction processing on the newly selected block. In S86, the related block selected is a block that has not yet been selected as a device extraction target. 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 and create the UI shown in FIG. 43 or the UIs 500 and 501 shown in FIG. 44.

<デバッグの具体例>
図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 S91, the user sets NG determination as a storage condition for the log data 73 through the log setting unit 51. According to FIG. 43, the storage condition for the log data 73 is determined to be that the device MR010 that manages 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判定が発生すると、搬送ベルトが停止するため、ユーザは何らかのエラーが発生したことを知る。 In S92, the user operates the PLC1. The PLC 1 executes the project data 71 and stores the log data 73 in the memory card 36 when the storage conditions in the log setting data 72 are satisfied. In the example shown in FIG. 43, when an NG determination 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 workpiece 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 the acceptance conditions are met. If the work does not satisfy the pass conditions, the user determines that the NG determination is a false positive.

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. 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 specifies 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. Displays the UIs 500 and 501 shown in FIG. Further, the waveform display module 322 converts the device value displayed by the program display module 321 into a waveform and displays the waveform. For example, the measured value of the height of the workpiece held in EM0 and the depth of the workpiece held in EM2 are converted into waveforms and displayed on the display section 7. Furthermore, the device value of the device MR000 that manages workpiece detection is also displayed in waveform form. The user observes these waveforms and determines that the chattering of the workpiece detection sensor is the cause of the false detection. The user operates the editing section 311 to take measures against chattering, and modifies the workpiece detection module B1 as shown in FIG. 47. According to this modification, when a workpiece is continuously detected by the workpiece detection sensor for one second or more, the device MR001 for starting measurement is turned on. The user transfers the updated project data 71 to the PLC 1, operates the PLC 1, and determines whether the chattering countermeasures were successful.

このようにユーザプログラムとデバイス値の波形とを同期して表示することで、誤検知の原因の特定と、原因を解消するためのユーザプログラムのデバッグとをユーザは効率よく実行できるようになる。 By displaying the user program and the waveform of the device value in synchronization in this manner, the user can efficiently identify the cause of 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 that includes a plurality of devices that are storage areas referenced by the program execution section. The recording unit 81 is an example of a device recording unit that records device values stored in any of a plurality of devices in chronological order. The PC 2 is an example of a program creation support device that is connected to a programmable logic controller and supports creation of a user program.

図6に示したようにプロジェクト作成部50は、表示部7を介したユーザ入力に基づいて、ユーザプログラムを構成する複数のプログラム部品であって複数のデバイスのいずれかに関する命令語を含むプログラム部品を作成するプログラム作成部の一例である。部品指定部52は、複数のプログラム部品のうちデバイス記録部による記録対象となる特定のデバイスを抽出されるプログラム部品を指定するプログラム部品指定部の一例である。デバイス抽出部53はプログラム部品指定部により指定されたプログラム部品を解析して当該プログラム部品に記述されているデバイスを抽出するデバイス抽出部の一例である。基本ユニット3の記録部81は、デバイス抽出部により記録対象として抽出された特定のデバイスに記憶されているデバイス値を時系列に記録するように構成されている。 As shown in FIG. 6, the project creation unit 50 selects a plurality of program parts that constitute a user program based on user input via the display unit 7, and that includes a command word related to one of the plurality of devices. This is an example of a program creation section that creates a program. The component designation unit 52 is an example of a program component designation unit that designates 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 extraction section 53 is an example of a device extraction section that analyzes a program component specified by the program component specification section and extracts a device described in the program component. The recording section 81 of the basic unit 3 is configured to record in chronological order device values stored in a specific device extracted as a recording target by the device extraction section.

このようにユーザはプログラム部品を指定することで、指定されたプログラム部品からデバイスが抽出される。また、ユーザは、特定のプログラム部品を、デバイスの抽出対象から除外することもできる。よって、PLCにおいてロギングの対象となるデバイスのユーザによる登録負担が軽減される。 In this manner, the user specifies a program component, and a device is extracted from the specified program component. The user can also exclude specific program parts from being extracted from devices. Therefore, the burden of registration by 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 component created by the program creation unit 63 and extract the device described in the program component. The component specifying section 52 selects a program component in which a specific device to be recorded by the recording section 81 is used or described, among the plurality of program components created by the program creation section 63, in program component units (program components). ) may be specified. In this case, the recording unit 81 records the device value stored in the specific device extracted by the extracting unit 53 and used or written in the program component specified by the component specifying unit 52. Record in series.

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

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

抽出部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 the plurality of program parts created by the program creation unit 63 and extract devices used or written for each program part. The component designation unit 52 may designate at least one program component to be recorded or excluded from among the plurality of program components created by the program creation unit 63. The recording unit 81 stores a device stored in a specific device used or described in a program component designated as a recording target by the component designation unit 52, among the devices extracted from a plurality of program components by the extraction unit 53. The configuration may be such that the values are recorded in chronological order and devices used in program parts other than the program parts designated as exclusion targets by the parts specifying unit 52 are recorded. For example, if module A uses device memories DM0 and DM1 and module B uses device memories DM1 and DM2, device memories DM0, DM1, and DM2 are extracted from modules A and B. Here, when module B is designated as an exclusion target, DM2 is excluded, but since DM1 is also used in module A, DM1 remains as a recording target. In this way, devices may be added or removed in units of program parts (that is, for each program part). Further, after devices are extracted from all program parts, program parts to be recorded or program parts to be excluded may be specified.

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

プログラム部品は、たとえば、再利用可能なプログラムモジュールであってもよい。複数のプログラム部品は、それぞれ個別のファイルに格納されていてもよい。複数のプログラム部品は、それぞれ個別にアクセス権限(編集権限)が設定されてもよい。 A program component 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 components.

ユーザプログラムは、たとえば、ラダープログラムであってもよい。この場合、複数のプログラム部品は、ラダープログラム内で使用または記述される複数のファンクションブロックであってもよい。 The user program may be, for example, a ladder program. In this case, the multiple program parts may be multiple function blocks used or written 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 to be rewritten by the detection unit 82 as a recording target.

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

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

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

図7においては、選択されたプログラム部品からのデバイスの抽出と、選択された機能からのデバイスの抽出と、ユーザによるデバイスの手動追加とが記載されている。しかし、これらのすべてが必須というわけではない。これらのうち二つ以上が採用されれば十分であろう。あるいは、選択されたプログラム部品からのデバイスの抽出だけが採用されてもよいし、選択された機能からのデバイスの抽出だけが採用されてもよい。 In FIG. 7, extraction of a device from a selected program component, extraction of a device from a selected function, and manual addition of a device by the user are described. However, not all of these are required. It would be sufficient if two or more of these were adopted. Alternatively, only the extraction of the device from the selected program component may be employed, or only the extraction of the device from the selected function 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 a 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 basic unit 3 may include the functionality of the expansion unit 4. The functional program is, for example, a motion control program. The program execution engine and the plurality of function execution engines may be executed by a single CPU, a plurality of CPUs, or may be realized by an ASIC or an FPGA. Further, 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 unit 34 is an example of a device storage unit that includes a plurality of devices that 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 records device values stored in any of a plurality of devices in chronological order. The function setting unit 62 may function as an allocation unit that allocates a plurality of devices to be used by each of the plurality of function execution engines. The function specifying unit 60 may function as a specifying unit that specifies one or more functions among a plurality of functions corresponding to a plurality of function execution engines. The device extraction unit 53 may extract, from the plurality of devices allocated by the allocation unit, a device used for one or more functions specified by the specification unit as a recording target of the device recording 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 in order to expand the functions of the main unit. All of the plurality of function execution engines may be provided in the main unit.

基本ユニット3は、プログラム実行部と、デバイス記憶部と、デバイス記録部とを有するメインユニットの一例である。拡張ユニット4は、メインユニットの機能を拡張するために該メインユニットと電気的に接続される機能拡張ユニットの一例である。 The basic unit 3 is an example of a main unit that includes 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 that is electrically connected to the main unit in order to expand the functions of the main unit.

機能設定部62は、表示部7を介したユーザ入力に基づいて、メインユニットの機能のために使用されるデバイスと、機能拡張ユニットの機能のために使用されるデバイスとを割り付ける割付部として機能する。機能設定部62は、機能に対してデバイスを割り付けるためのUIを表示部7に表示してもよい。 The function setting section 62 functions as an allocation section 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 via the display section 7. do. The function setting section 62 may display on the display section 7 a UI for allocating devices to functions.

機能指定部60は、メインユニットに設けられた機能と機能拡張ユニットに設けられた機能とを含む複数の機能のうち一つ以上の機能を指定する指定部の一例である。デバイス抽出部53の追加部54は、指定部により指定された機能のために使用されるデバイスをデバイス記録部の記録対象として抽出する。デバイス抽出部53の削除部55は、指定部により指定された機能のために使用されるデバイスをデバイス記録部の記録対象から除外する。通信部23は、記録対象として抽出された特定のデバイスに記憶されているデバイス値を時系列にデバイス記録部に記録させるための設定データをPLC1に送信する送信部として機能する。記録部81は、デバイス抽出部53により記録対象として抽出されたデバイスに記憶されているデバイス値を時系列に記録するように構成されている。 The function specifying section 60 is an example of a specifying section that specifies one or more functions among 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 a 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 specified by the specification unit from the recording targets of the device recording unit. The communication unit 23 functions as a transmitting unit that transmits to the PLC 1 setting data for causing the device recording unit to record device values stored in a specific device extracted as a recording target in chronological order. The recording unit 81 is configured to record device values stored in devices extracted as recording targets by the device extraction unit 53 in chronological order.

プロジェクト作成部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. Further, the device extracting unit 53 may add a device used for the function specified as a recording target (extracting target) by the function specifying unit 60 to the device list. Further, the deletion unit 55 may be configured to delete from the device list a device used for a function designated as an exclusion target by the function designation unit 60. The device list is included in the log setting data 72. The recording unit 81 is configured to record device values stored in devices registered in the device list in chronological order.

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

図19を用いて説明されたように、収集部92aは複数のデバイスのいずれかに記憶されているデバイス値を収集し、当該デバイス値の収集時刻に関する情報と当該デバイス値とを関連付けて第一バッファに記憶する第一収集部の一例である。なお、収集対象のデバイス値は、ログ設定データ72によって予め設定されてもよい。リングバッファ91aは第一バッファの一例である。収集時刻に関する情報は、たとえば、時刻管理部83aから供給される時刻情報であってもよい。IF99a、99fは拡張ユニット4と通信する第一インタフェースの一例である。通信部33は外部設定機器からユーザプログラムと設定情報とを受け付ける第一の外部インタフェースの一例である。 As described using FIG. 19, the collection unit 92a collects device values stored in any of a plurality of devices, associates information regarding the collection time of the device value with the device value, and first collects the device value. This is an example of a first collection unit that stores data in a buffer. Note that the device values to be collected may be set in advance using the log setting data 72. The ring buffer 91a is an example of a first buffer. The information regarding 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. 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 an example of a third interface (two-dimensional data receiving section) that is connected to a monitoring device that acquires two-dimensional data and receives the two-dimensional data from the monitoring device. The connection port 97 may function as a second external interface that is connected to a monitoring device and receives data from the monitoring device. Camera 98 is an example of monitoring equipment. The monitoring device may be a barcode reader. In this case, the barcode 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 workpiece. A height image and a distance image are examples of two-dimensional data. The two-dimensional data may be video data. Furthermore, large-capacity data whose size is larger 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 that involves inputting data from the monitoring device via the second external interface based on the received setting information.

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

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

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

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

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

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

保存部93はメインユニットから着脱可能なメモリカード36を含んでもよい。保存部93は第一バッファに記憶されているデバイス値と収集時刻に関する情報と、第二バッファに記憶されている二次元データと取得時刻に関する情報とをメモリカード36に保存してもよい。これにより、ログデータ73をPC2へ搬送しやすくなる。図19が示すように、第一バッファはメインユニットに設けられていてもよい。図20が示すように、第二バッファは拡張ユニットに設けられていてもよい。 The storage unit 93 may include a memory card 36 that is removable from the main unit. The storage unit 93 may store, in the memory card 36, information regarding the device value and collection time stored in the first buffer, and information regarding the two-dimensional data and 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 arranged on a side surface of the main unit, which is opposite to a side surface of the expansion unit. The second interface may be provided on the side of the expansion unit so as to be connected to 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 the expansion unit. 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 transmitting unit 94 is an example of a transmitting unit that transmits the device value stored in the storage device 32, information regarding collection time, two-dimensional data, and information regarding acquisition time to an external device. The external device may be a cloud or a PC2. The PC 2 may receive the log data 73 in real time and display the log data 73 on the display unit 7.

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

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

時刻管理部83a、83bに関して説明されたように、収集時刻を計時するメインユニットの時計と取得時刻を計時する拡張ユニットの時計とは同期している。この同期は、たとえば、ユニット間同期によって実現されてもよい。 As explained regarding 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 stores device values collected at predetermined collection times before and after a preset storage trigger, information regarding the collection time, two-dimensional data, and information regarding the acquisition time on the memory card 36. may be configured to be stored 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 when a preset start relay is turned on, information regarding the collection time, two-dimensional data, and acquired data. The memory card 36 may be configured to store information regarding time.

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

ユーザプログラムは複数のプログラム部品から構成されている。また、プロジェクトデータは複数のプログラム部品を管理している。記憶装置32はプロジェクトデータ71の一部としてユーザプログラムを記憶するプログラム記憶部として機能する。出力部84は、ユーザプログラムを含むプロジェクトデータ71を出力するとともに、ユーザプログラムの識別情報としてプロジェクトデータ71の識別情報を出力するように構成されていてもよい。これにより、PC2に記憶されているプロジェクトデータ71(マスタデータ)と、PLC1に記憶されているプロジェクトデータ71とが一致しているかどうかを判定しやすくなる。 A user program is composed of a plurality of program parts. Additionally, project data manages multiple program parts. The storage device 32 functions as a program storage unit that stores a user program 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 also 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 of the expansion unit 4. This is because the setting information of the expansion unit 4 may be required when debugging the project data 71. For example, when a plurality of expansion units 4 are connected to the basic unit 3, the connection order of the plurality of expansion units 4 is included in the setting information of the expansion unit 4. Information regarding this connection order may be required for debugging.

判定部301はユーザプログラム(プロジェクトデータ71)の出力が禁止されているかどうかを判定する判定部として機能する。出力部84は、判定部301によりユーザプログラムの出力が禁止されていると判定された場合、デバイス記録部に記録されているデバイス値と、プログラム記憶部に記憶されているユーザプログラムの識別情報とを外部メモリに出力してもよい。これにより、ユーザプログラムをプロテクトしつつ、識別情報に基づきPC2のマスタデータが利用可能となる。 The determining unit 301 functions as a determining unit that determines whether 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. Thereby, 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 in relation to the addition unit 312, the identification information of the user program is identification information that is updated when the user program is changed. Therefore, project data 71 of a different version from the project data 71 held in PLC 1 will not be used for debugging by mistake.

演算部313に関連して説明されたように、ユーザプログラムの識別情報は、ユーザプログラムから演算される誤り検出符号またはハッシュ値であってもよい。このように、プロジェクトデータ71が更新されると、識別情報も更新されるような識別情報の演算方法が採用されてもよい。識別情報はタイムスタンプなどであってもよい。 As described in relation to the calculation unit 313, the identification information of the user program may be an error detection code or a hash value calculated from the user program. In this way, an identification information calculation method may be adopted in which when the project data 71 is updated, the identification information is also 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 a user program and identification information of the user program. The matching unit 334 is an example of a matching unit that matches the identification information of the user program output from the programmable logic controller and the identification information of the user program stored in the program memory, and displays the matching result on the display unit. The warning section 335 outputs a warning when the two do not match, but when the two match, a message or image indicating the match may be displayed on the display section 7.

図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 a portion of the user program in which a command related to the device value is written. 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 in 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. The 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 make it easier for the user to understand the relationship between changes in specific device values and programs.

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

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

同期ソフトウエアモジュールは、履歴再生モードにおいて第一エンジニアリングソフトウェアモジュールにおける表示対象時刻と第二エンジニアリングソフトウェアモジュールにおける表示対象時刻とを同期させる同期手段を有してもよい。再生制御部343は同期手段の一例である。 The synchronization software module may include 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 playback control unit 343 is an example of synchronization means.

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

第二エンジニアリングソフトウェアモジュールは、履歴再生モードにおいて表示対象時刻を更新する第二更新手段をさらに有してもよい。バー103、時刻UI330および表示時刻制御部331は第二更新手段の一例である。同期手段である再生制御部343は、第二更新手段により更新された表示対象時刻を第一エンジニアリングソフトウェアモジュールの表示対象時刻へ反映させる。 The second engineering software module may further include 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 updating means. The playback control unit 343, which is a synchronization unit, reflects the display target time updated by the second update unit on 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 an instruction word 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, the device may be specified by specifying the device shown in FIG. 28 (eg, R000, DM100, etc.) using the pointer 101. As shown in FIG. 38, the first display control means may be configured to display the device value of the device in question along with the instruction word found in the ladder diagram. Further, the pointer 101 is an example of a specifying means for specifying an arbitrary device. The first display control means searches the ladder diagram for a command word related to the device specified by the designation means among the plurality of devices referenced in the programmable logic controller, and searches the ladder diagram for a command word related to the device specified by the designation means among the plurality of devices referenced in the programmable logic controller, and searches the ladder diagram for a command word related to the device specified by the designation means among the plurality of devices referenced in the programmable logic controller. Device values may also be displayed.

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

図43が示すように、第一表示制御手段は、デバイスに関連する命令語を含む複数のブロックを見つけると、当該複数のブロックに対応するラダー図を並べて表示してもよい。 As shown in FIG. 43, when the first display control means finds a plurality of blocks including command words related to a 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, in the ladder program, the command word related to the first device (example: MR001) in the first block (example: measurement module B2) is an input system command word. In this case, identify the second device (e.g. MR003) that is the target of the output system command written in correspondence with the input system command, and select the input system that targets the second device. The second block (eg, determination module B3) in which the instruction word of is written may be specified.

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

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

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

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

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

複数の拡張ユニット4のそれぞれ異なる内部制御周期にしたがって動作している。よって、複数の拡張ユニット4から取得されるデバイス値の取得時刻や画像データの取得時刻が一致しないことが多い。そこで、図26~図28に関連して説明されたように、第一表示制御手段および第二表示制御手段は、履歴再生モードにおいて、表示対象時刻に最も近い時刻データに関連付けられているデバイス値を読み出すように構成されていてもよい。 Each of the plurality of expansion units 4 operates according to a different internal control cycle. Therefore, the acquisition times of device values and the acquisition times of image data acquired from the plurality of expansion units 4 often do not match. Therefore, as explained in relation 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 playback mode. may be configured to read out.

Claims (15)

プログラマブルロジックコントローラにおいて収集された時系列の複数のデバイス値と、各デバイス値の収集時刻を示す時刻データとを保存する保存手段と、
前記デバイス値をラダー図上に表示する第一エンジニアリングソフトウェアモジュールと、
前記デバイス値を時系列波形として表示する第二エンジニアリングソフトウェアモジュールと、
前記第一エンジニアリングソフトウェアモジュールにおける表示対象時刻と前記第二エンジニアリングソフトウェアモジュールにおける表示対象時刻とを同期させる同期ソフトウェアモジュールと
を有し、
前記第一エンジニアリングソフトウェアモジュールは、
リアルタイム再生モードにおいて前記プログラマブルロジックコントローラからデバイス値を取得してラダー図上に当該デバイス値を表示し、履歴再生モードにおいて前記時刻データに基づき表示対象時刻に対応するデバイス値を前記保存手段から取得してラダー図上に表示する第一表示制御手段を有し、
前記第二エンジニアリングソフトウェアモジュールは、
前記リアルタイム再生モードにおいて前記プログラマブルロジックコントローラからデバイス値を取得して時系列波形を表示し、前記履歴再生モードにおいて前記時刻データに基づき前記表示対象時刻に対応するデバイス値を前記保存手段から取得して時系列波形を表示する第二表示制御手段を有し、
前記同期ソフトウェアモジュールは、前記履歴再生モードにおいて、前記第一エンジニアリングソフトウェアモジュールと前記第二エンジニアリングソフトウェアモジュールとの間で表示対象時刻を受け渡すことにより、前記第一エンジニアリングソフトウェアモジュールにおける表示対象時刻と前記第二エンジニアリングソフトウェアモジュールにおける表示対象時刻とを同期させる同期手段を有し、前記第一表示制御手段と前記第二表示制御手段のいずれによっても起動されることを特徴とするプログラマブルロジックコントローラ用のエンジニアリングツール。
Storage means for storing a plurality of time-series device values collected in the programmable logic controller and time data indicating the collection time of each device value;
a first engineering software module that displays the device values on a ladder diagram;
a second engineering software module that displays the device values as a time series waveform;
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;
The first engineering software module includes:
In a real-time playback mode, a device value is obtained from the programmable logic controller and the device value is displayed on a ladder diagram, and in a history playback mode, a device value corresponding to a display target time is obtained from the storage means based on the time data. a first display control means for displaying on the ladder diagram;
The second engineering software module includes:
In the real-time playback mode, a device value is obtained from the programmable logic controller to display a time series waveform, and in the history playback mode, a device value corresponding to the display target time is obtained from the storage means based on the time data. comprising a second display control means for displaying a time series waveform;
The synchronization software module transfers the display target time between the first engineering software module and the second engineering software module in the history playback mode, thereby adjusting the display target time in the first engineering software module and the display target time. Engineering for a programmable logic controller , comprising synchronization means for synchronizing display target time in a second engineering software module, and activated by both the first display control means and the second display control means. tool.
前記第一エンジニアリングソフトウェアモジュールは、前記履歴再生モードにおいてユーザ操作に応じて前記表示対象時刻を更新する第一更新手段を有し、
前記第二エンジニアリングソフトウェアモジュールは、前記履歴再生モードにおいてユーザ操作に応じて前記表示対象時刻を更新する第二更新手段を有し、
前記同期手段は、前記第一更新手段により表示対象時刻が更新された場合は、当該表示対象時刻を受け取って、前記第二エンジニアリングソフトウェアモジュールに通知し、前記第二更新手段により表示対象時刻が更新された場合は、当該表示対象時刻を受け取って、前記第一エンジニアリングソフトウェアモジュールに通知することを特徴とする請求項1に記載のプログラマブルロジックコントローラ用のエンジニアリングツール。
The first engineering software module has a first updating means for updating the display target time in response to a user operation in the history playback mode,
The second engineering software module has a second updating means for updating the display target time in response to a user operation in the history playback mode,
When the display target time is updated by the first updating means, the synchronizing means receives the display target time and notifies the second engineering software module, and the display target time is updated by the second updating means. 2. The engineering tool for a programmable logic controller according to claim 1, further comprising the step of receiving the display target time and notifying the first engineering software module when the display target time is displayed.
前記第一更新手段は、時間軸方向にスライド移動して前記表示対象時刻を示す第一時刻指定カーソルを有し、当該第一時刻指定カーソルに対する移動操作に応じて前記表示対象時刻を更新し、
前記第二更新手段は、時間軸方向にスライド移動して前記表示対象時刻を示す第二時刻指定カーソルを有し、当該第二時刻指定カーソルに対する移動操作に応じて前記表示対象時刻を更新し、
前記同期手段が前記表示対象時刻を同期させることにより、前記第一時刻指定カーソルと前記第二時刻指定カーソルが連動することを特徴とする請求項2に記載のプログラマブルロジックコントローラ用のエンジニアリングツール。
The first updating means has a first time designation cursor that slides in the time axis direction to indicate the display target time, and updates the display target time in response to a movement operation on the first time designation cursor,
The second updating means has a second time designation cursor that slides in the time axis direction to indicate the display target time, and updates the display target time in response to a movement operation on the second time designation cursor,
3. The engineering tool for a programmable logic controller according to claim 2, wherein the first time designation cursor and the second time designation cursor are linked by the synchronization means synchronizing the display target time.
任意のデバイスを指定する指定手段をさらに有し、
前記第一表示制御手段は、前記プログラマブルロジックコントローラにおいて参照される複数のデバイスのうち前記指定手段により指定されたデバイスに関連する命令語を、前記ラダー図において検索し、前記ラダー図において見つかった命令語とともに当該デバイスのデバイス値を表示するように構成されていることを特徴とする請求項1に記載のプログラマブルロジックコントローラ用のエンジニアリングツール。
further having a specification means for specifying an arbitrary device,
The first display control means searches the ladder diagram for an instruction word related to the device designated by the designation means among the plurality of devices referenced in the programmable logic controller, and searches the ladder diagram for an instruction word related to the device specified by the designation means among the plurality of devices referenced in the programmable logic controller. The engineering tool for a programmable logic controller according to claim 1, wherein the engineering tool is configured to display a device value of the device along with the word.
前記第一表示制御手段は、前記プログラマブルロジックコントローラにおいてラダープログラムは複数のプログラム部品から構成されており、前記デバイスに関連する命令語を含む一つ以上のブロックを前記複数のプログラム部品の中から検索し、見つかったブロックを前記ラダー図として表示するように構成されていることを特徴とする請求項4に記載のプログラマブルロジックコントローラ用のエンジニアリングツール。 In the programmable logic controller, the ladder program is composed of a plurality of program parts, and the first display control means searches for one or more blocks containing instruction words related to the device from among the plurality of program parts. The engineering tool for a programmable logic controller according to claim 4, wherein the engineering tool is configured to display the found blocks as the ladder diagram. 前記第一表示制御手段は、前記デバイスに関連する命令語を含む複数のブロックを見つけると、当該複数のブロックに対応するラダー図を並べて表示するように構成されていることを特徴とする請求項5に記載のプログラマブルロジックコントローラ用のエンジニアリングツール。 3. The first display control means is configured to display ladder diagrams corresponding to the plurality of blocks side by side when a plurality of blocks containing command words related to the device are found. 5. An engineering tool for the programmable logic controller described in 5. 前記第一表示制御手段は、前記ラダープログラムにおいて、第一ブロックにおいて第一デバイスに関連する命令語が入力系の命令語である場合に、当該入力系の命令語に対応して記述されている出力系の命令語の対象とされている第二デバイスを特定し、当該第二デバイスを対象とする入力系の命令語を記述された第二ブロックを特定することを特徴とする請求項6に記載のプログラマブルロジックコントローラ用のエンジニアリングツール。 In the ladder program, when the command related to the first device in the first block is an input system command, the first display control means is written in correspondence with the input system command. Claim 6, characterized in that the second device targeted by the output system command is specified, and the second block in which the input system command directed to the second device is written is specified. Engineering tools for the programmable logic controllers described. 前記第一表示制御手段は、前記ラダープログラムにおいて、第一ブロックにおいて第一デバイスに関連する命令語が出力系の命令語である場合に、当該出力系の命令語に対応して記述されている入力系の命令語の対象とされている第二デバイスを特定し、当該第二デバイスを対象とする出力系の命令語を記述された第二ブロックを特定することを特徴とする請求項6に記載のプログラマブルロジックコントローラ用のエンジニアリングツール。 In the ladder program, when the instruction word related to the first device in the first block is an output-related instruction word, the first display control means is written in correspondence with the output-related instruction word. Claim 6, characterized in that the second device targeted by the input system command is specified, and the second block in which the output system command targeted at the second device is written is specified. Engineering tools for the programmable logic controllers described. 前記同期手段は、前記表示対象時刻の更新速度を設定する設定手段を有することを特徴とする請求項1ないし8のいずれか一項に記載のプログラマブルロジックコントローラ用のエンジニアリングツール。 9. The engineering tool for a programmable logic controller according to claim 1, wherein the synchronization means includes a setting means for setting an update rate of the display target time. 前記第一表示制御手段および前記第二表示制御手段は、前記プログラマブルロジックコントローラに関する情報を表示するヒューマンインタフェースから入力されたユーザ入力に基づき設定されたデバイス値をさらに表示するように構成されていることを特徴とする請求項1ないし9のいずれか一項に記載のプログラマブルロジックコントローラ用のエンジニアリングツール。 The first display control means and the second display control means are configured to further display device values set based on user input input from a human interface that displays information regarding the programmable logic controller. An engineering tool for a programmable logic controller according to any one of claims 1 to 9. 前記ヒューマンインタフェースをエミュレータにより実現されていることを特徴とする請求項10に記載のプログラマブルロジックコントローラ用のエンジニアリングツール。 11. The engineering tool for a programmable logic controller according to claim 10, wherein the human interface is realized by an emulator. 前記保存手段は、カメラユニットより取得された時系列の複数の画像データと、各画像データの取得時刻を示す時刻データとをさらに保存しており、
前記第二エンジニアリングソフトウェアモジュールは、前記リアルタイム再生モードにおいて前記プログラマブルロジックコントローラからデバイス値を取得して時系列波形を表示するとともに前記カメラユニットから取得された画像データを表示し、前記履歴再生モードにおいて前記保存手段から表示対象時刻に対応するデバイス値と前記画像データとを取得して表示するように構成されていることを特徴とする請求項1ないし11のいずれか一項に記載のプログラマブルロジックコントローラ用のエンジニアリングツール。
The storage means further stores a plurality of time-series image data acquired by the camera unit and time data indicating the acquisition time of each image data,
The second engineering software module acquires device values from the programmable logic controller in the real-time playback mode and displays time-series waveforms, and displays image data acquired from the camera unit, and in the history playback mode, the second engineering software module 12. The programmable logic controller according to claim 1, wherein the device value corresponding to the display target time and the image data are acquired from storage means and displayed. engineering tools.
前記保存手段は、カメラユニットより取得された時系列の複数の画像データと、各画像データの取得時刻を示す時刻データとをさらに保存しており、
前記第一エンジニアリングソフトウェアモジュールは、前記リアルタイム再生モードにおいて前記プログラマブルロジックコントローラからデバイス値を取得してラダー図上に当該デバイス値を表示するとともに前記カメラユニットから取得された画像データを表示し、前記履歴再生モードにおいて前記保存手段から表示対象時刻に対応するデバイス値と前記画像データとを取得してラダー図上に表示するように構成されていることを特徴とする請求項1ないし12のいずれか一項に記載のプログラマブルロジックコントローラ用のエンジニアリングツール。
The storage means further stores a plurality of time-series image data acquired by the camera unit and time data indicating the acquisition time of each image data,
The first engineering software module obtains a device value from the programmable logic controller in the real-time playback mode, displays the device value on a ladder diagram, and displays image data obtained from the camera unit, and displays the image data obtained from the camera unit, and displays the image data obtained from the camera unit. Any one of claims 1 to 12, wherein the image data and the device value corresponding to the display target time are acquired from the storage means in the playback mode and displayed on a ladder diagram. Engineering tools for programmable logic controllers described in section.
前記第一表示制御手段および前記第二表示制御手段は、前記履歴再生モードにおいて、前記表示対象時刻に最も近い時刻データに関連付けられているデバイス値を読み出すように構成されていることを特徴とする請求項1ないし11のいずれか一項に記載のプログラマブルロジックコントローラ用のエンジニアリングツール。 The first display control means and the second display control means are configured to read a device value associated with time data closest to the display target time in the history playback mode. An engineering tool for a programmable logic controller according to any one of claims 1 to 11. 前記第一表示制御手段および前記第二表示制御手段は、ユーザの入力操作に基づき前記リアルタイム再生モードと前記履歴再生モードのいずれが選択されたかを判定し、当該履歴再生モードが選択されると前記同期ソフトウェアモジュールを起動する、ことを特徴とする請求項1ないし14のいずれか一項に記載のプログラマブルロジックコントローラ用のエンジニアリングツール。The first display control means and the second display control means determine whether the real-time playback mode or the history playback mode is selected based on the user's input operation, and when the history playback mode is selected, the Engineering tool for a programmable logic controller according to any one of claims 1 to 14, characterized in that it activates a synchronous software module.
JP2018199201A 2018-10-23 2018-10-23 Engineering tools for programmable logic controllers Active JP7412076B2 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2018199201A JP7412076B2 (en) 2018-10-23 2018-10-23 Engineering tools for programmable logic controllers
JP2023218370A JP2024023867A (en) 2018-10-23 2023-12-25 Programmable logic controller systems and engineering tools

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2018199201A JP7412076B2 (en) 2018-10-23 2018-10-23 Engineering tools for programmable logic controllers

Related Child Applications (1)

Application Number Title Priority Date Filing Date
JP2023218370A Division JP2024023867A (en) 2018-10-23 2023-12-25 Programmable logic controller systems and engineering tools

Publications (2)

Publication Number Publication Date
JP2020013528A JP2020013528A (en) 2020-01-23
JP7412076B2 true JP7412076B2 (en) 2024-01-12

Family

ID=69169381

Family Applications (2)

Application Number Title Priority Date Filing Date
JP2018199201A Active JP7412076B2 (en) 2018-10-23 2018-10-23 Engineering tools for programmable logic controllers
JP2023218370A Pending JP2024023867A (en) 2018-10-23 2023-12-25 Programmable logic controller systems and engineering tools

Family Applications After (1)

Application Number Title Priority Date Filing Date
JP2023218370A Pending JP2024023867A (en) 2018-10-23 2023-12-25 Programmable logic controller systems and engineering tools

Country Status (1)

Country Link
JP (2) JP7412076B2 (en)

Citations (20)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000047707A (en) 1998-07-27 2000-02-18 Omron Corp Information managing device and its control method
JP2000250775A (en) 1999-03-01 2000-09-14 Omron Corp Trouble analysis supporting device and simulation system
JP2001067574A (en) 1999-06-21 2001-03-16 Yokogawa Electric Corp Plant monitoring system
JP2001117608A (en) 1999-10-15 2001-04-27 Omron Corp Programmable logic controller
JP2001282314A (en) 2000-03-31 2001-10-12 Toyoda Mach Works Ltd Device for displaying ladder circuit at the time of abnormality generation in programmable controller
JP2003076405A (en) 2001-08-30 2003-03-14 Digital Electronics Corp Control display device, control system, control program and recording medium recording the same
JP2003241806A (en) 2002-02-15 2003-08-29 Omron Corp Development support system and program product
JP2006301846A (en) 2005-04-19 2006-11-02 Keyence Corp Retrieval apparatus for user program and program to be applied to the same
JP2007257077A (en) 2006-03-20 2007-10-04 Mitsubishi Electric Corp Program debugging device, method and program
JP2008014792A (en) 2006-07-06 2008-01-24 Keyence Corp Waveform display device
JP2008084027A (en) 2006-09-27 2008-04-10 Digital Electronics Corp Programmable display device, display program and recording medium recording the same
JP2011107866A (en) 2009-11-16 2011-06-02 Hakko Denki Kk Apparatus and method for sequence control of connected equipment simulator, and program therefor
JP2012014384A (en) 2010-06-30 2012-01-19 Digital Electronics Corp Programmable display and data display program
WO2012056539A1 (en) 2010-10-27 2012-05-03 三菱電機株式会社 Logging setup device, logging setup method and recordable medium
JP2012118567A (en) 2009-03-27 2012-06-21 Mitsubishi Electric Corp Programmable display
WO2014167726A1 (en) 2013-04-12 2014-10-16 三菱電機株式会社 Programmable controller peripheral device and debug assistance program
JP2015156063A (en) 2014-02-19 2015-08-27 株式会社安川電機 Ladder program creation device, computer program, and computer readable information recording medium
JP2016004414A (en) 2014-06-17 2016-01-12 三菱電機株式会社 Device, method, and program for editing program
JP2017079009A (en) 2015-10-21 2017-04-27 株式会社キーエンス Monitor device of programmable logic controller
WO2018073868A1 (en) 2016-10-17 2018-04-26 三菱電機株式会社 Debugging assistance device and debugging assistance method

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2978260B2 (en) * 1991-03-15 1999-11-15 株式会社日立製作所 Programming method and apparatus for programmable controller
JPH1011118A (en) * 1996-06-24 1998-01-16 Keyence Corp Sequence controller, data processor, data recording and reproducing method, and recording medium

Patent Citations (20)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000047707A (en) 1998-07-27 2000-02-18 Omron Corp Information managing device and its control method
JP2000250775A (en) 1999-03-01 2000-09-14 Omron Corp Trouble analysis supporting device and simulation system
JP2001067574A (en) 1999-06-21 2001-03-16 Yokogawa Electric Corp Plant monitoring system
JP2001117608A (en) 1999-10-15 2001-04-27 Omron Corp Programmable logic controller
JP2001282314A (en) 2000-03-31 2001-10-12 Toyoda Mach Works Ltd Device for displaying ladder circuit at the time of abnormality generation in programmable controller
JP2003076405A (en) 2001-08-30 2003-03-14 Digital Electronics Corp Control display device, control system, control program and recording medium recording the same
JP2003241806A (en) 2002-02-15 2003-08-29 Omron Corp Development support system and program product
JP2006301846A (en) 2005-04-19 2006-11-02 Keyence Corp Retrieval apparatus for user program and program to be applied to the same
JP2007257077A (en) 2006-03-20 2007-10-04 Mitsubishi Electric Corp Program debugging device, method and program
JP2008014792A (en) 2006-07-06 2008-01-24 Keyence Corp Waveform display device
JP2008084027A (en) 2006-09-27 2008-04-10 Digital Electronics Corp Programmable display device, display program and recording medium recording the same
JP2012118567A (en) 2009-03-27 2012-06-21 Mitsubishi Electric Corp Programmable display
JP2011107866A (en) 2009-11-16 2011-06-02 Hakko Denki Kk Apparatus and method for sequence control of connected equipment simulator, and program therefor
JP2012014384A (en) 2010-06-30 2012-01-19 Digital Electronics Corp Programmable display and data display program
WO2012056539A1 (en) 2010-10-27 2012-05-03 三菱電機株式会社 Logging setup device, logging setup method and recordable medium
WO2014167726A1 (en) 2013-04-12 2014-10-16 三菱電機株式会社 Programmable controller peripheral device and debug assistance program
JP2015156063A (en) 2014-02-19 2015-08-27 株式会社安川電機 Ladder program creation device, computer program, and computer readable information recording medium
JP2016004414A (en) 2014-06-17 2016-01-12 三菱電機株式会社 Device, method, and program for editing program
JP2017079009A (en) 2015-10-21 2017-04-27 株式会社キーエンス Monitor device of programmable logic controller
WO2018073868A1 (en) 2016-10-17 2018-04-26 三菱電機株式会社 Debugging assistance device and debugging assistance method

Also Published As

Publication number Publication date
JP2024023867A (en) 2024-02-21
JP2020013528A (en) 2020-01-23

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
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
JP7173826B2 (en) Programmable logic controller system, programming support device and computer program
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
JP7405714B2 (en) programmable logic controller
JP7412076B2 (en) Engineering tools for programmable logic controllers
JP2022158228A (en) Monitoring device and programmable logic controller system
JP6806946B2 (en) External setting devices and programs
JP6948450B2 (en) Programmable logic controller and main unit
JP6986125B2 (en) Programmable logic controller and main unit
JP7356778B2 (en) Program creation support device for programmable logic controllers
US11960379B2 (en) Simulation system, method for simulation system, and non-transitory computer-readable storage medium storing simulation program
US20230004482A1 (en) Simulation system, method for simulation system, and non-transitory computer-readable storage medium storing simulation program
US11520315B2 (en) Production system, production method, and information storage medium
JP2022101969A (en) Control system, support device and label assignment method
JP2022158229A (en) Programmable logic controller system
JP6783034B1 (en) Programmable logic controllers, computers, methods, and programs
JP2023547855A (en) Systems and equipment for authoring and developing automation interfaces and processes without writing code

Legal Events

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

Free format text: JAPANESE INTERMEDIATE CODE: A7422

Effective date: 20210113

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20210908

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20220630

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20220719

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20220920

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20230116

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20230714

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20230911

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20231226

R150 Certificate of patent or registration of utility model

Ref document number: 7412076

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150