JP6948450B2 - Programmable logic controller and main unit - Google Patents

Programmable logic controller and main unit Download PDF

Info

Publication number
JP6948450B2
JP6948450B2 JP2020201712A JP2020201712A JP6948450B2 JP 6948450 B2 JP6948450 B2 JP 6948450B2 JP 2020201712 A JP2020201712 A JP 2020201712A JP 2020201712 A JP2020201712 A JP 2020201712A JP 6948450 B2 JP6948450 B2 JP 6948450B2
Authority
JP
Japan
Prior art keywords
unit
time
log
display
program
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
JP2020201712A
Other languages
Japanese (ja)
Other versions
JP2021036479A (en
JP2021036479A5 (en
Inventor
哲也 宮坂
哲也 宮坂
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Keyence Corp
Original Assignee
Keyence Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Family has litigation
First worldwide family litigation filed litigation Critical https://patents.darts-ip.com/?family=74716377&utm_source=google_patent&utm_medium=platform_link&utm_campaign=public_patent_search&patent=JP6948450(B2) "Global patent litigation dataset” by Darts-ip is licensed under a Creative Commons Attribution 4.0 International License.
Priority claimed from JP2020134823A external-priority patent/JP6806946B2/en
Application filed by Keyence Corp filed Critical Keyence Corp
Priority to JP2020201712A priority Critical patent/JP6948450B2/en
Publication of JP2021036479A publication Critical patent/JP2021036479A/en
Publication of JP2021036479A5 publication Critical patent/JP2021036479A5/ja
Application granted granted Critical
Publication of JP6948450B2 publication Critical patent/JP6948450B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

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

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

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

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

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

本発明は、たとえば、
ログ設定情報を受け付けるインタフェースと、ラダープログラムを繰り返し実行するプログラム実行部と、前記プログラム実行部により参照される記憶領域である複数のデバイスを有するデバイス記憶部と、前記ログ設定情報で指定される収集周期ごとに、前記デバイス記憶部に記憶されている複数のデバイス値を収集時刻に関する情報と対応付けて記録する記録部とを有し、前記ログ設定情報で指定される条件が満たされると前記記録部から前記複数のデバイス値および対応付けられた収集時刻に関する情報を読み出してログデータとして出力するプログラマブルロジックコントローラに接続され、
前記プログラマブルロジックコントローラにより出力されるログデータを用いて、前記複数のデバイス値を表示する外部設定機器であって、
前記収集周期としてラダープログラムの1スキャンを指定し、前記条件として特定のデバイスおよび当該特定のデバイスの状態変化によって定まるタイミングを指定する前記ログ設定情報を、前記プログラマブルロジックコントローラに対して送信する送信部と、
前記ラダープログラムおよび前記ログデータを記憶するメモリと、
前記メモリに記憶されたラダープログラムを表示するとともに、前記メモリに記憶されたログデータから前記収集時刻に関する情報に基づき複数のデバイス値を取得して、特定時刻におけるデバイス値として当該ラダープログラム上に表示するログ表示部と、
を備え、
前記ログ表示部は、第1ボタンを介した表示更新指示を受け付けると、時間経過に応じて前記特定時刻を進めて行くとともに、当該特定時刻と前記収集時刻に基づき前記ラダープログラム上に表示されるデバイス値であって前記特定時刻に対応するデバイス値を繰り返し更新することを特徴とする外部設定機器を提供する。
The present invention is, for example,
An interface that accepts log setting information, a program execution unit that repeatedly executes a ladder program, a device storage unit that has a plurality of devices that are storage areas referenced by the program execution unit , and a collection specified by the log setting information. for each cycle, have a recording section which records in association with information about the collection time a plurality of device values stored in the device memory unit, the condition specified in the log setting information is satisfied recorded It is connected to a programmable logic controller that reads out the information about the plurality of device values and the associated collection time from the unit and outputs it as log data.
An external setting device that displays the plurality of device values using the log data output by the programmable logic controller.
A transmitter that transmits the log setting information to the programmable logic controller, which specifies one scan of the ladder program as the collection cycle and specifies the timing determined by the state change of the specific device and the specific device as the condition. When,
A memory for storing the ladder program and the log data, and
The ladder program stored in the memory is displayed, and a plurality of device values are acquired from the log data stored in the memory based on the information regarding the collection time and displayed on the ladder program as the device value at a specific time. Log display and
With
When the log display unit receives a display update instruction via the first button, the log display unit advances the specific time according to the passage of time and is displayed on the ladder program based on the specific time and the collection time. Provided is an external setting device characterized by repeatedly updating a device value corresponding to the specific time.

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

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

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

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

図1は、本発明の実施の形態によるプログラマブル・ロジック・コントローラシステムの一構成例を示す概念図である。図1が示すように、このシステムは、ラダープログラムなどのユーザプログラムの編集を行うための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 FIG. 1, this system is a PLC (programmable logic controller) 1 for comprehensively controlling a PC 2 for editing a user program such as a ladder program and various control devices installed in a factory or the like. And have. PC is an abbreviation for personal computer. The user program may be created using a graphical programming language such as a ladder language or a flowchart-type motion program such as SFC (sequential function chart), or may be created using a high-level programming language such as C language. .. In the following, for convenience of explanation, the user program will be a ladder program. The PLC 1 includes a basic unit 3 having a built-in CPU and one or a plurality of expansion units 4. One or more expansion units 4 can be attached to and detached from the basic unit 3. For example, the expansion unit 4a may be a positioning unit that drives a motor (field device 10a) to position the work, and the expansion unit 4b may be a counter unit. The counter unit counts signals from an encoder (field device 10b) such as a manual pulsar. The characters a, b, c ... Attached to the end of the reference code may be omitted. The basic unit 3 is sometimes called a CPU unit. The system including PLC1 and PC2 may be called a programmable logic controller system.

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

拡張ユニット4は、PLC1の機能を拡張するために用意されている。各拡張ユニット4には、その拡張ユニット4の機能に対応するフィールドデバイス(被制御装置)10が接続され、これにより、各フィールドデバイス10が拡張ユニット4を介して基本ユニット3に接続される。フィールドデバイス10は、センサやカメラなどの入力機器であってもよいし、アクチュエータなどの出力機器であってもよい。また、一つの拡張ユニット4に対して複数のフィールドデバイスが接続されてもよい。 The expansion unit 4 is prepared to expand the function of the PLC1. A field device (controlled device) 10 corresponding to the function of the expansion unit 4 is connected to each expansion unit 4, whereby 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 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に送信してもよい。 PC2 may 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 unit 7 and an operation unit 8. A ladder program, which is an example of a user program for controlling PLC1, is created using PC2. The created ladder program is converted into a mnemonic code in PC2. The PC 2 is connected to the basic unit 3 of the PLC 1 via a communication cable 9 such as USB (Universal Serial Bus), and sends a ladder program converted into a mnemonic code to the basic unit 3. The basic unit 3 converts the ladder program into machine code and stores it in the memory provided in the basic unit 3. Although the mnemonic code is transmitted to the basic unit 3 here, the present invention is not limited to this. For example, the PC 2 may convert the mnemonic code into an intermediate code and transmit the intermediate code to the basic unit 3.

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

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

図2が示すリレー回路は、入力装置からの入力信号に基づいてオン/オフされる3つの仮想デバイス(以下、「入力デバイス」と呼ぶ。)のシンボルと、出力装置の動作を制御するためにオン/オフされる仮想デバイス(以下、「出力デバイス」と呼ぶ。)のシンボルと、が適宜結合されることにより構成されている。 The relay circuit shown in FIG. 2 is used to control the symbols of three virtual devices (hereinafter, referred to as “input devices”) that are turned on / off based on the input signal from the input device and the operation of the output device. It is configured by appropriately combining the symbols of virtual devices (hereinafter, referred to as "output devices") that are 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 the 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 character displayed above the symbol of the output device (“return to origin”) is a label 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 AND circuit is configured by connecting the symbols of the two input devices corresponding to the device names “R0001” and “R0002” in series. Further, the OR circuit is configured by connecting the symbols of the input devices corresponding to the device name "R0003" in parallel to the AND circuit composed of the symbols of these two input devices. That is, in this relay circuit, only when the input devices corresponding to the two symbols in the first line are turned on, or when the input devices corresponding to the symbols in the second line are turned on, the symbols in the first line are supported. 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. 3, the PC 2 includes a CPU 21, a display unit 7, an operation unit 8, a storage device 22, and a communication unit 23. The display unit 7, the operation unit 8, the storage device 22, and the communication unit 23 are each electrically connected to the CPU 21. The storage device 22 includes a RAM and a ROM, and may further 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, a ladder program) and configuration information of the basic unit 3 and the expansion unit 4. The configuration information includes information indicating the connection positions of a plurality of expansion units 4 with respect to the basic unit 3, functions provided in the basic unit 3 (example: communication function and positioning function), and functions of the expansion unit 4 (example: shooting function). It is information indicating such as. Here, editing the project data includes creating and modifying the project data. The project data created by using the editing software is stored in the storage device 22. Further, the user can read the project data stored in the storage device 22 as needed and change the project data by using editing software. The communication unit 23 is for connecting the PC 2 to the basic unit 3 so as to be communicable via the communication cable 9. The CPU 21 transfers the project data to the basic unit 3 via the communication unit 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 PLC1. As shown in FIG. 4, the basic unit 3 includes a CPU 31, a display unit 5, an operation unit 6, a storage device 32, and a communication unit 33. The display unit 5, the operation unit 6, the storage device 32, and the communication unit 33 are each electrically connected to the CPU 31. The storage device 32 may include a RAM, a ROM, a memory card, and the like. The storage device 32 has a plurality of storage areas such as a device unit 34, a project storage unit 35, and a detachable memory card 36. The device unit 34 has a bit device, a word device, and the like, and each device stores a device value. The project storage unit 35 stores the project data input from the PC2. The storage device 32 also stores the 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. The communication function related to the unit internal bus 90 may be implemented as a part of the communication unit 33. The communication unit 33 may have a network communication circuit. The CPU 31 may transmit log data or the like to the PC 2 or the cloud via the communication unit 33.

ここで、ユニット内部バス90について、補足説明する。このユニット内部バス90は、次に説明する入出力リフレッシュ等が行われるバスであって、ユニット内部バス90における通信制御は、いわゆるバスマスタ38によって実現される(なお、通信部33の一部としてバスマスタを設けてもよいし、CPU31の一部としてバスマスタ38を設けてもよい)。バスマスタ38は、ユニット内部バス90での通信を制御するための制御回路であって、CPU31からの通信要求を受けて、拡張ユニット4との間で、後述する入出力リフレッシュ等の通信を行う。 Here, the unit internal bus 90 will be supplementarily described. The unit internal bus 90 is a bus on which input / output refresh and the like described below are performed, and communication control in the unit internal bus 90 is realized by a so-called bus master 38 (note that the bus master is a part of the communication unit 33). Or a bus master 38 may be provided as a part of the CPU 31). The bus master 38 is a control circuit for controlling communication on the unit internal bus 90, and receives a communication request from the CPU 31 and performs communication such as input / output refresh 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 an instruction (device value) from the basic unit 3 stored in the device. Further, the CPU 41 stores the control result of the field device 10 in a device called a buffer memory. The control result stored in the device is transferred to the basic unit 3 by input / output refresh. Further, the control result stored in the device is transferred to the basic unit 3 according to the read instruction from the basic unit 3 even at a timing different from the input / output refresh. The memory 42 includes a RAM, a ROM, and the like. In particular, the RAM has a storage area used as a buffer memory. The memory 42 may have a buffer that temporarily holds data (eg, still image data or moving image data) acquired by the field device 10.

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

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

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

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

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

上述したように基本ユニット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 remove devices from the logging target in units of these functions. For example, if an undesired event occurs regarding the communication function of the basic unit 3, the user can easily eliminate 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 / removal)
FIG. 6 shows a function realized by the CPU 21 of the PC 2 executing the editing software stored in the storage device 22. Some or all of these functions may be realized by hardware circuits such as ASICs and FPGAs. ASIC is an abbreviation for a special purpose integrated circuit. FPGA is an abbreviation for field programmable gate array.

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

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

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

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

同様にして、削除部55は、プロジェクトデータ71に含まれる一又は複数のプログラム部品を先に解析することで抽出リストを作成した後で、部品指定部52によって指定されたプログラム部品に記述されたデバイスを抽出し、これを抽出リストから削除するようにしてもよい。 Similarly, the deletion unit 55 is described in the program component designated by the component designation unit 52 after creating an extraction list by first analyzing one or more program components included in the project data 71. You may want to extract the device and remove it from the extraction list.

なお、本実施形態では、説明の便宜上、追加部54と削除部55を分けているが、一つの機能ブロックであってもよいことは言うまでもない。 In the present embodiment, the addition unit 54 and the deletion unit 55 are separated for convenience of explanation, 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 a user instruction input through the operation unit 8. The estimation unit 59 estimates the influence of the recording of the device value by the PLC1 on the execution of the user program based on the number of devices extracted as the recording target by the device extraction unit 53. Logging adds a delay time that correlates to the number of device values to the scan time. Therefore, the estimation unit 59 may obtain the delay time by multiplying the number of device values by a predetermined coefficient, and display the delay time as the estimation result on the display unit 7. This delay time may be referred to as an increase in scan time.

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

図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) accepts the designation of the program component to be extracted from the device.

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

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

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

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

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

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

図9において基本ユニット3の機能である通信エラーモニタは通信部33の通信エラーを監視する機能である。センサI/Oモニタはセンサの入出力を監視する機能である。モーションユニットは位置決めユニットとも呼ばれ、軸とよばれる制御対象の位置を制御する。一般に軸ごとにモータなどの駆動源が存在する。アナログ入力ユニットは、入力されるアナログ信号をサンプリングしてデジタル信号に変換するユニットである。ユニットモニタはモーションユニットやアナログ入力ユニットなどの拡張ユニット4の動作を監視する機能である。 In FIG. 9, the communication error monitor, which is a function of the basic unit 3, is a function of monitoring the communication error of the communication unit 33. The sensor I / O monitor is a function for monitoring the input / output of the sensor. The motion unit is also called a positioning unit and controls the position of a controlled object called an axis. Generally, there is a drive source such as a motor for each shaft. 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 of monitoring the operation of the expansion unit 4 such as the motion unit and the 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 view of the screen of the unit monitor 440 with respect to the axis 1 of the motion unit. FIG. 10B is a schematic view of a setting screen 441 for changing the monitoring target 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, command coordinates, current speed, command speed, feedback torque, load factor, and peak current are set as monitoring targets 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 the present embodiment, 16 bits are secured for one UG, and two UGs are secured for expressing the current coordinates in 32 bits. The device value of UG is, for example, a numerical value such as 0PLS (pulse). Further, UG8 and UG9 are assigned to the command coordinates. Two UGs are secured for the same reason as described above (to secure a 32-bit representation). Since the unit designer can freely assign the UG, there are some unused UGs (UG6 and UG7). Similarly, UG10 and UG11 are assigned to the current speed, and UG12 and UG13 are assigned to the command speed, respectively. 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 item is to be monitored by the unit monitor 440. For example, by selecting one item from the "hidden" column 442 shown in FIG. 10B and clicking the right arrow button 443, that one item moves to the "display" column 444 and is monitored by the unit monitor 440. It 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 when there are a plurality of axes 2 and 3. For each axis, the item selected by the user is monitored.

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

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

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

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

S3でデバイス抽出部53は部品指定部52により指定されたプログラム部品を解析し、指定されたプログラム部品において記述されているデバイスを抽出する。 In S3, the device extraction unit 53 analyzes the program component designated by the component designation unit 52, and extracts the device described in the designated 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 extracted from the device, the name of the leading device (device number), the number of devices extracted based on the leading device, and the device name actually extracted as the logging target. Is shown. Generally, a number of devices corresponding to a specified number are extracted with the first device as a reference. However, the number of devices exceeding the specified number may be extracted. R34000 is a relay device, which holds 1-bit information, and a series of 16 devices from R34000 to R34015 are extracted. This is because logging 16-bit devices together is advantageous from the viewpoint of data processing speed. In FIG. 10C, the number of R34000 is "1", which indicates one word (16 bits). Further, the number of CR4001 is also "1", which also indicates one word (CR4001, CR4002, ..., 16 bits of CR4015 and CR4100). A global is a device commonly used by a plurality of program components. Main shows the main program. first_operation is the name of a function block. Sub indicates a subprogram (submodule).

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

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

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

S6でマージ部56は、プログラム部品から抽出されたデバイス、機能から抽出されたデバイスおよび手動で追加されたデバイスをマージしてロギング対象リストを作成する。ロギング対象リストはデバイスリストと呼ばれてもよい。 In S6, the merging unit 56 merges the devices extracted from the program components, the devices extracted from the functions, and the devices added manually to create a logging target list. 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 illustrating the concept of the merge process. The device extraction unit 53 creates an extraction list L1 that describes the devices extracted from the program components. The device extraction unit 53 creates an extraction list L2 that describes the devices extracted from the function. The device extraction unit 53 creates an extraction list L3 that describes the devices manually added by the user. The merging unit 56 merges the extraction lists L1 to L3 to create the logging target list L0. In the extraction lists L1 to L3, there may be devices extracted in duplicate. When the same device is logged multiple times, the log data becomes bloated. Therefore, the merge process is executed in order to avoid duplicate logging of the same device. For example, in the extraction list L1, the data memory DM0-DM100, which is a kind of device, is registered. Further, the data memory DM50-DM200 is registered in the extraction list L3. That is, DM50-DM100 are duplicated. The merging unit 56 merges DM0-DM100 and DM50-DM200 and describes DM0-DM200 in the logging target list L0.

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

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

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

S9でログ設定部51はロギング対象リストL0を含むログ設定データ72を作成し、記憶装置22に格納する。なお、CPU21は、プロジェクトデータ71とともにログ設定データ72を基本ユニット3に送信するよう通信部23を制御する。 In S9, the log setting unit 51 creates the log setting data 72 including the logging target list L0 and stores it in the storage device 22. The CPU 21 controls the communication unit 23 so as 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 (eg, IP address, etc.) of each function may also be added as logging targets.

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

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

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

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

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

004,005番のステップは、モータの原点復帰(動作)要求であり、R34310は、モータの原点復帰開始トリガーを示すリレーデバイスである。本ステップからは、MR001、R34310、R40905,R40910,R34310の各デバイスが抽出される。 The 004,005 step is a motor origin return (operation) request, and R34310 is a relay device indicating a motor origin return start trigger. From this step, each device of MR001, R34310, R40905, R40910, and R34310 is 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の各デバイスが抽出される。 The steps 006 to 008 are processes for reading the home-origin completion code from the motion unit and determining whether or not the homing is correctly completed when the home-returning of the motor is completed. More specifically, the R40910 is a relay device that indicates a return-to-origin completion trigger of the motor. The basic unit 3 does not recognize the specific processing operation of the home return in the motion unit in real time, and determines whether the home return is completed by monitoring whether the 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 the buffer memory No. 4060 in the unit No. 1 and assign one word to the device @ EM0. Here, the home return completion code is stored in the buffer memory No. 4060, and is 0 when the home return is completed normally, and a numerical value other than 0 (1 or 2) when the home return is abnormally completed. Etc.) are stored. Then, as shown in step 007, when the device value of @ EM0 is other than 0, the basic unit 3 sets the device MR000 and recognizes that the origin return has ended abnormally. On the other hand, as shown in step 008, when the device value of @ EM0 is 0, the basic unit 3 sets the device MR001 and recognizes that the home return has been normally completed. From this step, each device of R40910, @ EM0, @ MR000, @ MR001 is extracted.

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

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

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

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

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

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

一方で、実行部80のユニット制御部80bは、入出力リフレッシュにより取得した拡張ユニットに関するデバイス値を、拡張ユニットデバイス部34bに読み書きする。また、基本ユニットと拡張ユニットは、ユニット内部バスによって電気的に接続されており、ユニット制御部80bは、このユニット内部バスにおける通信制御を行う機能、いわゆるバスマスタとしての機能を有している。ユニット制御部80bがバスマスタとして機能する場合には、図6を用いて説明したユニット構成情報、すなわち、PLC1全体がどのようなユニットから構成されるかを示す情報に基づいて、各拡張ユニットとリフレッシュ通信を行う。 On the other hand, the unit control unit 80b of the execution unit 80 reads / writes the device value related to the expansion unit acquired by the input / output refresh to / from the expansion unit device unit 34b. Further, the basic unit and the expansion unit are electrically connected by the unit internal bus, and the unit control unit 80b has a function of performing communication control in the unit internal bus, that is, a function as a so-called bus master. When the unit control unit 80b functions as a bus master, each expansion unit and refresh are based on the unit configuration information described with reference to FIG. 6, that is, information indicating what kind of unit the entire PLC1 is composed of. 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) according to the log setting data 72, or acquires a device value from the buffer memory of the expansion unit 4. , Write to memory (for example, ring buffer) as log data 73. As described above, the recording unit 81 executes the logging process at the time of the END process or the like.

END処理におけるロギング処理について、更に詳細に説明する。ログ設定データ72には、図10Cや図11を用いて説明したように、部品指定部52によって指定されたプログラム部品に記述されたデバイスや、機能指定部60によって指定された機能(例えばユニットモニタによる監視の対象)に割り付けられたデバイスが、ロギング対象として含まれている。前者のデバイスについては、END処理の際に、ログデータ73に書き込む一方で、後者のデバイスについては、END処理の際に、拡張ユニット4から対象となるデバイス(UG)のデバイス値を読み出して、ログデータ73に書き込む。 The logging process in the END process will be described in more detail. In the log setting data 72, as described with reference to FIGS. 10C and 11, the device described in the program component designated by the component designation unit 52 and the function specified by the function designation unit 60 (for example, the unit monitor) are included in the log setting data 72. Devices assigned to (monitored by) are included as logging targets. For the former device, the log data 73 is written during the END processing, while for the latter device, the device value of the target device (UG) is read from the expansion unit 4 during the END processing. 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 the present embodiment, since the device value of the UG is read out in synchronization with the scan cycle, not all the current coordinates and the command coordinates are written in the log data 73. However, the present invention is not limited to this. For example, the current coordinates and command coordinates are stored in the memory of the expansion unit 4 for each control cycle, and a plurality of current coordinates and commands stored up to that point are stored at the timing of the scan cycle. It is also possible to configure the coordinates and the like to be read out.

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

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

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

検知部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 an ASIC. In this case, the execution unit 80 specifies the address of the device to be read / written to the storage device 32 by using the address line. Therefore, the detection unit 82 may dynamically detect the device whose device value has been updated by monitoring this address line. This will be useful when adding devices that are not described in the user program as recording targets.

検知部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 the device value to the specific device of the device unit 34, and may write the device value and the device name (device number) to the log data 73. This method will be 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 the device regardless of the device list included in the log setting data 72. In an extreme case, the user can acquire the log data 73 without creating the log setting data 72. For example, when the execution unit 80 is activated, the execution unit 80 acquires device values from all the 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 the device information (address information) of the read device value to the recording unit 81. The recording unit 81 reads device values from all the devices included in the device unit 34 based on the address information transmitted by the detection unit 82 and writes them in the log data 73. After that, every time the detection unit 82 detects 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 access to the device a plurality of times within one cycle, the recording unit 81 may write to the log data 73 only with the device value when the last access is detected. This makes it possible to reduce the data size of the log data 73.

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

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

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

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

ところで、ログ設定データ72には、ログデータ73のデータ形式(例:バイナリー形式やテキスト形式)が含まれてもよい。データ形式としては、10進数16ビット、10進数32ビット、±10進数16ビット、±10進数32ビット、16進数16ビット、16進数32ビット、文字列、Float、DoubleFloatなどが、デバイスごとに設定されてもよい。このようなデータ形式はプログラム部品における命令語を解析することで判別可能である。 By the way, the log setting data 72 may include the data format (eg, binary format or text format) of the log data 73. As the data format, decimal 16 bits, decimal 32 bits, ± decimal 16 bits, ± decimal 32 bits, hexadecimal 16 bits, hexadecimal 32 bits, character string, Float, DoubleFloat, etc. are set for each device. May be done. Such a data format can be identified by analyzing the instruction word 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 stores the project data 71, the log data 73, and the image data in the memory when a predetermined output condition is satisfied, such as when the execution of the user program is completed or when the save trigger relay to the memory card is turned on. Write to card 36. Until the predetermined output condition is satisfied, the log data 73 is recorded in the 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 additionally recorded. (Record in so-called FIFO format). The memory card 36 is removed from the basic unit 3 and mounted on the mounting portion of the PC 2. As a result, the log data 73 is displayed on the display unit 7 of the PC 2. The output unit 84 may transmit the log data 73 to the PC2, the cloud, or the like via the communication unit 33.

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

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

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

図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 function of the CPU 31 of the basic unit 3. The same reference numerals are given to the parts already described. In this example, the recording unit 81 has a collecting unit 92a. When the predetermined collection start condition is satisfied, the collection unit 92a reads the device value specified by the log setting data 72 among the device values held in the device unit 34 from the device unit, and also reads the device value specified by the log setting data 72 from the device unit and from the time management unit 83a. Get time information. The collecting unit 92a associates the device value with the time information and stores it in the ring buffer 91a. The collection unit 92a acquires the device value and the time information for each collection cycle (example: 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 adopted is that not all the data stored in the ring buffer 91a is stored in the memory card 36 as the log data 73. For example, the storage unit 93 may read the device value and the 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, when the predetermined storage condition is satisfied, the storage unit 93 may read the large-capacity data and the time information from the expansion unit 4, create the log data 73, and store it in the memory card 36. The storage unit 93 stores the above-mentioned device value and time information in association with the above-mentioned large-capacity data and time information. Here, "associating" saving means that the file is saved in a form that can be easily played back on the PC 2, and for example, file management in which a plurality of files are associated with each other may be performed. 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 to a specific folder (directory path) becomes a common flag, and this common flag can be used to "associate" and save files in the first subfolder and files in the second subfolder. It will be possible. If there is another folder placed at the same level (directory) as the above-mentioned specific folder, the other folder means a data package saved at another timing. Of course, the same subfolders as described above are also placed under this separate 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 a common flag (predetermined directory path). , You may save those multiple files. In addition, for example, by adopting a file name as a common flag and generating a file having the same or corresponding file name, it is possible to save the file "in association with each other". In addition, for example, it is possible to "associate" and save the device value and the data (large amount of data) by associating them with each other and collecting them in one file by using the time information as a key. .. In the present embodiment, a large amount of data is considered as an example of data from the monitoring device, but it goes without saying that it may be continuous data such as motion data, communication data, and voice data. The transmission unit 94 may transmit the log data 73 to the PC2, the cloud, or the like. When the ring buffer 91a is full, the collecting unit 92a overwrites the oldest information held in the ring buffer 91a with the newest information.

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

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

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

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

図21はさらに拡張ユニット4のリングバッファ91bに保持された画像データと時刻情報とを示している。一つのレコードは、取得された画像データと、この画像データが取得された時刻を示す時刻情報とを有している。 FIG. 21 further shows the image data and the time information held in the ring buffer 91b of the expansion unit 4. One record has acquired image data and time information indicating the time when the 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 (collecting unit 92a) determines whether or not the device value acquisition condition is satisfied. The acquisition condition is a condition for starting the storage of the device value and the time information in the ring buffer 91a. The acquisition condition may be described in the user program (eg, the start relay is turned on) or in the log setting data 72. When the acquisition condition is satisfied, the CPU 31 proceeds to S22.

S22でCPU31(収集部92a)は取得リレーをONにする。取得リレーは一ビットデバイスであり、拡張ユニット4に対してリングバッファ91bへのデータの格納を指示するためのリレーである。 In S22, the CPU 31 (collecting 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 (collecting unit 92a) determines whether or not the device value acquisition timing has arrived. The acquisition timing is, for example, every scan cycle (for example, is acquired in the END process in each 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 the 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 (collecting unit 92a) determines whether or not the storage timing has arrived. The save timing is a timing for saving the information held in the ring buffer 91a in the log data 73. The save timing may be, for example, the occurrence of a predetermined event (eg, save trigger). The save timing is also defined by the log setting data 72. If the save timing has not arrived, the CPU 31 returns to S23. If the save timing has arrived, the CPU 31 proceeds to S26.

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

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

S28で(収集部92a)は、終了条件が満たされたかどうかを判定する。終了条件は、ロギングの終了条件である。終了条件もログ設定データ72により定義されていてもよい。終了条件が満たされていなければ、CPU31はS23に戻る。終了条件が満たされていれば、CPU31はロギング処理を終了する。 In S28, (collecting unit 92a) determines whether or not the termination condition is satisfied. The end condition is the end condition of logging. The end condition may also be defined by the log setting data 72. If the end condition is not satisfied, the CPU 31 returns to S23. If the end condition is satisfied, the CPU 31 ends 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 (collecting unit 92b) determines whether or not the image data acquisition condition (eg, the acquisition relay is turned on) is satisfied. When the acquisition relay is turned on, the CPU 41 proceeds to S32. In the present 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. Alternatively, for example, when the mode of PLC1 is switched to the operation mode, it may be determined that the image data acquisition condition is satisfied. More specifically, the PLC1 is provided with a mode changeover switch for switching between a setting mode (program mode) for performing various settings and an operation mode (RUN mode) for repeatedly executing a ladder program to perform actual operation. May be done. In this case, if 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 (collecting unit 92b) determines whether or not the image data acquisition timing has arrived. The acquisition timing is, for example, each 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 (collecting unit 92b) acquires a 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. When the time management unit 83b receives the trigger signal, it reads the time information from the internal clock and writes it in the time information buffer 95. The camera 98 executes imaging according to the imaging conditions specified in advance, and outputs image data. The image receiving unit 96a outputs the image data to the collecting unit 92b. The image receiving unit 96a may write the image data directly to the ring buffer 91b. The collecting unit 92b associates the time information read from the time information buffer 95 with the image data acquired by the camera 98 and writes the time information to the ring buffer 91b.

S34でCPU41(収集部92b)は、基本ユニット3からリングバッファ91bに対する読み出し要求(読み出し命令)が発行されたかどうかを判定する。読み出し要求を受信したのであれば、CPU41はS35に進む。読み出し要求が発行されていなければ、CPU41はS32に戻る。 In S34, the CPU 41 (collecting unit 92b) determines whether or not a read request (read instruction) to the ring buffer 91b has been issued from the basic unit 3. If the read request is 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 (collecting 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 (collecting unit 92b) determines whether or not the end condition is satisfied. For example, the collecting unit 92b determines whether or not the acquisition relay is turned off. If the end condition is not satisfied, the CPU 41 returns to S32. If the end condition is satisfied, the CPU 41 ends 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 form>
FIG. 24 shows the connection form of the building block type PLC1. An IF99a for connecting to and communicating with the expansion unit 4 is provided on the right side surface of the basic unit 3. IF is an abbreviation for interface. In this example, the expansion unit 4a is connected to the basic unit 3, and the expansion unit 4b is connected to the expansion unit 4a. The expansion unit 4 has IF99 on both the right side surface and the left side surface. The right side surface of the basic unit 3 faces the left side surface of the expansion unit 4a. Therefore, the IF99a of the basic unit 3 is connected to the IF99b provided on the left side surface of the expansion unit 4a. The right side surface of the expansion unit 4a faces the left side surface of the expansion unit 4b. Therefore, the IF99c of the expansion unit 4a is connected to the IF99d provided on the left side surface of the expansion unit 4b. The 99e provided on the right side surface of the expansion unit 4b may be connected to the end unit. In this way, IF99a to IF99e form the unit internal bus 90. For example, the image data acquired by the camera 98a connected to the expansion unit 4a can be transferred to the basic unit 3 via the unit internal bus 90. The image data acquired by the camera 98b connected to the expansion unit 4b can be transferred to the basic unit 3 via the unit internal bus 90.

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

図25はバックプレーン200を有するPLC1の接続形態を示している。バックプレーン200は、基本ユニット3の底面および拡張ユニット4の底面に接続されるか、基本ユニット3の背面および拡張ユニット4の背面に接続される。バックプレーン200は基本ユニット3および拡張ユニット4を支持する支持プレート(ベースプレート)として機能する。ここでは一例として背面が接続面として説明される。基本ユニット3の背面はバックプレーン200の正面と対向している。よって、基本ユニット3の背面に設けられたIF99fはバックプレーン200の正面に設けられたIF99gと接続する。拡張ユニット4の背面はバックプレーン200の正面と対向している。拡張ユニット4aの背面に設けられたIF99hはバックプレーン200の正面に設けられたIF99iに接続される。拡張ユニット4bの背面に設けられたIF99jはバックプレーン200の正面に設けられたIF99kに接続される。IF99fないしIF99kはユニット内部バス90を形成している。 FIG. 25 shows the connection form of the PLC1 having the backplane 200. The backplane 200 is connected to the bottom surface of the basic unit 3 and the bottom surface of the expansion unit 4, or is connected to the back surface of the basic 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 the expansion unit 4. Here, as an example, the back surface is described as a connecting surface. The back surface of the basic unit 3 faces the front surface of the backplane 200. Therefore, the IF99f provided on the back surface of the basic unit 3 is connected to the IF99g provided on the front surface of the backplane 200. The back surface of the expansion unit 4 faces the front surface of the backplane 200. The IF99h provided on the back surface of the expansion unit 4a is connected to the IF99i provided on the front surface of the backplane 200. The IF99j provided on the back surface of the expansion unit 4b is connected to the IF99k 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を有する。 The backplane 200 may have a communication control unit 213 for controlling bus communication via the unit internal bus 90. Further, the backplane 200 may have a CPU 211 and a memory 212. The memory 212 may have a memory card 36 in addition to the RAM and ROM. In this case, the CPU 211 may function as a collecting unit 92a or a storage unit 93. Further, the memory 212 may be provided with a ring buffer 91a. Alternatively, the CPU 211 may have a time management unit 83b and a collection unit 92. In this case, the memory 212 has a ring buffer 91b.

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

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

すでに図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 work image i1 do not match. Therefore, the log display unit 61 compares the acquisition time of the work image i1 with the acquisition time of the device values d1 to d10, and obtains the acquisition time of the device value dx closest to the acquisition time of the work image i1. In this example, the closest acquisition time of the work image i1 is the acquisition time of the device value d1. Therefore, the log display unit 61 starts displaying the device value d1 and also starts displaying the work image i1. Next, the log display unit 61 obtains the acquisition time of the device value dx closest to the acquisition time of the work image i2. In this example, the acquisition time of the device value d4 is closest to the acquisition time of the work image i2. Therefore, when the display timing of the device value d4 arrives, the log display unit 61 starts displaying the device value d4 and the work image i2. The log display unit 61 obtains the acquisition time of the device value dx closest to the acquisition time of the other image j1. In this example, the acquisition time of the device value d2 is closest to the acquisition time of the other image j1. Therefore, when the display timing of the device value d2 arrives, the log display unit 61 starts displaying the device value d2 and also starts displaying another image j1.

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

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

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

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

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

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

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

<デバッグ>
図31はユーザにより実行されるユーザプログラムのデバッグ処理の概要を示すフローチャートである。
<Debugging>
FIG. 31 is a flowchart showing an outline of the debugging process of the user program 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, creates a user program composed of a plurality of program components, and creates project data 71 including the user program. The program creation unit 63 creates a user program according to the user input and stores it in the storage device 22. The project creation unit 50 creates the project data 71 according to the 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 execute an operation on the project data 71 or the user program to obtain a hash value, an error detection code, or the like, and add these as identification information to the project data 71. The identification information may be a GUID (global unique identifier) or the like.

S42でユーザはPC2を操作し、プロジェクトデータ71をPLC1に転送する。プロジェクト作成部50はプロジェクトデータ71を記憶装置22から読み出し、通信部23を介してPLC1へ送信する。PLC1の基本ユニット3はプロジェクトデータ71を受信すると、記憶装置32に書き込む。 In S42, the user operates the PC2 and transfers the project data 71 to the PLC1. The project creation unit 50 reads the project data 71 from the storage device 22 and transmits it to the PLC 1 via the communication unit 23. When the basic unit 3 of the PLC1 receives the project data 71, it writes it to 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 unit 6 of the basic unit 3 (for example, by operating the mode changeover switch for switching from the PROGRAM mode to the RUN mode), and instructs the execution of the project. The execution unit 80 executes the user program included in the project data 71. The recording unit 81 logs the device value and the like, and stores (records) the logged device value in the ring buffer 91a. When a predetermined output condition is satisfied, the storage unit 93 of the output units 84 stores the device value recorded in the ring buffer 91a and the above-mentioned image data in the memory card 36 or the internal memory 37. , Create log data 73.

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

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

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

また、本実施形態では、プロジェクトデータ71をメモリに保存しているが、本発明はこれに限られず、例えば、プロジェクトデータ71に代えて、プロジェクトデータ71の識別情報のみをメモリに保存するようにしてもよい。この場合、PC2における現在のプロジェクトデータは、実際のトラブル発生時のプロジェクトデータ71と一致することを前提としている。すなわち、プロジェクトデータをPLC1に転送した後、現在のプロジェクトデータは編集・改変されていないことを前提としている。仮に、両データが不一致と判定された場合には、ユーザは、現在のプロジェクトデータが、実際のトラブル発生時のプロジェクトデータ71とは異なることを認識した上でリプレイを行えばよいので、ユーザがこれを認識しない状態でリプレイ(不正確なトラブルシューティング)が行われるのを防ぐことができる。 Further, in the present 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 is stored in the memory. You may. In this case, it is assumed that the current project data on the PC2 matches the project data 71 at the time of the actual trouble occurrence. That is, it is assumed that the current project data has not been edited or modified after the project data has been transferred to PLC1. If it is determined that both data do not match, the user may replay after recognizing that the current project data is different from the project data 71 at the time of the actual trouble. It is possible to prevent replay (inaccurate troubleshooting) from being performed without recognizing 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 unit 6 of the basic unit 3 and instructs to transfer the project data 71 and the log data 73 to the PC 2. Alternatively, the operation unit 8 of the PC 2 may be operated to read the project data 71, the identification information of the project data 71, and the log data 73 written in the memory card 36. The output unit 84 transmits the project data 71 and the log data 73 to the PC2. 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 the hash value or an error detection code or the like is executed. And these may be added to the log data 73 as identification information. Any rule may be adopted as long as the rules for creating the identification information executed by the PC 2 and the rules for creating the identification information 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 PC2, investigates the cause of the trouble while playing back (replaying) the log data 73, and debugs the user program constituting the project data 71. The 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 including the log data 73. This includes displaying the time-series image data in the display unit 7. The log display unit 61 has an internal clock that measures a virtual time, acquires a device value from the log data 73 in synchronization with the internal clock, and displays it on the display unit 7. The project data 71 may not be transmitted from the PLC1. In this case, the log display unit 61 may display the device value in association with the user program by using the user program of the project data 71 (master data) stored in the storage device 22. Details of investigating the cause of the trouble caused by reproducing the log data 73 will be described later.

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

S46でユーザはPC2を操作し、プロジェクトデータ71をPLC1に転送する。なお、プロジェクトデータ71内のユーザプログラムが変更されると、識別情報が更新される。これにより、修正前のプロジェクトデータ71と修正後のプロジェクトデータ71とが区別可能となる。 In S46, the user operates the PC2 and transfers the project data 71 to the PLC1. When the user program in the project data 71 is changed, the identification information is updated. As a result, the project data 71 before the modification and the project data 71 after the modification can be distinguished.

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

なお、プロジェクトデータ71の転送はメモリカード36を介して実行されてもよい。つまり、PC2はメモリカード36に書き込む。ユーザはメモリカード36をPC2から取り外し、基本ユニット3にメモリカード36を取り付ける。基本ユニット3はメモリカード36からプロジェクトデータ71を読み出して記憶装置32に書き込む。同様に、ログデータ73の転送もメモリカード36を介して実行されてもよい。 The transfer of the project data 71 may be executed 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 the log data 73 may also be executed 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 an output unit 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 PC2. However, in order to prevent information leakage of the project data 71, an access authority (protection) for prohibiting writing to the memory card 36 and transmission to the PC 2 may be set in the project data 71. Therefore, the determination unit 301 refers to the access authority given to the project data 71 and determines whether or not the output of the project data 71 is prohibited. When the output of the project data 71 is prohibited, the output unit 84 outputs the log data 73, but does not output the project data 71. On the other hand, 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. When the output of the project data 71 is prohibited, the addition unit 302 may output the identification information of the project data 71 held in the storage device 32 together with the log data 73. This identification information may be a part of the project data 71, or the identification information may be obtained by the calculation unit 303 executing a predetermined calculation on the project data 71 or the user program. The predetermined operation may be, for example, a hash operation or an error detection code operation. The real-time transmission 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 PC2 or HMI (human interface).

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

<ログ表示部61>
図34はログ表示部61の詳細を示している。プログラム表示モジュール321はプロジェクトデータ71に含まれるユーザプログラムとともに、ログデータ73に含まれるデバイス値を表示部7に表示するモジュールである。また、プログラム表示モジュール321は、ユーザプログラムのみならず、プロジェクトデータ71に含まれるプログラム構成情報、複数のプログラム部品、ユニット構成、ユニット毎の機能設定など、ユーザがプロジェクトデータ71の設定内容を視認するための各種情報を表示可能となっている。画像表示モジュール323は、ログデータ73に含まれる時系列の画像データを表示部7に表示する。波形表示モジュール322は、ログデータ73に含まれる時系列のデバイス値を波形化して表示部7に表示するモジュールである。再生制御モジュール324は、プログラム表示モジュール321によって表示される情報と波形表示モジュール322によって表示される情報とを時間的に同期させる。これらのモジュールはエンジニアリングソフトウエアと呼ばれてもよい。なお、画像表示モジュール323は、プログラム表示モジュール321の一機能(画像表示部)として具現化されてもよいし、波形表示モジュール322の一機能(画像表示部)として具現化されてもよい。
<Log display unit 61>
FIG. 34 shows the details of the log display unit 61. The program display module 321 is a module that displays the device value included in the log data 73 on the display unit 7 together with the user program included in the project data 71. Further, in the program display module 321, not only the user program but also the user visually recognizes the setting contents of the project data 71 such as the program configuration information included in the project data 71, a plurality of program parts, the unit configuration, and the function setting for each unit. It is possible to display various information for the purpose. The image display module 323 displays the time-series image data included in the log data 73 on the display unit 7. The waveform display module 322 is a module that waveforms the time-series device values included in the log data 73 and displays them on the display unit 7. The reproduction control module 324 synchronizes the information displayed by the program display module 321 with the information displayed by the waveform display module 322 in time. These modules may be referred to as engineering software. The image display module 323 may be embodied as one function (image display unit) of the program display module 321 or as a function (image display unit) 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 the details of the program display module 321. The time UI 330a provides a UI (eg, a slide bar, a cursor, etc.) for operating the acquisition time (display time) of the device displayed together with the user program. The display time control unit 331a sends the display time specified by the time UI 330a to the reproduction control module 324, and sets the display time notified from the reproduction control module 324 to the time UI 330a. The program display unit 332 displays the project data 71 on the display unit 7, or reads the project data 71 corresponding to the identification information from the storage device 22 and displays it on the display unit 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 reproduction mode and a log reproduction mode. The device value acquisition unit 333a accesses the real-time transmission unit 304 of the PLC1 in the real-time reproduction mode, acquires the device value, and passes it to the program display unit 332. The device value acquisition unit 333a accesses the reproduction control module 324 in the log reproduction mode, acquires the display time and the device value, and passes the display time and the device value to the program display unit 332.

図35Bは、プログラム表示部332等によって表示部7に表示されるGUIの一例を示す模式図である。 FIG. 35B is a schematic diagram showing an example of the GUI displayed on the display unit 7 by the program display unit 332 and 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. For the motion unit, the axis configuration and axis control setting parameters are displayed as function settings. By double-clicking the axis configuration and axis control on the GUI shown in FIG. 35B, the user can confirm what kind of setting contents are set for these setting parameters. Further, in the project display area 420, when Main and Sub are displayed for each scan module, when the user clicks Main, the Main program is displayed in the program display area 410 of the central ladder monitor 450. As described above, 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 the so-called ladder monitor 450, and can be operated independently in the real-time reproduction 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 unit 332 can reproduce the ladder program included in the project when the operation record is saved. Further, in the log reproduction mode, the program display unit 332 displays the device value included in the log data 73 via the device value acquisition unit 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 described with reference to 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 of 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 on the right side of this date indicates the current number of scans 35,000 for the total number of scans 74286. By dragging and moving the time designation cursor 404, the user updates the display time and the number of scans, and also updates the display of the device value. For example, at the updated display time, an ON display (for example, painting with a color) is made on the part of the relay device that is ON, and an OFF display (for example, color removal, etc.) is made on the part of the relay device that is OFF. Is done. Details of the function of the play button 406 and the like will be described later with reference to 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 in the image display area of the camera monitor 430 in synchronization with the display time displayed on the ladder monitor 450 by the program display module 321. In FIG. 35B, the image data associated with the display time of 20XX / 10/01 at 18:52:54 is displayed on the camera monitor 430. Further, on the right side of this display time, 282/601 is displayed, which indicates the current order of image data (282nd image) with respect to the total number of images captured 601. The user can update the display time and the order of the current 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 in the ladder monitor 450 described above also moves in conjunction with the movement. For example, when the time designation cursor 404a is set to 19:00 on the display time 20XX / 10/01, the time designation cursor 404 on the ladder monitor 450 is also set at 19:00 on the display time 20XX / 10/01. It moves following the position of 00. Then, as the time designation cursor 404 moves, the device value on the ladder monitor 450 is also updated. Here, the time designation cursor 404a is moved, but the reverse is also true. For example, when the time designation cursor 404 on the ladder monitor 450 is moved, the time designation cursor 404a on the camera monitor 430 is also moved accordingly. Such a processing operation is possible because the program display module 321 and the image display module 323 execute synchronous control regarding the display time via the reproduction control module 324.

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

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

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

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

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

●波形表示モジュール
図36Aは波形表示モジュール322の詳細を示している。時刻UI330bは、ユーザプログラムとともに表示されるデバイスの取得時刻(表示時刻)を操作するためのUI(例:スライドバーなど)を提供する。図28に示されているように、時刻UI330bは、基本的に、再生制御モジュール324から提供される表示時刻にしたがってバー103を左から右へ移動させる。ただし、時刻UI330bは、操作部8を通じたバー103の操作を受け付け、表示時刻制御部331bを通じて再生制御モジュール324にバー103の操作量を渡す。表示時刻制御部331bは時刻UI330bにより指定された表示時刻を再生制御モジュール324に送出したり、再生制御モジュール324から通知された表示時刻を時刻UI330bに設定したりする。デバイス値取得部333bは、リアルタイム再生モードとログ再生モードとを有している。デバイス値取得部333bは、リアルタイム再生モードにおいて、PLC1のリアルタイム送信部304にアクセスし、デバイス値を取得し、波形表示部336に渡す。デバイス値取得部333bは、ログ再生モードにおいて、再生制御モジュール324にアクセスし、表示時刻とデバイス値を取得し、波形表示部336に渡す。図28に示したように、波形表示部336は、デバイス値取得部333bにより取得されたデバイス値を波形化して表示部7に表示する。デバイス値を波形化は必須ではなく、デバイス値は数値のまま表示されてもよい。図28に示したように、画像表示モジュール323は再生制御モジュール324から出力される画像データを表示部7に表示する。なお、上述したように、画像表示モジュール323は、波形表示モジュール322の一機能として実現されてもよいが、図34に示すように、画像表示モジュール323(カメラモニタ)として別機能であってもよい。
● Waveform display module FIG. 36A shows the details of the waveform display module 322. The time UI 330b provides a UI (eg, a slide bar, etc.) for operating the acquisition time (display time) of the device displayed together with the user program. As shown in FIG. 28, the time UI 330b basically moves the bar 103 from left to right according to the display time provided by the playback control module 324. 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 reproduction control module 324 through the display time control unit 331b. The display time control unit 331b sends the display time specified by the time UI 330b to the reproduction control module 324, and sets the display time notified from the reproduction control module 324 to the time UI 330b. The device value acquisition unit 333b has a real-time reproduction mode and a log reproduction mode. The device value acquisition unit 333b accesses the real-time transmission unit 304 of the PLC1 in the real-time reproduction mode, acquires the device value, and passes it to the waveform display unit 336. The device value acquisition unit 333b accesses the reproduction control module 324 in the log reproduction mode, acquires the display time and the device value, and passes the display time and the device value to the waveform display unit 336. As shown in FIG. 28, the waveform display unit 336 waveforms the device value acquired by the device value acquisition unit 333b and displays it on the display unit 7. Waveformation of the device value is not essential, 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 unit 7. 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, the image display module 323 may have another 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 and the like. In particular, the GUI displayed by the waveform display module 322 is the so-called real-time chart monitor 460 displayed in the pop-up window at the lower 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 made by the program display module 321 and the image display module 323. In FIG. 36B, the unit monitor 440 by the unit display module 325 omits the display, but this may be displayed.

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

リアルタイムチャートモニタ460の下方には、時刻指定カーソル404b(図28に示すバー103に相当。再生位置カーソルと呼んでもよい)が表示されており、ユーザは、この時刻指定カーソル404bの位置をクリックして移動させることができるようになっている。このとき、時刻指定カーソル404bの位置が移動すると、再生制御モジュール324の機能によって、ラダーモニタ450における時刻指定カーソル404、カメラモニタ430における時刻指定カーソル404aが、連動して移動するようになっている。具体的には、図36Bにおいて、リアルタイムチャートモニタ460の波形表示領域における横軸はスキャン回数(時刻に切り替え表示してもよい)を示しているが、ユーザが時刻指定カーソル404bをクリックして所定のスキャン回数の位置へスライド移動させると、ラダーモニタ450における時刻指定カーソル404及びカメラモニタ430における時刻指定カーソル404aは、それぞれ、そのスキャン回数に対応する表示時刻の位置へ移動する。そして、移動後の表示位置に対応するデバイス値や画像データが表示される。もちろん、逆も同様である。すなわち、ラダーモニタ450における時刻指定カーソル404又はカメラモニタ430における時刻指定カーソル404aをクリックして所望位置へスライドさせると、時刻指定カーソル404bも、その所望位置に対応するスキャン回数の位置へと移動する。このとき、時刻指定カーソル404又は時刻指定カーソル404aを一定量以上動かすと、時刻指定カーソル404bが示す位置が、現在のリアルタイムチャートモニタ460の表示範囲外となるが、本実施形態では、この位置が常に表示範囲内になるよう、表示範囲が追従していく。 A time designation cursor 404b (corresponding to bar 103 shown in FIG. 28, which may be called a playback position cursor) is displayed below the real-time chart monitor 460, and the user clicks the position of the time designation cursor 404b. It can be moved. 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 by 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 (may be switched to the time and displayed), but the user clicks the time designation cursor 404b to determine the number of scans. When the slide is moved to the position of 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, respectively. Then, the device value and the 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 is out of the display range of the current real-time chart monitor 460. The display range follows so that it is always within the display range.

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

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

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

(1)ユーザは、まず、リアルタイムチャートモニタ460の表示エリアバー404cにおいて、四角インジケータをドラッグして左右に移動させることで、波形表示領域に表示されたデバイス波形を視認しながら、トラブルの原因究明に役立ちそうな時刻を探す。このとき、上述したように、時刻指定カーソル404bは、リアルタイムチャートモニタ460の表示範囲から非表示になってもよい。 (1) The user first investigates the cause of the trouble while visually recognizing the device waveform displayed in the waveform display area by dragging the square indicator to the left or right on the display area bar 404c of the real-time chart monitor 460. Find a time that might be useful for you. 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) When a time with an abnormal device value is found in the device waveform, double-click the time in the waveform display area. Then, the time designation cursor 404b jumps to that time, and the time designation cursor 404 on the ladder monitor 450 and the time designation cursor 404a on the camera monitor 430 both jump to that time.

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

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

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

<プログラムの表示UI>
図38はプログラム表示モジュール321によって提供される表示UI400を示している。図35Bや図36Aで説明した表示UI400を別の観点から、更に詳述する。プログラム表示領域410は、プロジェクトデータ71のユーザプログラムを表示する領域である。この例ではプログラム表示領域410はラダープログラム(ラダー図)を表示している。プログラム表示部332は、ユーザプログラムに使用または記述されているデバイスのデバイス値をデバイス値取得部333aにより取得し、ユーザプログラムとともに表示する。たとえば、プログラム表示部332は、リレーデバイスがONであればONを示すアイコン401aをユーザプログラム上に重ねて表示してもよい。プログラム表示部332は、リレーデバイスがOFFであればOFFを示すアイコン401bをユーザプログラム上に重ねて表示してもよい。プログラム表示部332は、出力系のデバイスであるDM100のデバイス値をデバイス値取得部333aにより取得し、ユーザプログラムにおけるDM100の記述と重ねて表示してもよい。この例では、DM100の記述の下にデバイス値の表示領域403が設けられている。プログラム表示部332は表示領域403にデバイス値を表示する。なお、再生制御モジュール324は表示時刻の更新とともにデバイス値も更新するため、プログラム表示部332は、ユーザプログラムとともに表示されているデバイス値を更新する。時刻UI330aは時刻デバイス342から取得した表示時刻に応じて時刻指定カーソル404を右から左へ移動させる。時刻指定カーソル404はポインタ101によりドラッグ可能である。時刻指定カーソル404がポインタ101によりドラッグされたことを時刻UI330aが検知すると、表示時刻制御部331aは再生制御部343に表示時刻の更新を停止させ、時刻指定カーソル404のドラッグ量を再生制御部343に通知する。再生制御部343は、ドラッグ量に応じて内部時計のカウント値(表示時刻)を調整する。時刻UI330aは、表示時刻の更新速度(例:・・・、2.0倍、1.0倍、0.5倍、0.1倍、・・・)を速度指定部405に表示してもよい。なお、速度指定部405は、複数の更新速度のリストを表示し、そのうちの一つの更新速度を選択可能なプルダウメニューによって実現されてもよい。時刻UI330aは、速度指定部405に対するポインタ101によるクリックを検知すると、このようなプルダウメニューを表示し、更新速度の選択を受け付けてもよい。再生ボタン406はデバイス値の時系列的な表示を指示するためのボタンである。時刻UI330aは再生ボタン406がポインタ101によりクリックされたことを検知すると、表示時刻制御部331aに表示時刻の更新を開始するよう再生制御部343に指示する。この指示はデバイス値の表示の開始の指示または表示の再開の指示に相当する。ワンステップ逆再生ボタン407は、表示時刻をワンステップずつ更新(巻き戻し)しながらデバイス値を時系列的に表示することを指示するためのボタンである。時刻UI330aはワンステップ逆再生ボタン407がポインタ101によりクリックされたことを検知すると、表示時刻制御部331aに表示時刻を一ステップ戻すように指示する。ワンステップ再生ボタン408は、表示時刻をワンステップずつ更新しながらデバイス値を時系列的に表示することを指示するためのボタンである。時刻UI330aはワンステップ再生ボタン408がポインタ101によりクリックされたことを検知すると、表示時刻制御部331aに表示時刻を一ステップ進めるように指示する。なお、ワンステップ再生が実行されているときは、ワンステップ逆再生ボタン407またはワンステップ再生ボタン408が操作されない限り、再生制御部343は表示時刻を更新しない。ワンステップ再生が実行されているときに、再生ボタン406が操作されると、再生制御部343は速度指定部405により指定された更新速度で表示時刻の更新を再開する。時刻表示領域409は時刻デバイス342に保持されている表示時刻を表示する領域である。表示時刻制御部331aは、時刻デバイス342から取得された表示時刻を時刻表示領域409に表示する。
<Program display UI>
FIG. 38 shows the display UI 400 provided by the program display module 321. The display UI 400 described with reference to FIGS. 35B and 36A will be described in more detail from another viewpoint. The program display area 410 is an area for displaying the user program of the project data 71. In this example, the program display area 410 displays a ladder program (ladder diagram). The program display unit 332 acquires the device value of the device used or described in the user program by the device value acquisition unit 333a and displays it together with the user program. For example, the program display unit 332 may display the icon 401a indicating ON on the user program if the relay device is ON. If the relay device is OFF, the program display unit 332 may display the icon 401b indicating OFF on the user program. The program display unit 332 may acquire the device value of the DM100, which is an output device, by the device value acquisition unit 333a and display it in an overlapping manner with the description of the DM100 in the user program. In this example, a device value display area 403 is provided under the description of DM100. The program display unit 332 displays the device value in the display area 403. Since the playback control module 324 updates the device value as well as the display time, the program display unit 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 stops the playback control unit 343 from updating the display time, and the drag amount of the time designation cursor 404 is adjusted to the playback control unit 343. Notify to. The reproduction control unit 343 adjusts the count value (display time) of the internal clock according to the drag amount. Even if the time UI330a displays the update speed of the display time (example: ..., 2.0 times, 1.0 times, 0.5 times, 0.1 times, ...) On the speed designation unit 405. good. The speed designation unit 405 may be realized by a pull-down menu that displays a list of a plurality of update speeds and can select one of the update speeds. When the time UI 330a detects a click by the pointer 101 on the speed designation unit 405, such a pull-down menu may be displayed and the selection of the update speed may be accepted. The play button 406 is a button for instructing the time-series display of the device value. When the time UI 330a detects that the play button 406 is clicked by the pointer 101, the time UI 330a instructs the display time control unit 331a to start updating the display time. This instruction corresponds to an instruction to start displaying the device value or an instruction to restart the display. The one-step reverse playback button 407 is a button for instructing the display of device values in chronological order while updating (rewinding) the display time step by step. When the time UI 330a detects that the one-step reverse playback button 407 is clicked by the pointer 101, the time UI 330a 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 the device values to be displayed in chronological order while updating the display time step by step. When the time UI 330a detects that the one-step playback button 408 is clicked by the pointer 101, the time UI 330a instructs the display time control unit 331a to advance the display time by one step. 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. If the playback button 406 is operated while one-step playback is being executed, the playback control unit 343 restarts the update of 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 PLC1 can be connected to an external display device called an HMI. The HMI may have a touch panel type input device. The HMI reads out the device value held in the device unit 34 of the PLC1 and displays it on the display device. The project creation unit 50 sets the UI displayed on the HMI and the device value displayed on the UI, and saves it in the project data 71. The debug unit 314 has an HMI emulator, and confirms 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 the 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 UI490 of the HMI emulator. In this example, the HMI emulator is included in the program display module 321. The program display unit 332 reflects the device value provided by the playback control unit 343 in the display area of the UI 490. The UI 490 may have a time control object related to the playback control included in the UI 400, such as a time designation cursor 404 and a play button 406. The operation of the time control object in the UI 490 is reflected in 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 in the UI 490, the time designation cursor 404 of the UI 400 also moves to the left in conjunction with the display time provided by the playback control unit 343, and the bar shown in FIG. 28 103 also moves to the left. Further, if the bar 103 shown in FIG. 28 is operated to the left, the time designation cursors 404 of the UI 400 and 450 also move to the left in conjunction with the display time provided by the reproduction control unit 343. This is because they are all synchronized with the same display time held in the time device 342.

<ログ表示に関するフローチャート>
●プログラム表示モジュール
図40はプログラム表示モジュール321によって実行される表示処理を示している。なお、S50、S51およびS60はPLC1からプロジェクトデータ71を取得できない場合にのみ実行されてもよい。PLC1からプロジェクトデータ71を取得できる場合、PLC1からプロジェクトデータ71が使用される。PLC1からプロジェクトデータ71を取得できない場合、PC2に保持されているプロジェクトデータ71が使用される。
<Flowchart related to log display>
● Program display module FIG. 40 shows the display process 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 PLC1. If the project data 71 can be obtained from the PLC1, the project data 71 is used from the PLC1. 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 (collation unit 334) acquires the identification information of the project data 71 held in the PLC1 and the identification information of the project data 71 held in the PC2.

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

S52でCPU21(プログラム表示部332)はPLC1または記憶装置22からプロジェクトデータ71を取得する。 In S52, the CPU 21 (program display unit 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 reproduction mode is selected or the real-time reproduction 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 PLC1 without going through the reproduction control module 324. In S59, the CPU 21 (program display unit 332) displays the device value on the display unit 7 together with the user program included in the project data 71. If the log reproduction 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) activates the reproduction control module 324 and acquires the display time and the device value of the log data 73 from the reproduction control module 324.

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

S56でCPU21(表示時刻制御部331a)は時刻UI330aにより時刻指定が検知されたかどうかを判定する。上述したように時刻指定は時刻指定カーソル404の操作によって実行される。時刻指定が検知されていなければ、CPU21はS54に戻る。時刻指定が検知されていれば、CPU21はS57に進む。 In S56, the CPU 21 (display time control unit 331a) determines whether or not the time designation is detected by the time UI 330a. As described above, the time designation is executed by the operation of the time designation 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 reproduction control unit 343 of the reproduction control module 324 of the designated time input by the time designation cursor 404. The CPU 21 returns to S54.

●波形表示モジュール
図41は波形表示モジュール322によって実行される表示処理を示している。
● Waveform display module FIG. 41 shows a display process 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 reproduction mode is selected or the real-time reproduction 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 PLC1 without going through the reproduction control module 324. In S67, the CPU 21 (waveform display unit 336) displays the device value on the display unit 7. If the log reproduction mode is selected, the CPU 21 proceeds to S62.

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

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

S64でCPU21(表示時刻制御部331b)は時刻UI330bにより時刻指定が検知されたかどうかを判定する。上述したように時刻指定はバー103によって実行される。時刻指定が検知されていなければ、CPU21はS62に戻る。時刻指定が検知されていれば、CPU21はS65に進む。 In S64, the CPU 21 (display time control unit 331b) determines whether or not the time designation is detected by the time UI 330b. As described above, the time designation is executed by 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 reproduction control unit 343 of the reproduction control module 324 of the designated time input by 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 the log data 73 in the storage device 22.

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

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

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

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

S76でCPU21(再生制御部343)は表示時刻制御部331からの時刻指定にしたがって内部時計の時刻を変更する。 In S76, the CPU 21 (reproduction control 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 (reproduction control unit 343) determines whether or not the update speed change instruction has been received from the display time control unit 331. If the change instruction is received, the CPU 21 proceeds to S78. If the change instruction has not been received, the CPU 21 proceeds to S73.

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

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

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

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

測定モジュールB2において接点系命令にはMR001がONになると、出力系命令を実行することが記述されている。この例では、拡張ユニット4により取得された高さの計測値がデバイスEM0に格納されており、これをデバイスTM100にコピーすることが記述されている。同様に、拡張ユニット4により取得された奥行の計測値がデバイスEM2に格納されており、これをデバイスTM101にコピーすることが記述されている。さらに、測定完了を管理するためのデバイスMR003がONに設定される。 In the measurement module B2, the contact system instruction describes that the output system instruction is executed when MR001 is turned ON. In this example, the height measurement value acquired by the expansion unit 4 is stored in the device EM0, and it is described that the measured value is copied to the device TM100. Similarly, it is described that the measured value of the depth acquired by the expansion unit 4 is stored in the device EM2, and this is copied to the device TM101. Further, the device MR003 for managing the 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, the device MR010 is turned on. This means measurement NG. More specifically, if the measured height stored in the device TM100 is less than 95, MR010 is turned ON. If the measured height stored in the device TM100 exceeds 105, MR010 is turned on. If the measured depth stored in the device TM101 is less than 35, MR010 is turned on. If the measured depth value stored in the 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 transfer of the transfer belt when an error occurs. In this example, when MR010 is turned ON (measurement NG), MR012 is turned ON (forced stop), or MR013 is turned ON (transport NG), MR011 is turned ON (convey 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, the device described in the contact system instruction of a certain module is described in the output system instruction of another module. On the contrary, the device described in the output system instruction of a certain module is described in the contact system instruction of another module. For example, the device MR001 described in the output system instruction of the work detection module B1 is described in the contact system instruction of the measurement module B2. Therefore, the work detection module B1 and the measurement module B2 are extracted as interconnected modules. Next, paying attention to the device MR003 described in the output system instruction of the measurement module B2, it can be seen that MR003 is described in the contact system instruction of the determination module B3. Therefore, the measurement module B2 and the determination module B3 are extracted as mutually related modules. Next, paying attention to 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 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 unit 53 may be mounted on the log display unit 61. That is, the log display unit 61 extracts a plurality of modules related to each other, further extracts a plurality of devices described in the extracted plurality of modules, and sets each device value of the extracted plurality of 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 the UI 500 that displays the extraction result. The log display unit 61 and the device extraction unit 53 may create a UI 500 for displaying the device and the block (program component) extracted from the user program, and display the UI 500 on the display unit 7. The UI500 can easily display the extraction result of the device and the program component. Therefore, the user will be able to easily grasp the whole picture of the extraction result. When any block included in the UI 500 is clicked by the pointer 101, the log display unit 61 or the device extraction unit 53 may display the details of the clicked block on the UI 501. This will give the user quick access to the details of the extracted blocks. The log display unit 61 and the device extraction unit 53 may display the extraction result using the UI illustrated in FIG. 43.

<ブロックおよびデバイスの抽出処理>
図45はデバイス抽出部53が実行するブロックおよびデバイスの抽出処理を示している。ここではプロジェクトデータ71には、複数のブロック(プログラム部品)が含まれている。よって、デバイス抽出部53はプロジェクトデータ71を参照し、ブロックやデバイスを抽出する。
<Block and device extraction process>
FIG. 45 shows a block and device extraction process 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 unit 53) accepts block selection through the operation unit 8. The device extraction unit 53 may accept the designation of the device through the operation unit 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 user selection for one block from the plurality of blocks. Such a device may be, for example, a device that the user pays attention to in debugging. The user sets a condition (example: save trigger) for outputting the log data 73 to the output unit 84 of the PLC1 through the log setting unit 51. More specifically, it is set on the condition that a specific relay device is turned on. Therefore, the device extraction unit 53 may specify the relay device set as the save trigger.

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

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

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

S85でCPU21(デバイス抽出部53)は発見されたブロックを関連ブロックとして抽出する。たとえば、デバイス抽出部53は、関連ブロックを管理するためのリストに、発見されたブロックの識別情報(例:名称やファイル名など)を登録する。 In S85, the CPU 21 (device extraction unit 53) extracts the found block as a related block. For example, the device extraction unit 53 registers the identification information (eg, name, file name, etc.) of the found block in the list for managing the 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 the block from which the device is extracted. After that, the CPU 21 returns to S82 in order to execute the extraction process for the newly selected block. The related block selected in S86 is a block that has not yet been selected as a device extraction target. If the device extraction process is completed for all the 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 device and the extracted block of the device. The device extraction unit 53 or the log display unit 61 may refer to these lists and create the UI shown in FIG. 43 and 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 the NG determination as the storage condition of the log data 73 through the log setting unit 51. According to FIG. 43, it is determined as the storage condition of the log data 73 that the device MR010 that manages the NG determination is turned on. The user transfers the project data 71 and the log setting data 72 to the PLC1.

S92でユーザはPLC1を稼働させる。PLC1はプロジェクトデータ71を実行し、ログ設定データ72における保存条件が満たされるとログデータ73をメモリカード36に保存する。図43に示された例ではNG判定が発生すると、搬送ベルトが停止するため、ユーザは何らかのエラーが発生したことを知る。 In S92, the user runs PLC1. The PLC1 executes the project data 71, and saves 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 the NG determination occurs, the conveyor belt stops, so that the user knows that some error has occurred.

S93でユーザはワークを確認し、NG判定が誤検知かどうかを判断する。たとえば、ユーザはワークの高さや奥行を実測し、合格条件を満たしているかどうかを判断する。ワークが合格条件を満たしていなければ、ユーザはNG判定を誤検知と判断する。 In S93, the user confirms the work and determines whether the NG determination is a false positive. For example, the user actually measures the height and depth of the work to determine whether or not the passing conditions are satisfied. If the work does not satisfy the pass condition, 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 value 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 the block and device extraction process, and the UI shown in FIG. 43 and FIG. 44. UI500 and 501 shown in the above are displayed. Further, the waveform display module 322 displays the device value displayed by the program display module 321 as a waveform. For example, the measured value of the height of the work held in EM0 and the depth of the work held in EM2 are waveformized and displayed on the display unit 7. In addition, the device value of the device MR000 that manages the work detection is also displayed as a waveform. The user observes these waveforms and finds out that the chattering of the work detection sensor is the cause of the false detection. The user operates the editorial unit 311 to prevent chattering, and modifies the work detection module B1 as shown in FIG. 47. According to this modification, when the work is continuously detected by the work detection sensor for 1 second or longer, the device MR001 for starting the measurement is turned on. The user transfers the updated project data 71 to the PLC1, operates the PLC1, and determines whether or not the chattering countermeasure is successful.

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

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

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

なお、抽出部53はプログラム作成部63により作成されたプログラム部品を解析して、当該プログラム部品に記述されているデバイスを抽出してもよい。部品指定部52は、プログラム作成部63により作成された複数のプログラム部品のうち、記録部81の記録対象となる特定のデバイスが使用または記述されたプログラム部品を、プログラム部品を単位として(プログラム部品ごとに)指定してもよい。この場合、記録部81は、抽出部53により抽出されたデバイスであって、かつ、部品指定部52により指定されたプログラム部品に使用または記述される特定のデバイスに記憶されているデバイス値を時系列に記録する。 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 designation unit 52 uses a program component as a unit (program component) in which a program component used or described by a specific device to be recorded by the recording unit 81 among a plurality of program components created by the program creation unit 63. It may be specified (for each). In this case, the recording unit 81 is a device extracted by the extraction unit 53, and the device value stored in a specific device used or described in the program component specified by the component designation unit 52 is timed. Record in series.

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

部品指定部52は、プログラム作成部63により作成された複数のプログラム部品のうち少なくとも一つのプログラム部品を指定するように構成されていてもよい。抽出部53は、部品指定部52により指定されたプログラム部品を解析して、当該プログラム部品ごとに使用または記述されるデバイスを抽出してもよい。記録部81は、抽出部53により抽出された特定のデバイスに記憶されているデバイス値を時系列に記録する。このように、プログラム部品が指定された後でデバイスの抽出が実行されてもよい。これにより抽出処理が軽くなろう。 The component designation unit 52 may be configured to designate at least one program component among a plurality of program components created by the program creation unit 63. The extraction unit 53 may analyze the program component designated by the component designation unit 52 and extract the device used or described for each program component. 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 lighter.

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

プログラム部品は、たとえば、再利用可能なプログラムモジュールであってもよい。複数のプログラム部品は、それぞれ個別のファイルに格納されていてもよい。複数のプログラム部品は、それぞれ個別にアクセス権限(編集権限)が設定されてもよい。 The program component may be, for example, a reusable program module. The plurality of program parts may be stored in individual files. Access privileges (editing privileges) 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 plurality of program components may be a plurality of function blocks used or described in 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 for any device among a plurality of devices. The recording unit 81 may add a device whose device value rewriting is detected by the detection unit 82 to the recording target.

PLC1は、着脱可能なメモリカード36と、メモリカード36に対する命令を検知し、当該命令の対象となっているデバイスを特定する特定部57とをさらに有してもよい。図6においては特定部57がPC2に設けられているが、基本ユニット3のCPU31に実装されてもよい。記録部81は、特定部57により特定されたデバイスを記録対象に追加してもよい。 The PLC 1 may further include a detachable memory card 36 and a specific unit 57 that detects an instruction to the memory card 36 and identifies a device that is the target of the instruction. Although the specific unit 57 is provided on the PC 2 in FIG. 6, it may be mounted on the CPU 31 of the basic unit 3. The recording unit 81 may add the device specified by the specific 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 extraction unit 53 may add a device used for the positioning function and not described in the user program (eg, a buffer memory in the motion unit) to the recording target.

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

図7においては、選択されたプログラム部品からのデバイスの抽出と、選択された機能からのデバイスの抽出と、ユーザによるデバイスの手動追加とが記載されている。しかし、これらのすべてが必須というわけではない。これらのうち二つ以上が採用されれば十分であろう。あるいは、選択されたプログラム部品からのデバイスの抽出だけが採用されてもよいし、選択された機能からのデバイスの抽出だけが採用されてもよい。 In FIG. 7, device extraction from the selected program component, device extraction from the selected function, and manual addition of the device by the user are described. However, not all of these are essential. It would be sufficient if two or more of these were adopted. Alternatively, only device extraction from the selected program component may be employed, or only device extraction 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, each of which executes a different function (eg, a function program) related to the user program based on a command from the user program. This suggests that the basic unit 3 may include the functions 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, may be executed by a plurality of CPUs, and may be realized by an ASIC or an FPGA. Further, a single CPU may be equipped with multi-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 having a plurality of devices which are storage areas referred to 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 time series. The function setting unit 62 may function as an allocation unit for allocating a plurality of devices used in each of the plurality of function execution engines. The function designation unit 60 may function as a designation unit for designating one or more of a plurality of functions corresponding to a plurality of function execution engines. The device extraction unit 53 may extract a device used for one or more functions designated by the designated unit from a plurality of devices allocated by the allocation 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 the function expansion unit electrically connected to the main unit in order to expand the function 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 having a program execution unit, a device storage unit, and a device recording unit. 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 function of the main unit.

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

機能指定部60は、メインユニットに設けられた機能と機能拡張ユニットに設けられた機能とを含む複数の機能のうち一つ以上の機能を指定する指定部の一例である。デバイス抽出部53の追加部54は、指定部により指定された機能のために使用されるデバイスをデバイス記録部の記録対象として抽出する。デバイス抽出部53の削除部55は、指定部により指定された機能のために使用されるデバイスをデバイス記録部の記録対象から除外する。通信部23は、記録対象として抽出された特定のデバイスに記憶されているデバイス値を時系列にデバイス記録部に記録させるための設定データをPLC1に送信する送信部として機能する。記録部81は、デバイス抽出部53により記録対象として抽出されたデバイスに記憶されているデバイス値を時系列に記録するように構成されている。 The function designation unit 60 is an example of a designation unit that designates one or more of a plurality of functions including the function provided in the main unit and the function provided in the function expansion unit. The additional unit 54 of the device extraction unit 53 extracts the device used for the function specified by the designated unit as the 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 designation unit from the recording target of the device recording unit. The communication unit 23 functions as a transmission unit that transmits setting data for recording the device values stored in the specific device extracted as the recording target in the device recording unit in time series to the PLC1. The recording unit 81 is configured to record the device values stored in the device extracted as the recording target 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 a command word related to any 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 the devices used or described in the user program, and create a device list (extraction list) including the extracted devices. Further, the device extraction unit 53 may add the device used for the function designated as the recording target (extraction target) by the function designation unit 60 to the device list. Further, the deletion unit 55 may be configured to delete the device used for the function designated as the exclusion target by the function designation unit 60 from the device list. The device list is included in the log setting data 72. The recording unit 81 is configured to record the device values stored in the devices registered in the device list in chronological order.

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

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

図19を用いて説明されたように、収集部92aは複数のデバイスのいずれかに記憶されているデバイス値を収集し、当該デバイス値の収集時刻に関する情報と当該デバイス値とを関連付けて第一バッファに記憶する第一収集部の一例である。なお、収集対象のデバイス値は、ログ設定データ72によって予め設定されてもよい。リングバッファ91aは第一バッファの一例である。収集時刻に関する情報は、たとえば、時刻管理部83aから供給される時刻情報であってもよい。IF99a、99fは拡張ユニット4と通信する第一インタフェースの一例である。通信部33は外部設定機器からユーザプログラムと設定情報とを受け付ける第一の外部インタフェースの一例である。 As described with reference to FIG. 19, the collecting unit 92a collects the device values stored in any of the plurality of devices, and associates the information on the collection time of the device values with the device values. This is an example of the first collection unit stored in the buffer. The device value to be collected may be preset by the log setting data 72. The ring buffer 91a is an example of the first buffer. The information regarding the collection time may be, for example, time information supplied from the time management unit 83a. IF99a and 99f are examples of the first interface for communicating 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は第二の外部インタフェースを介して監視機器からのデータの入力を伴う機能を、受け付けた設定情報に基づいて実行する機能実行部として機能してもよい。 IF99b, 99d, 99h, 99j and the like are examples of a second interface that communicates with the main unit. The image receiving unit 96a and the connection port 97 are an example of a third interface (two-dimensional data receiving unit) 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 the monitoring device and data is input from the monitoring device. The camera 98 is an example of a surveillance device. 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 work. Height images and distance images are examples of two-dimensional data. The two-dimensional data may be moving image data. In addition, a large amount of data whose size is large compared to the device value is also an example of two-dimensional data. For example, the numerical data acquired by the 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 collects the two-dimensional data received via the third interface, associates the information on the acquisition time when the two-dimensional data was acquired with the two-dimensional data, and stores the two-dimensional data in the second buffer. This is an example. The time information provided by the time management unit 83 is an example of information related to the acquisition time. The ring buffer 91b is an example of a second buffer.

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

このようにデバイス値および二次元データにはそれぞれ取得時刻に関する情報が紐付けられている。そのため、二次元データなどの比較的に大容量のデータとデバイス値との時間的な関係を特定しやすくなる。 In this way, information about the acquisition time is associated with the device value and the two-dimensional data, respectively. Therefore, it becomes easy to identify 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 that acquires image data of a still image or a moving image. The function execution unit 96 executes a function involving input of image data from the camera 98. The collection unit 92b, which is the second collection unit, stores the information regarding the acquisition time when the image data is acquired and the image data in the second buffer in association with each other. 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 the monitoring device, asynchronously with the execution cycle of the user program. The storage unit 93 may also store the project data including the user program and the setting information. The storage unit 93 stores the information on the device value and the collection time, the data stored in the second buffer, and the information on the acquisition time in a plurality of files identified by the common flag, 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 can specify the collection time for each of the plurality of device values collected in the time series. The collection time may be associated with each of the plurality of device values. Alternatively, for example, the collection time may be associated only for the first device value. In the latter case, the collection time for device values other than the first device value may be calculated based on other information (scan count, scan time, etc.). Since the device values are recorded in the same number as the number of scans, the collection time of any device value can be specified by storing the processing time (scan time) in each scan. For example, when trying to specify the collection time of the device value recorded in the 100th scan, the collection time of the device value recorded in the first scan is 10:10:00, and the 2nd to 100th times. It is assumed that each scan took 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 record the collection time in association with all device values.

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

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

送信部94は、記憶装置32に保存されているデバイス値、収集時刻に関する情報、二次元データ、および取得時刻に関する情報を外部機器に送信する送信部の一例である。外部機器はクラウドであってもよいし、PC2であってもよい。PC2は、ログデータ73をリアルタイムで受信して表示部7にログデータ73を表示してもよい。 The transmission unit 94 is an example of a transmission unit that transmits the device value, the information regarding the collection time, the two-dimensional data, and the information regarding the acquisition time stored in the storage device 32 to the 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 generated in a cycle shorter than the execution cycle of the user program (eg, scan cycle).

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

時刻管理部83a、83bに関して説明されたように、収集時刻を計時するメインユニットの時計と取得時刻を計時する拡張ユニットの時計とは同期している。この同期は、たとえば、ユニット間同期によって実現されてもよい。 As described with respect to the time management units 83a and 83b, the clock of the main unit that clocks the collection time and the clock of the expansion unit that clocks 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, information on collection time, two-dimensional data, and information on acquisition time collected at a predetermined collection time before and after a preset storage trigger on the memory card 36. It may be configured to be stored in.

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

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

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

プロジェクトデータ71は、拡張ユニット4の設定情報を含んでもよい。これは、プロジェクトデータ71をデバッグする際に拡張ユニット4の設定情報が必要になることがあるからである。たとえば、複数の拡張ユニット4が基本ユニット3に接続されている場合、複数の拡張ユニット4の接続順番が拡張ユニット4の設定情報に含まれている。この接続順番に関する情報がデバッグの際に必要となることがある。 The project data 71 may include the 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 about this connection order may be needed when debugging.

判定部301はユーザプログラム(プロジェクトデータ71)の出力が禁止されているかどうかを判定する判定部として機能する。出力部84は、判定部301によりユーザプログラムの出力が禁止されていると判定された場合、デバイス記録部に記録されているデバイス値と、プログラム記憶部に記憶されているユーザプログラムの識別情報とを外部メモリに出力してもよい。これにより、ユーザプログラムをプロテクトしつつ、識別情報に基づきPC2のマスタデータが利用可能となる。 The determination unit 301 functions as a determination unit for determining whether or not the 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 uses 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 an external memory. As a result, the master data of the PC2 can be used based on the identification information while protecting the user program.

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

演算部313に関連して説明されたように、ユーザプログラムの識別情報は、ユーザプログラムから演算される誤り検出符号またはハッシュ値であってもよい。このように、プロジェクトデータ71が更新されると、識別情報も更新されるような識別情報の演算方法が採用されてもよい。識別情報はタイムスタンプなどであってもよい。 As described in connection with 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, when the project data 71 is updated, the identification information calculation method may be adopted so that the identification information is also updated. The identification information may be a time stamp 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 the user program and the identification information of the user program. The collation unit 334 is an example of a collation unit that collates the user program identification information output from the programmable logic controller with the user program identification information stored in the program memory and displays the collation result on the display unit. The warning unit 335 outputs a warning when the two do not match, but if the two match, a message or an image indicating that they match may be displayed on the display unit 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 the portion of the user program in which the instruction word related to the device value is described. This makes it easier for the user to understand the relationship between changes in device values and user programs. This will improve the efficiency of debugging.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Claims (22)

ログ設定情報を受け付けるインタフェースと、ラダープログラムを繰り返し実行するプログラム実行部と、前記プログラム実行部により参照される記憶領域である複数のデバイスを有するデバイス記憶部と、前記ログ設定情報で指定される収集周期ごとに、前記デバイス記憶部に記憶されている複数のデバイス値を収集時刻に関する情報と対応付けて記録する記録部とを有し、前記ログ設定情報で指定される条件が満たされると前記記録部から前記複数のデバイス値および対応付けられた収集時刻に関する情報を読み出してログデータとして出力するプログラマブルロジックコントローラに接続され、
前記プログラマブルロジックコントローラにより出力されるログデータを用いて、前記複数のデバイス値を表示する外部設定機器であって、
前記収集周期としてラダープログラムの1スキャンを指定し、前記条件として特定のデバイスおよび当該特定のデバイスの状態変化によって定まるタイミングを指定する前記ログ設定情報を、前記プログラマブルロジックコントローラに対して送信する送信部と、
前記ラダープログラムおよび前記ログデータを記憶するメモリと、
前記メモリに記憶されたラダープログラムを表示するとともに、前記メモリに記憶されたログデータから前記収集時刻に関する情報に基づき複数のデバイス値を取得して、特定時刻におけるデバイス値として当該ラダープログラム上に表示するログ表示部と、
を備え、
前記ログ表示部は、第1ボタンを介した表示更新指示を受け付けると、時間経過に応じて前記特定時刻を進めて行くとともに、当該特定時刻と前記収集時刻に基づき前記ラダープログラム上に表示されるデバイス値であって前記特定時刻に対応するデバイス値を繰り返し更新することを特徴とする外部設定機器。
An interface that accepts log setting information, a program execution unit that repeatedly executes a ladder program, a device storage unit that has a plurality of devices that are storage areas referenced by the program execution unit , and a collection specified by the log setting information. for each cycle, have a recording section which records in association with information about the collection time a plurality of device values stored in the device memory unit, the condition specified in the log setting information is satisfied recorded It is connected to a programmable logic controller that reads out the information about the plurality of device values and the associated collection time from the unit and outputs it as log data.
An external setting device that displays the plurality of device values using the log data output by the programmable logic controller.
A transmitter that transmits the log setting information to the programmable logic controller, which specifies one scan of the ladder program as the collection cycle and specifies the timing determined by the state change of the specific device and the specific device as the condition. When,
A memory for storing the ladder program and the log data, and
The ladder program stored in the memory is displayed, and a plurality of device values are acquired from the log data stored in the memory based on the information regarding the collection time and displayed on the ladder program as the device value at a specific time. Log display and
With
When the log display unit receives a display update instruction via the first button, the log display unit advances the specific time according to the passage of time and is displayed on the ladder program based on the specific time and the collection time. An external setting device that is a device value and is characterized in that the device value corresponding to the specific time is repeatedly updated.
前記ログ表示部は、前記特定時刻に対して収集時刻が近いデバイス値を前記ラダープログラム上に表示することを特徴とする請求項1に記載の外部設定機器。 The external setting device according to claim 1, wherein the log display unit displays a device value whose collection time is close to the specific time on the ladder program. 前記ログ表示部は、さらに、第2ボタンを介した表示更新指示を受け付けると、前記ラダープログラム上に表示されるデバイス値を、前記特定時刻に対応する収集時刻の一ステップ次の収集時刻に収集されたデバイス値に更新することを特徴とする請求項1または2に記載の外部設定機器。 When the log display unit further receives a display update instruction via the second button, the log display unit collects the device value displayed on the ladder program at the collection time one step next to the collection time corresponding to the specific time. The external setting device according to claim 1 or 2, wherein the device value is updated to the value of the device. 前記ログ表示部は、前記ラダープログラム上に表示されるデバイス値の収集時刻を表示することを特徴とする請求項3に記載の外部設定機器。 The external setting device according to claim 3, wherein the log display unit displays a collection time of a device value displayed on the ladder program. 前記ログ表示部は、前記ラダープログラムを表示するプログラム表示領域の下方に前記第1ボタンと前記第2ボタンを並べて表示することを特徴とする請求項3または4に記載の外部設定機器。 The external setting device according to claim 3 or 4, wherein the log display unit displays the first button and the second button side by side below a program display area for displaying the ladder program. 前記ログ表示部は、前記ラダープログラム上に表示されるデバイス値を繰り返し更新する際に、時系列からなる複数の前記収集時刻のうち一部の収集時刻のデバイス値を前記ラダープログラム上に表示することを特徴とする請求項1から5のいずれか一項に記載の外部設定機器。 When the device value displayed on the ladder program is repeatedly updated, the log display unit displays the device value of a part of the collection times of the plurality of time-series collection times on the ladder program. The external setting device according to any one of claims 1 to 5, characterized in that. 前記ログ表示部は、さらに、第3ボタンを介した表示更新指示を受け付けると、前記ラダープログラム上に表示されるデバイス値を、前記特定時刻に対応する収集時刻の一ステップ前の収集時刻に収集されたデバイス値に更新することを特徴とする請求項1から6のいずれか一項に記載の外部設定機器。 When the log display unit further receives a display update instruction via the third button, the log display unit collects the device value displayed on the ladder program at the collection time one step before the collection time corresponding to the specific time. The external setting device according to any one of claims 1 to 6, wherein the device value is updated to the value of the device. 前記ログ表示部は、前記特定時刻に対応する収集時刻を表示するとともに、前記第1ボタンを介した表示更新指示を受け付けると、当該表示更新指示を受け付けた後の時間経過に応じて当該特定時刻に対応する収集時刻の表示を繰り返し更新することを特徴とする請求項1から7のいずれか一項に記載の外部設定機器。 When the log display unit displays the collection time corresponding to the specific time and receives the display update instruction via the first button, the specific time corresponds to the passage of time after receiving the display update instruction. The external setting device according to any one of claims 1 to 7, wherein the display of the collection time corresponding to the above is repeatedly updated. 前記ログ表示部は、前記特定時刻に対応するスキャン回数を表示するとともに、前記第1ボタンを介した表示更新指示を受け付けると、当該表示更新指示を受け付けた後の時間経過に応じて当該特定時刻に対応するスキャン回数の表示を繰り返し更新することを特徴とする請求項1から8のいずれか一項に記載の外部設定機器。 When the log display unit displays the number of scans corresponding to the specific time and receives a display update instruction via the first button, the log display unit receives the display update instruction, and the specific time corresponds to the lapse of time after receiving the display update instruction. The external setting device according to any one of claims 1 to 8, wherein the display of the number of scans corresponding to the above is repeatedly updated. 前記ログ表示部は、ユーザによる時刻指定指示を受け付け可能であって、前記特定時刻に応じて移動する第1時刻指定カーソルを表示することを特徴とする請求項1から9のいずれか一項に記載の外部設定機器。 The log display unit can receive a time designation instruction by a user, and any one of claims 1 to 9 is characterized in that it displays a first time designation cursor that moves according to the specific time. Described external setting device. 前記ログ表示部は、前記第1時刻指定カーソルのドラッグ操作を受け付けたとき、当該ドラッグ操作のドラッグ量に応じて前記特定時刻を調整することを特徴とする請求項10に記載の外部設定機器。 The external setting device according to claim 10, wherein the log display unit adjusts the specific time according to the drag amount of the drag operation when the drag operation of the first time designation cursor is received. 前記ログ表示部は、前記第1ボタンを介した表示更新指示により前記特定時刻を所定の更新速度で更新している場合に前記第1時刻指定カーソルのドラッグ操作を受け付けたとき、当該特定時刻の更新を停止することで、当該特定時刻に対応するデバイス値の表示の更新を停止させることを特徴とする請求項11に記載の外部設定機器。 When the log display unit receives a drag operation of the first time designation cursor when the specific time is updated at a predetermined update speed by a display update instruction via the first button, the log display unit receives the drag operation of the specific time. The external setting device according to claim 11, wherein the update of the display of the device value corresponding to the specific time is stopped by stopping the update. 前記ログ表示部は、さらに、前記メモリに記憶されたログデータから前記収集時刻に関する情報に基づき取得したデバイス値の時系列波形を表示する波形表示部を有し、
前記波形表示部は、前記第1ボタンを介した表示更新指示を受け付けると、当該表示更新指示を受けた後の時間経過に応じて当該デバイス値の時系列波形の表示範囲を時間軸方向に沿って移動させることを特徴とする請求項10から12のいずれか一項に記載の外部設定機器。
The log display unit further includes a waveform display unit that displays a time-series waveform of device values acquired from log data stored in the memory based on information regarding the collection time.
When the waveform display unit receives the display update instruction via the first button, the waveform display unit sets the display range of the time-series waveform of the device value along the time axis direction according to the passage of time after receiving the display update instruction. The external setting device according to any one of claims 10 to 12, wherein the external setting device is moved.
前記波形表示部は、前記デバイス値の時系列波形において時刻を指定するための第2時刻指定カーソルを当該時系列波形に重ねて表示し、
前記第2時刻指定カーソルにより指定される時刻と前記特定時刻に対応する収集時刻とが同じになるよう構成されていることを特徴とする請求項13に記載の外部設定機器。
The waveform display unit displays a second time designation cursor for designating a time in the time series waveform of the device value overlaid on the time series waveform.
The external setting device according to claim 13, wherein the time specified by the second time designation cursor and the collection time corresponding to the specific time are configured to be the same.
前記波形表示部は、ユーザによる時刻指定指示を受け付け可能であって、前記特定時刻に応じて移動する前記第1時刻指定カーソルを表示し、
前記第2時刻指定カーソルのドラッグ操作を受け付けたとき、当該ドラッグ操作のドラッグ量に応じて前記第1時刻指定カーソルを移動させることを特徴とする請求項14に記載の外部設定機器。
The waveform display unit can accept a time designation instruction by a user, and displays the first time designation cursor that moves according to the specific time.
The external setting device according to claim 14, wherein when the drag operation of the second time designation cursor is accepted, the first time designation cursor is moved according to the drag amount of the drag operation.
前記記録部は、前記デバイス記憶部に記憶されている複数のデバイス値を収集時刻に関する情報と対応付けて1つのレコードとして記録し、
前記ログ表示部は、前記レコードにおける収集時刻であって前記特定時刻に近い収集時刻に関する情報と対応付けられているデバイス値が前記ラダープログラム上に表示されるように表示を繰り返し更新することを特徴とする請求項1から15のいずれか一項に記載の外部設定機器。
The recording unit records a plurality of device values stored in the device storage unit as one record in association with information regarding the collection time.
The log display unit is characterized in that the display is repeatedly updated so that the device value associated with the collection time in the record and the information related to the collection time close to the specific time is displayed on the ladder program. The external setting device according to any one of claims 1 to 15.
前記ログ表示部は、時間を計時する内部時計を有し、
前記内部時計にしたがって前記特定時刻を進めて行くことを特徴とする請求項1から16のいずれか一項に記載の外部設定機器。
The log display unit has an internal clock that keeps time.
The external setting device according to any one of claims 1 to 16, wherein the specific time is advanced according to the internal clock.
前記プログラマブルロジックコントローラは、前記ログ設定情報で指定される条件が満たされると前記記録部から対象期間分の前記複数のデバイス値および対応付けられた収集時刻に関する情報を読み出してログデータとして出力し、When the condition specified in the log setting information is satisfied, the programmable logic controller reads out the information on the plurality of device values for the target period and the associated collection time from the recording unit and outputs the log data.
前記ログ設定情報には、前記タイミングを基準とした前記対象期間の指定が含まれることを特徴とする請求項1から17のいずれか一項に記載の外部設定機器。The external setting device according to any one of claims 1 to 17, wherein the log setting information includes designation of the target period based on the timing.
前記対象期間は、前記タイミングよりも前の所定期間を含むことを特徴とする請求項18に記載の外部設定機器。The external setting device according to claim 18, wherein the target period includes a predetermined period prior to the timing. 前記外部設定機器は、The external setting device is
ユーザ操作に基づいて、前記条件として特定のデバイスおよび当該特定のデバイスの状態変化によって定まるタイミングが指定された前記ログ設定情報を作成するログ設定部を備え、A log setting unit for creating the log setting information in which a specific device and a timing determined by a state change of the specific device are specified as the condition based on a user operation is provided.
前記送信部は、前記収集周期としてラダープログラムの1スキャンの指定が含まれ、前記ログ設定部により作成された前記ログ設定情報を、前記プログラマブルロジックコントローラに対して送信することを特徴とする請求項1から19のいずれか一項に記載の外部設定機器。The claim is characterized in that the transmission unit includes the designation of one scan of the ladder program as the collection cycle, and transmits the log setting information created by the log setting unit to the programmable logic controller. The external setting device according to any one of 1 to 19.
前記外部設定機器は、The external setting device is
ユーザ操作に基づきラダープログラムを作成するプログラム作成部を備え、Equipped with a program creation unit that creates a ladder program based on user operations
前記送信部は、前記プログラム作成部により作成したラダープログラムとともに、前記ログ設定情報を前記プログラマブルロジックコントローラに対して送信することを特徴とする請求項1から20のいずれか一項に記載の外部設定機器。 The external setting according to any one of claims 1 to 20, wherein the transmission unit transmits the log setting information to the programmable logic controller together with a ladder program created by the program creation unit. device.
ログ設定情報を受け付けるインタフェースと、ラダープログラムを繰り返し実行するプログラム実行部と、前記プログラム実行部により参照される記憶領域である複数のデバイスを有するデバイス記憶部と、前記ログ設定情報で指定される収集周期ごとに、前記デバイス記憶部に記憶されている複数のデバイス値を収集時刻に関する情報と対応付けて記録する記録部とを有し、前記ログ設定情報で指定される条件が満たされると前記記録部から前記複数のデバイス値および対応付けられた収集時刻に関する情報を読み出してログデータとして出力するプログラマブルロジックコントローラに接続され、
前記プログラマブルロジックコントローラにより出力されるログデータを用いて、前記複数のデバイス値を表示するコンピュータにおいて実行されるプログラムであって、
前記収集周期としてラダープログラムの1スキャンを指定し、前記条件として特定のデバイスおよび当該特定のデバイスの状態変化によって定まるタイミングを指定する前記ログ設定情報を、前記プログラマブルロジックコントローラに対して送信する送信工程と、
前記コンピュータのメモリに記憶されたラダープログラムを表示するとともに、前記メモリに記憶されたログデータから前記収集時刻に関する情報に基づき複数のデバイス値を取得して、特定時刻におけるデバイス値として当該ラダープログラム上に表示するログ表示工程とを前記コンピュータに実行させ、
前記ログ表示工程は、
第1ボタンを介した表示更新指示を受け付けると、時間経過に応じて前記特定時刻を進めて行くとともに、当該特定時刻と前記収集時刻に基づき前記ラダープログラム上に表示されるデバイス値であって前記特定時刻に対応するデバイス値を繰り返し更新することを含むことを特徴とするプログラム。
An interface that accepts log setting information, a program execution unit that repeatedly executes a ladder program, a device storage unit that has a plurality of devices that are storage areas referred to by the program execution unit , and a collection specified by the log setting information. for each cycle, have a recording section which records in association with information about the collection time a plurality of device values stored in the device memory unit, the condition specified in the log setting information is satisfied recorded It is connected to a programmable logic controller that reads out the information about the plurality of device values and the associated collection time from the unit and outputs it as log data.
A program executed in a computer that displays the plurality of device values using the log data output by the programmable logic controller.
A transmission step of transmitting the log setting information to the programmable logic controller, which specifies one scan of the ladder program as the collection cycle and specifies the timing determined by the state change of the specific device and the specific device as the condition. When,
While displaying the ladder program stored in the memory of the computer, a plurality of device values are acquired from the log data stored in the memory based on the information regarding the collection time, and the device values at the specific time are displayed on the ladder program. Let the computer execute the log display process to be displayed in
The log display process is
When the display update instruction via the first button is received, the specific time is advanced according to the passage of time, and the device value displayed on the ladder program based on the specific time and the collection time is described above. A program characterized by repeatedly updating the device value corresponding to a specific time.
JP2020201712A 2020-08-07 2020-12-04 Programmable logic controller and main unit Active JP6948450B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2020201712A JP6948450B2 (en) 2020-08-07 2020-12-04 Programmable logic controller and main unit

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2020134823A JP6806946B2 (en) 2020-08-07 2020-08-07 External setting devices and programs
JP2020201712A JP6948450B2 (en) 2020-08-07 2020-12-04 Programmable logic controller and main unit

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP2020134823A Division JP6806946B2 (en) 2020-08-07 2020-08-07 External setting devices and programs

Publications (3)

Publication Number Publication Date
JP2021036479A JP2021036479A (en) 2021-03-04
JP2021036479A5 JP2021036479A5 (en) 2021-06-17
JP6948450B2 true JP6948450B2 (en) 2021-10-13

Family

ID=74716377

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2020201712A Active JP6948450B2 (en) 2020-08-07 2020-12-04 Programmable logic controller and main unit

Country Status (1)

Country Link
JP (1) JP6948450B2 (en)

Family Cites Families (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH07182013A (en) * 1991-04-11 1995-07-21 Ge Fanuc Autom North America Inc Method and apparatus for discrimination of input/output module coupled to programmable logic controller
JPH1011118A (en) * 1996-06-24 1998-01-16 Keyence Corp Sequence controller, data processor, data recording and reproducing method, and recording medium
JPH11331766A (en) * 1998-05-15 1999-11-30 Omron Corp Equipment logging device
JP2000235412A (en) * 1999-02-15 2000-08-29 Omron Corp Logging device
JP2000250775A (en) * 1999-03-01 2000-09-14 Omron Corp Trouble analysis supporting device and simulation system
JP2000259239A (en) * 1999-03-12 2000-09-22 Omron Corp Device, system and report for logging
JP2001125612A (en) * 1999-10-25 2001-05-11 Omron Corp Facility logging device
JP2005056098A (en) * 2003-08-04 2005-03-03 Digital Electronics Corp Display device
US20070168068A1 (en) * 2004-03-22 2007-07-19 Masao Saito Display apparatus, program product causing computer to function as the display apparatus, and recording medium storing the program product
US20110208324A1 (en) * 2010-02-25 2011-08-25 Mitsubishi Electric Corporation Sysyem, method, and apparatus for maintenance of sensor and control systems
JP5246186B2 (en) * 2010-03-15 2013-07-24 オムロン株式会社 Controller support device, control program simulation method, controller support program, and computer-readable storage medium storing controller support program
KR101311093B1 (en) * 2011-04-18 2013-09-25 미쓰비시덴키 가부시키가이샤 Programmable logic controller
JP5992775B2 (en) * 2012-09-04 2016-09-14 株式会社キーエンス Pluggable logic controller
JP6535459B2 (en) * 2014-12-08 2019-06-26 株式会社キーエンス Programmable logic controller, basic unit, control method and program
JP6626315B2 (en) * 2015-10-21 2019-12-25 株式会社キーエンス Monitoring device for programmable logic controller and programmable logic controller system

Also Published As

Publication number Publication date
JP2021036479A (en) 2021-03-04

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
JP2023164999A (en) Program creation assistance device for programmable logic controller
JP2020134985A (en) Programmable logic controller and camera input expansion unit
JP7320953B2 (en) Programmable logic controller and its log data storage method
JP7450471B2 (en) Programmable logic controller and PLC system
JP7212496B2 (en) Programmable logic controller system, programming support device and computer program
JP7173826B2 (en) Programmable logic controller system, programming support device and computer program
JP2000250775A (en) Trouble analysis supporting device and simulation system
JP7466319B2 (en) Programmable display and programmable logic controller system equipped with the same
JP6948450B2 (en) Programmable logic controller and main unit
JP6806946B2 (en) External setting devices and programs
JP6986125B2 (en) Programmable logic controller and main unit
JP2022158228A (en) Monitoring device and programmable logic controller system
JP7405714B2 (en) programmable logic controller
JP7412076B2 (en) Engineering tools for programmable logic controllers
JP2022029907A (en) Control apparatus and program
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
US11520315B2 (en) Production system, production method, and information storage medium
US20230004482A1 (en) Simulation system, method for simulation system, and non-transitory computer-readable storage medium storing simulation program
US11287789B2 (en) Program development support device, program development support system, program development support method, and non-transitory computer-readable recording medium
JP2022158229A (en) Programmable logic controller system

Legal Events

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

Free format text: JAPANESE INTERMEDIATE CODE: A7422

Effective date: 20210113

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20210412

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20210531

A871 Explanation of circumstances concerning accelerated examination

Free format text: JAPANESE INTERMEDIATE CODE: A871

Effective date: 20210531

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20210611

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20210806

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20210917

R150 Certificate of patent or registration of utility model

Ref document number: 6948450

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

R157 Certificate of patent or utility model (correction)

Free format text: JAPANESE INTERMEDIATE CODE: R157