JP7375977B1 - Programmable logic controller, support device, display device, logging method, support method, and display method - Google Patents

Programmable logic controller, support device, display device, logging method, support method, and display method Download PDF

Info

Publication number
JP7375977B1
JP7375977B1 JP2023076791A JP2023076791A JP7375977B1 JP 7375977 B1 JP7375977 B1 JP 7375977B1 JP 2023076791 A JP2023076791 A JP 2023076791A JP 2023076791 A JP2023076791 A JP 2023076791A JP 7375977 B1 JP7375977 B1 JP 7375977B1
Authority
JP
Japan
Prior art keywords
control
variables
values
collected
program
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2023076791A
Other languages
Japanese (ja)
Inventor
良祐 仲野
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fuji Electric Co Ltd
Original Assignee
Fuji Electric Co Ltd
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 Fuji Electric Co Ltd filed Critical Fuji Electric Co Ltd
Priority to JP2023076791A priority Critical patent/JP7375977B1/en
Application granted granted Critical
Publication of JP7375977B1 publication Critical patent/JP7375977B1/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

Figure 0007375977000001

【課題】PLCによる機器の制御において使用される変数の値を適切に収集する。
【解決手段】制御部は、外部機器を制御するための制御プログラムを実行するプログラム実行処理と、制御プログラムにおいて使用されている変数の値を収集するロギング処理とを含む制御処理を、制御周期毎に繰り返す。制御部は、制御プログラムにおいて使用されている複数の変数を複数の制御周期に分割し、複数の制御周期各々において複数の変数のうち一部の変数の値を収集することで、複数の変数それぞれの値を制御周期よりも長い収集期間内に収集する。
【選択図】図11

Figure 0007375977000001

An object of the present invention is to appropriately collect values of variables used in controlling equipment using a PLC.
[Solution] A control unit performs control processing, including program execution processing for executing a control program for controlling external equipment, and logging processing for collecting values of variables used in the control program, every control cycle. Repeat. The control unit divides a plurality of variables used in a control program into a plurality of control cycles, and collects the values of some of the plurality of variables in each of the plurality of control cycles. The value of is collected within a collection period that is longer than the control period.
[Selection diagram] Figure 11

Description

本発明は、プログラマブルロジックコントローラ(Programmable Logic Controller,PLC)の技術に関する。 The present invention relates to a programmable logic controller (PLC) technology.

PLCに関して、監視機器から入力される各種データとデバイス値との時間的な関係を特定しやすくする技術が知られている(例えば、特許文献1を参照)。ユーザアプリケーションの実行や機器の制御に影響なくロギングを行える技術も知られている(例えば、特許文献2を参照)。スケジューラを実装したPLCも知られている(例えば、特許文献3を参照)。 Regarding PLC, a technique is known that makes it easier to specify the temporal relationship between various data input from monitoring equipment and device values (see, for example, Patent Document 1). A technique is also known that allows logging to be performed without affecting the execution of user applications or the control of devices (see, for example, Patent Document 2). PLCs equipped with a scheduler are also known (for example, see Patent Document 3).

特開2020-13526号公報JP2020-13526A 特許第7188631号公報Patent No. 7188631 特開2008-146357号公報Japanese Patent Application Publication No. 2008-146357

特許文献1及び特許文献2のPLCでは、機器の制御に与える影響を抑制しながら、機器及びPLCの動作状態を示すデータを大量に収集することが難しい。 With the PLCs of Patent Document 1 and Patent Document 2, it is difficult to collect a large amount of data indicating the operating status of the device and the PLC while suppressing the influence on the control of the device.

1つの側面において、本発明は、PLCによる機器の制御において使用される変数の値を適切に収集することを目的とする。 In one aspect, the present invention aims to appropriately collect values of variables used in controlling equipment by PLC.

1つの実施形態によれば、プログラマブルロジックコントローラは、制御部を含む。制御部は、制御処理を制御周期毎に繰り返す。制御処理は、外部機器を制御するための制御プログラムを実行するプログラム実行処理と、制御プログラムにおいて使用されている変数の値を収集するロギング処理とを含む。 According to one embodiment, a programmable logic controller includes a controller. The control unit repeats the control process every control cycle. The control process includes a program execution process that executes a control program for controlling external equipment, and a logging process that collects values of variables used in the control program.

制御部は、制御プログラムにおいて使用されている複数の変数を複数の制御周期に分割し、複数の制御周期各々において複数の変数のうち一部の変数の値を収集することで、複数の変数それぞれの値を制御周期よりも長い収集期間内に収集する。 The control unit divides a plurality of variables used in a control program into a plurality of control cycles, and collects the values of some of the plurality of variables in each of the plurality of control cycles. The value of is collected within a collection period that is longer than the control period.

別の実施形態によれば、プログラマブルロジックコントローラは、制御処理を制御周期毎に繰り返す。制御処理は、外部機器を制御するための制御プログラムを実行するプログラム実行処理と、制御プログラムにおいて使用されている変数の値を収集するロギング処理とを含む。 According to another embodiment, the programmable logic controller repeats the control process every control cycle. The control process includes a program execution process that executes a control program for controlling external equipment, and a logging process that collects values of variables used in the control program.

プログラマブルロジックコントローラは、支援装置から出力される設定情報に基づいて、制御プログラムにおいて使用されている複数の変数を複数の制御周期に分割し、複数の制御周期各々において複数の変数のうち一部の変数の値を収集する。これにより、プログラマブルロジックコントローラは、複数の変数それぞれの値を制御周期よりも長い収集期間内に収集する。 A programmable logic controller divides multiple variables used in a control program into multiple control cycles based on setting information output from a support device, and divides some of the variables in each of the multiple control cycles. Collect variable values. Thereby, the programmable logic controller collects the values of each of the plurality of variables within a collection period that is longer than the control cycle.

支援装置は、プログラム解析部、選択部、受付部、及び設定情報出力部を含む。プログラム解析部は、制御プログラムを解析して、制御プログラムにおいて使用されている変数を抽出する。選択部は、抽出された変数の中から、制御プログラムにおいて使用されている複数の変数を選択する。受付部は、収集期間の指定を受け付ける。設定情報出力部は、制御プログラムにおいて使用されている複数の変数を示す情報と収集期間を示す情報とを、設定情報として出力する。 The support device includes a program analysis section, a selection section, a reception section, and a setting information output section. The program analysis section analyzes the control program and extracts variables used in the control program. The selection unit selects a plurality of variables used in the control program from among the extracted variables. The reception department accepts the designation of the collection period. The setting information output unit outputs information indicating a plurality of variables used in the control program and information indicating a collection period as setting information.

さらに別の実施形態によれば、プログラマブルロジックコントローラは、制御処理を制御周期毎に繰り返す。制御処理は、外部機器を制御するための制御プログラムを実行するプログラム実行処理と、制御プログラムにおいて使用されている変数の値を収集するロギング処理とを含む。 According to yet another embodiment, the programmable logic controller repeats the control process every control cycle. The control process includes a program execution process that executes a control program for controlling external equipment, and a logging process that collects values of variables used in the control program.

プログラマブルロジックコントローラは、制御プログラムにおいて使用されている複数の変数を複数の制御周期に分割し、複数の制御周期各々において複数の変数のうち一部の変数の値を収集する。これにより、プログラマブルロジックコントローラは、複数の変数それぞれの値を制御周期よりも長い収集期間内に収集する。 A programmable logic controller divides a plurality of variables used in a control program into a plurality of control periods, and collects values of some of the variables in each of the plurality of control periods. Thereby, the programmable logic controller collects the values of each of the plurality of variables within a collection period that is longer than the control cycle.

プログラマブルロジックコントローラによって収集された情報を表示する表示装置は、表示部を含む。表示部は、収集期間における複数の変数それぞれの値の収集時刻と対応付けて、複数の変数それぞれの値を表示する。 A display device that displays information collected by a programmable logic controller includes a display section. The display unit displays the values of each of the plurality of variables in association with the collection time of each value of the plurality of variables during the collection period.

1つの側面によれば、PLCによる機器の制御において使用される変数の値を適切に収集することができる。 According to one aspect, values of variables used in controlling equipment by PLC can be appropriately collected.

PLCシステムの構成例を示す図である。It is a diagram showing an example of the configuration of a PLC system. PLCが実行する各処理の実行期間の例を示す図である。It is a figure which shows the example of the execution period of each process which PLC performs. 収集期間の例を示す図である。It is a figure showing an example of a collection period. PLCのハードウェア構成例を示す図である。It is a diagram showing an example of the hardware configuration of a PLC. PCのハードウェア構成例を示す図である。It is a diagram showing an example of the hardware configuration of a PC. 支援装置の機能構成例を示す図である。It is a figure showing an example of functional composition of a support device. ロギング処理の実行の条件の設定を行う方法の例を説明する図である。FIG. 3 is a diagram illustrating an example of a method for setting conditions for executing logging processing. UI画面の画面例である。This is an example of a UI screen. ロギング設定データのデータ構造の例を示す図である。FIG. 3 is a diagram showing an example of a data structure of logging setting data. 収集対象設定情報のデータ構造の例を示す図である。FIG. 3 is a diagram illustrating an example of a data structure of collection target setting information. PLCの機能構成例を示す図である。It is a figure showing an example of functional composition of PLC. PLCによるロギング実行方法の例を説明する図である。It is a figure explaining the example of the logging execution method by PLC. ロギング処理及び保存処理の処理内容の例を示すフローチャートである。12 is a flowchart illustrating an example of processing contents of logging processing and storage processing. ロギング収集データのデータ構造の例を示す図である。FIG. 3 is a diagram showing an example of a data structure of logging collection data. 収集データのデータ構造の例を示す図である。FIG. 3 is a diagram showing an example of a data structure of collected data. 同期収集処理の例を示すフローチャートである。3 is a flowchart illustrating an example of synchronous collection processing. 非同期収集処理の例を示すフローチャートである。3 is a flowchart illustrating an example of asynchronous collection processing. 収集データ表示装置のハードウェア構成例を示す図である。It is a diagram showing an example of the hardware configuration of a collected data display device. 収集データ表示装置の機能構成例を示す図である。FIG. 2 is a diagram showing an example of a functional configuration of a collected data display device. 収集データを表示する方法の例を説明する図である。FIG. 3 is a diagram illustrating an example of a method of displaying collected data. プログラム表示処理の例を説明する図である。FIG. 3 is a diagram illustrating an example of program display processing. 収集データの表示画面の画面例である。This is an example of a display screen for collected data. 警告画面の画面例である。This is an example of a warning screen. 波形表示処理の例を説明する図である。FIG. 3 is a diagram illustrating an example of waveform display processing. 収集データの波形表示画面の画面例である。This is an example of a waveform display screen of collected data. ロギングファイル解析・変換処理の例を説明する図である。FIG. 3 is a diagram illustrating an example of logging file analysis/conversion processing. 表示制御処理の例を説明する図である。FIG. 3 is a diagram illustrating an example of display control processing.

以下、図面を参照しながら、実施形態を詳細に説明する。 Hereinafter, embodiments will be described in detail with reference to the drawings.

PLCは、ファクトリーオートメーションにおいて製造機器、搬送装置、検査装置等を制御する制御装置である。PLCは、ラダープログラム等の、ユーザにより作成されるユーザアプリケーションプログラムを実行することで様々な制御機器を制御する。 PLC is a control device that controls manufacturing equipment, transport equipment, inspection equipment, etc. in factory automation. PLCs control various control devices by executing user application programs created by users, such as ladder programs.

PLCのような制御装置による機器の制御において異常が発生した場合には、その異常の原因を特定することが望ましい。また、このような異常の発生の場合に限られず、機器の制御に関する情報を記録しておいて、その後に情報を検証したいという要望がある。そこで、ユーザが、データの履歴を残すための条件を予め制御装置に設定しておき、この条件に基づいて、制御装置が、機器及び制御装置自体の動作状態を示すデータをロギングすることがある。 When an abnormality occurs in the control of equipment by a control device such as a PLC, it is desirable to identify the cause of the abnormality. In addition, there is a desire to record information related to control of equipment and to verify the information afterward, not only in the case of occurrence of such an abnormality. Therefore, the user may set conditions in the control device in advance for keeping a data history, and based on these conditions, the control device may log data indicating the operating status of the equipment and the control device itself. .

特許文献1のPLCでは、各制御周期において、入力処理、ユーザアプリケーションプログラムを実行するプログラム実行処理、出力処理、及びロギング処理が順に実行される。しかしながら、入力処理、プログラム実行処理、及び出力処理に続いてロギング処理が追加されることで、制御周期が長くなると、次の制御周期の開始が遅延する。このため、ユーザアプリケーションがユーザの意図した通りに動作しないことがある。 In the PLC of Patent Document 1, input processing, program execution processing for executing a user application program, output processing, and logging processing are executed in order in each control cycle. However, when the control cycle becomes longer due to the addition of logging processing following input processing, program execution processing, and output processing, the start of the next control cycle is delayed. Therefore, the user application may not operate as intended by the user.

特許文献2のPLCでは、ロギング処理の追加によって制御周期が長くなることはないが、制御周期の伸長を抑えるために、ロギングされるデータのデータ量が制限されることがある。 In the PLC of Patent Document 2, although the control cycle does not become longer due to the addition of logging processing, the amount of logged data may be limited in order to suppress the extension of the control cycle.

図1は、PLCシステムの構成例を示している。図1のPLCシステムは、PLC1と、パーソナルコンピュータ(Personal Computer,PC)2と、入出力モジュール3と、通信モジュール4とを含む。PLC1とPC2とは通信ケーブル6を介して接続されている。PLC1は、工場等に設置される各種制御機器を統括的に制御する。 FIG. 1 shows an example of the configuration of a PLC system. The PLC system in FIG. 1 includes a PLC 1, a personal computer (PC) 2, an input/output module 3, and a communication module 4. PLC1 and PC2 are connected via a communication cable 6. The PLC 1 centrally controls various control devices installed in factories and the like.

PC2はPLC1を支援する支援装置としての機能を提供する。PC2は、例えば、ユーザアプリケーションプログラムの編集を行うために用いられる。ユーザアプリケーションプログラムは、外部機器を制御するための制御プログラムに対応する。なお、以降の説明では、ユーザアプリケーションプログラムを「ユーザプログラム」と称することがある。 The PC2 provides a function as a support device that supports the PLC1. The PC 2 is used, for example, to edit a user application program. The user application program corresponds to a control program for controlling external equipment. Note that in the following description, the user application program may be referred to as a "user program."

ユーザプログラムは、例えば、IEC(International Electrotechnical Commission)61131-3準拠のラダー言語を用いて作成されてもよい。ユーザプログラムは、シーケンシャルファンクションチャート(Sequential Function Chart,SFC)等のフローチャート形式のモーションプログラム等といったグラフィカルプログラミング言語を用いて作成されてもよい。ユーザプログラムは、C言語等の高級プログラミング言語を用いて作成されてもよい。 The user program may be created using, for example, a ladder language compliant with IEC (International Electrotechnical Commission) 61131-3. The user program may be created using a graphical programming language such as a motion program in a flowchart format such as a Sequential Function Chart (SFC). The user program may be created using a high-level programming language such as the C language.

また、後述するように、PC2は、ロギング処理の実行の条件の設定を行う機能も提供する。 Furthermore, as will be described later, the PC 2 also provides a function for setting conditions for executing logging processing.

PLC1と入出力モジュール3及び通信モジュール4とは通信バス7を介して接続されている。通信バス7には、複数の入出力モジュール3や複数の通信モジュール4が接続されていてもよい。入出力モジュール3及び通信モジュール4は、着脱可能となっている。入出力モジュール3及び通信モジュール4は、外部機器に対応する。 The PLC 1, the input/output module 3, and the communication module 4 are connected via a communication bus 7. A plurality of input/output modules 3 and a plurality of communication modules 4 may be connected to the communication bus 7. The input/output module 3 and the communication module 4 are removable. The input/output module 3 and the communication module 4 correspond to external devices.

入出力モジュール3は、サーボアンプやエンコーダ、あるいは、センサの信号を電気信号に変換するものであり、また、デジタル信号若しくはアナログ信号を入出力するものであってもよい。 The input/output module 3 converts a signal from a servo amplifier, an encoder, or a sensor into an electrical signal, and may input/output a digital signal or an analog signal.

通信モジュール4は、他の機器との通信インタフェースを提供する。 Communication module 4 provides a communication interface with other devices.

図2は、図1のPLCシステムにおいてPLC1が実行する各処理の実行期間の例を示している。 FIG. 2 shows an example of the execution period of each process executed by the PLC 1 in the PLC system of FIG.

PLC1は、入力処理、プログラム実行処理、出力処理、ロギング処理、及びシステム処理を含む制御処理を、制御周期毎に繰り返す。入力処理は、入出力モジュール3から受信した入力データを取り込む処理である。プログラム実行処理は、ユーザにより作成されたユーザプログラムを実行する処理である。このユーザプログラムの実行では、入力処理により取り込まれた入力データが用いられる。出力処理は、ユーザプログラムの実行結果を出力することによって入出力モジュール3を制御して、実行結果を入出力モジュール3の出力に反映させる処理である。 The PLC 1 repeats control processing including input processing, program execution processing, output processing, logging processing, and system processing every control cycle. The input process is a process of capturing input data received from the input/output module 3. The program execution process is a process of executing a user program created by a user. In the execution of this user program, input data captured through input processing is used. The output process is a process of controlling the input/output module 3 by outputting the execution result of the user program, and causing the execution result to be reflected in the output of the input/output module 3.

ロギング処理は、ユーザプログラムにおいて使用されている変数の値を収集して、収集データを生成する処理である。ロギング処理は、PLC1を含むPLCシステムの各構成機器の動作状態を示すデータを記録し、履歴として保存する処理でもある。システム処理は、PLC1自身の動作を管理して、適正な動作を維持するための処理である。 The logging process is a process of collecting values of variables used in a user program and generating collected data. The logging process is also a process of recording data indicating the operating state of each component of the PLC system including the PLC 1 and saving it as a history. System processing is processing for managing the operation of the PLC 1 itself and maintaining proper operation.

PLC1は、ユーザプログラムの実行を妨げないように、各制御周期における出力処理の後にロギング処理を実行する。制御周期は、入力処理、プログラム実行処理、出力処理、ロギング処理、及びシステム処理の実行期間の合計である。したがって、ロギング処理の実行期間は、制御周期の帯域により制限される。制御周期は、例えば、ユーザにより指定される。 The PLC 1 executes the logging process after the output process in each control cycle so as not to interfere with the execution of the user program. The control cycle is the total execution period of input processing, program execution processing, output processing, logging processing, and system processing. Therefore, the execution period of the logging process is limited by the control cycle band. The control period is specified by the user, for example.

図3は、図1のPLCシステムにおいて用いられる収集期間の例を示している。図3の収集期間は、制御周期よりも長い期間であり、複数のロギング処理の実行期間を含む。各ロギング処理の実行期間は、複数の制御周期各々に含まれている。したがって、収集期間内において、収集対象の複数の変数が複数の制御周期それぞれのロギング処理に分割されて、制御周期とは非同期に変数の値が収集される。 FIG. 3 shows an example of a collection period used in the PLC system of FIG. 1. The collection period in FIG. 3 is longer than the control cycle, and includes the execution period of a plurality of logging processes. The execution period of each logging process is included in each of a plurality of control cycles. Therefore, within the collection period, a plurality of variables to be collected are divided into logging processes for each of a plurality of control cycles, and the values of the variables are collected asynchronously with the control cycles.

これにより、ユーザプログラムと機器の制御に関連する入力処理、プログラム実行処理、及び出力処理の実行期間に影響を与えることなく、所望のデータ量の変数の値を収集することが可能になる。したがって、機器の制御において使用される変数の値を適切に収集することができる。 This makes it possible to collect variable values in a desired amount of data without affecting the execution period of input processing, program execution processing, and output processing related to user program and device control. Therefore, values of variables used in controlling the equipment can be appropriately collected.

なお、プログラム実行処理、システム処理、及びロギング処理のそれぞれの実行期間の割合を変更することによってロギング処理の実行期間を調整可能にしてもよい。 Note that the execution period of the logging process may be adjustable by changing the ratio of the execution period of each of the program execution process, system process, and logging process.

次に、PLCシステムにおけるPLC1及びPC2についてさらに詳細に説明する。 Next, PLC1 and PC2 in the PLC system will be explained in more detail.

まず、PLC1のハードウェア構成について、図4に示されているハードウェア構成例を参照しながら説明する。図4のPLC1は通信I/F11、CPU(Central Processing Unit)12、バスコントローラ13、メモリ14、及び記憶装置I/F15を含む。これらの構成要素は何れもハードウェアであって、内部バス16に接続されており、相互にデータの授受を行うことが可能である。「I/F」とはインタフェースの略称である。CPUは、プロセッサと呼ばれることもある。 First, the hardware configuration of the PLC 1 will be described with reference to the example hardware configuration shown in FIG. The PLC 1 in FIG. 4 includes a communication I/F 11, a CPU (Central Processing Unit) 12, a bus controller 13, a memory 14, and a storage device I/F 15. All of these components are hardware, connected to the internal bus 16, and are capable of exchanging data with each other. "I/F" is an abbreviation for interface. A CPU is sometimes called a processor.

通信I/F11は通信ケーブル6に接続されており、PC2との間で行われる各種のデータの授受を管理する。 The communication I/F 11 is connected to the communication cable 6 and manages the exchange of various data with the PC 2.

CPU12は、ユーザプログラム、PLC1自身の動作を管理するためのシステムプログラム、ロギング実行プログラム等の各種のプログラムを実行する。 The CPU 12 executes various programs such as a user program, a system program for managing the operation of the PLC 1 itself, and a logging execution program.

バスコントローラ13は通信バス7に接続されており、入出力モジュール3や通信モジュール4との間で行われる各種のデータの授受を管理する。 The bus controller 13 is connected to the communication bus 7 and manages the exchange of various data between the input/output module 3 and the communication module 4.

メモリ14は、例えば半導体メモリであり、RAM(Random Access Memory)領域及びROM(Read Only Memory)領域を含む。RAM領域は、CPU12が各種のプログラムを実行する際に各種のデータを一時的に記憶しておく記憶領域として利用される。ROM領域は、各種のプログラムやデータが保存される領域であり、例えば不揮発性メモリが用いられる。 The memory 14 is, for example, a semiconductor memory, and includes a RAM (Random Access Memory) area and a ROM (Read Only Memory) area. The RAM area is used as a storage area for temporarily storing various data when the CPU 12 executes various programs. The ROM area is an area where various programs and data are stored, and for example, nonvolatile memory is used.

記憶装置I/F15は、メモリカード等の外部記憶装置17に対する各種のデータの書き込み処理や読み出し処理を管理する。 The storage device I/F 15 manages writing and reading processing of various data to and from an external storage device 17 such as a memory card.

次に、PC2のハードウェア構成について、図5に示されているハードウェア構成例を参照しながら説明する。図5のPC2はCPU21、メモリ22、入力装置23、表示装置24、補助記憶装置25、及び通信I/F26を含む。これらの構成要素は何れもハードウェアであって、内部バス27に接続されており、相互にデータの授受を行うことが可能である。 Next, the hardware configuration of the PC 2 will be described with reference to the example hardware configuration shown in FIG. The PC 2 in FIG. 5 includes a CPU 21, a memory 22, an input device 23, a display device 24, an auxiliary storage device 25, and a communication I/F 26. All of these components are hardware and are connected to the internal bus 27, so that they can exchange data with each other.

CPU21は、例えば、メモリ22を利用して所定のプログラムを実行することにより、ユーザプログラムの編集機能や、ロギング処理の実行の条件の設定を行うための機能を提供する。 The CPU 21 provides a user program editing function and a function for setting conditions for executing logging processing, for example, by executing a predetermined program using the memory 22.

入力装置23は、例えば、キーボードやポインティングデバイス等であり、ユーザからの指示又は情報の入力に用いられる。 The input device 23 is, for example, a keyboard, a pointing device, or the like, and is used to input instructions or information from the user.

表示装置24は、例えば、ユーザへの問い合わせ又は指示や、処理結果の表示出力に用いられる。 The display device 24 is used, for example, to make inquiries or instructions to the user, and to display and output processing results.

補助記憶装置25は、磁気ディスク装置、光ディスク装置、光磁気ディスク装置等であり、例えば、ハードディスクドライブやフラッシュメモリであってもよい。PC2は、補助記憶装置25にプログラム及びデータを格納しておき、それらをメモリ22にロードして使用することができる。 The auxiliary storage device 25 is a magnetic disk device, an optical disk device, a magneto-optical disk device, etc., and may be, for example, a hard disk drive or a flash memory. The PC 2 can store programs and data in the auxiliary storage device 25 and load them into the memory 22 for use.

通信I/F26は通信ケーブル6に接続されており、PLC1との間で行われる各種のデータの授受を管理する。 The communication I/F 26 is connected to the communication cable 6 and manages the exchange of various data with the PLC 1.

<ロギングの設定> <Logging settings>

次に、図1のPLCシステムにおいて、ロギング処理の実行の条件をPLC1に設定する手法について説明する。 Next, a method of setting conditions for executing logging processing in the PLC 1 in the PLC system of FIG. 1 will be described.

まず図6について説明する。図6は支援装置30の機能構成例を示した図である。この構成例は、PLC1によるロギング処理の実行の条件を設定する機能を支援装置30が提供する場合の一例である。PLCシステムでは、所定の設定ツールプログラムをPC2に実行させることによって、支援装置30の機能をPC2が提供する。 First, FIG. 6 will be explained. FIG. 6 is a diagram showing an example of the functional configuration of the support device 30. This configuration example is an example in which the support device 30 provides a function of setting conditions for execution of logging processing by the PLC 1. In the PLC system, the PC 2 provides the functions of the support device 30 by causing the PC 2 to execute a predetermined setting tool program.

図6において、支援装置30は、プログラム解析部31、選択部32、受付部33、設定情報出力部34、計算部35、及びデータ量出力部36を含む。なお、支援装置30には、制御処理をPLC1に行わせるときの制御周期がユーザにより予め設定されているものとする。 In FIG. 6, the support device 30 includes a program analysis section 31, a selection section 32, a reception section 33, a setting information output section 34, a calculation section 35, and a data amount output section 36. It is assumed that the control cycle for causing the PLC 1 to perform control processing is set in advance in the support device 30 by the user.

プログラム解析部31は、PLC1に実行させるユーザプログラムを解析して、ユーザプログラムにおいて使用されている複数の変数を抽出する。 The program analysis unit 31 analyzes a user program to be executed by the PLC 1 and extracts a plurality of variables used in the user program.

選択部32は、抽出された変数の中から、ユーザプログラムにおいて使用されている複数の変数を、収集対象の変数として選択する。 The selection unit 32 selects a plurality of variables used in the user program from among the extracted variables as variables to be collected.

受付部33は、制御周期よりも長い収集期間の指定を受け付ける。設定情報出力部34は、収集対象の複数の変数を示す情報と収集期間を示す情報とを、設定情報として出力する。 The accepting unit 33 accepts a designation of a collection period that is longer than the control cycle. The setting information output unit 34 outputs information indicating a plurality of variables to be collected and information indicating a collection period as setting information.

PLC1は、支援装置30から出力される設定情報に基づいて、収集対象の複数の変数を複数の制御周期に分割し、複数の制御周期各々において、収集対象の複数の変数のうち一部の変数の値を収集する。これにより、PLC1は、収集対象の複数の変数それぞれの値を収集期間内に収集する。 The PLC 1 divides the plurality of variables to be collected into a plurality of control cycles based on the setting information output from the support device 30, and divides some of the variables among the plurality of variables to be collected in each of the plurality of control cycles. Collect the value of . Thereby, the PLC 1 collects the values of each of the plurality of variables to be collected within the collection period.

計算部35は、収集期間及び制御周期に基づいて、収集対象の複数の変数それぞれの値が分割して収集される複数の制御周期の個数を決定する。そして、計算部35は、複数の変数それぞれの値の総データ量と複数の制御周期の個数とに基づいて、複数の制御周期各々において収集される一部の変数の値のデータ量を求める。 The calculation unit 35 determines the number of control cycles in which the values of the plurality of variables to be collected are divided and collected based on the collection period and the control cycle. Then, the calculation unit 35 calculates the amount of data of the values of some variables collected in each of the plurality of control periods, based on the total amount of data of the values of each of the plurality of variables and the number of the plurality of control periods.

データ量出力部36は、複数の制御周期各々において収集される一部の変数の値のデータ量を出力する。 The data amount output unit 36 outputs the data amount of the values of some variables collected in each of a plurality of control cycles.

このような支援装置30によれば、機器の制御に影響を与えることなく、所望のデータ量の変数の値を収集する処理を、PLC1に実行させることが可能になる。したがって、機器の制御において使用される変数の値を適切に収集することができる。 According to the support device 30, it is possible to cause the PLC 1 to execute a process of collecting variable values of a desired amount of data without affecting the control of the device. Therefore, values of variables used in controlling the equipment can be appropriately collected.

図6のような構成を含む支援装置30によって行われる支援方法の一例である、ロギング処理の実行の条件の設定を行う方法について、図7を用いてさらに詳細に説明する。 A method for setting conditions for executing logging processing, which is an example of a support method performed by the support device 30 having the configuration shown in FIG. 6, will be described in more detail with reference to FIG.

支援装置30には設定ツール40が備えられている。PC2では、所定の設定ツールプログラムをCPU21に実行させることによって設定ツール40の機能が提供される。 The support device 30 is equipped with a setting tool 40. In the PC 2, the function of the setting tool 40 is provided by causing the CPU 21 to execute a predetermined setting tool program.

設定ツール40にはプロジェクトデータ41が入力される。プロジェクトデータ41は、PLCシステムのシステム構成の情報、PLC1で実行させるユーザプログラム、及び、PLCシステムが含む入出力モジュール3や通信モジュール4等についての機能設定情報を含む情報である。ここでは、このプロジェクトデータ41は、例えばPC2において所定のプロジェクトデータ編集プログラムを実行することによりユーザによって既に作成されていて、例えば補助記憶装置25に既に記憶されているものとする。 Project data 41 is input to the setting tool 40 . The project data 41 is information including information on the system configuration of the PLC system, a user program to be executed by the PLC 1, and function setting information regarding the input/output module 3, communication module 4, etc. included in the PLC system. Here, it is assumed that the project data 41 has already been created by the user by executing a predetermined project data editing program on the PC 2, and is already stored in the auxiliary storage device 25, for example.

設定ツール40により、まず、このプロジェクトデータ41に対してS110の収集対象設定処理が行われる。この処理は、ユーザプログラムで使用されている変数から、ロギングの対象とする変数を設定する処理であって、図6の支援装置30におけるプログラム解析部31及び選択部32の機能を提供する処理である。 The setting tool 40 first performs collection target setting processing on the project data 41 in S110. This process is a process that sets variables to be logged from variables used in the user program, and is a process that provides the functions of the program analysis unit 31 and selection unit 32 in the support device 30 in FIG. be.

このS110の処理はS111のプログラム解析処理を含む。プログラム解析処理は、プロジェクトデータ41に含まれているユーザプログラムを解析して、ユーザプログラムで使用されている複数の変数を抽出する処理である。S110の収集対象設定処理では、プログラム解析処理の実行によって抽出された変数から、PLC1に行わせるロギング処理による収集対象の変数をユーザに選択させる処理がさらに行われる。 The process of S110 includes the program analysis process of S111. The program analysis process is a process of analyzing a user program included in the project data 41 and extracting a plurality of variables used in the user program. In the collection target setting process of S110, a process of having the user select variables to be collected by the logging process performed by the PLC 1 from the variables extracted by executing the program analysis process is further performed.

ここで図8について説明する。図8は、S110の収集対象設定処理で用いられるUI(User Interface)画面100の画面例を表している。 Now, FIG. 8 will be explained. FIG. 8 shows an example of a UI (User Interface) screen 100 used in the collection target setting process of S110.

図8の画面例では、UI画面100は、プログラム選択部101、抽出変数表示部102、及び対象変数表示部103を含む。支援装置30の機能を図5のPC2が提供する場合、表示装置24は、UI画面100を表示する。 In the screen example of FIG. 8, the UI screen 100 includes a program selection section 101, an extracted variable display section 102, and a target variable display section 103. When the PC 2 in FIG. 5 provides the functions of the support device 30, the display device 24 displays the UI screen 100.

プログラム選択部101には、プロジェクトデータ41に含まれていたユーザプログラムを示す情報が表示される。なお、本実施形態では、複数のプログラムの集合体としてタスクが構成され、複数のタスクの集合体としてユーザプログラムが構成されているものとする。図8の画面例において、「アプリ名称」はユーザプログラムの名称であり、「タスク1」、「タスク2」、及び「タスク3」は各タスクの名称であり、「プログラム」、「プログラムN」は各タスクに属する各プログラムの名称である。この画面例では、ユーザプログラムと各タスクと各プログラムとの関係をツリー形式で表現することが表されている。 Information indicating the user program included in the project data 41 is displayed in the program selection section 101. In this embodiment, it is assumed that a task is configured as a collection of a plurality of programs, and a user program is configured as a collection of a plurality of tasks. In the screen example of FIG. 8, "Application name" is the name of the user program, "Task 1", "Task 2", and "Task 3" are the names of each task, "Program", "Program N" is the name of each program belonging to each task. In this screen example, the relationship between the user program, each task, and each program is expressed in a tree format.

プログラム選択部101に表示されているプログラムの名称の何れかを選択する操作がユーザにより行われると、選択された名称に対応するプログラムに対してS111のプログラム解析処理が行われ、そのプログラムで使用されている変数が抽出される。なお、プログラムの名称の代わりにタスクの名称を選択する操作が行われた場合には、選択された名称に対応するタスクに属するプログラムのそれぞれから変数が抽出される。このとき、抽出された変数の名称が抽出変数表示部102に一覧表示される。 When the user performs an operation to select one of the program names displayed in the program selection section 101, the program analysis process of S111 is performed on the program corresponding to the selected name. The variables that are specified are extracted. Note that when an operation is performed to select a task name instead of a program name, variables are extracted from each of the programs belonging to the task corresponding to the selected name. At this time, the names of the extracted variables are displayed in a list on the extracted variable display section 102.

抽出変数表示部102に表示されている変数の名称のうちから何れか1以上を選択し、登録ボタン104を押下する操作がユーザにより行われると、選択された名称に対応する変数が収集対象の変数として特定される。このとき、特定された収集対象の変数の名称が対象変数表示部103に一覧表示される。 When the user selects one or more of the variable names displayed in the extracted variable display area 102 and presses the registration button 104, the variable corresponding to the selected name will be collected. Identified as a variable. At this time, the names of the identified variables to be collected are displayed in a list on the target variable display section 103.

なお、対象変数表示部103に表示されている収集対象の変数の名称のうちから何れか1以上を選択し、解除ボタン105を押下する操作がユーザにより行われると、選択された名称に対応する変数が収集対象の変数から除外される。 Note that when the user selects one or more of the names of the variables to be collected displayed in the target variable display section 103 and presses the release button 105, the name corresponding to the selected name is selected. The variable is excluded from the variables to be collected.

また、一括登録ボタン106を押下する操作がユーザにより行われると、抽出変数表示部102に名称が表示されている変数の全てが収集対象の変数として選択され、その名称が対象変数表示部103に一覧表示される。その一方で、一括解除ボタン107を押下する操作がユーザにより行われると、対象変数表示部103に名称が表示されている変数の全てが収集対象の変数から除外される。 Furthermore, when the user presses the batch registration button 106, all the variables whose names are displayed in the extracted variable display section 102 are selected as variables to be collected, and their names are displayed in the target variable display section 103. A list will be displayed. On the other hand, when the user presses the batch release button 107, all variables whose names are displayed in the target variable display section 103 are excluded from the variables to be collected.

また、S110の収集対象設定処理では、以上のようにして選択された収集対象の変数の全てについてロギング処理を実行した場合に収集される総データ量がプロジェクトデータ41に基づいて算出される。得られた総データ量は、UI画面100における収集データサイズ表示部108に表示される。 In addition, in the collection target setting process of S110, the total amount of data that will be collected when the logging process is executed for all of the collection target variables selected as described above is calculated based on the project data 41. The obtained total data amount is displayed on the collected data size display section 108 on the UI screen 100.

ユーザにより予め設定されている制御周期は、UI画面100における制御周期表示部109に表示される。 The control cycle preset by the user is displayed on the control cycle display section 109 on the UI screen 100.

図7の説明に戻る。S120では収集動作設定処理が行われる。この処理は、ロギング処理の動作設定のための情報を作成する処理であって、図6の支援装置30における受付部33の機能を提供する処理である。この情報によって、例えば、収集対象のデータである変数の値の収集タイミング、データの収集を行う収集期間、収集したデータをPLC1が外部記憶装置17に保存させる保存タイミング等の設定がPLC1に対して行われる。 Returning to the explanation of FIG. 7. In S120, collection operation setting processing is performed. This process is a process that creates information for setting the operation of the logging process, and is a process that provides the function of the reception unit 33 in the support device 30 of FIG. 6. This information allows the PLC 1 to set, for example, the collection timing of variable values that are the data to be collected, the collection period for data collection, the storage timing for the PLC 1 to save the collected data in the external storage device 17, etc. It will be done.

収集期間を指定する操作がユーザにより行われると、指定された収集期間が受け付けられて、UI画面100における収集期間表示部110に表示される。 When the user performs an operation to specify a collection period, the specified collection period is accepted and displayed on the collection period display section 110 on the UI screen 100.

上述したS110及びS120の処理に続いて、S130の設定内容確認処理が行われる。この処理は、S110の処理により選択された収集対象の変数の全てについてPLC1がロギング処理を実行した場合における制御処理の実行時間が、予め設定されている制御周期に収まるかどうかを判定する処理である。この処理は、さらに、図6の支援装置30における計算部35及びデータ量出力部36の機能も提供する。 Following the processes of S110 and S120 described above, a setting content confirmation process of S130 is performed. This process is a process that determines whether the execution time of the control process when the PLC 1 executes the logging process for all the variables to be collected selected in the process of S110 falls within the preset control cycle. be. This process further provides the functions of the calculation unit 35 and data amount output unit 36 in the support device 30 of FIG.

この処理では、例えば、PLC1により実行される制御処理における入力処理、プログラム実行処理、出力処理、及びシステム処理の実行時間がプロジェクトデータ41から算出される。そして、これらの実行時間の合計が制御周期から減算される。この減算によって得られる時間は、ロギング処理が実行可能な時間であり、この時間を「最大処理時間」と称することとする。 In this process, for example, execution times of input processing, program execution processing, output processing, and system processing in the control processing executed by the PLC 1 are calculated from the project data 41. The sum of these execution times is then subtracted from the control period. The time obtained by this subtraction is the time during which the logging process can be executed, and this time will be referred to as the "maximum processing time."

次に、この最大処理時間に基づき、この時間内に収集可能なデータのデータ量が、制御周期で収集可能な最大サイズとして求められる。そして、この最大サイズと、S110の処理により算出していた総データ量(UI画面100における収集データサイズ表示部108に表示される値)との大小比較が行われ、総データ量が最大サイズ以下であるかどうかが判定される。 Next, based on this maximum processing time, the amount of data that can be collected within this time is determined as the maximum size that can be collected in the control cycle. Then, a comparison is made between this maximum size and the total data amount calculated in the process of S110 (the value displayed on the collected data size display section 108 on the UI screen 100), and the total data amount is less than or equal to the maximum size. It is determined whether or not.

総データ量が最大サイズを超えている場合、制御周期に非同期でのロギングを有効にする設定ボックス112の選択が可能になる。 If the total amount of data exceeds the maximum size, it becomes possible to select a setting box 112 that enables logging asynchronously to the control cycle.

設定ボックス112を選択する操作がユーザにより行われると、図5のCPU21は、計算部35として動作し、収集期間及び制御周期に基づいて、収集期間の分割数を決定する。分割数は、収集対象の複数の変数それぞれの値が分割して収集される複数の制御周期の個数を表す。CPU21は、例えば、収集期間を制御周期で除算することで、分割数を計算することができる。 When the user performs an operation to select the setting box 112, the CPU 21 in FIG. 5 operates as the calculation unit 35 and determines the number of divisions of the collection period based on the collection period and the control cycle. The number of divisions represents the number of control cycles in which the values of each of the plurality of variables to be collected are divided and collected. The CPU 21 can calculate the number of divisions, for example, by dividing the collection period by the control period.

次に、CPU21は、収集データサイズ表示部108に表示された総データ量と分割数とに基づいて、制御周期で収集可能なデータサイズを求める。制御周期で収集可能なデータサイズは、複数の制御周期各々において収集される一部の変数の値のデータ量を表す。CPU21は、例えば、総データ量を分割数で除算することで、制御周期で収集可能なデータサイズを計算することができる。 Next, the CPU 21 determines the data size that can be collected in the control cycle based on the total data amount and the number of divisions displayed on the collected data size display section 108. The data size that can be collected in a control cycle represents the amount of data of values of some variables that are collected in each of a plurality of control cycles. The CPU 21 can calculate the data size that can be collected in a control cycle, for example, by dividing the total data amount by the number of divisions.

図8の例では、制御周期が1msであり、収集期間が200msであるため、分割数は、200ms/1ms=200となる。また、総データ量は400kWである。Wは、ワード数を表す。この場合、制御周期で収集可能なデータサイズは、400kW/200=2kWとなる。 In the example of FIG. 8, the control period is 1 ms and the acquisition period is 200 ms, so the number of divisions is 200 ms/1 ms=200. Also, the total amount of data is 400kW. W represents the number of words. In this case, the data size that can be collected in the control cycle is 400kW/200=2kW.

制御周期で収集可能なデータサイズは、UI画面100におけるデータサイズ表示部111に表示される。データサイズ表示部111に表示されている2kW/30kWのうち、2kWが制御周期で収集可能なデータサイズであり、30kWは制御周期で収集可能な最大サイズである。この場合、図5の表示装置24は、データ量出力部36として動作し、制御周期で収集可能なデータサイズをUI画面100に表示する。 The data size that can be collected in a control cycle is displayed on the data size display section 111 on the UI screen 100. Of the 2kW/30kW displayed on the data size display section 111, 2kW is the data size that can be collected in the control cycle, and 30kW is the maximum size that can be collected in the control cycle. In this case, the display device 24 in FIG. 5 operates as the data amount output unit 36 and displays the data size that can be collected in the control period on the UI screen 100.

制御周期、収集期間、収集データサイズ、及び制御周期で収集可能なデータサイズをUI画面100に表示することによって、例えば、収集対象の変数の検討をユーザに想起させることが可能になる。 By displaying the control cycle, collection period, collection data size, and data size that can be collected in the control cycle on the UI screen 100, it becomes possible to remind the user to consider the variables to be collected, for example.

次に、S140の設定ファイル作成処理が行われる。この設定ファイル作成処理は、図6の支援装置30における設定情報出力部34の機能を提供する処理である。図5の通信I/F26は、設定情報出力部34として動作する。 Next, a setting file creation process of S140 is performed. This setting file creation process is a process that provides the function of the setting information output unit 34 in the support device 30 of FIG. The communication I/F 26 in FIG. 5 operates as the setting information output section 34.

設定ファイル作成処理は、S110の処理により選択された収集対象の変数を特定する情報とS120の処理により設定されたロギング処理の動作設定情報とをロギング設定データ42として出力する処理である。ロギング設定データ42は、設定情報出力部34が出力する設定情報に対応する。ロギング設定データ42はPLC1に転送され、PLC1では、ロギング処理についての動作設定が、ロギング設定データ42の内容に基づいて行われる。 The configuration file creation process is a process that outputs, as logging configuration data 42, the information specifying the variable to be collected selected in the process of S110 and the operation setting information of the logging process set in the process of S120. The logging setting data 42 corresponds to the setting information output by the setting information output unit 34. The logging setting data 42 is transferred to the PLC 1, and in the PLC 1, operation settings for logging processing are performed based on the contents of the logging setting data 42.

ロギング設定データ42についてさらに説明する。図9は、ロギング設定データ42のデータ構造の一例を示している。 The logging setting data 42 will be further explained. FIG. 9 shows an example of the data structure of the logging setting data 42.

ロギング設定データ42は、プロジェクトデータ情報51と、収集動作設定情報52と、収集対象設定情報53とを含む。 The logging setting data 42 includes project data information 51, collection operation setting information 52, and collection target setting information 53.

プロジェクトデータ情報51は、PLC1に実行させるユーザプログラムを特定する情報であり、例えば、ユーザプログラムをコンパイルして得られるオブジェクトコードに付された名称(プロジェクト名)や、コンパイルの実行日時等の情報を含む。なお、プロジェクトデータ情報51は、プロジェクトデータ41の一部として含まれている。 The project data information 51 is information that specifies the user program to be executed by the PLC 1, and includes information such as the name (project name) given to the object code obtained by compiling the user program and the execution date and time of the compilation. include. Note that the project data information 51 is included as part of the project data 41.

収集動作設定情報52はS120の収集動作設定処理によって作成される情報である。収集動作設定情報52には、例えば、収集タイミング、ユーザにより指定された収集期間、及び収集方式が含まれている。収集タイミングは、収集期間が開始されるタイミングを表す。 The collection operation setting information 52 is information created by the collection operation setting process in S120. The collection operation setting information 52 includes, for example, collection timing, a collection period specified by the user, and a collection method. Collection timing represents the timing at which the collection period starts.

収集方式は、同期又は非同期を示す情報である。同期は、制御周期に同期してロギングを行う収集方式であり、非同期は、制御周期とは非同期にロギングを行う収集方式である。図8の設定ボックス112が選択された場合、収集方式として非同期が設定され、それ以外の場合、収集方式として同期が設定される。 The collection method is information indicating synchronous or asynchronous. Synchronous is a collection method that performs logging in synchronization with the control cycle, and asynchronous is a collection method that performs logging asynchronously with the control cycle. If the setting box 112 in FIG. 8 is selected, asynchronous is set as the collection method; otherwise, synchronous is set as the collection method.

収集動作設定情報52には、収集したデータをPLC1が外部記憶装置17に保存させる保存タイミング、及び収集したデータを保存させる保存先の外部記憶装置17を特定する情報も含まれている。 The collection operation setting information 52 also includes information specifying the storage timing at which the PLC 1 stores the collected data in the external storage device 17 and the storage destination external storage device 17 in which the collected data is stored.

収集対象設定情報53は、S110の収集対象設定処理によって選択された収集対象の変数についての情報である。収集対象設定情報53のデータ構造の一例が図10に示されている。 The collection target setting information 53 is information about the collection target variable selected by the collection target setting process in S110. An example of the data structure of the collection target setting information 53 is shown in FIG.

図10の例では、収集対象設定情報53には、データの収集タイミングにおける収集データの合計サイズの情報が含まれている。また、収集対象設定情報53には、収集対象の変数の個数の情報が含まれている。さらに、収集対象設定情報53には、収集対象の変数のそれぞれについての情報として、メモリ種別、データ型、メモリアドレス、及びデータサイズの情報が含まれている。これらの情報によって、PLC1においてユーザプログラムが実行されたときに収集対象の変数の値の保持に使用される記憶領域の位置についてのメモリ14上の位置が特定される。 In the example of FIG. 10, the collection target setting information 53 includes information on the total size of collected data at the data collection timing. Furthermore, the collection target setting information 53 includes information on the number of variables to be collected. Furthermore, the collection target setting information 53 includes information on memory type, data type, memory address, and data size as information about each variable to be collected. These pieces of information specify the location on the memory 14 of the storage area used to hold the values of the variables to be collected when the user program is executed in the PLC 1.

PLC1によるロギング処理の実行の条件の設定は、上述した設定ツール40を用いることによって、支援装置30によって行われる。 Setting of the conditions for execution of the logging process by the PLC 1 is performed by the support device 30 by using the setting tool 40 described above.

<ロギングの実行> <Execution of logging>

次に、図1のPLCシステムにおいて、支援装置30としてのPC2によって設定された条件に従ってPLC1により行われるロギング処理について説明する。 Next, a logging process performed by the PLC 1 in accordance with conditions set by the PC 2 as the support device 30 in the PLC system of FIG. 1 will be described.

まず図11について説明する。図11はロギング処理を行うPLC1の機能構成例を示した図である。図11に示した構成例では、PLC1は、制御部61を含む。 First, FIG. 11 will be explained. FIG. 11 is a diagram showing an example of the functional configuration of the PLC 1 that performs logging processing. In the configuration example shown in FIG. 11, the PLC 1 includes a control section 61.

制御部61は、入力処理、プログラム実行処理、出力処理、ロギング処理、及びシステム処理を含む制御処理を、制御周期毎に繰り返す。制御部61は、支援装置30から出力されるロギング設定データ42に基づいて、収集対象の複数の変数を複数の制御周期に分割し、複数の制御周期各々において、収集対象の複数の変数のうち一部の変数の値を収集する。これにより、制御部61は、収集対象の複数の変数それぞれの値を収集期間内に収集する。図4に示したハードウェア構成例では、CPU12が制御部61として動作する。 The control unit 61 repeats control processing including input processing, program execution processing, output processing, logging processing, and system processing every control cycle. The control unit 61 divides the plurality of variables to be collected into a plurality of control periods based on the logging setting data 42 output from the support device 30, and divides the plurality of variables to be collected into a plurality of control periods in each of the plurality of control periods. Collect values of some variables. Thereby, the control unit 61 collects the values of each of the plurality of variables to be collected within the collection period. In the hardware configuration example shown in FIG. 4, the CPU 12 operates as the control unit 61.

このようなPLC1によれば、機器の制御に影響を与えることなく、所望のデータ量の変数の値を収集することが可能になる。したがって、機器の制御において使用される変数の値を適切に収集することができる。 According to such a PLC 1, it is possible to collect the values of variables of a desired amount of data without affecting the control of the equipment. Therefore, values of variables used in controlling the equipment can be appropriately collected.

図11のような構成要素を含むPLC1によって行われるロギング実行方法について、図12を用いてさらに詳細に説明する。S220、S250、S260、S270、及びS280の処理は、制御部61によって行われる。 The logging execution method performed by the PLC 1 including the components shown in FIG. 11 will be described in further detail using FIG. 12. The processes of S220, S250, S260, S270, and S280 are performed by the control unit 61.

S220のプログラム実行処理は、入力処理で取り込まれた、入出力モジュール3や通信モジュール4から送られてくる入力データを用いてユーザプログラムを実行する処理である。この実行結果は、入出力モジュール3や通信モジュール4の制御のために出力処理によって出力される。図5のハードウェア構成例において、このプログラム実行処理を実行するCPU12は、ユーザプログラムの実行のためにメモリ14の記憶領域を使用する。このときに使用される記憶領域を、プログラム使用領域14aと称することとする。 The program execution process of S220 is a process of executing a user program using the input data sent from the input/output module 3 and the communication module 4, which was captured in the input process. This execution result is output by output processing for controlling the input/output module 3 and the communication module 4. In the hardware configuration example of FIG. 5, the CPU 12 that executes this program execution process uses the storage area of the memory 14 for executing the user program. The storage area used at this time will be referred to as the program use area 14a.

S250のロギング処理は、S220のプログラム実行処理により実行されるユーザプログラムにおいて使用されている変数のうち収集対象の変数の値を収集する処理である。この収集対象の変数についての情報と、ロギング処理の動作設定情報とを含むロギング設定データ42は、支援装置30(PC2)において前述したようにして作成されてPLC1に予め提供されているものとする。 The logging process of S250 is a process of collecting values of variables to be collected among the variables used in the user program executed by the program execution process of S220. It is assumed that the logging setting data 42 including information about the variables to be collected and operation setting information of the logging process is created as described above in the support device 30 (PC2) and provided to the PLC 1 in advance. .

S260の時刻管理処理とS270の収集タイミング検知処理は、入力処理、プログラム実行処理、出力処理、ロギング処理、及びシステム処理を含む制御処理と並行して行われる。時刻管理処理は現在の時刻を計時する処理である。収集タイミング検知処理は、ロギング設定データ42に含まれている収集動作設定情報52により示されているデータの収集タイミングの到来を検知する処理である。 The time management process in S260 and the collection timing detection process in S270 are performed in parallel with control processes including input processing, program execution processing, output processing, logging processing, and system processing. The time management process is a process of measuring the current time. The collection timing detection process is a process of detecting the arrival of the data collection timing indicated by the collection operation setting information 52 included in the logging setting data 42.

S250のロギング処理では、収集タイミング検知処理による収集タイミングの到来の検知に応じて、収集対象の変数の値を収集する処理が行われる。また、ロギング処理では、変数の値の収集時刻を時刻管理処理による計時結果から取得し、変数の値とその収集時刻とをそれぞれ対応付けた収集データをリングバッファ62に保存する処理が行われる。 In the logging process of S250, the process of collecting the values of the variables to be collected is performed in response to the detection of the arrival of the collection timing by the collection timing detection process. In addition, in the logging process, a process is performed in which the collection time of the variable value is acquired from the time measurement result by the time management process, and the collected data in which the variable value and the collection time are associated with each other is stored in the ring buffer 62.

リングバッファ62は、ロギング処理による変数の値の収集時刻を、その収集時刻に収集された変数の値に対応付けた収集データを、変数の値を収集する度に保存する記憶領域である。図4に示したハードウェア構成例では、メモリ14の記憶領域の一部によってリングバッファ62が構成される。 The ring buffer 62 is a storage area that stores collected data in which the collection time of the variable value through logging processing is associated with the variable value collected at that collection time, each time the variable value is collected. In the hardware configuration example shown in FIG. 4, a ring buffer 62 is configured by a part of the storage area of the memory 14.

また、PLC1のCPU12はS280の保存処理を実行する。この保存処理は、ロギング設定データ42に含まれている収集動作設定情報52により示されている保存タイミングの到来を検知する処理を含む。また、この保存処理は、記憶装置I/F15を制御して、リングバッファ62に保存されている収集データを保存タイミングの到来の検知に応じて読み出させて、収集動作設定情報52により示されている保存先である外部記憶装置17に保存させる処理を含む。 Further, the CPU 12 of the PLC 1 executes the storage process of S280. This storage process includes a process of detecting the arrival of the storage timing indicated by the collection operation setting information 52 included in the logging setting data 42. In addition, this storage process is performed by controlling the storage device I/F 15 to read the collection data stored in the ring buffer 62 in response to the detection of the arrival of the storage timing. This includes processing for saving the data in the external storage device 17, which is the storage destination.

ここで、S250のロギング処理とS280の保存処理とについて、図13に示したフローチャートを用いてさらに詳細に説明する。 Here, the logging process in S250 and the storage process in S280 will be explained in more detail using the flowchart shown in FIG.

図13において、S258及びS259の処理は保存処理の詳細を表しており、残余のS251からS257の各処理はロギング処理の詳細を表している。 In FIG. 13, the processes of S258 and S259 represent the details of the storage process, and the remaining processes of S251 to S257 represent the details of the logging process.

図13に示されている処理は、各制御周期の制御処理において、ロギング処理の処理開始タイミングが到来すると開始される。 The processing shown in FIG. 13 is started when the processing start timing of the logging processing arrives in the control processing of each control cycle.

まず、S251において、前述したS270の収集タイミング検知処理によって収集タイミングの到来が検知されたか否かを判定する処理が行われる。この判定処理において、収集タイミングの到来が検知されたと判定されたとき(判定結果がYESのとき)には、S252において、ロギング設定データ42の収集動作設定情報52に含まれる収集方式が非同期であるか否かを判定する処理が行われる。 First, in S251, a process is performed to determine whether or not the collection timing has been detected by the collection timing detection process in S270 described above. In this determination process, when it is determined that the arrival of the collection timing has been detected (when the determination result is YES), in S252, the collection method included in the collection operation setting information 52 of the logging setting data 42 is asynchronous. Processing is performed to determine whether or not.

収集方式が非同期であるとき(判定結果がYESのとき)には、S253の非同期収集処理が行われ、収集方式が同期であるとき(判定結果がNOのとき)には、S254の同期収集処理が行われる。 When the collection method is asynchronous (when the determination result is YES), asynchronous collection processing in S253 is performed, and when the collection method is synchronous (when the determination result is NO), synchronous collection processing in S254 is performed. will be held.

S251の判定処理において、収集タイミングの到来が検知されないと判定されたとき(判定結果がNOのとき)には、S255において、ロギング設定データ42の収集動作設定情報52に含まれる収集方式が非同期であるか否かを判定する処理が行われる。 In the determination process of S251, when it is determined that the arrival of the collection timing is not detected (when the determination result is NO), in S255, the collection method included in the collection operation setting information 52 of the logging setting data 42 is asynchronous. A process is performed to determine whether or not there is one.

収集方式が非同期であるとき(判定結果がYESのとき)には、S256において、ロギング設定データ42の収集対象設定情報53に情報が含まれていた収集対象の変数の全てについて値の収集を済ませたか否かを判定する処理が行われる。この判定処理において、値の収集を済ませていない収集対象の変数が残っていると判定されたとき(判定結果がNOのとき)には、S257の非同期収集処理が行われる。 When the collection method is asynchronous (when the determination result is YES), in S256, values are collected for all the collection target variables whose information was included in the collection target setting information 53 of the logging setting data 42. A process is performed to determine whether or not the In this determination process, when it is determined that there are variables to be collected whose values have not yet been collected (when the determination result is NO), the asynchronous collection process of S257 is performed.

S255の判定処理において、収集方式が同期であるとき(判定結果がNOのとき)には、図13に示されている処理が終了する。S256の判定処理において、収集対象の変数の全てについて値の収集を済ませたと判定されたとき(判定結果がYESのとき)には、図13に示されている処理が終了する。 In the determination process of S255, when the collection method is synchronous (when the determination result is NO), the process shown in FIG. 13 ends. In the determination process of S256, when it is determined that values have been collected for all of the variables to be collected (when the determination result is YES), the process shown in FIG. 13 ends.

S253の非同期収集処理、S254の同期収集処理、及びS257の非同期収集処理では、収集対象の変数の値が収集され、収集された値が、後述する収集データ73としてリングバッファ62に保存される。 In the asynchronous collection process of S253, the synchronous collection process of S254, and the asynchronous collection process of S257, the values of the variables to be collected are collected, and the collected values are stored in the ring buffer 62 as collected data 73, which will be described later.

S253の非同期収集処理、S254の同期収集処理、又はS257の非同期収集処理に続き、S258では、ロギング設定データ42に含まれている収集動作設定情報52により示されている保存タイミングが到来したか否かを判定する処理が行われる。この判定処理において、保存タイミングが到来したと判定したとき(判定結果がYESのとき)にはS259に処理を進める。一方、この判定処理において、保存タイミングが到来しないと判定したとき(判定結果がNOのとき)には、S259の処理を行わずに、図13に示されている処理が終了する。 Following the asynchronous collection process in S253, the synchronous collection process in S254, or the asynchronous collection process in S257, in S258 it is determined whether the storage timing indicated by the collection operation setting information 52 included in the logging setting data 42 has arrived. A process is performed to determine whether the In this determination process, when it is determined that the storage timing has arrived (when the determination result is YES), the process advances to S259. On the other hand, in this determination process, when it is determined that the storage timing has not arrived (when the determination result is NO), the process shown in FIG. 13 ends without performing the process of S259.

S259では、今回実行中のロギング処理におけるS253の非同期収集処理、S254の同期収集処理、又はS257の非同期収集処理によりリングバッファ62に保存された収集データ73を読み出す処理が行われる。S259では、読み出された収集データ73を、収集動作設定情報52で示されている保存先の外部記憶装置17にロギング収集データ70として保存する処理も行われる。 In S259, a process is performed to read the collected data 73 stored in the ring buffer 62 by the asynchronous collection process of S253, the synchronous collection process of S254, or the asynchronous collection process of S257 in the logging process currently being executed. In S259, processing is also performed to save the read collected data 73 as the logging collected data 70 in the storage destination external storage device 17 indicated by the collection operation setting information 52.

ロギング収集データ70についてさらに説明する。図14は、ロギング収集データ70のデータ構造の一例を示している。 The logging collection data 70 will be further explained. FIG. 14 shows an example of the data structure of the logging collection data 70.

ロギング収集データ70は、プロジェクトデータ情報51と、収集データ数71と、収集データサイズ72と、1以上の収集データ73とを含む。 The logging collection data 70 includes project data information 51, the number of collection data 71, the collection data size 72, and one or more collection data 73.

プロジェクトデータ情報51は、PLC1で実行されたユーザプログラムを特定する情報であり、例えば、ユーザプログラムをコンパイルして得られるオブジェクトコードに付された名称や、コンパイルの実行日時の情報を含む。つまり、ロギング収集データ70に含まれているプロジェクトデータ情報51は、ロギング設定データ42に含まれていたプロジェクトデータ情報51と同様のものである。CPU12は、S253の非同期収集処理、S254の同期収集処理、及びS257の非同期収集処理において、ロギング設定データ42からプロジェクトデータ情報51を読み出してロギング収集データ70に取り込む。 The project data information 51 is information that specifies the user program executed by the PLC 1, and includes, for example, the name given to the object code obtained by compiling the user program, and information on the execution date and time of the compilation. That is, the project data information 51 included in the logging collection data 70 is similar to the project data information 51 included in the logging setting data 42. The CPU 12 reads the project data information 51 from the logging setting data 42 and incorporates it into the logging collection data 70 in the asynchronous collection process of S253, the synchronous collection process of S254, and the asynchronous collection process of S257.

収集データ数71は、ロギング収集データ70に含まれている収集データ73の個数を表している情報である。また、収集データサイズ72は、ロギング収集データ70に含まれている収集データ73の総データ量を表している情報である。 The number of collected data 71 is information representing the number of pieces of collected data 73 included in the logging collected data 70. Further, the collected data size 72 is information representing the total amount of collected data 73 included in the logging collected data 70.

ロギング収集データ70には、収集データ73として、収集された変数の値についてのデータが、収集された順序に従って含まれている。この収集データ73のデータ構造の一例が図15に示されている。 The logging collected data 70 includes, as collected data 73, data about the values of collected variables in the order in which they were collected. An example of the data structure of this collected data 73 is shown in FIG.

図15の例では、収集データ73にはタイムスタンプの情報が含まれている。このタイムスタンプは、変数の値の収集が行われたときの時刻を表している。 In the example of FIG. 15, the collected data 73 includes time stamp information. This timestamp represents the time when the value of the variable was collected.

また、収集データ73には、タイムスタンプの時刻において収集された1以上の変数のそれぞれの値を表す変数データが、「変数データ1」、「変数データ2」、・・・、「変数データN」として含まれている。 In addition, the collected data 73 includes variable data representing the respective values of one or more variables collected at the time of the timestamp. ” is included.

S259の処理では、ロギング設定データ42とリングバッファ62に保存された収集データ73とを用いて、このようなデータ構造を有するロギング収集データ70を作成して外部記憶装置17に保存する処理が行われる。 In the process of S259, the logging collection data 70 having such a data structure is created using the logging setting data 42 and the collection data 73 stored in the ring buffer 62, and is stored in the external storage device 17. be exposed.

S259の処理が終了すると、図13に示されている処理が終了する。図13の処理によれば、収集方式が非同期である場合、S251において収集タイミングの到来が検知されていない場合であっても、S257の非同期収集処理が行われる。したがって、S253の非同期収集処理に続いて、S257の非同期収集処理が制御周期毎に繰り返される。これにより、制御周期とは非同期に変数の値を収集することが可能になる。 When the process of S259 ends, the process shown in FIG. 13 ends. According to the process of FIG. 13, when the collection method is asynchronous, the asynchronous collection process of S257 is performed even if the arrival of the collection timing is not detected in S251. Therefore, following the asynchronous collection process in S253, the asynchronous collection process in S257 is repeated every control cycle. This makes it possible to collect variable values asynchronously with the control cycle.

なお、図13のフローチャートで示したロギング処理が終了したときには、CPU12は、ロギング設定データ42を外部記憶装置17にさらに保存する処理も行うようにする。このロギング設定データ42は、後述する収集データ73の表示の際に使用される。 Note that when the logging process shown in the flowchart of FIG. 13 is completed, the CPU 12 also performs a process of further saving the logging setting data 42 in the external storage device 17. This logging setting data 42 is used when displaying collected data 73, which will be described later.

次に、図13におけるS254の同期収集処理について、図16に示したフローチャートを用いてさらに詳細に説明する。 Next, the synchronous collection process of S254 in FIG. 13 will be described in more detail using the flowchart shown in FIG.

まず、S261において、今回の制御周期における制御処理についてのロギング処理の実行時間の計測を開始する処理が行われる。 First, in S261, a process is performed to start measuring the execution time of the logging process for the control process in the current control cycle.

次に、S262において、前述したS260の時刻管理処理により計時されている現在の時刻をタイムスタンプとして取得し、得られたタイムスタンプを収集データ73のタイムスタンプとしてリングバッファ62に書き込む処理が行われる。 Next, in S262, a process is performed in which the current time measured by the time management process in S260 described above is obtained as a timestamp, and the obtained timestamp is written into the ring buffer 62 as a timestamp of the collected data 73. .

次に、S263において、収集対象の各変数の現在の値を取得し、収集データ73のタイムスタンプの書き込み位置に続けて、取得した値を、変数データとして、収集対象の変数に対応づけられた所定の順序でリングバッファ62に書き込む処理が行われる。 Next, in S263, the current value of each variable to be collected is acquired, and the acquired value is associated with the variable to be collected as variable data following the writing position of the time stamp of the collected data 73. The process of writing to the ring buffer 62 is performed in a predetermined order.

収集対象の変数の値は、ロギング設定データ42の収集対象設定情報53に含まれている収集対象の変数についてのメモリ種別、データ型、メモリアドレス、及びデータサイズの情報に基づいて特定される、プログラム使用領域14a上の位置で保持されている。したがって、S263の処理では、この位置で保持されているデータを読み出すことによって、収集対象の変数の値の取得が行われ、リングバッファ62への書き込みが行われる。 The value of the variable to be collected is specified based on the information on the memory type, data type, memory address, and data size regarding the variable to be collected, which is included in the collection target setting information 53 of the logging setting data 42. It is held at a position above the program use area 14a. Therefore, in the process of S263, the value of the variable to be collected is acquired by reading the data held at this position, and written to the ring buffer 62.

次に、S264において、S261の処理により計測を開始した今回のロギング処理の実行時間が、前述した最大処理時間内に収まっているか否かを判定する処理が行われる。この判定処理において、今回のロギング処理の実行時間が最大処理時間内に収まっていると判定されたとき(判定結果がYESのとき)にはS265に処理を進める。一方、この判定処理において、今回のロギング処理の実行時間が最大処理時間内に収まらなかったと判定されたとき(判定結果がNOのとき)には、今回の収集処理が終了する。なお、処理の高速化を目的として、このS264の処理を、次に説明するS265の判定処理における、収集対象の変数の全てについて値の収集を済ませたと判定されたとき(判定結果がYESのとき)の後に行うようにしてもよい。 Next, in S264, a process is performed to determine whether the execution time of the current logging process whose measurement was started in the process of S261 is within the maximum processing time described above. In this determination process, when it is determined that the execution time of the current logging process is within the maximum processing time (when the determination result is YES), the process advances to S265. On the other hand, in this determination process, when it is determined that the execution time of the current logging process does not fall within the maximum processing time (when the determination result is NO), the current collection process ends. Note that for the purpose of speeding up the process, the process in S264 is performed when it is determined that values have been collected for all the variables to be collected (when the determination result is YES) in the determination process in S265, which will be described next. ) may be performed after.

S265では、ロギング設定データ42の収集対象設定情報53に情報が含まれていた収集対象の変数の全てについて値の収集を済ませたか否かを判定する処理が行われる。この判定処理において、収集対象の変数の全てについて値の収集を済ませたと判定されたとき(判定結果がYESのとき)には今回の収集処理が終了する。一方、この判定処理において、値の収集を済ませていない収集対象の変数が残っていると判定されたとき(判定結果がNOのとき)にはS263へ処理を戻して、値の収集を済ませていない収集対象の変数について、その値を収集する処理が行われる。 In S265, a process is performed to determine whether values have been collected for all of the collection target variables whose information was included in the collection target setting information 53 of the logging setting data 42. In this determination process, when it is determined that values have been collected for all variables to be collected (when the determination result is YES), the current collection process ends. On the other hand, in this judgment process, if it is judged that there are variables to be collected whose values have not yet been collected (when the judgment result is NO), the process returns to S263 and the values have been collected. For variables to be collected that do not exist, processing is performed to collect their values.

以上の収集処理が終了すると、収集データ73のリングバッファ62への保存が完了し、続いて図13のS258の処理が行われる。 When the above collection process is completed, the storage of the collected data 73 in the ring buffer 62 is completed, and then the process of S258 in FIG. 13 is performed.

次に、図13におけるS253及びS257の非同期収集処理について、図17に示したフローチャートを用いてさらに詳細に説明する。 Next, the asynchronous collection processing in S253 and S257 in FIG. 13 will be described in more detail using the flowchart shown in FIG.

まず、S271において、今回の制御周期における制御処理についてのロギング処理の実行時間の計測を開始する処理が行われる。 First, in S271, a process is performed to start measuring the execution time of the logging process for the control process in the current control cycle.

次に、S272において、図13のS251における収集タイミングの到来に伴ってS253の非同期収集処理が開始されたか否かを判定する処理が行われる。この判定処理において、S253の非同期収集処理が開始されたと判定されたとき(判定結果がYESのとき)にはS273に処理を進める。一方、この判定処理において、S257の非同期収集処理が開始されたと判定されたとき(判定結果がNOのとき)にはS278に処理を進める。 Next, in S272, a process is performed to determine whether or not the asynchronous collection process in S253 has been started with the arrival of the collection timing in S251 in FIG. In this determination process, when it is determined that the asynchronous collection process in S253 has started (when the determination result is YES), the process advances to S273. On the other hand, in this determination process, when it is determined that the asynchronous collection process in S257 has been started (when the determination result is NO), the process advances to S278.

S273では、現在の時刻をタイムスタンプとして取得し、得られたタイムスタンプを収集データ73のタイムスタンプとしてリングバッファ62に書き込む処理が行われる。 In S273, a process is performed in which the current time is acquired as a timestamp and the acquired timestamp is written into the ring buffer 62 as the timestamp of the collected data 73.

次に、S274において、収集対象の各変数の現在の値を取得し、収集データ73のタイムスタンプの書き込み位置に続けて、取得した値を、変数データとして、収集対象の変数に対応づけられた所定の順序でリングバッファ62に書き込む処理が行われる。 Next, in S274, the current value of each variable to be collected is acquired, and the acquired value is associated with the variable to be collected as variable data following the writing position of the time stamp of the collected data 73. The process of writing to the ring buffer 62 is performed in a predetermined order.

次に、S275において、ロギング設定データ42の収集対象設定情報53に情報が含まれていた収集対象の変数の全てについて値の収集を済ませたか否かを判定する処理が行われる。この判定処理において、値の収集を済ませていない収集対象の変数が残っていると判定されたとき(判定結果がNOのとき)にはS276に処理を進める。 Next, in S275, a process is performed to determine whether values have been collected for all the collection target variables whose information was included in the collection target setting information 53 of the logging setting data 42. In this determination process, if it is determined that there remain variables to be collected whose values have not been collected (when the determination result is NO), the process advances to S276.

S276では、S271の処理により計測を開始した今回のロギング処理の実行時間が所定時間に達したか否かを判定する処理が行われる。所定時間としては、例えば、ユーザにより指定された時間、又は前述した最大処理時間が用いられる。この判定処理において、今回のロギング処理の実行時間が所定時間に達していないと判定されたとき(判定結果がNOのとき)にはS274へ処理を戻して、値の収集を済ませていない収集対象の変数について、その値を収集する処理が行われる。 In S276, a process is performed to determine whether the execution time of the current logging process whose measurement was started in the process of S271 has reached a predetermined time. As the predetermined time, for example, the time specified by the user or the maximum processing time described above is used. In this judgment process, if it is judged that the execution time of the current logging process has not reached the predetermined time (when the judgment result is NO), the process returns to S274, and the collection target whose values have not been collected is A process is performed to collect the values of the variables.

一方、この判定処理において、今回のロギング処理の実行時間が所定時間に達したと判定されたとき(判定結果がYESのとき)には、S277において、最後に収集された変数を示す変数情報を記録する処理が行われる。この変数情報は、ロギング設定データ42の収集対象設定情報53に情報が含まれていた収集対象の変数のうち、直前のS274の処理において収集された変数を示している。 On the other hand, in this determination process, when it is determined that the execution time of the current logging process has reached the predetermined time (when the determination result is YES), in S277, variable information indicating the last collected variable is Recording processing is performed. This variable information indicates the variable that was collected in the immediately preceding process of S274 among the collection target variables whose information was included in the collection target setting information 53 of the logging setting data 42.

S275の判定処理において、収集対象の変数の全てについて値の収集を済ませたと判定されたとき(判定結果がYESのとき)にはS277に処理を進める。 In the determination process of S275, when it is determined that values have been collected for all the variables to be collected (when the determination result is YES), the process advances to S277.

S278では、次に収集する変数を特定する処理が行われる。S278の処理では、例えば、前回の非同期収集処理において記録された変数情報に基づいて、最後に収集された変数の次の変数が、次に収集する変数として特定される。最後に収集された変数が収集対象の最後の変数である場合、次に収集する変数が存在しないと判定される。 In S278, processing is performed to identify the next variable to be collected. In the process of S278, for example, based on the variable information recorded in the previous asynchronous collection process, the variable following the last collected variable is specified as the next variable to be collected. If the last variable to be collected is the last variable to be collected, it is determined that there is no variable to collect next.

次に、S279において、ロギング設定データ42の収集対象設定情報53に情報が含まれていた収集対象の変数の全てについて値の収集を済ませたか否かを判定する処理が行われる。S278の処理において次に収集する変数が存在しないと判定された場合、収集対象の変数の全てについて値の収集を済ませたと判定される。 Next, in S279, a process is performed to determine whether values have been collected for all the collection target variables whose information was included in the collection target setting information 53 of the logging setting data 42. If it is determined in the process of S278 that there are no variables to be collected next, it is determined that values have been collected for all variables to be collected.

S279の判定処理において、値の収集を済ませていない収集対象の変数が残っていると判定されたとき(判定結果がNOのとき)には、次に収集する変数を対象として、S274以降の処理が行われる。なお、今回の非同期収集処理において収集される変数の値の収集時刻を記録しておきたい場合には、次に収集する変数を対象として、S273以降の処理が行われる。収集対象の変数の全てについて値の収集を済ませたと判定されたとき(判定結果がYESのとき)には今回の非同期収集処理が終了する。 In the determination process of S279, if it is determined that there are still variables to be collected whose values have not been collected (when the determination result is NO), the processes from S274 onwards are performed for the next variable to be collected. will be held. Note that if it is desired to record the collection time of the value of the variable collected in the current asynchronous collection process, the processes from S273 onwards are performed for the next variable to be collected. When it is determined that values have been collected for all of the variables to be collected (when the determination result is YES), the current asynchronous collection process ends.

S273又はS274以降の処理が繰り返されることで、S277において、最後に収集された変数を示す変数情報が更新される。したがって、変数情報は、収集対象の複数の変数それぞれの値が分割して収集される複数の制御周期のうち、先頭の制御周期から今回の制御周期までの期間に収集された変数を示す情報である。今回の制御周期は、何れかの制御周期の一例である。 By repeating the processes after S273 or S274, variable information indicating the last collected variable is updated in S277. Therefore, variable information is information indicating variables collected during the period from the first control cycle to the current control cycle among multiple control cycles in which the values of each of the multiple variables to be collected are divided and collected. be. The current control cycle is an example of any control cycle.

以上の収集処理が終了すると、収集データ73のリングバッファ62への保存が完了し、続いて図13のS258の処理が行われる。 When the above collection process is completed, the storage of the collected data 73 in the ring buffer 62 is completed, and then the process of S258 in FIG. 13 is performed.

<ロギングによる収集データの表示> <Display of collected data by logging>

次に、図1のPLCシステムにおけるPLC1により行われたロギング処理により得られた収集データ73を表示する手法について説明する。 Next, a method of displaying the collected data 73 obtained by the logging process performed by the PLC 1 in the PLC system of FIG. 1 will be described.

まず、収集データ73を表示する装置のハードウェア構成について説明する。図18は収集データ表示装置80のハードウェア構成例を示している。 First, the hardware configuration of the device that displays the collected data 73 will be described. FIG. 18 shows an example of the hardware configuration of the collected data display device 80.

図18の構成例では、収集データ表示装置80は、CPU81、メモリ82、入力装置83、補助記憶装置84、表示装置85、及び記憶装置I/F86を含む。これらの構成要素は何れもハードウェアであって、内部バス87に接続されており、相互にデータの授受を行うことが可能である。 In the configuration example of FIG. 18, the collected data display device 80 includes a CPU 81, a memory 82, an input device 83, an auxiliary storage device 84, a display device 85, and a storage device I/F 86. All of these components are hardware, connected to an internal bus 87, and can exchange data with each other.

CPU81は、例えば、メモリ82を利用して所定のプログラムを実行することにより、収集データの表示や収集データの波形表示等の各種の表示を制御する機能を提供する。 The CPU 81 provides a function of controlling various displays such as the display of collected data and the waveform display of the collected data, by executing a predetermined program using the memory 82, for example.

入力装置83は、例えば、キーボードやポインティングデバイス等であり、ユーザからの指示又は情報の入力に用いられる。 The input device 83 is, for example, a keyboard, a pointing device, or the like, and is used to input instructions or information from the user.

補助記憶装置84は、磁気ディスク装置、光ディスク装置、光磁気ディスク装置等であり、例えば、ハードディスクドライブやフラッシュメモリであってもよい。収集データ表示装置80は、補助記憶装置84にプログラム及びデータを格納しておき、それらをメモリ82にロードして使用することができる。 The auxiliary storage device 84 is a magnetic disk device, an optical disk device, a magneto-optical disk device, etc., and may be a hard disk drive or a flash memory, for example. The collected data display device 80 can store programs and data in the auxiliary storage device 84 and load them into the memory 82 for use.

表示装置85は、例えば、ユーザへの問い合わせ又は指示や、処理結果の表示出力に用いられる。 The display device 85 is used, for example, to make inquiries or instructions to the user, and to display and output processing results.

記憶装置I/F86は、メモリカード等の外部記憶装置17に対する各種のデータの読み出し処理を管理する。 The storage device I/F 86 manages reading processing of various data from the external storage device 17 such as a memory card.

収集データ表示装置80は以上のハードウェア構成を有している。なお、このようなハードウェア構成は、一般的なコンピュータが有している標準的な構成であるので、このようなコンピュータを用いて収集データ表示装置80を構成するようにしてもよい。また、図1のPLCシステムにおいて支援装置30として機能させたPC2をさらに用いて、収集データ表示装置80を構成するようにしてもよい。 The collected data display device 80 has the above hardware configuration. Note that since such a hardware configuration is a standard configuration of a general computer, the collected data display device 80 may be configured using such a computer. Further, the collected data display device 80 may be configured by further using the PC 2 that functions as the support device 30 in the PLC system of FIG.

次に図19について説明する。図19は収集データ表示装置80の機能構成例を示した図である。 Next, FIG. 19 will be explained. FIG. 19 is a diagram showing an example of the functional configuration of the collected data display device 80.

図19の構成例では、収集データ表示装置80は、表示部91を含み、PLC1によって収集された情報を表示する。図18の表示装置85は、表示部91として動作する。 In the configuration example of FIG. 19, the collected data display device 80 includes a display section 91 and displays information collected by the PLC 1. The display device 85 in FIG. 18 operates as a display section 91.

表示部91は、収集期間における収集対象の複数の変数それぞれの値の収集時刻と対応付けて、複数の変数それぞれの値を表示する。 The display unit 91 displays the values of each of the plurality of variables in association with the collection time of each value of the plurality of variables to be collected during the collection period.

このような収集データ表示装置80によれば、機器の制御に影響を与えることなく収集された所望のデータ量の変数の値を、収集期間内の時刻と対応付けて表示することができる。 According to such collected data display device 80, the value of the variable of the desired amount of data collected can be displayed in association with the time within the collection period without affecting the control of the device.

図19のような構成を含む収集データ表示装置80によって行われる、収集データを表示する方法の一例について、図20を用いてさらに詳細に説明する。 An example of a method for displaying collected data performed by the collected data display device 80 having the configuration shown in FIG. 19 will be described in further detail using FIG. 20.

収集データ表示装置80は、S310のプログラム表示処理、S320の波形表示処理、S330のロギングファイル解析・変換処理、及びS340の表示制御処理を行う。これらの各処理は、図18のCPU81によって行われる。これらの各処理をCPU81に行わせるプログラムはエンジニアリングソフトウェアと称されることもある。 The collected data display device 80 performs program display processing in S310, waveform display processing in S320, logging file analysis/conversion processing in S330, and display control processing in S340. Each of these processes is performed by the CPU 81 in FIG. A program that causes the CPU 81 to perform each of these processes is sometimes referred to as engineering software.

S310のプログラム表示処理は、前述したプロジェクトデータ41に含まれるユーザプログラムを表示すると共に、ロギング収集データ70から作成された表示用データを用いて、ユーザプログラムについての収集対象の変数の値を表示する処理である。表示用データは、収集時刻及び変数値を含む。なお、ここでは、プロジェクトデータ41は、例えばPC2において所定のプロジェクトデータ編集プログラムを実行することによりユーザによって既に作成されていて、例えば補助記憶装置84に既に記憶されているものとする。 The program display process in S310 displays the user program included in the project data 41 described above, and also displays the values of variables to be collected for the user program using display data created from the logging collection data 70. It is processing. The display data includes collection time and variable values. Here, it is assumed that the project data 41 has already been created by the user by executing a predetermined project data editing program on the PC 2, and is already stored in the auxiliary storage device 84, for example.

S320の波形表示処理は、ロギング収集データ70から作成された表示用データを用いて、収集時刻と収集対象の変数の値との関係を波形によって表示する処理である。 The waveform display process of S320 is a process of displaying the relationship between the collection time and the value of the variable to be collected using a waveform using the display data created from the logging collection data 70.

S330のロギングファイル解析・変換処理は、ロギング設定データ42とロギング収集データ70を解析して、収集データ73を、S310のプログラム表示処理とS320の波形表示処理とのそれぞれに入力される表示用データに変換する処理である。なお、ここでは、ロギング設定データ42及びロギング収集データ70は外部記憶装置17により提供されるものとする。ロギングファイル解析・変換処理では、これらのデータが外部記憶装置17から読み出されて使用される。 The logging file analysis/conversion process at S330 analyzes the logging setting data 42 and the logging collection data 70, and converts the collected data 73 into display data that is input to each of the program display process at S310 and the waveform display process at S320. This is the process of converting it into It is assumed here that the logging setting data 42 and the logging collection data 70 are provided by the external storage device 17. In the logging file analysis/conversion process, these data are read from the external storage device 17 and used.

S340の表示制御処理は、S330のロギングファイル解析・変換処理によって作成された表示用データを、S310のプログラム表示処理とS320の波形表示処理とに提供する処理を含む。また、この表示制御処理は、プログラム表示処理と波形表示処理との表示を連動させる処理を含む。 The display control process of S340 includes a process of providing the display data created by the logging file analysis/conversion process of S330 to the program display process of S310 and the waveform display process of S320. The display control process also includes a process of linking the display of the program display process and the waveform display process.

以下、収集データ表示装置80によって行われる、図20に示した各処理の詳細をさらに説明する。 The details of each process shown in FIG. 20 performed by the collected data display device 80 will be further explained below.

まず、S310のプログラム表示処理の詳細について、図21を用いて説明する。 First, details of the program display process in S310 will be explained using FIG. 21.

図21で表されているように、S310のプログラム表示処理は、S311の操作UI処理と、S312の変数値表示制御処理と、S313のユーザプログラム表示処理とを含む。 As shown in FIG. 21, the program display process in S310 includes the operation UI process in S311, the variable value display control process in S312, and the user program display process in S313.

S311の操作UI処理は、収集データ表示装置80のユーザによる入力装置83に対する操作に応じた入力を受け付ける処理である。 The operation UI process in S<b>311 is a process of accepting input according to an operation on the input device 83 by the user of the collected data display device 80 .

S312の変数値表示制御処理は、S311の操作UI処理により受け付けられた入力の情報や、S340の表示制御処理からの連動の情報を受け付けて、表示用データに含まれる変数値の表示を制御する処理である。 The variable value display control process in S312 receives the input information accepted by the operation UI process in S311 and the interlocking information from the display control process in S340, and controls the display of variable values included in the display data. It is processing.

S313のユーザプログラム表示処理は、プロジェクトデータ41に含まれるユーザプログラムを表示すると共に、S312の変数値表示制御処理による制御の下で、収集対象の変数の値を、ユーザプログラムの表示上に表示させる処理である。 The user program display process of S313 displays the user program included in the project data 41, and also displays the value of the variable to be collected on the display of the user program under the control of the variable value display control process of S312. It is processing.

ここで図22について説明する。図22は、収集データの表示画面の例である。この表示画面は、CPU81がS310のプログラム表示処理を実行することによって表示装置85に表示される。 Here, FIG. 22 will be explained. FIG. 22 is an example of a display screen for collected data. This display screen is displayed on the display device 85 when the CPU 81 executes the program display process in S310.

図22の画面例は、S313のユーザプログラム表示処理により得られるユーザプログラム表示画面113に重ねて、S311の操作UI処理により得られるUI画面120が表示されている状態を表している。 The example screen in FIG. 22 shows a state in which a UI screen 120 obtained by the operation UI process in S311 is displayed over the user program display screen 113 obtained in the user program display process in S313.

S313のユーザプログラム表示処理によって、プロジェクトデータ41に含まれているユーザプログラムの内容を表す図(例えばラダープログラム)が作成され、ユーザプログラム表示画面113として表示される。 Through the user program display process in S313, a diagram (for example, a ladder program) representing the contents of the user program included in the project data 41 is created and displayed as the user program display screen 113.

UI画面120は、収集時刻毎に収集されている変数の値についての表示を順次更新させる指示を与えるコマ戻りボタン121-1及びコマ送りボタン121-2やシークバー122、表示させる変数の値の収集時刻を直接入力する時刻入力欄123等を有している。なお、時刻入力欄123は、コマ戻りボタン121-1及びコマ送りボタン121-2やシークバー122への操作によって指定される収集時刻を表示する表示欄としての機能も有している。 The UI screen 120 includes a frame-back button 121-1 and a frame-forward button 121-2 that give instructions to sequentially update the display of the values of variables collected at each collection time, a seek bar 122, and a button 122 for collecting the values of variables to be displayed. It has a time input field 123 for directly inputting the time. Note that the time input field 123 also has a function as a display field that displays the collection time specified by operating the frame return button 121-1, the frame forward button 121-2, or the seek bar 122.

S311の操作UI処理によって、コマ戻りボタン121-1及びコマ送りボタン121-2やシークバー122への操作に応じて指定された収集時刻が取得され、この時刻が時刻入力欄123に表示される。また、時刻の入力操作が時刻入力欄123に対して行われた場合には、この操作UI処理によって、入力された時刻が、指定した収集時刻として取得される。 Through the operation UI process in S311, the collection time specified in response to the operation of the frame-back button 121-1, the frame-forward button 121-2, or the seek bar 122 is acquired, and this time is displayed in the time input field 123. Further, when a time input operation is performed in the time input field 123, the input time is acquired as the specified collection time by this operation UI process.

S312の変数値表示制御処理により、ロギング収集データ70において収集時刻が対応付けられている変数の値や、S311の操作UI処理によって取得された収集時刻の指定が取得される。なお、ロギング収集データ70はS330のロギングファイル解析・変換処理により取得されてS340の表示制御処理に送付されたものであり、変数値表示制御処理は、表示制御処理からロギング収集データ70の提供を受ける。また、この変数値表示制御処理により、指定された収集時刻における変数の値がS313のユーザプログラム表示処理に送られ、ユーザプログラム表示処理により、その変数の値についての表示が、ユーザプログラム表示画面113で行われる。 Through the variable value display control process in S312, the value of the variable associated with the collection time in the logging collection data 70 and the designation of the collection time acquired through the operation UI process in S311 are acquired. Note that the logging collection data 70 is acquired by the logging file analysis/conversion processing in S330 and sent to the display control processing in S340, and the variable value display control processing requires the provision of the logging collection data 70 from the display control processing. receive. Also, through this variable value display control process, the value of the variable at the specified collection time is sent to the user program display process in S313, and the user program display process causes the value of the variable to be displayed on the user program display screen 113. It will be held in

図22の画面例において、ON/OFF表示114や変数表示115は、変数の値を表示するものである。 In the screen example shown in FIG. 22, the ON/OFF display 114 and variable display 115 display values of variables.

ON/OFF表示114は、ONとOFFとのどちらかの状態を有するプログラム構成要素の状態が収集対象の変数として選択されている場合に、変数値で示される状態に応じた異なる色彩でその要素を塗りつぶした表示を行って変数値を表すものである。図22の画面例では、ON/OFF表示114として、ユーザプログラム中の収集対象の要素が黒塗りで表示されているが、実際には、例えば、「ON」の場合には赤塗りで、また、「OFF」の場合には青塗りでその要素が表示される。 The ON/OFF display 114 displays the element in a different color depending on the state indicated by the variable value when the state of a program component having either ON or OFF state is selected as a variable to be collected. The variable value is represented by a filled-in display. In the screen example of FIG. 22, the elements to be collected in the user program are displayed in black as the ON/OFF display 114, but in reality, for example, if they are "ON", they are displayed in red, or , in the case of "OFF", the element is displayed in blue.

変数表示115は、プログラム構成要素に関する数値が収集対象の変数として選択されている場合に、その数値を変数値として直接表示するものである。 The variable display 115 directly displays the numerical value as a variable value when a numerical value regarding a program component is selected as a variable to be collected.

以上のように、S311、S312、及びS313の処理によって、図22の画面例で表されているように、収集時刻とその収集時刻に収集された変数の値とが関係付けされて表示装置85で表示される。 As described above, through the processes of S311, S312, and S313, as shown in the screen example of FIG. 22, the collection time and the value of the variable collected at that collection time are associated and is displayed.

また、S310のプログラム表示処理はS314の照合処理とS315の警告処理とをさらに含む。 Furthermore, the program display process in S310 further includes a verification process in S314 and a warning process in S315.

S314の照合処理は、プロジェクトデータ41、ロギング設定データ42、及びロギング収集データ70のプロジェクトデータ情報51の照合を行う処理である。 The verification process in S314 is a process of verifying the project data 41, the logging setting data 42, and the project data information 51 of the logging collection data 70.

S315の警告処理は、S314の照合処理によって、各データのプロジェクトデータ情報51が一致しない場合に所定の警告を行う処理である。 The warning process of S315 is a process of issuing a predetermined warning when the project data information 51 of each data does not match as a result of the collation process of S314.

図23は、表示装置85に表示される警告画面の画面例を表している。S315の警告処理による所定の警告は、例えばこのような警告画面を表示装置85に表示することによって行われる。この画面例には、プロジェクトデータ情報51が一致しないことをユーザに警告する警告ダイアログ130が含まれている。なお、例えばユーザプログラムのデバッグを行う場合等には有益であるので、収集データ表示装置80では、プロジェクトデータ情報51が不一致であっても変数の値の表示の機能は利用可能としている。 FIG. 23 shows an example of a warning screen displayed on the display device 85. A predetermined warning in the warning process of S315 is performed by displaying such a warning screen on the display device 85, for example. This example screen includes a warning dialog 130 that warns the user that the project data information 51 does not match. Note that, since this is useful when debugging a user program, for example, the collected data display device 80 allows the function of displaying variable values to be used even if the project data information 51 does not match.

次に、S320の波形表示処理の詳細について、図24を用いて説明する。 Next, details of the waveform display processing in S320 will be explained using FIG. 24.

図24で表されているように、S320の波形表示処理は、S321の操作UI処理と、S322の変数値表示制御処理と、S323の波形作成処理とを含む。 As shown in FIG. 24, the waveform display process in S320 includes the operation UI process in S321, the variable value display control process in S322, and the waveform creation process in S323.

S321の操作UI処理は、S311の処理と同様の処理であり、収集データ表示装置80のユーザによる入力装置83に対する操作に応じた入力を受け付ける処理である。 The operation UI process of S321 is similar to the process of S311, and is a process of accepting input according to the operation on the input device 83 by the user of the collected data display device 80.

S322の変数値表示制御処理は、S312の処理と同様の処理であり、S321の操作UI処理により受け付けられた入力の情報や、S340の表示制御処理からの前述の連動の情報を受け付けて、表示用データに含まれる変数値の表示を制御する処理である。 The variable value display control process in S322 is similar to the process in S312, and receives input information accepted by the operation UI process in S321 and the above-mentioned linked information from the display control process in S340, and displays This process controls the display of variable values included in the data.

S323の波形作成処理は、S340の表示制御処理により提供される表示用データに基づいて、収集時刻と変数との関係を表している波形を作成して表示する処理である。 The waveform creation process of S323 is a process of creating and displaying a waveform representing the relationship between the collection time and the variable based on the display data provided by the display control process of S340.

ここで図25について説明する。図25は、収集データの波形表示画面140の例である。この波形表示画面140は、CPU81がS320の波形表示処理を実行することによって表示装置85に表示される。 Here, FIG. 25 will be explained. FIG. 25 is an example of a waveform display screen 140 of collected data. This waveform display screen 140 is displayed on the display device 85 when the CPU 81 executes the waveform display process in S320.

波形表示画面140に含まれている波形141は、S323の波形作成処理によって作成されたものである。なお、図27の画面例では、「変数1」、「変数2」、及び「変数3」のそれぞれについての波形141が、それぞれ実線、破線、及び一点鎖線を用いて表示されている。また、波形表示画面140に含まれている時刻表示142は、波形141により変数値との関係が表されている収集時刻を表しており、S323の波形作成処理によって波形表示画面140に表示される。 The waveform 141 included in the waveform display screen 140 is created by the waveform creation process in S323. In the screen example of FIG. 27, the waveforms 141 for each of "variable 1," "variable 2," and "variable 3" are displayed using a solid line, a broken line, and a dashed-dotted line, respectively. Further, a time display 142 included in the waveform display screen 140 represents the collection time at which the relationship with the variable value is expressed by the waveform 141, and is displayed on the waveform display screen 140 by the waveform creation process of S323. .

また、S321の操作UI処理によって、収集時刻の範囲の移動指示が受け付けられると、S323の波形作成処理により、移動後の収集時刻の範囲についての波形141が波形表示画面140に表示される。また、波形表示画面140に表示されている太線143によって示される収集時刻が、S323の波形作成処理によって時刻表示欄144に表示される。 Furthermore, when an instruction to move the collection time range is accepted through the operation UI process in S321, the waveform 141 for the post-move collection time range is displayed on the waveform display screen 140 through the waveform creation process in S323. Furthermore, the acquisition time indicated by the thick line 143 displayed on the waveform display screen 140 is displayed in the time display field 144 by the waveform creation process of S323.

S322の変数値表示制御処理により、S340の表示制御処理により提供される表示用データにおいて収集時刻が対応付けられている変数の値が取得される。また、このS322の変数値表示制御処理により、時刻表示欄144に表示された収集時刻が取得される。さらに、この変数値表示制御処理により、取得された収集時刻における変数の値が、波形141と太線143との交点の位置で表される変数の値として、変数値表示欄145に表示される。 The variable value display control process of S322 acquires the value of the variable associated with the collection time in the display data provided by the display control process of S340. Furthermore, the collection time displayed in the time display column 144 is acquired through the variable value display control process in S322. Further, by this variable value display control processing, the value of the variable at the acquired collection time is displayed in the variable value display column 145 as the value of the variable represented by the position of the intersection of the waveform 141 and the thick line 143.

以上のように、S321、S322、及びS323の処理によって、図25の画面例で表されているように、収集時刻とその収集時刻に収集された変数の値とが関係付けされて表示装置85で表示される。 As described above, through the processes of S321, S322, and S323, as shown in the screen example of FIG. 25, the collection time and the value of the variable collected at that collection time are correlated and is displayed.

次に、S330のロギングファイル解析・変換処理の詳細について、図26を用いて説明する。 Next, details of the logging file analysis/conversion process in S330 will be explained using FIG. 26.

図26で表されているように、S330のロギングファイル解析・変換処理は、S331のロギング設定データ取得処理、S332のロギング収集データ取得処理、及び、S333の表示用データ作成処理を含んでいる。 As shown in FIG. 26, the logging file analysis/conversion process in S330 includes the logging setting data acquisition process in S331, the logging collection data acquisition process in S332, and the display data creation process in S333.

S331のロギング設定データ取得処理は、ロギング設定データ42を外部記憶装置17から取り込む処理である。 The logging setting data acquisition process of S331 is a process of importing the logging setting data 42 from the external storage device 17.

S332のロギング収集データ取得処理は、ロギング収集データ70を外部記憶装置17から読み出して取り込む処理である。 The logging collection data acquisition process of S332 is a process of reading and importing the logging collection data 70 from the external storage device 17.

S333の表示用データ作成処理は、ロギング設定データ42とロギング収集データ70から、収集時刻及び変数値を含む表示用データを作成する処理である。 The display data creation process in S333 is a process for creating display data including collection times and variable values from the logging setting data 42 and the logging collection data 70.

次に、S340の表示制御処理の詳細について、図27を用いて説明する。 Next, details of the display control process in S340 will be explained using FIG. 27.

図27で表されているように、S340の表示制御処理は、S341の変数値提供処理、S342の再生制御処理、及び、S343の収集データ取得処理を含む。 As shown in FIG. 27, the display control process in S340 includes the variable value providing process in S341, the playback control process in S342, and the collected data acquisition process in S343.

S341の変数値提供処理は、S330のロギングファイル解析・変換処理により作成された表示用データを、収集時刻が対応付けられている変数の値として、S310のプログラム表示処理とS320の波形表示処理とに提供する処理である。 The variable value providing process in S341 uses the display data created by the logging file analysis/conversion process in S330 as the value of the variable associated with the collection time, and performs the program display process in S310 and the waveform display process in S320. This is a process provided to

S342の再生制御処理は、所定の連動の指示を受けると、S310のプログラム表示処理とS320の波形表示処理とを制御して、それぞれの処理により表示される画面の内容を連動させる処理である。この再生制御処理により、例えば、図22の画面例におけるUI画面120に対する操作により指定された収集時刻と、図25の画面例における太線143によって示される収集時刻とを同一の時刻とする処理が行われる。 The playback control process in S342 is a process in which, upon receiving a predetermined linkage instruction, the program display process in S310 and the waveform display process in S320 are controlled to link the contents of the screen displayed by each process. Through this playback control process, for example, a process is performed in which the collection time specified by the operation on the UI screen 120 in the example screen of FIG. 22 and the collection time indicated by the thick line 143 in the example screen of FIG. 25 are made the same time. be exposed.

S343の収集データ取得処理は、S330のロギングファイル解析・変換処理により作成された表示用データを取得してS341の変数値提供処理に提供する処理である。 The collected data acquisition process at S343 is a process for acquiring display data created by the logging file analysis/conversion process at S330 and providing it to the variable value providing process at S341.

以上のように、S340の表示制御処理によって、S330のロギングファイル解析・変換処理により作成された表示用データが、S310のプログラム表示処理とS320の波形表示処理とに提供される。 As described above, the display control process in S340 provides the display data created by the logging file analysis/conversion process in S330 to the program display process in S310 and the waveform display process in S320.

以上、開示の実施形態とその利点について詳しく説明したが、当業者は、特許請求の範囲に明確に記載した本発明の範囲から逸脱することなく、様々な変更、追加、省略をすることができるであろう。 Although the disclosed embodiments and their advantages have been described in detail above, those skilled in the art can make various changes, additions, and omissions without departing from the scope of the present invention as clearly stated in the claims. Will.

1 PLC
2 PC
3 入出力モジュール
4 通信モジュール
6 通信ケーブル
7 通信バス
11、26 通信I/F
12、21、81 CPU
13 バスコントローラ
14、22、82 メモリ
14a プログラム使用領域
15、86 記憶装置I/F
16、27、87 内部バス
17 外部記憶装置
23、83 入力装置
24、85 表示装置
25、84 補助記憶装置
30 支援装置
31 プログラム解析部
32 選択部
33 受付部
34 設定情報出力部
35 計算部
36 データ量出力部
40 設定ツール
41 プロジェクトデータ
42 ロギング設定データ
51 プロジェクトデータ情報
52 収集動作設定情報
53 収集対象設定情報
61 制御部
62 リングバッファ
70 ロギング収集データ
71 収集データ数
72 収集データサイズ
73 収集データ
80 収集データ表示装置
91 表示部
100、120 UI画面
101 プログラム選択部
102 抽出変数表示部
103 対象変数表示部
104 登録ボタン
105 解除ボタン
106 一括登録ボタン
107 一括解除ボタン
110 収集期間表示部
111 データサイズ表示部
112 設定ボックス
113 ユーザプログラム表示画面
114 ON/OFF表示
115 変数表示
120 UI画面
121-1 コマ戻りボタン
121-2 コマ送りボタン
122 シークバー
123 時刻入力欄
130 警告ダイアログ
140 波形表示画面
141 波形
142 時刻表示
143 太線
144 時刻表示欄
145 変数値表示欄
1 PLC
2 PCs
3 Input/output module 4 Communication module 6 Communication cable 7 Communication bus 11, 26 Communication I/F
12, 21, 81 CPU
13 Bus controller 14, 22, 82 Memory 14a Program use area 15, 86 Storage device I/F
16, 27, 87 Internal bus 17 External storage device 23, 83 Input device 24, 85 Display device 25, 84 Auxiliary storage device 30 Support device 31 Program analysis section 32 Selection section 33 Reception section 34 Setting information output section 35 Calculation section 36 Data Volume output section 40 Setting tool 41 Project data 42 Logging setting data 51 Project data information 52 Collection operation setting information 53 Collection target setting information 61 Control section 62 Ring buffer 70 Logging collection data 71 Number of collection data 72 Collection data size 73 Collection data 80 Collection Data display device 91 Display section 100, 120 UI screen 101 Program selection section 102 Extracted variable display section 103 Target variable display section 104 Registration button 105 Cancel button 106 Bulk registration button 107 Bulk cancellation button 110 Collection period display section 111 Data size display section 112 Setting box 113 User program display screen 114 ON/OFF display 115 Variable display 120 UI screen 121-1 Frame return button 121-2 Frame forward button 122 Seek bar 123 Time input field 130 Warning dialog 140 Waveform display screen 141 Waveform 142 Time display 143 Thick line 144 Time display field 145 Variable value display field

Claims (9)

外部機器を制御するための制御プログラムを実行するプログラム実行処理と、前記制御プログラムにおいて使用されている変数の値を収集するロギング処理とを含む制御処理を、制御周期毎に繰り返す制御部を備え、
前記制御部は、前記制御プログラムにおいて使用されている複数の変数を複数の制御周期に分割し、前記複数の制御周期各々において前記複数の変数のうち一部の変数の値を収集することで、前記複数の変数それぞれの値を前記制御周期よりも長い収集期間内に収集することを特徴とするプログラマブルロジックコントローラ。
comprising a control unit that repeats a control process for each control cycle, including a program execution process for executing a control program for controlling an external device, and a logging process for collecting values of variables used in the control program;
The control unit divides a plurality of variables used in the control program into a plurality of control cycles, and collects values of some variables among the plurality of variables in each of the plurality of control cycles, A programmable logic controller characterized in that values of each of the plurality of variables are collected within a collection period that is longer than the control cycle.
前記制御部は、前記複数の制御周期のうち先頭の制御周期から前記複数の制御周期のうち何れかの制御周期までの期間に収集された変数を示す変数情報を記録し、前記何れかの制御周期の次の制御周期において、前記変数情報に基づき、前記複数の変数のうち未だ収集されていない変数の値を収集することを特徴とする請求項1記載のプログラマブルロジックコントローラ。 The control unit records variable information indicating variables collected during a period from a first control cycle among the plurality of control cycles to any one of the plurality of control cycles, and 2. The programmable logic controller according to claim 1, wherein in the next control cycle, values of variables that have not yet been collected among the plurality of variables are collected based on the variable information. 前記制御部は、前記何れかの制御周期において、前記ロギング処理の実行時間を計測し、前記ロギング処理の実行時間が所定時間に達した場合、前記何れかの制御周期における前記ロギング処理を終了することを特徴とする請求項2記載のプログラマブルロジックコントローラ。 The control unit measures the execution time of the logging process in any of the control cycles, and ends the logging process in any of the control cycles when the execution time of the logging process reaches a predetermined time. The programmable logic controller according to claim 2, characterized in that: プログラマブルロジックコントローラの支援装置であって、
前記プログラマブルロジックコントローラは、外部機器を制御するための制御プログラムを実行するプログラム実行処理と、前記制御プログラムにおいて使用されている変数の値を収集するロギング処理とを含む制御処理を、制御周期毎に繰り返し、前記支援装置から出力される設定情報に基づいて、前記制御プログラムにおいて使用されている複数の変数を複数の制御周期に分割し、前記複数の制御周期各々において前記複数の変数のうち一部の変数の値を収集することで、前記複数の変数それぞれの値を前記制御周期よりも長い収集期間内に収集し、
前記支援装置は、
前記制御プログラムを解析して、前記制御プログラムにおいて使用されている変数を抽出するプログラム解析部と、
抽出された変数の中から、前記制御プログラムにおいて使用されている複数の変数を選択する選択部と、
前記収集期間の指定を受け付ける受付部と、
前記制御プログラムにおいて使用されている複数の変数を示す情報と前記収集期間を示す情報とを、前記設定情報として出力する設定情報出力部と、
を備えることを特徴とする支援装置。
A support device for a programmable logic controller,
The programmable logic controller performs a control process, including a program execution process for executing a control program for controlling an external device, and a logging process for collecting values of variables used in the control program, in each control cycle. Repeatedly, based on the setting information output from the support device, a plurality of variables used in the control program are divided into a plurality of control cycles, and a part of the plurality of variables is divided in each of the plurality of control cycles. By collecting the values of the variables, the values of each of the plurality of variables are collected within a collection period longer than the control cycle,
The support device includes:
a program analysis unit that analyzes the control program and extracts variables used in the control program;
a selection unit that selects a plurality of variables used in the control program from among the extracted variables;
a reception department that accepts the designation of the collection period;
a setting information output unit that outputs information indicating a plurality of variables used in the control program and information indicating the collection period as the setting information;
A support device characterized by comprising:
前記収集期間及び前記制御周期に基づいて、前記複数の制御周期の個数を決定し、前記複数の変数それぞれの値の総データ量と前記複数の制御周期の個数とに基づいて、前記複数の制御周期各々において収集される前記一部の変数の値のデータ量を求める計算部と、
前記複数の制御周期各々において収集される前記一部の変数の値のデータ量を出力するデータ量出力部と、
をさらに備えることを特徴とする請求項4記載の支援装置。
The number of the plurality of control periods is determined based on the collection period and the control period, and the number of the plurality of control periods is determined based on the total data amount of the values of each of the plurality of variables and the number of the plurality of control periods. a calculation unit that calculates the amount of data of the values of some of the variables collected in each cycle;
a data amount output unit that outputs a data amount of values of the some of the variables collected in each of the plurality of control cycles;
The support device according to claim 4, further comprising:.
部機器を制御するための制御プログラムを実行するプログラム実行処理と、前記制御プログラムにおいて使用されている変数の値を収集するロギング処理とを含む制御処理を、制御周期毎に繰り返し、前記制御プログラムにおいて使用されている複数の変数を複数の制御周期に分割し、前記複数の制御周期各々において前記複数の変数のうち一部の変数の値を収集することで、前記複数の変数それぞれの値を前記制御周期よりも長い収集期間内に収集するプログラマブルロジックコントローラと
記収集期間における前記複数の変数それぞれの値の収集時刻と対応付けて、前記複数の変数それぞれの値を表示する表示装置と、
を備えることを特徴とするプログラマブルロジックコントローラシステム
A control process including a program execution process of executing a control program for controlling an external device and a logging process of collecting the values of variables used in the control program is repeated every control cycle, and the control process By dividing a plurality of variables used in a plurality of control cycles into a plurality of control cycles, and collecting values of some of the plurality of variables in each of the plurality of control cycles, the values of each of the plurality of variables can be calculated. a programmable logic controller that collects data within a collection period that is longer than the control cycle;
a display device that displays the values of each of the plurality of variables in association with the collection time of each of the values of the plurality of variables during the collection period;
A programmable logic controller system comprising:
プログラマブルロジックコントローラが、外部機器を制御するための制御プログラムを実行するプログラム実行処理と、前記制御プログラムにおいて使用されている変数の値を収集するロギング処理とを含む制御処理を、制御周期毎に繰り返し、
前記プログラマブルロジックコントローラは、前記制御プログラムにおいて使用されている複数の変数を複数の制御周期に分割し、前記複数の制御周期各々において前記複数の変数のうち一部の変数の値を収集することで、前記複数の変数それぞれの値を前記制御周期よりも長い収集期間内に収集することを特徴とするロギング方法。
The programmable logic controller repeats control processing, including program execution processing for executing a control program for controlling external equipment, and logging processing for collecting the values of variables used in the control program, in each control cycle. ,
The programmable logic controller divides a plurality of variables used in the control program into a plurality of control cycles, and collects values of some of the variables in each of the plurality of control cycles. , a logging method characterized in that the values of each of the plurality of variables are collected within a collection period that is longer than the control cycle.
表示装置が、前記収集期間における前記複数の変数それぞれの値の収集時刻と対応付けて、前記複数の変数それぞれの値を表示することを特徴とする請求項7記載のロギング方法。8. The logging method according to claim 7, wherein the display device displays the values of each of the plurality of variables in association with collection times of the values of each of the plurality of variables during the collection period. プログラマブルロジックコントローラが、外部機器を制御するための制御プログラムを実行するプログラム実行処理と、前記制御プログラムにおいて使用されている変数の値を収集するロギング処理とを含む制御処理を、制御周期毎に繰り返し、前記プログラマブルロジックコントローラの支援装置から出力される設定情報に基づいて、前記制御プログラムにおいて使用されている複数の変数を複数の制御周期に分割し、前記複数の制御周期各々において前記複数の変数のうち一部の変数の値を収集することで、前記複数の変数それぞれの値を前記制御周期よりも長い収集期間内に収集し、
前記支援装置が、
前記制御プログラムを解析して、前記制御プログラムにおいて使用されている変数を抽出し、
抽出された変数を表示し、
表示された変数の中から選択された複数の変数を、前記制御プログラムにおいて使用されている複数の変数として特定し、
前記収集期間の指定を受け付け、
前記制御プログラムにおいて使用されている複数の変数を示す情報と前記収集期間を示す情報とを、前記設定情報として出力する、
ことを特徴とする支援方法
The programmable logic controller repeats control processing, including program execution processing for executing a control program for controlling external equipment, and logging processing for collecting the values of variables used in the control program, in each control cycle. , divides a plurality of variables used in the control program into a plurality of control periods based on setting information output from a support device of the programmable logic controller, and divides a plurality of variables used in the control program into a plurality of control periods, and divides the plurality of variables in each of the plurality of control periods. By collecting the values of some of the variables, the values of each of the plurality of variables are collected within a collection period longer than the control cycle,
The support device is
Analyzing the control program and extracting variables used in the control program,
Display the extracted variables,
identifying a plurality of variables selected from the displayed variables as a plurality of variables used in the control program;
Accepting the specification of the collection period,
outputting information indicating a plurality of variables used in the control program and information indicating the collection period as the setting information;
A support method characterized by :
JP2023076791A 2023-05-08 2023-05-08 Programmable logic controller, support device, display device, logging method, support method, and display method Active JP7375977B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2023076791A JP7375977B1 (en) 2023-05-08 2023-05-08 Programmable logic controller, support device, display device, logging method, support method, and display method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2023076791A JP7375977B1 (en) 2023-05-08 2023-05-08 Programmable logic controller, support device, display device, logging method, support method, and display method

Publications (1)

Publication Number Publication Date
JP7375977B1 true JP7375977B1 (en) 2023-11-08

Family

ID=88645960

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2023076791A Active JP7375977B1 (en) 2023-05-08 2023-05-08 Programmable logic controller, support device, display device, logging method, support method, and display method

Country Status (1)

Country Link
JP (1) JP7375977B1 (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001273013A (en) 2000-03-23 2001-10-05 Omron Corp Method and apparatus for monitoring motion
JP2016143169A (en) 2015-01-30 2016-08-08 株式会社キーエンス Device monitoring apparatus and device monitoring method
JP2021189482A (en) 2020-05-25 2021-12-13 株式会社キーエンス Programmable logic controller

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001273013A (en) 2000-03-23 2001-10-05 Omron Corp Method and apparatus for monitoring motion
JP2016143169A (en) 2015-01-30 2016-08-08 株式会社キーエンス Device monitoring apparatus and device monitoring method
JP2021189482A (en) 2020-05-25 2021-12-13 株式会社キーエンス Programmable logic controller

Similar Documents

Publication Publication Date Title
CN110262279B (en) Control system and control method
US9013574B2 (en) Machine vision system program editing environment including synchronized user interface features
US10503146B2 (en) Control system, control device, and control method
JP2013104877A (en) Machine vision system program edition environment including a real time context generation function
CN108693822B (en) Control device, storage medium, control system, and control method
US20190018385A1 (en) Programmable logic controller, data collector, and programming support apparatus
JP5074896B2 (en) Inspection support system and image processing controller
JP5060677B2 (en) Image processing controller and inspection support system
JP7375977B1 (en) Programmable logic controller, support device, display device, logging method, support method, and display method
US20200088794A1 (en) Operation data collection system, operation data collection method, and information storage medium
JPH07191717A (en) Automatic preparing device for control program
US20020049929A1 (en) Humanity interface development system of testing program of circuit board
JP2023167381A (en) Programmable logic controller, support device, and display device, and, logging method, support method, and display method
JP2023168185A (en) Support device and support method
JP7168114B1 (en) Programmable logic controller, support device, display device, logging method, support method, display method
JP2023168186A (en) Display device and display method
JPH07129677A (en) Production simulation device
JP2001005522A (en) Data displaying device
US20180088914A1 (en) Method for supporting program creation and apparatus for supporting program creation
WO2023286393A1 (en) Information processing system and information processing method
EP4227745A1 (en) Control system, production method, and program
JP2023006304A (en) Control system, model generation method, and model generation program
JP5413793B2 (en) Measuring system
JP2023151886A (en) Information processing device and information processing program
JP2022158227A (en) Analysis device, analysis system, and method for controlling the same

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20230508

A871 Explanation of circumstances concerning accelerated examination

Free format text: JAPANESE INTERMEDIATE CODE: A871

Effective date: 20230508

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20230801

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20230906

RD03 Notification of appointment of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7423

Effective date: 20230906

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20231009

R150 Certificate of patent or registration of utility model

Ref document number: 7375977

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150