JP2020067752A - Programmable logic controller system, program creation assisting device, and computer program - Google Patents

Programmable logic controller system, program creation assisting device, and computer program Download PDF

Info

Publication number
JP2020067752A
JP2020067752A JP2018199198A JP2018199198A JP2020067752A JP 2020067752 A JP2020067752 A JP 2020067752A JP 2018199198 A JP2018199198 A JP 2018199198A JP 2018199198 A JP2018199198 A JP 2018199198A JP 2020067752 A JP2020067752 A JP 2020067752A
Authority
JP
Japan
Prior art keywords
unit
program
time
display
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2018199198A
Other languages
Japanese (ja)
Other versions
JP7173826B2 (en
Inventor
中村 達也
Tatsuya Nakamura
達也 中村
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Keyence Corp
Original Assignee
Keyence Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Keyence Corp filed Critical Keyence Corp
Priority to JP2018199198A priority Critical patent/JP7173826B2/en
Publication of JP2020067752A publication Critical patent/JP2020067752A/en
Application granted granted Critical
Publication of JP7173826B2 publication Critical patent/JP7173826B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/02Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]

Landscapes

  • Programmable Controllers (AREA)

Abstract

To reduce the burden of registration by the user of a device that is the object of logging in a PLC.SOLUTION: A plurality of devices used in each of a plurality of function execution engines are allocated. One or more functions among a plurality of functions corresponding to the plurality of function execution engines are designated. A device used for the designated one or more functions is extracted from the plurality of allocated devices as the recording object of a device recording unit. The device values stored in the specific device extracted as the recording object are recorded in time series.SELECTED DRAWING: Figure 7

Description

本発明は、プログラマブルロジックコントローラシステム、プログラム作成支援装置およびコンピュータプログラムに関する。   The present invention relates to a programmable logic controller system, a program creation support device, and a computer program.

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

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

ところで、ユーザプログラムに関与するデバイスの数は膨大である。そのため、すべてデバイス値をロギングすると、ユーザプログラムの実行が遅延してしまう。ラダープログラムなどのユーザプログラムは繰り返し実行されるプログラムであり、一回あたりの実行時間はスキャンタイム(スキャン周期)と呼ばれる。多数のデバイスのロギングによって、このスキャンタイムが長くなってしまう。一方、ロギング対象となるデバイスをユーザが予め指定することができれば、遅延の問題を緩和できるであろう。しかし、適切にロギング対象となるデバイスを指定することはユーザにとって簡単なことではない。なぜなら、多数のデバイスのうち、実際にトラブルの解決に役立つデバイスを取捨選択(加除)することは高度の知識と経験とが必要となるからである。   By the way, the number of devices involved in the user program is enormous. Therefore, if all device values are logged, execution of the user program will be delayed. A user program such as a ladder program is a program that is repeatedly executed, and the execution time for each time is called a scan time (scan cycle). This scan time is lengthened by the logging of many devices. On the other hand, if the user can specify the device to be logged in advance, the problem of delay will be alleviated. However, it is not easy for the user to properly specify the device to be logged. This is because, among a large number of devices, it is necessary to have a high degree of knowledge and experience to select (add or remove) a device that is actually useful for solving a trouble.

また、PLCは様々な機能(例:位置決め機能、撮影機能、通信機能)を有している。したがって、解決したいトラブルに関連した機能に関連したデバイスをロギング対象として抽出し、トラブルとは関係しない機能に関連したデバイスをロギング対象から削除できれば、ユーザにとって便利であろう。   Further, the PLC has various functions (eg, positioning function, photographing function, communication function). Therefore, it would be convenient for the user if a device related to a function related to a trouble to be solved can be extracted as a logging target and a device related to a function not related to the trouble can be deleted from the logging target.

そこで、本発明は、PLCにおいてロギングの対象となるデバイスのユーザによる登録負担を軽減することを目的とする。   Therefore, an object of the present invention is to reduce the registration burden on the user of the device to be logged in the PLC.

本発明は、たとえば、
ユーザプログラムを繰り返し実行するプログラム実行エンジンと、
前記ユーザプログラムからの指令に基づいて、各々が前記ユーザプログラムに関する異なる機能を実行する複数の機能実行エンジンと、
前記プログラム実行エンジンと前記複数の機能実行エンジンにより参照される記憶領域である複数のデバイスを有するデバイス記憶部と、
前記複数のデバイスのいずれかに記憶されているデバイス値を時系列に記録するデバイス記録部と、
を有するプログラマブルロジックコントローラシステムにおいて、
前記複数の機能実行エンジンの各々にて使用される複数のデバイスを割り付ける割付部と、
前記複数の機能実行エンジンに対応する複数の機能のうち一つ以上の機能を指定する指定部と、
前記割付部により割り付けられた複数のデバイスから、前記指定部により指定された一つ以上の機能のために使用されるデバイスを前記デバイス記録部の記録対象として抽出するデバイス抽出部と、
をさらに有し、
前記デバイス記録部は、前記デバイス抽出部により記録対象として抽出された前記デバイスに記憶されているデバイス値を時系列に記録するように構成されていることを特徴とするプログラマブルロジックコントローラシステムを提供する。
The present invention is, for example,
A program execution engine that repeatedly executes user programs,
A plurality of function execution engines, each of which executes different functions related to the user program based on a command from the user program;
A device storage unit having a plurality of devices that are storage areas referred to by the program execution engine and the plurality of function execution engines;
A device recording unit that records device values stored in any of the plurality of devices in time series,
In a programmable logic controller system having
An allocation unit that allocates a plurality of devices used in each of the plurality of function execution engines,
A designation unit for designating one or more functions of the plurality of functions corresponding to the plurality of function execution engines;
From a plurality of devices allocated by the allocation unit, a device extraction unit that extracts a device used for one or more functions specified by the specification unit as a recording target of the device recording unit,
Further has
Provided is a programmable logic controller system, wherein the device recording unit is configured to record device values stored in the device extracted as a recording target by the device extraction unit in time series. .

本発明によれば、PLCにおいてロギングの対象となるデバイスのユーザによる登録負担が軽減される。   According to the present invention, the registration burden on the user of the device to be logged in the PLC is reduced.

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

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

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

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

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

PC2はプログラム作成支援装置と呼ばれてもよい。PC2は、たとえば、携帯可能なノートタイプやタブレットタイプのパーソナルコンピュータであって、表示部7および操作部8を備えている。PLC1を制御するためのユーザプログラムの一例であるラダープログラムは、PC2を用いて作成される。その作成されたラダープログラムは、PC2内でニモニックコードに変換される。PC2は、USB(Universal Serial Bus)などの通信ケーブル9を介してPLC1の基本ユニット3に接続され、ニモニックコードに変換されたラダープログラムを基本ユニット3に送る。基本ユニット3はラダープログラムをマシンコードに変換し、基本ユニット3に備えられたメモリ内に記憶する。なお、ここではニモニックコードが基本ユニット3に送信されているが、本発明はこれに限られない。たとえば、PC2は、ニモニックコードを中間コードに変換し、中間コードを基本ユニット3に送信してもよい。   The PC 2 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 the PLC 1, is created using the PC 2. 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 a USB (Universal Serial Bus) and sends the ladder program converted into the 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 send the intermediate code to the basic unit 3.

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

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

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

各入力デバイスのシンボルの上方に表示されている文字(「R0001」、「R0002」および「R0003」)は、その入力デバイスのデバイス名(アドレス名)を表している。各入力デバイスのシンボルの下方に表示されている文字(「フラグ1」、「フラグ2」および「フラグ3」)は、その入力デバイスに対応付けられたデバイスコメントを表している。出力デバイスのシンボルの上方に表示されている文字(「原点復帰」)は、その出力デバイスの機能を表す文字列からなるラベルである。   The characters (“R0001”, “R0002”, and “R0003”) displayed above the symbol of each input device represent the device name (address name) of that input device. The characters (“flag 1”, “flag 2”, and “flag 3”) displayed below the symbol of each input device represent the device comment associated with that input device. The character ("return to origin") displayed above the symbol of the output device is a label composed 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, symbols of two input devices corresponding to device names “R0001” and “R0002” are connected in series to form an AND circuit. Further, an 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, the symbols in the first row are dealt with only when all the input devices corresponding to the two symbols in the first row are turned on or when the input devices corresponding to the symbols in the second row are turned on. 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 electrically connected to the CPU 21, respectively. The storage device 22 includes RAM and 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, ladder programs), configuration information of the basic unit 3 and expansion unit 4, and the like. The configuration information includes information indicating connection positions of the plurality of extension units 4 with respect to the base unit 3, functions provided in the base unit 3 (eg, communication function and positioning function), functions of the extension unit 4 (eg, shooting function). It is information indicating such as. Here, editing the project data includes creating and changing the project data. The project data created 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 necessary and change the project data using the editing software. The communication unit 23 is for connecting the PC 2 to the basic unit 3 via the communication cable 9 so that they can communicate with each other. 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 the PLC 1. As shown in FIG. 4, the basic unit 3 includes a CPU 31, a display unit 5, an operation unit 6, a storage device 32, and a communication unit 33. The display unit 5, the operation unit 6, the storage device 32, and the communication unit 33 are electrically connected to the CPU 31, respectively. The storage device 32 may include a RAM, a ROM, a memory card, or the like. The storage device 32 has a plurality of storage areas such as a device section 34, a project storage section 35, and a removable memory card 36. The device 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 PC 2. The storage device 32 also stores a control program for the basic unit 3. As shown in FIG. 4, the basic unit 3 and the expansion unit 4 are connected via a unit internal bus 90 which is a kind of expansion bus. The communication function regarding the unit internal bus 90 may be implemented as a part of the communication unit 33. The communication unit 33 may include a network communication circuit. The CPU 31 may transmit the 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 described below is performed, and communication control in the unit internal bus 90 is realized by a so-called bus master 38 (note that the bus master 38 serves as part of the communication unit 33. May be provided, or the 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. The CPU 41 also 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 command from the basic unit 3 even at a timing different from the input / output refresh. The memory 42 includes RAM and ROM. In particular, a storage area used as a buffer memory is secured in the RAM. 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 performing input / output refresh, program execution 202, and END processing 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 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. Thus, the input / output refresh synchronizes the device of the basic unit 3 and the device of the expansion unit 4. A mechanism (inter-unit synchronization) for updating the device value between units at a timing other than refresh may be adopted. However, the device of the basic unit 3 is rewritten by the basic unit 3 at any time, and similarly, the device of the expansion unit 4 is rewritten by the expansion unit 4 at any time. 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 devices of the expansion unit 4 can be accessed at any time by a device inside the expansion unit 4. The basic unit 3 and the extension 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 sequentially executed according to the project data. The basic unit 3 arithmetically processes the data by executing the program. Note that the END processing means overall processing relating 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 checking.

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

<ロギング>
ユーザがユーザプログラムを改良したり、修正したりする際に、PLC1がユーザプログラムを実行している際に取得されたデバイス値が役に立つことがある。そこで、PLC1は予め指定されたデバイス値を取得し、ログデータを作成する。ここで、PLC1が管理するデバイスには、ユーザプログラムによって利用されるものだけでなく、ユーザプログラムによって利用されないものも存在する。また、ユーザプログラムを改良したり、修正したりする際に役立つデバイスもあれば、役に立たないデバイスもある。一般にデバイスの数は数千個に及ぶため、ユーザが必要なデバイスを指定することは大きな負担となっていた。そこで、PC2は、ユーザプログラムを解析し、ユーザプログラムに使用または記述されているデバイスをロギング対象として抽出する。これにより、ユーザの負担が軽減される。
<Logging>
The device value obtained while the PLC 1 is executing the user program may be useful for the user to improve or modify the user program. Therefore, the PLC 1 acquires a device value designated in advance and creates log data. Here, the devices managed by the PLC 1 include not only those used by the user program but also those not used by the user program. Also, some devices are useful for improving or modifying the user program, while others are not. In general, the number of devices reaches several thousand, so that it is a heavy burden for the user to specify the required device. Therefore, the PC 2 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 devices managed by the PLC 1 are targeted for logging, the scan time becomes long. This is because the logging is executed as one of the user programs and is executed at the time of input / output refresh. At times, the delays introduced by logging may cause the user program to not behave as the user desires. Therefore, the number of devices to be logged should be properly maintained.

ユーザプログラムは、複数のプログラム部品(例:プログラムモジュール(メインのラダープログラムとサブのラダープログラム)、ファンクションブロック)から構成されることがある。このうち、ユーザが修正を希望するプログラム部品に関連したデバイスがロギングされれば、ユーザにとって十分な場合がある。また、複数のプログラム部品のうちで、ユーザは特定のプログラム部品を抽出対象から除外したり、特定のプログラム部品を抽出対象に追加したりすることを希望することもあろう。よって、プログラム部品を単位として、ロギング対象からデバイスを追加または削除できればユーザにとって便利であろう。   The user program may be composed of a plurality of program components (eg, program module (main ladder program and sub ladder program), function block). Of these, it may be sufficient for the user if the device associated with the program component that the user desires to correct is logged. Further, among the plurality of program components, the user may desire 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 if a device can be added or deleted 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 the user if devices can be added or deleted from the logging target in units of these functions. For example, if an undesired event related to the communication function of the base unit 3 occurs, the user will be able to resolve this event by referring to the device value of the device related to the communication function of the base unit 3.

●ロギングの設定(自動抽出と加除)
図6はPC2のCPU21が記憶装置22に記憶されている編集ソフトウエアを実行することで実現される機能を示している。これらの機能の一部またはすべてはASICやFPGAなどのハードウエア回路により実現されてもよい。ASICは特定用途集積回路の略称である。FPGAはフィールドプログラマブルゲートアレイの略称である。
● Logging settings (automatic extraction and addition / removal)
FIG. 6 shows the functions 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 a hardware circuit such as an ASIC or FPGA. ASIC is an abbreviation for special purpose integrated circuit. FPGA is an abbreviation for field programmable gate array.

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

プロジェクト作成部50は、表示部7にプロジェクトデータ71を作成するためのUIを表示し、操作部8から入力されたユーザ指示にしたがってプロジェクトデータ71を作成し、記憶装置22に記憶する。UIはユーザーインターフェースの略称である。プロジェクトデータ71には、ユーザプログラムと、PLC1の構成情報などが含まれている。プログラム作成部63は、UIを介したユーザ操作に基づいて、ユーザプログラムを構成する複数のプログラム部品(各モジュール)を作成する。機能設定部62は、基本ユニット3の機能や拡張ユニット4の機能に関する設定を実行する。たとえば、機能設定部62は、基本ユニット3に設けられた機能に対していずれかのデバイスを割り付けたり、拡張ユニット4に設けられた機能に対していずれかのデバイスを割り付けたりし、機能とデバイスとの関係を示す割付情報を構成情報に書き込む。なお、プロジェクト作成部50は、ユーザプログラムがどのようなプログラム部品から構成されているかを示すプログラム構成情報も、プロジェクトデータ71として記憶させる。PLC1全体がどのようなユニットから構成されるかを示すユニット構成情報も、プロジェクトデータ71として記憶させる。   The project creation unit 50 displays a UI for creating 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 and configuration information of the PLC 1. The program creation unit 63 creates a plurality of program parts (each module) that form a user program based on a user operation via the UI. The function setting unit 62 executes settings related to the functions of the basic unit 3 and the expansion unit 4. For example, the function setting unit 62 allocates any device to the function provided in the basic unit 3 or allocates any device to the function provided in the expansion unit 4, The allocation information indicating the relationship with is written in the configuration information. The project creation unit 50 also stores, as the project data 71, program configuration information indicating what kind of program components the user program is composed of. Unit configuration information indicating what unit the entire PLC 1 is configured to 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 a device extraction target according to a user instruction input from the operation unit 8. Further, the component designation unit 52 designates a program component excluded from the device extraction target according to a 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 redundantly extracted devices among the devices extracted from each of the plurality of program components, from the extraction list. The identifying unit 57 detects an instruction word for the memory card in the project data 71, identifies the device that is the target of the instruction word, and adds the identified device to the extraction list.

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

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

なお、本実施形態では、説明の便宜上、追加部54と削除部55を分けているが、一つの機能ブロックであってもよいことは言うまでもない。   In the present embodiment, the addition unit 54 and the deletion unit 55 are separated for convenience of description, 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 estimating unit 59 estimates the influence of the recording of the device value by the PLC 1 on the execution of the user program, based on the number of devices extracted as the recording target by the device extracting unit 53. The logging adds a delay time correlated 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 on the display unit 7 as the estimation result. This delay time may be referred to as scan time extension.

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

ログ表示部61は、PLC1において生成されたログデータ73を、メモリカード36を介して読み出し、表示部7にログデータ73を表示する。たとえば、ログ表示部61は、ログデータ73に記録されているデバイス値と、プロジェクトデータ71のプログラム部品とを関連付けて表示部7に表示してもよい。ログ表示部61は、プログラマブルロジックコントローラ用のエンジニアリングツールの中核をなす。   The log display unit 61 reads out the log data 73 generated in the PLC 1 via the memory card 36 and displays the log data 73 on the display unit 7. For example, the log display unit 61 may display the device value recorded in the log data 73 and the program component of the project data 71 in association with each other on the display unit 7. The log display unit 61 is the core of the engineering tool for the 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 designation of a program component to be a device extraction target.

図8はデバイスを抽出されるプログラム部品の選択を受け付けるためのUI100を示している。ログ設定部51は、ロギングの設定プログラムが起動されると、表示部7にUI100を表示する。UI100において、複数のプログラム部品はそれぞれの分類(モジュール/ファンクションブロック/マクロ)に基づいてツリー状に示されている。また、各プログラム部品にはチェックボックス102が関連付けて表示されている。操作部8の操作に応じてポインタ101がチェックボックス102にチェックを付与すると、追加部54は、チェックを付与されたチェックボックス102に対応するプログラム部品を抽出リストに追加する。一方、操作部8の操作に応じてポインタ101がチェックボックス102のチェックを外すと、削除部55は、チェックを外れたチェックボックス102に対応するプログラム部品を抽出リストから削除(除外)する。   FIG. 8 shows a UI 100 for accepting 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 activated. In the UI 100, a plurality of program parts are shown in a tree shape based on their classification (module / function block / macro). A check box 102 is displayed in association with each program component. When the pointer 101 adds a check to the check box 102 according to the operation of the operation unit 8, the adding 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 according 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 sub-module. The fixed cycle module is a program component that is executed in a fixed cycle. The unit synchronization module is a program component that is executed each time unit synchronization is executed. Although the initialization module is not shown, the initialization module is the module that is first executed when the user program is started. Therefore, since the initialization module is unlikely to cause a trouble, it may be excluded from the device extraction targets.

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

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

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

図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 selection of a function for extracting a device. The log setting unit 51 displays the UI 110 on the display unit 7 when the logging setting program is activated. 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 the UI 110, a plurality of functions are shown in a tree shape based on the unit to which each function belongs. A check box 102 is displayed in association with each function. When the pointer 101 adds a check to the check box 102 according to the operation of the operation unit 8, the adding unit 54 adds the function corresponding to the check box 102 with the check to the extraction list. On the other hand, when the pointer 101 unchecks the check box 102 according to the operation of the operation unit 8, the deletion unit 55 deletes (excludes) the function corresponding to the unchecked check box 102 from the extraction list.

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

ここで、ユニットモニタの一例として、モーションユニットのユニットモニタについて、更に詳述する。図10Aは、モーションユニットの軸1についてのユニットモニタ440の画面の模式図である。図10Bは、ユニットモニタ440による監視の対象を変更するための設定画面441の模式図である。   Here, the unit monitor of the motion unit will be described in more detail as an example of the unit monitor. FIG. 10A is a schematic diagram of a screen of the unit monitor 440 for the axis 1 of the motion unit. FIG. 10B is a schematic diagram of a setting screen 441 for changing the monitoring target of 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 targets to be monitored by the unit monitor 440. A buffer memory (UG) is assigned to each item. For example, UG4 and UG5 are assigned to the current coordinates. In this embodiment, 16 bits are reserved for one UG, and two UGs are reserved for representing the current coordinates in 32 bits. The device value of the UG is a numerical value such as 0PLS (pulse). Further, UG8 and UG9 are assigned to the command coordinates. The reason why two UGs are reserved is for the same reason as described above (for ensuring the 32-bit representation). Since unit designers can freely assign UGs, there are some unused UGs (UG6 and UG7). Similarly, UG10 and UG11 are assigned to the current speed, and UG12 and UG13 are assigned to the command speed. In addition, in FIG. 10A, UGs are assigned to respective items 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 “non-display” column 442 shown in FIG. 10B and clicking the right arrow button 443, the one item is moved to the “display” column 444 and monitored by the unit monitor 440. Becomes By clicking the OK button 445, the items listed in the “display” column 444 are confirmed as monitoring targets. 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 to be monitored.

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

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

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

なお、その他のモニタについて図示は省略するが、簡単に説明する。基本ユニット3の機能である通信エラーモニタは、例えば、サイクリック通信の開設タイムアウトエラーに割り付けられたデバイスを監視する。センサの入出力を監視するセンサI/Oモニタは、例えば、一又は複数のセンサの出力やエラー有無に割り付けられたデバイスを監視する。アナログ入力ユニットのユニットモニタは、例えば、AD変換データ、特殊データ、オフセット値、ゼロシフト、ピーク値、ボトム値などの各種パラメータに割り付けられたデバイス(DM又はR)を監視する。これらのデバイスは、ユニット設計者によって、予めデフォルト(初期設定)として割り付けられたものであるが、上述したモーションユニットのユニットモニタのように、ユーザによって監視対象が変更されてもよい。要するに、図9に示すUI110は、ユーザから機能の選択入力を受け付け可能な設定画面となっている。そして、選択入力される機能ごとに、表示部(モニタ)に表示させる監視項目を定めたテンプレート(設定情報)が対応付けられている(テンプレートはメモリに保存されている)。そのテンプレートによって特定されるデバイスは、上述したように予めデフォルトで割り付けられたものであってもよいし、ユーザが設定画面を介して加除(編集)した後のものであってもよい。機能指定部60は、ユーザ操作に基づいて一又は複数の機能を選択すると、その機能に対応付けられたテンプレートに従って、監視対象となるデバイスを抽出リストに追加する。   Although illustration of other monitors is omitted, they will be briefly described. The communication error monitor, which is a function of the basic unit 3, monitors, for example, the device assigned to the cyclic communication opening time-out error. The sensor I / O monitor that monitors the input / output of the sensor monitors, for example, the output of one or a plurality of sensors and the device assigned to the presence or absence of an error. The unit monitor of the analog input unit monitors 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. Although these devices are assigned in advance as defaults (initial settings) by the unit designer, the monitoring target may be changed by the user like the unit monitor of the motion unit described above. In short, the UI 110 shown in FIG. 9 is a setting screen that can accept selection input of a function from the user. Then, a template (setting information) defining monitoring items to be displayed on the display unit (monitor) is associated with each selected and input function (the template is stored in the memory). The device specified by the template may be a device assigned by default in advance as described above, or may be one after addition (edit) by the user via the setting screen. When selecting one or a plurality of functions based on a user operation, the function designation unit 60 adds a 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 the device extracted from the designated program component among the plurality of program components included in the project data 71. According to FIG. 10C, the name of the program component from which the device is extracted, the name of the first device (device number), the number of devices extracted based on the first device, and the device name actually extracted as the logging target And are shown. Generally, the number of devices corresponding to the designated number is extracted with the head device as a reference. However, the number of devices exceeding the specified number may be extracted. R34000 is a relay device, which is a device that holds 1-bit information, and a series of 16 devices from R34000 to R34015 are extracted. This is because logging 16-bit devices together is advantageous from the viewpoint of data processing speed. In FIG. 10C, the number of R34000 is “1”, which indicates 1 word (16 bits). Further, the number of CR4001 is also "1", but this also shows one word (16 bits of CR4001, CR4002, ..., CR4015, CR4100). Global is a device commonly used by a plurality of program components. Main indicates a main program. first_operation is the name of the function block. Sub indicates a subprogram (submodule).

S4でデバイス抽出部53は機能指定部60により指定された機能の構成情報を解析し、構成情報において機能と関連付けられているデバイスを抽出する。   In S4, the device extraction unit 53 analyzes the configuration information of the function designated 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) of the plurality of functions (the basic unit 3 and the extension unit 4) provided in the PLC 1. In this example, some buffer memories (UG) are extracted from the motion unit designated by the function designation unit 60. According to FIG. 11, the name of the function from which the device is extracted, the name of the first device (device number), the number of devices extracted based on the first 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 shows the current coordinates of the motor, UG8-UG9 shows the command coordinates of the motor, and UG10-UG11 shows the current speed of the motor. , UG12-UG13 indicate motor command speeds. Description of other UGs is 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 specifying the device.

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

S7で推定部59はロギング対象リストL0を解析し、スキャンタイムへの影響を推定し、推定結果を表示部7に表示する。   In S7, the estimation unit 59 analyzes the logging target list L0, estimates the influence on 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 scan time extension. When the list button 141 is operated through the operation unit 8, the estimation unit 59 may display the logging target list L0 on the display unit 7. The user considers the estimation result and determines whether to confirm or adjust the logging target list L0. When confirming the logging target list L0, the user may operate the pointer 101 with a button indicating the intention of confirmation.

S8でログ設定部51はロギング対象を確定するかどうかを判定する。たとえば、ロギング対象リストL0を確定するためのボタンが操作されると、ログ設定部51はロギング対象を確定すると判定する。一方で、ロギング対象リストL0を修正するためのボタンが操作されると、ログ設定部51はロギング対象を修正すると判定する。ロギング対象を修正する場合、ログ設定部51はS3ないしS8を繰り返すことで、デバイスの抽出対象となるプログラム部品および機能の追加や削除を受け付け、ロギング対象リストL0を修正する。たとえば、スキャンタイムの伸びが許容閾値を超えると、いくつかのデバイスが削除される。スキャンタイムの伸びが許容閾値未満であれば、いくつかのデバイスが追加されてもよい。ロギング対象が確定すると、CPU21はS9に進む。   In S8, the log setting unit 51 determines whether or not to set the logging target. For example, when the button for confirming the logging target list L0 is operated, the log setting unit 51 determines to confirm the logging target. On the other hand, when the button for modifying the logging target list L0 is operated, the log setting unit 51 determines to modify the logging target. When correcting the logging target, the log setting unit 51 accepts additions and deletions of program components and functions that are the extraction targets of the device, and corrects the logging target list L0 by repeating S3 to S8. For example, some devices are deleted when the scan time growth exceeds an allowable threshold. Several devices may be added as long as the scan time increase is less than the allowable 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 to transmit the log setting data 72 together with the project data 71 to the basic unit 3.

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

図14はデバイスの抽出処理で使用されるフィルタの設定UI120を示している。PLC1に関連したデバイスとしては複数の種別のデバイスが存在する。ユーザは特定の種別のデバイスに着目し、他の種別のデバイスについては無視したいと考えることもある。そこで、ログ設定部51は、フィルタの設定UI120を表示部7に表示し、抽出対象とするデバイス種別と、除外対象とするデバイス種別とをチェックボックス102を通じて受け付けてもよい。たとえば、デバイス抽出部53は、チェックボックス102にチェックを付与されたデバイス種別をプログラム部品や機能から抽出する。デバイス抽出部53は、チェックボックス102からチェックを外されたデバイス種別をプログラム部品や機能から抽出しない。これにより、ユーザの意図に沿って用意にロギング対象となるデバイスを取捨選択することが可能となる。   FIG. 14 shows a filter setting UI 120 used in the device extraction processing. There are a plurality of types of devices associated with the PLC 1. A user may want to focus on a particular type of device and ignore other types of devices. Therefore, the log setting unit 51 may display the filter setting UI 120 on the display unit 7 and accept the device types to be extracted and the device types to be excluded through the check boxes 102. For example, the device extraction unit 53 extracts the device type whose check box 102 is checked from the program components and functions. The device extraction unit 53 does not extract the device type unchecked from the check box 102 from the program component or function. As a result, it becomes 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, the CPU 21 may execute the device extraction process again when the project data 71 is changed by the project creation unit 50. This is because the description of the device in the user program may be changed. The CPU 21 may execute a device extraction process when the project creation unit 50 transfers the project data 71. Since the project data 71 is finally written in the PLC 1, the number of times the device extraction process is executed may be reduced by executing the device extraction process by using this writing as a trigger.

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

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

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

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

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

009番のステップは、原点復帰が正常に終了した場合に、1秒間だけ待機する処理である。デバイスT0は、設定値として10(100ms単位であるため1秒に相当)、現在のカウント値を有しており、カウント値が設定値になったらONするものである。本ステップからは、MR001,T0の各デバイスが抽出される。   Step 009 is a process of waiting for one second when the origin return is normally completed. The device T0 has a set value of 10 (corresponding to 1 second since it is a unit 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 steps 010 to 011, when the device T0 is turned on, the function block "First_operation" is executed for the unit of unit number 1. Then, the execution result is stored in @ MR002, and the completion code is stored in @ EM1. From this step, the devices @ MR002 and @ EM1 are extracted.

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

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

●ロギングの実行
図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 a hardware circuit such as an ASIC or FPGA. ASIC is an abbreviation for 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 a 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 the device value to the output system 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 the user program. The device value is read 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 extension unit are electrically connected by a unit internal bus, and the unit controller 80b has a function of performing communication control on this unit internal bus, that is, a function as a so-called bus master. When the unit controller 80b functions as a bus master, each expansion unit and refresh unit are refreshed based on the unit configuration information described with reference to FIG. 6, that is, information indicating what unit the entire PLC 1 is composed of. Communicate.

記録部81は、ログ設定データ72にしたがってデバイス部34(基本ユニットデバイス部34a又は拡張ユニットデバイス部34b)からデバイス値を取得したり、拡張ユニット4のバッファメモリからデバイス値を取得したりして、ログデータ73としてメモリ(例えばリングバッファ)に書き込む。上述されたように、記録部81は、END処理の際などに、ロギング処理を実行する。   The recording unit 81 acquires the device value from the device unit 34 (the basic unit device unit 34a or the expansion unit device unit 34b) according to the log setting data 72, or acquires the device value from the buffer memory of the expansion unit 4. , As log data 73 in a memory (for example, a ring buffer). 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. As described with reference to FIGS. 10C and 11, the log setting data 72 includes the device described in the program component designated by the component designation unit 52 and the function designated by the function designation unit 60 (for example, unit monitor). Devices that are assigned to (monitored by) are included as logging targets. For the former device, the log data 73 is written during the END process, while for the latter device, the device value of the target device (UG) is read from the expansion unit 4 during the END process. Write to the 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 significantly shorter than the scan cycle of the ladder program. Therefore, in the present embodiment, since the device value of the UG is read in synchronization with the scan cycle, not all the current coordinates and 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 at the timing of the scan cycle, the plurality of current coordinates and commands stored until then are stored. It is also possible to read the coordinates and the like.

また、記録部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 designated by the logging target list L0 of the log setting data 72, but the detection unit 82 may designate an additional device. The detection unit 82 may detect, for example, rewriting of a device value from an external device for any of the devices included in the device unit 34. In general, the device value may be rewritten according to a 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 rewriting of the device value is detected by the detection unit 82 as a logging target. Generally, rewriting the device value from an external device is likely to cause an unexpected event for the user. Therefore, the recording unit 81 will help the user to improve the program 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 may be issued regardless of the user program. UG is a device type indicating a buffer memory. The detection unit 82 may detect a UG read command issued regardless of the user program. The recording unit 81 may specify the buffer memory that is the target of the UG read command detected by the detection unit 82 and add the specified buffer memory as a recording target. When the extension unit 4 is a motion unit, such a buffer memory stores the torque value, the current coordinate position, and the like.

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

検知部82は実行部80に設けられてもよい。この場合、実行部80は、デバイス部34の特定のデバイスに対してデバイス値を書き込むとともに、このデバイス値とデバイス名(デバイス番号)をログデータ73に書き込んでもよい。この手法は、ユーザプログラムに記述されていないデバイスであって、動的に割り付け割れるデバイスを記録対象として追加する際に有用であろう。   The detection unit 82 may be provided in the execution unit 80. In this case, the execution unit 80 may write the device value to the specific device of the device unit 34 and write the device value and the device name (device number) to the log data 73. This method may be useful when adding a device which is not described in the user program and which is dynamically allocated and 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 devices in the device unit 34. Since the detection unit 82 monitors the device, the detection unit 82 detects that the execution unit 80 has read the device value, and transmits the information (address information) of the device whose device value has been read to the recording unit 81. The recording unit 81 reads the 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 the device values in the log data 73. After that, each 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 in the log data 73 every scan cycle or every predetermined collection cycle. For example, even if the detection unit 82 detects multiple accesses to the device within one cycle, the recording unit 81 may write the log data 73 with only the device value when the last access was detected. As a result, the data size of the log data 73 can be reduced.

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

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

検知部82は実行部80による拡張ユニット4のバッファメモリへのアクセスを検知してもよい。この場合、実行部80は、拡張ユニット4のバッファメモリから読み出したデバイス値を記憶装置32内に確保されたバッファ等に書き込む。記録部81はバッファからデバイス値を読み出してログデータ73に書き込む。   The detection unit 82 may detect access by the execution unit 80 to the buffer memory of the expansion unit 4. In this case, the execution unit 80 writes the device value read from the buffer memory of the expansion unit 4 in 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 in 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 an instruction word for rewriting the device value, the execution unit 80 outputs the device value together with the instruction word to the recording unit 81. The recording unit 81 may write the command word, the device value, and the time stamp (time when the device value 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 of the log data 73 (eg, binary format or text format). As the data format, decimal number 16 bits, decimal number 32 bits, ± decimal number 16 bits, ± decimal number 32 bits, hexadecimal number 16 bits, hexadecimal number 32 bits, character string, Float, DoubleFloat, etc. are set for each device. May be done. Such a data format can be determined by analyzing the command 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 predetermined output conditions are 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 on the card 36. The log data 73 is recorded in the memory (for example, a ring buffer) until a predetermined output condition is satisfied, and when the capacity is full, the oldest log data 73 is deleted and new log data 73 is additionally recorded. (Record in the so-called FIFO format). The memory card 36 is removed from the basic unit 3 and mounted in 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 send the log data 73 to the PC 2 or the cloud 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 the 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 stored in a non-volatile memory such as a hard disk). Further, at least the log data 73 needs to be stored in the memory card 36 or the internal memory 37 when the predetermined output condition is satisfied, while the project data 71 is stored when the predetermined output condition is satisfied. Not limited to For example, it may be stored in advance in the memory card 36 or the internal memory 37 at the timing when the PLC 1 changes from the setting mode (PROGRAM mode) to the operation mode (RUN mode).

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

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

図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 out the device value designated by the log setting data 72 from the device unit out of the device values held in the device unit 34, and from the time management unit 83a. Get time information. The collection unit 92a stores the device value and the time information in the ring buffer 91a in association with each other. The collection unit 92a acquires the device value and time information for each collection cycle (eg, scan cycle) designated by the log setting data 72 and stores the device value and time information in the ring buffer 91a. The reason why the ring buffer 91a is used 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 the log data 73 in the memory card 36 when a predetermined storage condition is satisfied. Similarly, the storage unit 93 may read large-capacity data and time information from the expansion unit 4, create log data 73, and store the log data 73 in the memory card 36 when a predetermined storage condition is satisfied. The storage unit 93 stores the device value and time information described above and the large-capacity data and time information described above in association with each other. Here, the “corresponding” storage may be stored as long as it can be easily reproduced 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 (directory path) to the specific folder becomes a common flag, and this common flag can be used to save the files in the first subfolder and the files in the second subfolder in “association”. It will be possible. When there is another folder placed at the same level (directory) as the above-mentioned specific folder, the another folder means a data package saved at another timing. Of course, subfolders similar to the 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 the common flag (predetermined directory path). , These multiple files may be saved. In addition, for example, by adopting a file name as the common flag and generating a file having the same or a corresponding file name, it is possible to save the files “in association with each other”. Alternatively, for example, by using the time information as a key, a device value and data (large-capacity data) are associated with each other and listed, and these can be stored in one file to be “associated with” and stored. . 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 PC 2 or the cloud. When the ring buffer 91a becomes full, the collection unit 92a overwrites the oldest information held in the ring buffer 91a with the newest information.

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

図20はカメラ入力機能を有した拡張ユニット4のCPU41の機能を説明する図である。時刻管理部83bの時計は、基本ユニット3の時刻管理部83aの時計と同期している。たとえば、時刻管理部83aは、END処理の際に時刻情報を時刻管理部83bに送信する。時刻管理部83bは、受信した時刻情報に基づき、時刻管理部83bの時計を時刻管理部83aの時計に同期させる。時計は、時刻情報に基づき時間をカウントするカウンタにより実現されてもよい。収集部92bは、所定の収集条件(例:所定のリレーデバイスがオンになったこと)が満たされると、例えば周期的にトリガー信号を出力する。時刻管理部83bはトリガー信号が入力されたときの時刻情報を時計から取得し、時刻情報バッファ95に格納する。メモリ42は時刻情報バッファ95とリングバッファ91aを有している。接続ポート97はカメラ98を拡張ユニット4に接続するためのインタフェースである。接続ポート97は、収集部92bにより発行されたトリガー信号をカメラ98に周期的に出力したり、カメラ98が出力する画像データを画像受信部96aに出力したりする。画像データは大容量データの一例である。接続ポート97は、カメラ98等の監視機器と接続され、その監視機器からデータ(画像データ)が入力される第二の外部インタフェースの一例である。画像受信部96aは、接続ポート97を介してカメラ98からの画像データの入力を伴う撮像機能を実行する機能実行部96の全部又は一部となる。本実施形態では、機能実行部96(画像受信部96a)は、露光時間、ゲイン、ホワイトバランス、コントラストなどの撮像パラメータ(設定情報の一例)に基づいて、カメラ98の制御を実行する。このような撮像パラメータは、PC2において、所望のパラメータ値が設定され、図4に示す基本ユニット3の通信部33及びCPU31を介して、機能実行部96に送られる。そのため、図4に示す通信部33は、PC2や表示器などの外部設定機器から設定情報を受け付ける第一の外部インタフェースの一例である。なお、第一の外部インタフェースとしての通信部33は、上述したようにPC2にて作成されたユーザプログラムも受け付ける。カメラ98は、トリガー信号にしたがって撮像を実行し、画像データを出力する。画像受信部96aは、画像データを収集部92bに転送する。収集部92bは、時刻情報バッファ95に保持されている時刻情報と、画像受信部96aから出力された画像データとを関連付けてリングバッファ91aに格納する。リングバッファ91bが満杯になると、収集部92bは、リングバッファ91bに保持されている最も古い情報に対して、最も新しい情報を上書きする。なお、本実施形態では、収集部92bが自動的かつ周期的に撮像トリガー信号をカメラ98に出力することとしたが、本発明はこれに限られず、収集部92bは、例えばユーザプログラムからの指令に基づいて撮像トリガー信号をカメラ98に出力してもよい。   FIG. 20 is a diagram for explaining the function of the CPU 41 of the expansion unit 4 having a 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 time based on time information. When a predetermined collection condition (for example, 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. The 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 surveillance device such as the camera 98 and receives data (image data) from the surveillance device. The image receiving unit 96a is the whole or a part of the function executing unit 96 that executes an imaging function that involves inputting image data from the camera 98 via the connection port 97. In the present embodiment, the function execution unit 96 (image reception unit 96a) executes control of the camera 98 based on imaging parameters (an example of setting information) such as exposure time, gain, white balance, and contrast. A desired parameter value is set in the PC 2 as such an imaging parameter, and is sent to the function executing unit 96 via the communication unit 33 and the CPU 31 of the basic unit 3 shown in FIG. Therefore, the communication unit 33 illustrated in FIG. 4 is an example of a first external interface that receives setting information from an external setting device such as the PC 2 or a display device. The communication unit 33 as the first external interface also receives 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 collection unit 92b stores the time information held in the time information buffer 95 and the image data output from the image reception unit 96a in the ring buffer 91a in association with each other. When the ring buffer 91b becomes full, the collection unit 92b overwrites the oldest information held in the ring buffer 91b with the newest information. Note that in the present embodiment, the collection unit 92b automatically and periodically outputs the imaging trigger signal to the camera 98, but the present invention is not limited to this, and the collection unit 92b issues a command from a user program, for example. The imaging 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 using any one of refresh communication executed for each scan, direct communication that can be executed at any time, and message communication executed on an event basis. The storage unit 93 reads the image data and the time information from the ring buffer 91b of the expansion unit 4 by using direct communication, for example, and additionally writes them to the log data 73. Note that a plurality of direct communications with priorities may be implemented as the direct communications. In this case, the priority of the direct communication executed in association with 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 influence of logging on the execution of the user program.

<リングバッファを用いたロギング>
図21は基本ユニット3のリングバッファ91aに保持されたデバイス値と時刻情報とを示している。一つのレコードは、取得されたデバイス値と、このデバイス値が取得された時刻を示す時刻情報とを有している。
<Logging using the ring buffer>
FIG. 21 shows the device value and 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 this device value was acquired.

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

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

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

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

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

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

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

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

S28で(収集部92a)は、終了条件が満たされたかどうかを判定する。終了条件は、ロギングの終了条件である。終了条件もログ設定データ72により定義されていてもよい。終了条件が満たされていなければ、CPU31はS23に戻る。終了条件が満たされていれば、CPU31はロギング処理を終了する。   In S28, the (collection unit 92a) determines whether or not the end condition is satisfied. The end condition is a logging end condition. The end condition may also be defined by the log setting data 72. If the ending 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 (collection unit 92b) determines whether or not an image data acquisition condition (for example, the acquisition relay is turned on) is satisfied. When the acquisition relay is turned on, the CPU 41 proceeds to S32. In this embodiment, when the acquisition relay is turned on, it is determined that the image data acquisition condition is satisfied, but this is merely an example. Alternatively, for example, it may be determined that the image data acquisition condition is satisfied when the mode of the PLC 1 is switched to the operation mode. More specifically, the PLC 1 is provided with a mode changeover switch that switches between a setting mode (program mode) for performing various settings and an operation mode (RUN mode) in which the ladder program is repeatedly executed to perform actual operation. You may be asked. In this case, when the mode switch is switched from the program mode to the RUN mode by the user, it may be determined that the image data acquisition condition is satisfied.

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

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

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

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

S36でCPU41(収集部92b)は、終了条件が満たされたかどうかを判定する。たとえば、収集部92bは取得リレーがOFFになったかどうかを判定する。終了条件が満たされていなければ、CPU41はS32に戻る。終了条件が満たされていれば、CPU41はロギング処理を終了する。   In S36, the CPU 41 (collection unit 92b) determines whether the ending condition is satisfied. For example, the collection unit 92b determines whether the acquisition relay has been turned off. If the ending 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 a connection form of a building block type PLC 1. On the right side surface of the basic unit 3, an IF 99a for connecting and communicating with the expansion unit 4 is provided. 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 IF 99a of the basic unit 3 is connected to the IF 99b 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 IF 99c of the expansion unit 4a is connected to the IF 99d 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, the IFs 99a 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 PLC 1, the side surface of each unit serves as a connection surface (connection surface). An IF 99 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 a connection form of the PLC 1 having the backplane 200. The backplane 200 is connected to the bottom surface of the base unit 3 and the bottom surface of the expansion unit 4, or is connected to the back surface of the base unit 3 and the back surface of the expansion unit 4. The backplane 200 functions as a support plate (base plate) that supports the basic unit 3 and the expansion unit 4. Here, the back surface is described as the connection surface as an example. The back surface of the basic unit 3 faces the front surface of the backplane 200. Therefore, the IF 99f provided on the back surface of the basic unit 3 is connected to the IF 99g provided on the front surface of the backplane 200. The rear surface of the expansion unit 4 faces the front surface of the backplane 200. The IF 99h provided on the back surface of the expansion unit 4a is connected to the IF 99i 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. The backplane 200 may also include the CPU 211 and the memory 212. The memory 212 may include the memory card 36 in addition to the RAM and the ROM. In this case, the CPU 211 may function as the collection unit 92a or the storage unit 93. Further, the memory 212 may be provided with a ring buffer 91a. Alternatively, the CPU 211 may include the time management unit 83b and the collection unit 92. In this case, the memory 212 has the ring buffer 91b.

<ログの表示例>
図26はログデータ73の一例を示している。この例では、デバイス値d1〜d10と、カメラ98aにより取得されたワーク画像i1〜i3と、カメラ98bにより取得された他の画像j1〜j3の取得タイミングが示されている。デバイス値d1〜d10はスキャン周期ごとに取得されている。ワーク画像i1〜i3はトリガー信号が発生したタイミングに取得されている。ワーク画像j1〜j3はトリガー信号が発生したタイミングに取得されている。各データの位置はそれぞれの時刻情報を示している。図26が示すように、各データの取得時刻や取得周期は一致していない。そのため、ログ表示部61は、各データの時刻情報に基づき各データの表示タイミングを調整する。
<Log display example>
FIG. 26 shows an example of the log data 73. In this example, the acquisition timings of the device values d1 to d10, the work images i1 to i3 acquired by the camera 98a, and 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 the time information of each. 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 continuation time 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 time of the device value d1. The log display unit 61 starts displaying the device value d2 when the display duration time has elapsed after starting displaying the device value d1. Thereafter, the display duration is similarly obtained, 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 times of the device values d1 to d10 to obtain the acquisition time of the device value dx that is closest to the acquisition time of the work image i1. In this example, the time closest to the 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 displaying the work image i1. Next, the log display unit 61 obtains the acquisition time of the device value dx that is closest to the acquisition time of the work image i2. In this example, the acquisition time of the device value d4 is the 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 that is closest to the acquisition time of the other image j1. In this example, the acquisition time of the device value d2 is closest to the acquisition time of the other image j1. Therefore, when the display timing of the device value d2 arrives, the log display unit 61 starts displaying the device value d2 and also starts displaying another image j1.

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

図28はログデータ73の表示方法を説明する図である。この例では、デバイス値dxとしてリレーデバイスR000とデータメモリDM100が取得されている(xは1から10までの値をとる)。このように、一つのワーク画像ixに対して複数のデバイス値が時刻情報にしたがって紐付けられる。ログ表示部61は、デバイス値dx、ワーク画像ix、他の画像jxを一つのウインドウ内に表示してもよいし、それぞれ個別のウインドウに表示してもよい。また、ログ表示部61は、プロジェクトデータ71からユーザプログラムを読み出し、ユーザプログラムに対してデバイス値dxをマッピングして表示してもよい。たとえば、ログ表示部61は、表示対象のデバイス値dxに関連する命令語を含むステップを検索し、見つかったステップを表示するとともに、当該ステップにおける命令語の下にデバイス値を表示してもよい。なお、表示対象デバイスがリレーデバイスであることもある。ログ表示部61は、リレーデバイスのオン/オフに応じて命令語の表示色またはアイコン画像(例:矢印)を変更してもよい。アイコン画像としてはオンを示すものと、オフを示すものとがある。また、ログ表示部61はデバイス値をグラフ化して表示してもよい。この場合に、ログ表示部61は、一つのウインドウにデバイス値d1〜d10を常に表示し、他のウインドウにワーク画像を表示する。ログ表示部61は、時間の経過とともにワーク画像を切り替える。ここで、ログ表示部61は時間軸方向に移動可能なバー103を表示してもよい。バー103はタイムラインバーと呼ばれてもよい。ログ表示部61は、時間の経過とともに左から右へ移動するようにバー103を表示してもよい。バー103はユーザによって移動されてもよい。この場合、ログ表示部61は操作部8を通じてバー103の移動操作(例:ポインタ101によるドラッグ操作)を受け付け、移動操作に応じて表示時刻を更新する。ログ表示部61はバー103により指定された表示時刻に対して取得時刻が最も近いデバイス値、ワーク画像および他の画像をログデータ73から抽出し、表示部7に表示してもよい。   FIG. 28 is a diagram illustrating a method of displaying 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 them in individual windows. 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 device value dx. For example, the log display unit 61 may search for a step including an instruction word related to the device value dx to be displayed, display the found step, and display the device value below the instruction 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 command word or the icon image (eg, arrow) according to ON / OFF of the relay device. There are two types of icon images, one indicating on and the other indicating off. Further, the log display unit 61 may display the device values in a graph. In this case, the log display unit 61 always displays the device values d1 to d10 in one window and the work image in another window. The log display unit 61 switches work images as time passes. Here, the log display unit 61 may display the bar 103 movable 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 over time. The bar 103 may be moved by the user. In this case, the log display unit 61 accepts a moving operation of the bar 103 (eg, a drag operation with the pointer 101) through the operation unit 8 and updates the display time according to the moving operation. The log display unit 61 may extract, from the log data 73, the device value, the work image, and the other image whose acquisition time is closest to the display time designated by the bar 103, and display the extracted device value 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 imaging function of the camera 98 is illustrated as the function of the function execution unit 96. The present invention is not limited to this, and the function executing unit 96 may have a motion function or a communication function. First, the former motion function will be described in detail. A case where a motion unit is connected to the basic unit 3 as the expansion unit 4 will be considered. In this case, in the PC 2, a program (motion flow program) that defines the operation of the motion unit and parameters (setting parameters for axis configuration and axis control, etc.) are set, and so-called setting information is created. Then, the setting information is sent to the function executing 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 speeds to an externally connected motor amplifier according to the setting information. Motion data such as current coordinates and current speed is received from the motor amplifier via the encoder. The control cycle for receiving the motion data such as the current coordinates and the current speed is shorter than the scan cycle of the ladder program and asynchronous with the scan cycle of the ladder program. Therefore, the collection unit of the motion unit collects the motion data at a predetermined cycle and stores the information about the reception time when the motion data is received and the motion data in the ring buffer 91b in association with each other. Then, at the save timing (similar to step S25 in FIG. 22), the motion data (current coordinates, current velocity, etc.) and time information are acquired from the ring buffer 91b, as in the process described with reference to FIG. Append to log data. This makes it possible to easily specify which device value is associated with which motion data. On the other hand, the latter communication control will be described in detail. Consider the case where a communication unit is connected as the expansion unit 4 to the basic unit 3. In this case, a program (communication flow program) and parameters (communication cycle, transfer rate, etc.) that define the operation of the communication unit are set in the PC 2, and setting information is created. Then, similarly to the motion control described above, the setting information is reflected in the communication unit via the communication 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 (a plurality of photoelectric sensors connected to each other) connected to the outside according to the setting information. The reception cycle (cyclic communication cycle) of such communication data is asynchronous with the scan cycle of the ladder program. When the number of sensors forming the sensor group is large, the communication data itself may form a large amount of data. The collection unit of the communication unit collects communication data in a predetermined cycle (so-called cyclic communication cycle), and stores information about the reception time when the communication data is received and the communication data in the ring buffer 91b in association with each other. After that, similar to the processing described with reference to FIG. 22, at the save timing (similar to step S25 in FIG. 22), communication data (sensor value, etc.) and time information are acquired from the ring buffer 91b, and the log data is acquired. 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 a UI 160 for setting the collection period. The UI 160, the UI 110, and the UI 100 may be switched by selecting the corresponding tabs with the pointer 101. The UI 160 has a pull-down menu 161 for designating a collection method. The collection method is a method of collecting the log data 73. In this example, a collection method called before and after a save trigger and a collection method called a start relay are described. Before and after the storage trigger is a method of collecting the log data 73 at a collection time Ta before the timing at which the storage trigger is turned on and at a collection time Tb after the timing at which the storage trigger is turned on. The text box 162 receives the input of the collection time T. The collection time T is a total value of the collection time Ta and the collection time Tb. The text box 163 receives the input of the collection time Tb after the trigger. The save trigger setting unit 164 receives settings of a device name of a relay device used as a save trigger and a condition (eg, switching from off to on). The up arrow means that the relay device designated as the save trigger has switched from off to on. The 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-described information on the device size and the increase in 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 storage trigger, the ring buffer 91 always stores device values and image data. When the relay device R200, which is the save trigger, is turned on, the save unit 93 creates the log data 73 of 20 seconds designated as the collection time. The storage unit 93 reads data recorded 18 seconds before the timing at which the relay device R200 is turned on from the ring buffer 91 from the data recorded 2 seconds after the timing, and creates the log data 73. .

図30は収集期間を設定するためのUI160を示している。この例ではポインタ101によってプルダウンメニュー161から収集方法として開始リレーが選択されている。ログ設定部51は、ユーザにより選択された収集方法にしたがってUI160を変更する。テキストボックス166は開始リレーとして使用されるリレーデバイスのデバイス名を受け付ける。ガイダンス部165が示すように、開始リレーと呼ばれる収集方法では、開始リレーがオンになったタイミングが収集時間の起点(開始点)となる。たとえば、製造ラインを流れてくる1個のワークをプレス処理するのに30秒かかると仮定する。また、トラブルが発生しうる時間は、30秒間の処理時間のうち最初の20秒間であると仮定する。リレーデバイスR000はプレス処理を開始するタイミングを規定するリレーである。収集部92は、リレーデバイスR000がオンになると、20秒間にわたりデバイス値や画像データをリングバッファ91に格納する。次のワークが到着することで、リレーデバイスR000が再びオンになると、収集部92は、20秒間にわたりデバイス値や画像データをリングバッファ91に格納する。保存トリガーであるリレーデバイスR200がオンになると、保存部93は、リングバッファ91に格納されている最新の20秒間にわたるデバイス値や画像データを取得してログデータ73を作成する。保存トリガーであるリレーデバイスR200は、トラブルが発生したときにオンとなるリレーデバイスである。   FIG. 30 shows a UI 160 for setting the collection period. In this example, the start relay is selected as the collection method from the pull-down menu 161 by the pointer 101. The log setting unit 51 changes the UI 160 according to the collection method selected by the user. The text box 166 receives the device name of the relay device used as the start relay. As shown by the guidance unit 165, in the collection method called a start relay, the timing when the start relay is turned on is the start point (start point) of the collection time. For example, assume that it takes 30 seconds to press a single work piece flowing through the manufacturing line. Further, it is assumed that the time in which a trouble may occur is the first 20 seconds of the processing time of 30 seconds. The relay device R000 is a relay that defines the timing to start the pressing process. When the relay device R000 is turned on, the collection 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 collection 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 save trigger, is turned on, the save unit 93 acquires the latest device value and image data stored in the ring buffer 91 for 20 seconds 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はユーザにより実行されるユーザプログラムのデバッグ処理の概要を示すフローチャートである。
<Debug>
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 to create a user program composed of a plurality of program parts, and create project data 71 including the user program. The program creating unit 63 creates a user program according to a 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 perform an operation on the project data 71 or the user program to obtain a hash value or an error detection code, and add these to the project data 71 as identification information. The identification information may be a GUID (globally unique identifier) or the like.

S42でユーザはPC2を操作し、プロジェクトデータ71をPLC1に転送する。プロジェクト作成部50はプロジェクトデータ71を記憶装置22から読み出し、通信部23を介してPLC1へ送信する。PLC1の基本ユニット3はプロジェクトデータ71を受信すると、記憶装置32に書き込む。   In S42, the user operates the 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 sends it to the PLC 1 via the communication unit 23. Upon receiving the project data 71, the basic unit 3 of the PLC 1 writes the project data 71 in 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 change switch for switching from the PROGRAM mode to the RUN mode) to instruct 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 unit 84 stores the device value recorded in the ring buffer 91a and the image data described above in the memory card 36 or the internal memory 37. , Log data 73 is created.

また、保存部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. This allows the PC 2 to reproduce the movement at the time of the trouble 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と一致するか否かを検証できるようになる。詳細については後述する。   In addition to the project data 71, the storage unit 93 also stores identification information (hash value or the like) of the project data 71 in the memory. As a result, the PC 2 can use the identification information to verify whether or not the current project data (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 saved in the memory in addition to the log data 73 at the timing when the predetermined output condition is satisfied, but the present invention is not limited to this. . For example, the project data 71 and its identification information are stored in a memory before the operation of the PLC 1 is started, at the time of the operation is started, or during operation, and only the log data 73 is stored in the memory when a predetermined output condition is satisfied. It may be saved. In short, when the predetermined output condition is satisfied, the log data 73, the project data 71, and the identification information thereof may be stored in the memory in a state of being associated with each other.

また、本実施形態では、プロジェクトデータ71をメモリに保存しているが、本発明はこれに限られず、例えば、プロジェクトデータ71に代えて、プロジェクトデータ71の識別情報のみをメモリに保存するようにしてもよい。この場合、PC2における現在のプロジェクトデータは、実際のトラブル発生時のプロジェクトデータ71と一致することを前提としている。すなわち、プロジェクトデータをPLC1に転送した後、現在のプロジェクトデータは編集・改変されていないことを前提としている。仮に、両データが不一致と判定された場合には、ユーザは、現在のプロジェクトデータが、実際のトラブル発生時のプロジェクトデータ71とは異なることを認識した上でリプレイを行えばよいので、ユーザがこれを認識しない状態でリプレイ(不正確なトラブルシューティング)が行われるのを防ぐことができる。   Further, although the project data 71 is stored in the memory in the present embodiment, 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. May be. In this case, it is assumed that the current project data in the PC 2 matches the project data 71 when the actual trouble occurred. That is, it is assumed that the current project data has not been edited or modified after the project data has been transferred to the PLC 1. If it is determined that the two data do not match, the user may perform the replay after recognizing that the current project data is different from the project data 71 at the time when the actual trouble occurs. 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 to instruct 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 PC 2. 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 (using a hash function, for example) on the project data 71 or the user program at a timing when a predetermined condition for writing to the memory card 36 is satisfied, and outputs a hash value or an error detection code. May be obtained and added to the log data 73 as identification information. Any rule may be adopted as long as the identification information creation rule executed by the PC 2 and the identification information creation rule executed by the basic unit 3 match.

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

ここで注意すべき点としては、ログデータ73を取得するために使用されたプロジェクトデータ71のバージョンと、PC2に保持されているプロジェクトデータ71のバージョンとが異なることがある。この場合、デバイス値をユーザプログラムに関連付けて表示することが不可能となるか、または、ユーザプログラムとデバイス値との関連付が誤ってしまうことも考えられる。この場合、ログ表示部61は、プロジェクトデータの識別情報を使って、ログデータ73を取得するために使用されたプロジェクトデータ71のバージョンと、PC2に保持されているプロジェクトデータ71のバージョンとが異なることを示す警告を表示部7に表示してもよい。なお、ログ表示部61は、第一のバージョンのプロジェクトデータ71を使用して取得されたログデータ73を、PC2に保持されている第2のバージョンのプロジェクトデータ71に関連付けて表示するかどうかをユーザに問い合わせもよい。ユーザがこのような表示を希望する場合、ログ表示部61は、第一のバージョンのプロジェクトデータ71を使用して取得されたログデータ73を、PC2に保持されている第2のバージョンのプロジェクトデータ71に関連付けて表示部7に表示する。なお、バージョンは識別情報によって管理される。ユーザがログデータ73に問題がないことを確認すると、デバッグは不要であり、後続のS46やS47も不要である。ユーザはログデータ73を分析し、ユーザプログラムのバグなどを発見し、ユーザプログラムを修正する。プロジェクト作成部50はユーザ入力にしたがってプロジェクトデータ71を修正(更新)し、記憶装置22に格納する。   It should be noted here that the version of the project data 71 used to acquire the log data 73 and the version of the project data 71 held in the PC 2 may be different. In this case, it may be impossible to display the device value in association with the user program, or the user program may be erroneously associated with the device value. 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 to display the log data 73 acquired using the first version of the project data 71 in association with the second version of the project data 71 stored in the PC 2. You may contact the user. When the user desires such a display, the log display unit 61 uses the log data 73 acquired by using the project data 71 of the first version as the project data of the second version 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 the log data 73 has no problem, debugging is not necessary 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. The identification information is updated when the user program in the project data 71 is changed. As a result, the project data 71 before correction and the project data 71 after correction 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, thereby verifying the project data 71. The execution unit 80 executes the user program included in the project data 71. If the PLC 1 is operating as expected by the user, the user determines that the project data 71 has been debugged successfully. If the PLC 1 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 debugging efficiency 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 in 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 in 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 the output unit 84 mounted on the basic unit 3. The output unit 84 may transfer the project data 71 used when acquiring the log data 73 to the PC 2 in addition to the log data 73. However, in order to prevent information leakage of the project data 71, an access right (protection) that prohibits 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 the output of the project data 71 is prohibited. When the output of the project data 71 is prohibited, the output unit 84 outputs the log data 73 but does not output the project data 71. On the other hand, when the output of the project data 71 is not prohibited, the output unit 84 outputs the log data 73 and the project data 71. When the output of the project data 71 is prohibited, the addition unit 302 may output the identification information of the project data 71 held in the storage device 32 together with the log data 73. This identification information may be a part of the project data 71, or the identification information may be obtained by the computing unit 303 performing a predetermined computation on the project data 71 or the user program. The predetermined calculation may be, for example, a hash calculation or an error detection code calculation. 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 the PC 2 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 section 50>
FIG. 33 shows the details of the project creation section 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 content. The setting of the function of the basic unit 3 includes the setting of the IP address, the setting related to the FTP client, the setting of the access right of the project data 71, and the like. The setting of the function of the expansion unit 4 includes the setting of the input channel and the setting related to the 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 a user program editing UI on the display unit 7, and edits the user program based on the information input from the operation unit 8. The debug unit 314 uses the project data 71 to debug the user program. The adding unit 312 adds identification information to the project data 71. The calculation unit 313 calculates identification information (eg, hash value or error detection code). The output unit 84 may perform the same function as the calculation (calculation) function of the identification information by the calculation unit 313.

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

図35Bにおいて、左欄のプロジェクト表示領域420には、プロジェクトデータ71を構成する様々な情報が表示されている。上から順に、ユニット構成(基本ユニット、モーションユニット、アナログ入力ユニット、カメラユニット)、プログラム構成(毎スキャンモジュール、定周期モジュール、ユニット間同期モジュール、ファンクションブロック、マクロ)が表示されている。モーションユニットについては、機能設定として軸構成や軸制御の設定パラメータが表示されている。ユーザは、図35Bに示すGUI上において、軸構成や軸制御をダブルクリックすることで、これらの設定パラメータについて、どのような設定内容になっているかを確認することができる。また、プロジェクト表示領域420において、毎スキャンモジュールに対してMainとSubが表示されているところ、ユーザがMainをクリックすると、中央のラダーモニタ450のプログラム表示領域410に、Mainプログラムが表示される。このように、図34に示すプログラム表示モジュール321は、メモリカード36からプロジェクトデータ71を読み出して、プロジェクト表示領域420に各種情報を表示したり、プログラム表示領域410に所望プログラムを表示したりする。   In FIG. 35B, in the project display area 420 in the left column, various information that constitutes the project data 71 is displayed. In order from the top, the unit configuration (basic unit, motion unit, analog input unit, camera unit) and program configuration (each scan module, fixed period 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. The user can double-click the axis configuration and the axis control on the GUI shown in FIG. 35B to check what the setting contents are for these setting parameters. Further, when Main and Sub are displayed for each scan module in the project display area 420, 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 cross 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. 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 designated by the time designation cursor 404 (more details will be described using FIG. 38 described later).

図35Bでいえば、時刻表示領域409に表示されている20XX/10/01の18:52:54と対応付けられたデバイス値が、Mainプログラムに記述されているデバイスと関連付けて表示される。この日付の右側に表示された[35000/74286]は、全スキャン回数74286に対する現在のスキャン回数35000を示している。ユーザは、時刻指定カーソル404をドラッグして移動させることで、表示時刻及びスキャン回数の更新とともに、デバイス値の表示も更新される。例えば、更新後の表示時刻において、ONしているリレーデバイスの箇所にはON表示(例えば色で塗潰す等)がなされ、OFFしているリレーデバイスの箇所にはOFF表示(例えば色抜き等)がなされる。再生ボタン406の機能等の詳細については、図38を用いて後述する。   In FIG. 35B, the device value associated with 18:52:54 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 35000 with respect to 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 the display of the device value is also updated. For example, at the display time after the update, the ON display (for example, paint with a color) is performed on the relay device that is ON, and the OFF display (for example, color removal) is displayed on the relay device that is OFF. Is done. Details of the function of the play button 406 will be described later with reference to FIG.

図35Bにおいて、右上欄には、カメラモニタ430の画像表示領域が設けられている。画像表示モジュール323は、プログラム表示モジュール321によってラダーモニタ450に表示された表示時刻と同期して、ログデータ73から画像データを読み出してカメラモニタ430の画像表示領域に表示する。図35Bでは、表示時刻である20XX/10/01の18:52:54と対応付けられた画像データが、カメラモニタ430に表示されている。また、この表示時刻の右側には、282/601と表示されているが、これは、全撮像枚数601に対する現在の画像データの順番(282枚目)を表している。ユーザは、カメラモニタ430において、時刻指定カーソル404aをドラッグして移動させることで、表示時刻及び現在の画像データの順番を更新させることができる。   In FIG. 35B, the image display area of the camera monitor 430 is provided in the upper right column. The image display module 323 reads the image data from the log data 73 and displays it in the image display area of the camera monitor 430 in synchronization with the display time displayed on the ladder monitor 450 by the program display module 321. In FIG. 35B, image data associated with 18:52:54 of 20XX / 10/01, which is the display time, is displayed on the camera monitor 430. Further, 282/601 is displayed on the right side of the display time, which represents the current order of image data (the 282nd image) with respect to the total number of captured images 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, with the movement of the time designation cursor 404a, the time designation cursor 404 on the ladder monitor 450 described above also moves in conjunction with it. For example, when the time designation cursor 404a is aligned with the display time 20XX / 10/01 at 19:00:00, the time designation cursor 404 on the ladder monitor 450 is also displayed at the display time 20XX / 10/01 at 19:00: It follows the position of 00 and moves. Then, with the movement of the time designation cursor 404, the device value in 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 also moves accordingly. Such a processing operation is possible because the program display module 321 and the image display module 323 execute the 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に表示される。   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 currently reproduced from the reproduction control module 324, it reads the device value associated with that time from the memory card 36, and It is displayed on the 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 schematically showing a data source for displaying a GUI in the log reproduction mode. As shown in FIG. 35C, the project display area 420 reads out the unit configuration, function settings, program configuration, and program components 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), the program component from the memory, displays the program component designated 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 function. For example, when there are multiple ports, port number, imaging cycle, gain setting, etc.). The image data corresponding to the display time is read from the data 73 and displayed. The unit monitor 440 uses the log data 73 to display a device value corresponding to the display time, based on information such as the unit configuration (what kind of unit exists) and the function setting (in the case of a motion unit, axis configuration, axis control, etc.) Is read out and displayed.

図35Bや図35Cから分かるように、再生制御モジュール324の機能によって、プログラム表示モジュール321、画像表示モジュール323、ユニット表示モジュール325を同期制御して、連携させることができる。なお、波形表示モジュール322の連携の詳細については後述する。   As can be seen from FIGS. 35B and 35C, the program display module 321, the image display module 323, and the unit display module 325 can be synchronously controlled by the function of the reproduction control module 324 to be linked with each other. 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 when an actual trouble occurs. More specifically, the collating unit 334 of the program display module 321 shown in FIG. 35 uses 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. It collates with the identification information of the (user program) and outputs the collation result to the warning unit 335. The warning unit 335 does not match 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. If so, a warning is displayed on the display unit 7.

例えば、警告部335は、図35Dに示すような警告画面470を表示部7に表示させる。具体例を挙げると、運転記録を保存した時のプロジェクトデータ71の識別情報と、現在の(リプレイ対象にしようとしている)プロジェクトデータの識別情報とは、不一致であると仮定する。例えば、プロジェクトデータをPLC1に転送した後、ユーザがそのプロジェクトデータ(プログラムや機能設定など)を編集したような場合である。この場合に、ユーザ操作に基づいて、リアルタイム再生モードからログ再生モードに移行したとき、図35Dに示す警告画面470が表示される。   For example, the warning unit 335 causes the display unit 7 to display a warning screen 470 as shown in FIG. 35D. As 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, this is a case where the user edits the project data (program, function setting, etc.) after transferring the project data to the PLC 1. In this case, when the real-time reproduction mode is switched to the log reproduction mode based on the user operation, a 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 allowed to select whether to use the current project data as it is to perform log reproduction or to use the project of the operation record to perform log reproduction. In the former case, the user recognizes that the current project data is different from the project data 71 at the time when the actual trouble occurred, and then performs the log reproduction. On the other hand, in the latter case, for example, the user performs the log reproduction by using the project of the operation record by designating the path (folder or directory) in the storage device 22 in which the project of the operation record is stored. be able to.

なお、本実施形態では、2つのプロジェクトデータの識別情報を比較して、一致・不一致を検証することとした。より詳細には、プロジェクトデータに含まれるプログラム構成、複数のプログラム部品、ユニット構成、ユニット毎に機能設定に対し、それぞれ識別情報が付加されており、それら全てが一致するか否かにより検証することとした。しかし、本発明はこれに限られず、少なくとも、複数のプログラム部品から構成されるユーザプログラムの識別情報を比較して、一致・不一致を検証すればよい。   In the present embodiment, the identification information of the two project data is compared to verify the match / mismatch. More specifically, the identification information is added to the program configuration, multiple program parts, unit configuration, and function settings for each unit included in the project data, and verify by checking if they all match. And However, the present invention is not limited to this, and at least the identification information of the user program including 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 (for example, a slide bar) 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 from the reproduction control module 324. However, the time UI 330b receives the operation of the bar 103 through the operation unit 8 and passes the operation amount of the bar 103 to the reproduction control module 324 through the display time control unit 331b. The display time control unit 331b sends the display time designated by the time UI330b to the reproduction control module 324, or sets the display time notified from the reproduction control module 324 to the time UI330b. The device value acquisition unit 333b has a real-time reproduction mode and a log reproduction mode. In the real-time reproduction mode, the device value acquisition unit 333b accesses the real-time transmission unit 304 of the PLC 1, 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 transfers the display time and the device value to the waveform display unit 336. As shown in FIG. 28, the waveform display unit 336 waveform-displays the device value acquired by the device value acquisition unit 333b on the display unit 7. Corrugation of the device value is not essential, and the device value may be displayed as it is. 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. The image display module 323 may be realized as one function of the waveform display module 322 as described above, but may be another function as the image display module 323 (camera monitor) as shown in FIG. 34. Good.

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

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

図36Bに示すリアルタイムチャートモニタ460について、その概要は、図28を用いて説明したとおりである。図36Bでは、リレーデバイスR000の波形データと、データメモリDM100の波形データとがメモリから読みだされ、表示されている。リアルタイムチャートモニタ460に表示させるべきデバイスは、図示しない設定画面を通じて、ユーザは自由に加減させることができる。   The outline of the real-time chart monitor 460 shown in FIG. 36B is as described with reference to FIG. 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の表示範囲外となるが、本実施形態では、この位置が常に表示範囲内になるよう、表示範囲が追従していく。   Below the real-time chart monitor 460, a time designation cursor 404b (corresponding to the bar 103 shown in FIG. 28, which may be called a playback position cursor) is displayed, 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 function of the reproduction control module 324 causes the time designation cursor 404 on the ladder monitor 450 and the time designation cursor 404a on the camera monitor 430 to move together. . Specifically, in FIG. 36B, the horizontal axis in the waveform display area of the real-time chart monitor 460 indicates the number of scans (which may be switched and displayed at time), but the user clicks the time designation cursor 404b to set a predetermined number. When it is slid 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 respectively move to the position of the display time corresponding to the number of scans. 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 a position corresponding to the desired number of scans. . 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 becomes outside the current display range of the real-time chart monitor 460, but in the present embodiment, this position is changed. The display range follows so that it is always within the display range.

ここで、図36Bに示すように、リアルタイムチャートモニタ460においては、時刻指定カーソル404bは、波形表示エリアに重畳表示された縦線と、その縦線の下端に付加された三角印の図形と、から構成されているが、さらに、この時刻指定カーソル404bの下方には、表示エリアバー404cが表示されている。表示エリアバー404cの中央には、現在位置を示す四角のインジケータが表示されている。ユーザは、このインジケータをドラッグして左右に動かすことで、リアルタイムチャートモニタ460に表示される範囲を変更することができる。そして、ユーザは、この表示エリアバー404cを上手く活用することで、トラブル原因を追究するトラブルシューティングを行うことができる。この点につき、図36Cを用いてより詳細に説明する。   Here, as shown in FIG. 36B, in the real-time chart monitor 460, the time designation cursor 404b has a vertical line superimposed and displayed in the waveform display area, and a triangular mark added to the lower end of the vertical line. The display area bar 404c is displayed below the time designation cursor 404b. At the center of the display area bar 404c, a square indicator indicating the current position is displayed. 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 carry out troubleshooting by investigating 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, the relay devices R000 and R001 and 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) for each device are displayed on the real-time chart monitor 460. Further, of these device values, the device value corresponding to one specific time for each device becomes the device value designated by the time designation cursor 404b. In FIG. 36C, the device value corresponds to the time in the center of the range displayed on 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 like 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 fixed amount (8 device values). When moving to the right by the minute), the time designation cursor 404b disappears. However, in this 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 as to facilitate troubleshooting. It is supposed to do. In other words, the waveform display unit 336 shown in FIG. 36A has a function of receiving designation of a desired position from the user in the waveform display area and moving the time designation cursor 404b to the received designated position.

図36Cに示すGUIを使ったトラブルシューティングの手順(一例)について、より具体的に説明する。   The procedure (example) of troubleshooting 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 in the display area bar 404c of the real-time chart monitor 460 and moving it to the left or right. Find a time that might help. 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 at which an abnormal device value is obtained 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 playback control module 324 displays the device value corresponding to that time on the ladder monitor 450 and the image data corresponding to that time on the camera monitor 430. Therefore, the user can investigate the cause of the trouble while visually checking these device values and image data.

●再生制御モジュール324
図37は再生制御モジュール324の詳細を示している。デバイス値提供部341は、ログデータ取得部344によりログデータ73から取得されたデバイス値をプログラム表示モジュール321と波形表示モジュール322とに提供する。また、デバイス値提供部341は、ユニット表示モジュール325にも、ログデータ73から取得されたデバイス値を提供する。なお、ログデータ73から取得されたデバイス値は一時的にログデバイス345に格納されてもよい。プログラム表示モジュール321と波形表示モジュール322のデバイス値取得部333はデバイス値提供部341にデバイス値を要求する。デバイス値取得部333はログデバイス345からデバイス値を取得し、デバイス値取得部333に送信する。時刻デバイス342は再生制御部343により設定された表示時刻を保持するデバイスである。時刻デバイス342に保持されているデバイス値(時刻情報)もデバイス値提供部341がデバイス値取得部333へ送信してもよい。あるいは、再生制御部343が表示時刻制御部331a、331bに時刻情報を提供してもよい。再生制御部343は、表示時刻を計時するための仮想的な内部時計を有し、この内部時計にしたがって時刻デバイス342に保持されている時刻情報を更新する。再生制御部343は、表示時刻制御部331a、331bに時刻デバイス342に保持されている時刻情報を送信する。再生制御部343は、表示時刻制御部331a、331bから表示時刻の指定を受信すると、受信した表示時刻を内部時計に設定する(時刻合わせ)。よって、表示時刻制御部331aから表示時刻が指定されると、この表示時刻は再生制御部343を介して表示時刻制御部331bに伝達される。同様に、表示時刻制御部331bから表示時刻が指定されると、この表示時刻は再生制御部343を介して表示時刻制御部331aに伝達される。これによりプログラム表示モジュール321の表示時刻と波形表示モジュール322の表示時刻とが同期する。スロー再生、早送り再生、巻き戻し再生などを実現するために、再生制御部343は、操作部8からのユーザ入力にしたがって内部時計の更新速度を変更する。再生制御部343は、ログデータ73に含まれている最も古いレコードの時刻情報を内部時計の初期値に設定してもよい。ログデータ取得部344は時刻デバイス342に保持されている表示時刻に関連付けられているデバイス値をログデータ73から取得して、デバイス値提供部341に渡す。
● Playback control module 324
FIG. 37 shows 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. 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 reproduction control unit 343. The device value providing unit 341 may also transmit the device value (time information) held in the time device 342 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 this 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. Upon receiving the designation of the display time from the display time control units 331a and 331b, the reproduction control unit 343 sets the received display time in the internal clock (time adjustment). Therefore, when the display time is designated by the display time control unit 331 a, this display time is transmitted to the display time control unit 331 b via the reproduction control unit 343. Similarly, when the display time is designated 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 reproduction, fast-forward reproduction, rewind reproduction, etc., the reproduction 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 to 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 provision 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 time of 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, 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 not limited to this. Instead, for example, the user may be allowed to select whether or not to synchronize. For example, a check box for the presence or absence of synchronization may be provided on each monitor screen, and the check state may be set by default. Then, the user can uncheck only the modules that he does not want to synchronize by unchecking the modules. As described above, the log display unit 61 may have a selection function of selecting a module to be synchronously controlled (following 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 a 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 when the relay device is ON, by superimposing it on the user program. If the relay device is OFF, the program display unit 332 may display the icon 401b indicating OFF on the user program in an overlapping manner. The program display unit 332 may acquire the device value of the DM 100, which is an output device, by the device value acquisition unit 333a, and may display it on the description of the DM 100 in the user program. In this example, a device value display area 403 is provided below the description of the DM 100. The program display unit 332 displays the device value in the display area 403. Since the reproduction 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 causes the playback control unit 343 to stop updating the display time, and the playback control unit 343 determines the drag amount of the time designation cursor 404. To notify. The reproduction control unit 343 adjusts the count value (display time) of the internal clock according to the drag amount. The time UI 330a displays the update speed of the display time (eg, ..., 2.0 times, 1.0 times, 0.5 times, 0.1 times, ...) 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 one of the update speeds can be selected. When the time UI 330a detects a click on the speed designation unit 405 by the pointer 101, the time UI 330a may display such a pull-down menu and accept the selection of the update speed. The play button 406 is a button for instructing time-series display of device values. 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 the update of the display time to the reproduction control unit 343. This instruction corresponds to an instruction to start display of the device value or an instruction to restart display. The one-step reverse reproduction button 407 is a button for instructing to display the device values in time series 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 return the display time by one step. The one-step playback button 408 is a button for instructing to display the device values in time series while updating the display time step by step. When the time UI 330a detects that the one-step reproduction 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 the one-step reproduction is being executed, the reproduction control unit 343 does not update the display time unless the one-step reverse reproduction button 407 or the one-step reproduction button 408 is operated. When the reproduction button 406 is operated during the one-step reproduction, the reproduction control unit 343 restarts the update of the display time at the update speed specified by the speed specifying 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>
An external display device called HMI can be connected to the PLC 1. 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 PLC 1 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 them 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 time series on the UI.

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

<ログ表示に関するフローチャート>
●プログラム表示モジュール
図40はプログラム表示モジュール321によって実行される表示処理を示している。なお、S50、S51およびS60はPLC1からプロジェクトデータ71を取得できない場合にのみ実行されてもよい。PLC1からプロジェクトデータ71を取得できる場合、PLC1からプロジェクトデータ71が使用される。PLC1からプロジェクトデータ71を取得できない場合、PC2に保持されているプロジェクトデータ71が使用される。
<Flowchart for log display>
Program Display Module FIG. 40 shows a 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 PLC 1. When the project data 71 can be acquired from the PLC 1, the project data 71 from the PLC 1 is used. If the project data 71 cannot be acquired from the PLC 1, the project data 71 held in the PC 2 is used.

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

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

S52でCPU21(プログラム表示部332)はPLC1または記憶装置22からプロジェクトデータ71を取得する。   In S52, the CPU 21 (program display 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 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 PLC 1 without going through the reproduction control module 324. In S59, the CPU 21 (program display unit 332) displays the device value on the display unit 7 together with the user program included in the project data 71. 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 the time designation is detected by the time UI 330a. As described above, the time designation is executed by operating 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 or the real-time reproduction mode is selected based on the information input from the operation unit 8. If the real-time reproduction mode is selected, the CPU 21 proceeds to S66. In S66, the CPU 21 (device value acquisition unit 333b) acquires the device value from the real-time transmission unit 304 of the PLC 1 without going through the 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 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 the time designation is detected by the time UI 330b. The time designation is executed by the bar 103 as described above. 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 step 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 it 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 a 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 the time designation is received from the display time control unit 331. If the time designation has been received, the CPU 21 proceeds to S76. If the time designation has not been received, the CPU 21 proceeds to S77.

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

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

図43はラダープログラムを構成する複数のモジュールを示している。この例では、次のようなPLC1が想定されている。ワークが搬送ベルトにより搬送される。ワーク検知センサがワークを検知すると、高さセンサがワークの高さを計測し、奥行センサがワークの奥行を計測する。ワークの高さが所定範囲内になければ、測定NGと判定される。同様に、ワークの奥行が所定範囲内になければ、測定NGと判定される。図43にはこれらの一連の処理を実現するためのプログラムモジュールが記載されている。各モジュールは接点系命令(入力系命令)と出力系命令とを含む。接点系命令は、出力系命令を実行するための条件である。   FIG. 43 shows a plurality of modules that make up the ladder program. In this example, the following PLC1 is assumed. The work is transported by the transport belt. When the work detection sensor detects a 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 as measurement 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-type instruction is a condition for executing the output-type instruction.

ワーク検知モジュールB1においてデバイスMR000はワークを検知するとONとなるリレーデバイスである。デバイスMR0002PLC1が自動運転中である場合にONとなるリレーデバイスである。デバイスMR001は、拡張ユニット4に測定開始を指示するためのリレーデバイスである。デバイスMR000は、自動運転中にワークが検知されると、ONとなる。   The device MR000 in the work detection module B1 is a relay device that is turned on when a work is detected. This is a relay device that is turned 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 command describes that the output system command 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 this is copied to the device TM100. Similarly, the depth measurement value acquired by the expansion unit 4 is stored in the device EM2, and it is described that this is copied to the device TM101. Further, the device MR003 for managing the completion of measurement is set to ON.

判定モジュールB3は、デバイスMR003がONになると、つまり測定が完了されると実行されるモジュールである。ここでは、測定結果が合格条件を満たさなければ、デバイスMR010がONになる。これは測定NGを意味する。より具体的には、デバイスTM100に格納されている高さの計測値が95未満であれば、MR010がONになる。デバイスTM100に格納されている高さの計測値が105を超えていれば、MR010がONになる。デバイスTM101に格納されている奥行の計測値が35未満であれば、MR010がONになる。デバイスTM100に格納されている奥行の計測値が45を超えていれば、MR010がONになる。   The determination module B3 is a module that is executed when the device MR003 is turned on, that is, when the measurement is completed. Here, if the measurement result does not satisfy the acceptance condition, the device MR010 is turned on. This means measured NG. More specifically, if the height measurement value stored in the device TM100 is less than 95, MR010 is turned on. If the height measurement value stored in the device TM100 exceeds 105, MR010 is turned on. If the depth measurement value stored in the device TM101 is less than 35, MR010 is turned on. If the depth measurement value stored in 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 conveyance of the conveyance belt when any 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 (transport 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 command of a certain module is described in the output system command of another module. On the contrary, the device described in the output system command of a certain module is described in the contact system command of another module. For example, the device MR001 described in the output system command of the work detection module B1 is described in the contact system command of the measurement module B2. Therefore, the work detection module B1 and the measurement module B2 are extracted as mutually related modules. Next, focusing on the device MR003 described in the output system command of the measurement module B2, it can be seen that MR003 is described in the contact system command of the determination module B3. Therefore, the measurement module B2 and the determination module B3 are extracted as mutually related modules. Next, focusing on the device MR010 described in the output system command of the determination module B3, it can be seen that MR010 is described in the contact system command of the error processing module B4. Therefore, the determination module B3 and the error processing module B4 are extracted as mutually related modules. In this way, a plurality of modules involved in a certain specific process and a plurality of devices described inside the plurality of modules are extracted. These extraction processes are executed by the device extraction unit 53. The device extraction unit 53 may be mounted on the log display unit 61. That is, the log display unit 61 extracts a plurality of mutually related modules, further extracts a plurality of devices described in the extracted plurality of modules, and obtains device values 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 a UI 500 that displays the extraction result. The log display unit 61 and the device extraction unit 53 may create the UI 500 that displays the devices and blocks (program components) extracted from the user program, and display the UI 500 on the display unit 7. The UI 500 can easily display the extraction result of the device and the program component. Therefore, the user can easily understand the whole image 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 allow the user to quickly access the details of the extracted block. The log display unit 61 and the device extraction unit 53 may display the extraction result using the UI illustrated in FIG.

<ブロックおよびデバイスの抽出処理>
図45はデバイス抽出部53が実行するブロックおよびデバイスの抽出処理を示している。ここではプロジェクトデータ71には、複数のブロック(プログラム部品)が含まれている。よって、デバイス抽出部53はプロジェクトデータ71を参照し、ブロックやデバイスを抽出する。
<Block and device extraction processing>
FIG. 45 shows block and device extraction processing executed by the device extraction unit 53. Here, the project data 71 includes a plurality of blocks (program components). 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 the block selection via the operation unit 8. The device extraction unit 53 may receive 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 receive a 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: storage trigger) for outputting the log data 73 to the output unit 84 of the PLC 1 through the log setting unit 51. More specifically, the condition is set such that a specific relay device is turned on. Therefore, the device extraction unit 53 may 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-type instruction of the selected block.

S83でCPU21(デバイス抽出部53)は抽出されたデバイスを出力系命令に記述されている他のブロックを検索する。   In S83, the CPU 21 (device extraction unit 53) searches the extracted device for another block 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 in which the extracted device is described in the output system instruction is found. 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 identification information (eg, name, file name, etc.) of the discovered block in the list for managing related blocks.

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

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

S91でユーザはログ設定部51を通じてログデータ73の保存条件としてNG判定を設定する。図43によれば、NG判定を管理するデバイスMR010がONになったことがログデータ73の保存条件に決定される。ユーザはプロジェクトデータ71とログ設定データ72をPLC1に転送する。   In S91, the user sets NG determination as the storage condition of the log data 73 through the log setting unit 51. According to FIG. 43, it is determined in 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 PLC 1.

S92でユーザはPLC1を稼働させる。PLC1はプロジェクトデータ71を実行し、ログ設定データ72における保存条件が満たされるとログデータ73をメモリカード36に保存する。図43に示された例ではNG判定が発生すると、搬送ベルトが停止するため、ユーザは何らかのエラーが発生したことを知る。   In S92, the user activates PLC1. The PLC 1 executes the project data 71 and saves the log data 73 in the memory card 36 when the saving condition in the log setting data 72 is 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 detection. For example, the user actually measures the height and depth of the work and determines whether or not the acceptance condition is satisfied. If the work does not satisfy the acceptance condition, the user determines that the NG determination is a false detection.

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

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

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

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

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

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

部品指定部52は、プログラム作成部63により作成された複数のプログラム部品のうち少なくとも一つのプログラム部品を指定するように構成されていてもよい。抽出部53は、部品指定部52により指定されたプログラム部品を解析して、当該プログラム部品ごとに使用または記述されるデバイスを抽出してもよい。記録部81は、抽出部53により抽出された特定のデバイスに記憶されているデバイス値を時系列に記録する。このように、プログラム部品が指定された後でデバイスの抽出が実行されてもよい。これにより抽出処理が軽くなろう。   The component designation unit 52 may be configured to designate at least one program component among the 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 to 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 time series. In this way, the device extraction may be executed after the program component is designated. 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 a device used or described for each program component. The component designation unit 52 may designate 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 components other than the program components designated as exclusion targets by the component 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 the module B is designated as the exclusion target, the DM2 is excluded, but the DM1 is also used by the module A, so that the DM1 remains as the recording target. In this way, device addition / removal may be executed in units of program components (that is, for each program component). In addition, a program component to be recorded or a program component to be excluded may be designated after devices are extracted from all the program components.

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

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

ユーザプログラムは、たとえば、ラダープログラムであってもよい。この場合、複数のプログラム部品は、ラダープログラム内で使用または記述される複数のファンクションブロックであってもよい。   The user program may be, for example, a ladder program. In this case, the 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 to any one of a plurality of devices. The recording unit 81 may add a device whose rewriting of the device value has been detected by the detection unit 82 as a recording target.

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

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

推定部59は、デバイス抽出部53により記録対象として抽出されたデバイスの数に基づき記録部81によるデバイス値の記録がユーザプログラムの実行に与える影響を推定する推定部の一例である。表示部7は、この影響を表示するように構成されていてもよい。これにより、ユーザは、スキャンタイムへの影響を加味しつつ、デバイスを加除することが可能となる。   The estimating unit 59 is an example of an estimating 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 extracting unit 53. The display unit 7 may be configured to display this influence. As a result, the user can add or remove the device while considering the influence on the scan time.

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

CPU31や実行部80は、ユーザプログラムを繰り返し実行するプログラム実行エンジンの一例である。CPU31や実行部80、CPU41は、ユーザプログラムからの指令に基づいて、各々がユーザプログラムに関する異なる機能(例:機能プログラム)を実行する複数の機能実行エンジンの一例である。これは、基本ユニット3が拡張ユニット4の機能を内包してもよいことを示唆している。機能プログラムは、たとえば、モーション制御プログラムである。プログラム実行エンジンや複数の機能実行エンジンは、単一のCPUにより実行されてもよいし、複数のCPUにより実行されてもよいし、ASICまたはFPGAにより実現されてもよい。また、単一のCPUがマルチコアを搭載しており、各コアがそれぞれ異なる機能を担当していてもよい。   The CPU 31 and the execution unit 80 are an example 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, 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 function of the expansion unit 4. The function 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, or may be realized by an ASIC or FPGA. Also, a single CPU may be equipped with multiple cores, and each core may be responsible for 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 that 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 the device values stored in any of the plurality of devices in time series. The function setting unit 62 may function as an allocating unit that allocates a plurality of devices used by each of the plurality of function execution engines. The function designating section 60 may function as a designating section that designates one or more functions among 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 designation unit as a recording target of the device recording unit from the plurality of devices assigned by the assignment unit.

プログラム実行エンジンは、メインユニットに設けられてもよい。複数の機能実行エンジンのうちの少なくとも一つは、メインユニットの機能を拡張するために該メインユニットと電気的に接続される機能拡張ユニットに設けられていてもよい。複数の機能実行エンジンのすべてがメインユニットに設けられてもよい。   The program execution engine may be provided in the main unit. At least one of the plurality of function execution engines may be provided in a function expansion unit electrically connected to the main unit to expand the function of the main unit. All of the 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 including 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 electrically connected to the main unit in order to expand the functions 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. To do. The function setting unit 62 may display a UI for assigning 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 functions out of a plurality of functions including a function provided in the main unit and a function provided in the function expansion unit. The addition unit 54 of the device extraction unit 53 extracts a device used for the function designated by the designation unit as a recording target of the device recording unit. The deletion unit 55 of the device extraction unit 53 excludes the device used for the function designated by the designation unit from the recording target of the device recording unit. The communication unit 23 functions as a transmission unit that transmits, to the PLC 1, setting data for recording the device value stored in the specific device extracted as the recording target in the device recording unit in time series. The recording unit 81 is configured to record the device values stored in the devices extracted as recording targets by the device extraction unit 53 in time series.

プロジェクト作成部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 an instruction word regarding any of the plurality of devices based on a user input via the display unit 7. The device extraction unit 53 may analyze the user program, extract devices used or described in the user program, and create a device list (extraction list) including the extracted devices. Further, the device extraction unit 53 may add devices 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 time series.

機能指定部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, the function may be selected or the unit may be selected. When one unit has a plurality of functions, the user selects one function so that all the functions included in the unit are selected as device extraction targets. The device extraction unit 53 may extract a device used for a unit designated as a recording target (extraction target) by the function designating unit 60 as a recording target of the device recording unit. Further, the device extraction unit 53 may be configured to exclude a device used for a unit designated as an exclusion target by the function designation unit 60 from a recording target of the device recording unit. In this way, the extraction target and the exclusion target may be designated in units of the main unit and the function expansion unit.

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

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

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

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

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

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

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

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

図24が示すように、第一インタフェースはメインユニットの側面であって、拡張ユニットの側面に対して対向する側面に配置されていてもよい。第二インタフェースは第一インタフェースと接続されるように拡張ユニットの側面に設けられていてもよい。   As shown in FIG. 24, the first interface may be arranged on a side surface of the main unit and a side surface facing the side surface of the expansion unit. The second interface may be provided on a 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 extension 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 about the collection time, the two-dimensional data, and the information about the acquisition time, which are stored in the storage device 32, to the external device. The external device may be the cloud or the PC 2. The PC 2 may receive the log data 73 in real time and display the log data 73 on the display unit 7.

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

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

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

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

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

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

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

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

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

付加部312に関連して説明されたように、ユーザプログラムの識別情報は、ユーザプログラムが変更されると更新される識別情報である。よって、PLC1に保持されているプロジェクトデータ71と異なる他のバージョンのプロジェクトデータ71が誤ってデバッグに利用されないようになろう。   As described in relation to the adding unit 312, the identification information of the user program 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 PLC 1 will not be erroneously used for debugging.

演算部313に関連して説明されたように、ユーザプログラムの識別情報は、ユーザプログラムから演算される誤り検出符号またはハッシュ値であってもよい。このように、プロジェクトデータ71が更新されると、識別情報も更新されるような識別情報の演算方法が採用されてもよい。識別情報はタイムスタンプなどであってもよい。   As described in relation to the calculation unit 313, the identification information of the user program may be an error detection code calculated from the user program or a hash value. In this way, an identification information calculation method may be adopted in which the identification information is also updated when the project data 71 is 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 a user program and identification information of the user program. The collation unit 334 is an example of a collation unit that collates the identification information of the user program output from the programmable logic controller with the identification information of the user program 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 when 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 command word related to the device value is described. This makes it easier for the user to understand the relationship between the change in device value and the user program. This will improve debugging efficiency.

記憶装置22やメモリカード36はプログラマブルロジックコントローラにおいて収集された時系列の複数のデバイス値と、各デバイス値の収集時刻を示す時刻データとを保存する保存手段の一例である。プログラム表示モジュール321はデバイス値をラダー図上に表示する第一エンジニアリングソフトウェアモジュールの一例である。波形表示モジュール322はデバイス値を時系列波形として表示する第二エンジニアリングソフトウェアモジュールの一例である。再生制御モジュール324は第一エンジニアリングソフトウェアモジュールにおける表示対象時刻と第二エンジニアリングソフトウェアモジュールにおける表示対象時刻とを同期させる同期ソフトウエアモジュールの一例である。これにより、ユーザは、特定のデバイス値の変化とプログラムの関係とを理解しやすくなろう。   The storage device 22 and the memory card 36 are an example of a storage unit that stores 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 with 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 stores the device value corresponding to the display target time based on the time data in the history playback mode. You may have a 1st display control means acquired from a means and displayed on a ladder diagram. The program display unit 332, the display time control unit 331, and the device value acquisition unit 333 function as a first display control unit. The log reproduction mode is an example of the history reproduction 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 from the storage unit based on the time data in the history reproduction mode. Second display control means for displaying a 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 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 a synchronization unit.

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

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

図43が示すように、第一表示制御手段は、プログラマブルロジックコントローラにおいて参照される複数のデバイスのうち第二エンジニアリングソフトウェアモジュールにおいて表示対象とされているデバイスに関連する命令語を、ラダー図において検索してもよい。たとえば、図28に示されているデバイス(例:R000やDM100など)をポインタ101により指定することで、デバイスが指定されてもよい。図38が示すように、第一表示制御手段は、ラダー図において見つかった命令語とともに当該デバイスのデバイス値を表示するように構成されていてもよい。また、ポインタ101は、任意のデバイスを指定する指定手段の一例である。第一表示制御手段は、プログラマブルロジックコントローラにおいて参照される複数のデバイスのうち指定手段により指定されたデバイスに関連する命令語を、ラダー図において検索し、ラダー図において見つかった命令語とともに当該デバイスのデバイス値を表示してもよい。   As shown in FIG. 43, the first display control means searches the ladder diagram for 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 designated by designating the device (eg, R000, DM100, etc.) shown in FIG. 28 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 command word found in the ladder diagram. Further, the pointer 101 is an example of a designation unit that designates an arbitrary device. The first display control means searches the ladder diagram for an instruction word related to the device designated by the designating means out of the plurality of devices referred to in the programmable logic controller, and with the instruction word found in the ladder diagram, the device The device value may be displayed.

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

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

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

第一表示制御手段は、ラダープログラムにおいて、第一ブロック(例:判定モジュールB3)において第一デバイス(例:MR010)に関連する命令語が出力系の命令語である場合に、当該出力系の命令語に対応して記述されている入力系の命令語の対象とされている第二デバイス(例:MR001)を特定し、当該第二デバイスを対象とする出力系の命令語を記述された第二ブロック(例:測定モジュールB2)を特定してもよい。   In the ladder program, when the command word related to the first device (example: MR010) is the command word of the output system in the ladder program, the first display control means outputs the command of the output system. The second device (eg, MR001) that is the target of the input system command word described in correspondence with the command word is specified, and the output system command word that targets the second device is described. The 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 a setting unit. With this, slow reproduction or fast-forward reproduction may be realized.

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

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

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

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

Claims (13)

ユーザプログラムを繰り返し実行するプログラム実行エンジンと、
前記ユーザプログラムからの指令に基づいて、各々が前記ユーザプログラムに関する異なる機能を実行する複数の機能実行エンジンと、
前記プログラム実行エンジンと前記複数の機能実行エンジンにより参照される記憶領域である複数のデバイスを有するデバイス記憶部と、
前記複数のデバイスのいずれかに記憶されているデバイス値を時系列に記録するデバイス記録部と、
を有するプログラマブルロジックコントローラシステムにおいて、
前記複数の機能実行エンジンの各々にて使用される複数のデバイスを割り付ける割付部と、
前記複数の機能実行エンジンに対応する複数の機能のうち一つ以上の機能を指定する指定部と、
前記割付部により割り付けられた複数のデバイスから、前記指定部により指定された一つ以上の機能のために使用されるデバイスを前記デバイス記録部の記録対象として抽出するデバイス抽出部と、
をさらに有し、
前記デバイス記録部は、前記デバイス抽出部により記録対象として抽出された前記デバイスに記憶されているデバイス値を時系列に記録するように構成されていることを特徴とするプログラマブルロジックコントローラシステム。
A program execution engine that repeatedly executes user programs,
A plurality of function execution engines, each of which executes different functions related to the user program based on a command from the user program;
A device storage unit having a plurality of devices that are storage areas referred to by the program execution engine and the plurality of function execution engines;
A device recording unit that records device values stored in any of the plurality of devices in time series,
In a programmable logic controller system having
An allocation unit that allocates a plurality of devices used in each of the plurality of function execution engines,
A designation unit for designating one or more functions of the plurality of functions corresponding to the plurality of function execution engines;
From a plurality of devices allocated by the allocation unit, a device extraction unit that extracts a device used for one or more functions specified by the specification unit as a recording target of the device recording unit,
Further has
The programmable logic controller system, wherein the device recording unit is configured to record device values stored in the device extracted as a recording target by the device extraction unit in time series.
前記プログラム実行エンジンは、メインユニットに設けられており、
前記複数の機能実行エンジンのうちの少なくとも一つは、前記メインユニットの機能を拡張するために該メインユニットと電気的に接続される機能拡張ユニットに設けられていることを特徴とする請求項1に記載のプログラマブルロジックコントローラシステム。
The program execution engine is provided in the main unit,
At least one of the plurality of function execution engines is provided in a function expansion unit electrically connected to the main unit to expand the function of the main unit. A programmable logic controller system according to.
前記複数のデバイスのいずれかに関する命令語を含むユーザプログラムを作成するプログラム作成部をさらに有し、
前記デバイス抽出部は、前記ユーザプログラムを解析し、前記ユーザプログラムに使用されているデバイスを抽出し、抽出されたデバイスを含むデバイスリストを作成し、前記指定部により抽出対象として指定された機能のために使用されるデバイスを前記デバイスリストに追加するように構成されており、
前記デバイス記録部は、前記デバイスリストに登録されているデバイスに記憶されているデバイス値を時系列に記録するように構成されていることを特徴とする請求項1または2に記載のプログラマブルロジックコントローラシステム。
Further comprising a program creating unit for creating a user program including an instruction word relating to any of the plurality of devices,
The device extraction unit analyzes the user program, extracts devices used in the user program, creates a device list including the extracted devices, and extracts a device list of functions specified as extraction targets by the specifying unit. Is configured to add the device used for
The programmable logic controller according to claim 1 or 2, wherein the device recording unit is configured to record device values stored in devices registered in the device list in time series. system.
前記指定部は、さらに、前記メインユニットと前記機能拡張ユニットとのうちのいずれかのユニットを指定するように構成されており、
前記デバイス抽出部は、前記指定部により抽出対象として指定されたユニットのために使用されるデバイスを前記デバイス記録部の記録対象として抽出するように構成されていることを特徴とする請求項2に記載のプログラマブルロジックコントローラシステム。
The designating unit is further configured to designate any one of the main unit and the function expansion unit,
The device extraction unit is configured to extract a device used for a unit designated as an extraction target by the designation unit, as a recording target of the device recording unit. A programmable logic controller system as described.
前記指定部は、さらに、抽出対象となるデバイスのデバイス種別を指定するように構成されており、
前記デバイス抽出部は、前記指定部により記録対象として指定されたデバイス種別のデバイスを前記デバイス記録部の記録対象として抽出するように構成されていることを特徴とする請求項1ないし4のいずれか一項に記載のプログラマブルロジックコントローラシステム。
The designation unit is further configured to designate a device type of a device to be extracted,
5. The device extracting unit is configured to extract a device of a device type designated as a recording target by the designating unit as a recording target of the device recording unit. A programmable logic controller system according to claim 1.
前記デバイス抽出部は、前記指定部により除外対象として指定された機能のために使用されるデバイスを前記デバイス記録部の記録対象から除外するように構成されていることを特徴とする請求項1ないし5のいずれか一項に記載のプログラマブルロジックコントローラシステム。   The device extraction unit is configured to exclude a device used for a function designated as an exclusion target by the designation unit from a recording target of the device recording unit. 5. The programmable logic controller system according to any one of 5 above. 前記デバイス抽出部は、前記指定部により除外対象として指定された機能のために使用されるデバイスを前記デバイスリストから削除するように構成されていることを特徴とする請求項3に記載のプログラマブルロジックコントローラシステム。   The programmable logic device according to claim 3, wherein the device extraction unit is configured to delete a device used for a function designated as an exclusion target by the designation unit from the device list. Controller system. 前記指定部は、さらに、前記メインユニットと前記機能拡張ユニットとのうちのいずれかのユニットを指定するように構成されており、
前記デバイス抽出部は、前記指定部により除外対象として指定されたユニットのために使用されるデバイスを前記デバイス記録部の記録対象から除外するように構成されていることを特徴とする請求項2に記載のプログラマブルロジックコントローラシステム。
The designating unit is further configured to designate any one of the main unit and the function expansion unit,
The device extraction unit is configured to exclude a device used for a unit designated as an exclusion target by the designation unit from a recording target of the device recording unit. A programmable logic controller system as described.
前記指定部は、さらに、除外対象となるデバイスのデバイス種別を指定するように構成されており、
前記デバイス抽出部は、前記指定部により除外対象として指定されたデバイス種別のデバイスを前記デバイス記録部の記録対象から除外するように構成されていることを特徴とする請求項6または8に記載のプログラマブルロジックコントローラシステム。
The designation unit is further configured to designate a device type of a device to be excluded,
The device extraction unit is configured to exclude a device of a device type designated as an exclusion target by the designation unit from a recording target of the device recording unit. Programmable logic controller system.
前記デバイス抽出部により記録対象として抽出されたデバイスの数に基づき前記デバイス記録部によるデバイス値の記録が前記ユーザプログラムの実行に与える影響を推定する推定部と、
前記影響を表示する表示部と、をさらに有することを特徴とする請求項1ないし9のいずれか一項に記載のプログラマブルロジックコントローラシステム。
An estimation unit that estimates the influence of the recording of the device value by the device recording unit on the execution of the user program based on the number of devices extracted as recording targets by the device extraction unit,
The programmable logic controller system according to claim 1, further comprising: a display unit that displays the influence.
前記複数のデバイスのうちのいずれかのデバイスに対する外部機器からのデバイス値の書き換えを検知する検知部をさらに有し、
前記デバイス記録部は、前記検知部によりデバイス値の書き換えが検知されたデバイスを記録対象に追加することを特徴とする請求項1ないし10のいずれか一項に記載のプログラマブルロジックコントローラシステム。
Further comprising a detection unit for detecting rewriting of a device value from an external device to any one of the plurality of devices,
11. The programmable logic controller system according to claim 1, wherein the device recording unit adds a device whose rewriting of a device value is detected by the detection unit to a recording target.
ユーザプログラムを繰り返し実行するプログラム実行エンジンと、前記ユーザプログラムからの指令に基づいて、各々が前記ユーザプログラムに関する異なる機能を実行する複数の機能実行エンジンと、前記プログラム実行エンジンと前記複数の機能実行エンジンにより参照される記憶領域である複数のデバイスを有するデバイス記憶部と、前記複数のデバイスのいずれかに記憶されているデバイス値を時系列に記録するデバイス記録部とを有するプログラマブルロジックコントローラに接続され、前記ユーザプログラムの作成を支援するプログラム作成支援装置であって、
前記複数の機能実行エンジンの各々にて使用される複数のデバイスを割り付ける割付部と、
前記複数の機能実行エンジンに対応する複数の機能のうち一つ以上の機能を指定する指定部と、
前記割付部により割り付けられた複数のデバイスから、前記指定部により指定された一つ以上の機能のために使用されるデバイスを前記デバイス記録部の記録対象として抽出するデバイス抽出部と、
を有し、
前記デバイス記録部は、前記デバイス抽出部により記録対象として抽出された前記デバイスに記憶されているデバイス値を時系列に記録するように構成されていることを特徴とするプログラム作成支援装置。
A program execution engine that repeatedly executes a user program, a plurality of function execution engines that respectively execute different functions related to the user program based on a command from the user program, the program execution engine, and the plurality of function execution engines Connected to a programmable logic controller having a device storage unit having a plurality of devices, which is a storage area referred to by, and a device recording unit configured to record device values stored in any of the plurality of devices in time series. A program creation support device for supporting the creation of the user program,
An allocation unit that allocates a plurality of devices used in each of the plurality of function execution engines,
A designation unit for designating one or more functions of the plurality of functions corresponding to the plurality of function execution engines;
From a plurality of devices allocated by the allocation unit, a device extraction unit that extracts a device used for one or more functions specified by the specification unit as a recording target of the device recording unit,
Have
The program creation support apparatus, wherein the device recording unit is configured to record device values stored in the device extracted as a recording target by the device extraction unit in time series.
ユーザプログラムを繰り返し実行するプログラム実行エンジンと、前記ユーザプログラムからの指令に基づいて、各々が前記ユーザプログラムに関する異なる機能を実行する複数の機能実行エンジンと、前記プログラム実行エンジンと前記複数の機能実行エンジンにより参照される記憶領域である複数のデバイスを有するデバイス記憶部と、前記複数のデバイスのいずれかに記憶されているデバイス値を時系列に記録するデバイス記録部とを有するプログラマブルロジックコントローラに接続され、前記ユーザプログラムの作成を支援するコンピュータに、
前記複数の機能実行エンジンの各々にて使用される複数のデバイスを割り付ける工程と、
前記複数の機能実行エンジンに対応する複数の機能のうち一つ以上の機能を指定する工程と、
前記割り付けられた複数のデバイスから、前記指定された一つ以上の機能のために使用されるデバイスを前記デバイス記録部の記録対象として抽出する工程と、
前記記録対象として抽出された前記デバイスに記憶されているデバイス値を時系列に前記デバイス記録部に記録させるための設定データを前記プログラマブルロジックコントローラに送信する工程と
を実行させるコンピュータプログラム。
A program execution engine that repeatedly executes a user program, a plurality of function execution engines that respectively execute different functions related to the user program based on a command from the user program, the program execution engine, and the plurality of function execution engines Connected to a programmable logic controller having a device storage unit having a plurality of devices, which is a storage area referred to by, and a device recording unit configured to record device values stored in any of the plurality of devices in time series. , A computer supporting the creation of the user program,
Allocating a plurality of devices used in each of the plurality of function execution engines,
Specifying one or more functions among a plurality of functions corresponding to the plurality of function execution engines,
Extracting a device used for the specified one or more functions from the plurality of allocated devices as a recording target of the device recording unit,
And a step of transmitting, to the programmable logic controller, setting data for causing the device recording section to record the device values stored in the device extracted as the recording target in time series.
JP2018199198A 2018-10-23 2018-10-23 Programmable logic controller system, programming support device and computer program Active JP7173826B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2018199198A JP7173826B2 (en) 2018-10-23 2018-10-23 Programmable logic controller system, programming support device and computer program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2018199198A JP7173826B2 (en) 2018-10-23 2018-10-23 Programmable logic controller system, programming support device and computer program

Publications (2)

Publication Number Publication Date
JP2020067752A true JP2020067752A (en) 2020-04-30
JP7173826B2 JP7173826B2 (en) 2022-11-16

Family

ID=70390380

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2018199198A Active JP7173826B2 (en) 2018-10-23 2018-10-23 Programmable logic controller system, programming support device and computer program

Country Status (1)

Country Link
JP (1) JP7173826B2 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2020140465A (en) * 2019-02-28 2020-09-03 株式会社安川電機 Communication system, communication method and program
CN112579433A (en) * 2020-11-04 2021-03-30 北京精密机电控制设备研究所 Integrated test system of servo software
CN116235401A (en) * 2020-10-09 2023-06-06 株式会社安川电机 Power conversion device, power conversion method, and method for manufacturing power conversion device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH01217522A (en) * 1988-02-25 1989-08-31 Hitachi Ltd Arithmetic processor
JP2004310592A (en) * 2003-04-09 2004-11-04 Mitsubishi Electric Corp Logging processor
JP2006268593A (en) * 2005-03-25 2006-10-05 Yokogawa Electric Corp Programmable controller
JP2008293138A (en) * 2007-05-22 2008-12-04 Fuji Electric Assets Management Co Ltd Software development support program and software development support method
JP2011028496A (en) * 2009-07-24 2011-02-10 Mitsubishi Electric Corp Apparatus for producing information on logging setting
WO2012056539A1 (en) * 2010-10-27 2012-05-03 三菱電機株式会社 Logging setup device, logging setup method and recordable medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH01217522A (en) * 1988-02-25 1989-08-31 Hitachi Ltd Arithmetic processor
JP2004310592A (en) * 2003-04-09 2004-11-04 Mitsubishi Electric Corp Logging processor
JP2006268593A (en) * 2005-03-25 2006-10-05 Yokogawa Electric Corp Programmable controller
JP2008293138A (en) * 2007-05-22 2008-12-04 Fuji Electric Assets Management Co Ltd Software development support program and software development support method
JP2011028496A (en) * 2009-07-24 2011-02-10 Mitsubishi Electric Corp Apparatus for producing information on logging setting
WO2012056539A1 (en) * 2010-10-27 2012-05-03 三菱電機株式会社 Logging setup device, logging setup method and recordable medium

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2020140465A (en) * 2019-02-28 2020-09-03 株式会社安川電機 Communication system, communication method and program
US11231700B2 (en) 2019-02-28 2022-01-25 Kabushiki Kaisha Yaskawa Denki Communication system, communication method, and information storage medium
CN116235401A (en) * 2020-10-09 2023-06-06 株式会社安川电机 Power conversion device, power conversion method, and method for manufacturing power conversion device
CN112579433A (en) * 2020-11-04 2021-03-30 北京精密机电控制设备研究所 Integrated test system of servo software

Also Published As

Publication number Publication date
JP7173826B2 (en) 2022-11-16

Similar Documents

Publication Publication Date Title
JP6757385B2 (en) Programmable logic controller and main unit
JP6757386B2 (en) Programmable logic controller and program creation support device
US10983743B2 (en) Programmable display and programmable logic controller system including the same
JP7273935B2 (en) External setting device, logging setting method and program
JP2020134985A (en) Programmable logic controller and camera input expansion unit
JP7173826B2 (en) Programmable logic controller system, programming support device and computer program
JP7320953B2 (en) Programmable logic controller and its log data storage method
JP2023164999A (en) Program creation assistance device for programmable logic controller
JP7450471B2 (en) Programmable logic controller and PLC system
JP7212496B2 (en) Programmable logic controller system, programming support device and computer program
JP7466319B2 (en) Programmable display and programmable logic controller system equipped with the same
JP2022158228A (en) Monitoring device and programmable logic controller system
JP6806946B2 (en) External setting devices and programs
JP6948450B2 (en) Programmable logic controller and main unit
JP7405714B2 (en) programmable logic controller
JP6986125B2 (en) Programmable logic controller and main unit
JP7412076B2 (en) Engineering tools 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
TW202006489A (en) Control system, control device and storage medium capable of easily verifying an operation history
JP7356778B2 (en) Program creation support device for programmable logic controllers
JP2022158229A (en) Programmable logic controller system
US11287789B2 (en) Program development support device, program development support system, program development support method, and non-transitory computer-readable recording medium
JP2023110263A (en) Program and programmable logic controller

Legal Events

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

Free format text: JAPANESE INTERMEDIATE CODE: A7422

Effective date: 20210113

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20210908

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20220615

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20220617

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20220812

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20221104

R150 Certificate of patent or registration of utility model

Ref document number: 7173826

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150