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

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

Info

Publication number
JP7188631B1
JP7188631B1 JP2022078536A JP2022078536A JP7188631B1 JP 7188631 B1 JP7188631 B1 JP 7188631B1 JP 2022078536 A JP2022078536 A JP 2022078536A JP 2022078536 A JP2022078536 A JP 2022078536A JP 7188631 B1 JP7188631 B1 JP 7188631B1
Authority
JP
Japan
Prior art keywords
logging
data
collection
processing
collected
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
JP2022078536A
Other languages
Japanese (ja)
Other versions
JP2023167381A (en
Inventor
良祐 仲野
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
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 JP2022078536A priority Critical patent/JP7188631B1/en
Application granted granted Critical
Publication of JP7188631B1 publication Critical patent/JP7188631B1/en
Publication of JP2023167381A publication Critical patent/JP2023167381A/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Programmable Controllers (AREA)

Abstract

【課題】ユーザアプリケーションの実行や機器の制御に影響なくロギングを可能にする。【解決手段】処理実行部61は、S210の入力処理、S220のプログラム実行処理、S230の出力処理、S240のシステム処理、及びS250のロギング処理を含む、S200の制御処理のサイクルを繰り返し実行する。S250のロギング処理は、S200の制御処理の1サイクルの実行時間が、予め設定されている制御周期に収まるかどうかを判定して、当該実行時間が当該制御周期に収まらないと判定したサイクルにおけるS200の制御処理に含まれるS250のロギング処理において当該変数の値の収集を中断する処理を含む。【選択図】図12An object of the present invention is to enable logging without affecting the execution of user applications and the control of devices. A processing execution unit 61 repeatedly executes a cycle of control processing of S200 including input processing of S210, program execution processing of S220, output processing of S230, system processing of S240, and logging processing of S250. In the logging process of S250, it is determined whether or not the execution time of one cycle of the control process of S200 falls within a preset control cycle, and S200 in the cycle in which it is determined that the execution time does not fall within the control cycle is performed. In the logging process of S250 included in the control process of , the process of interrupting the collection of the value of the variable is included. [Selection drawing] Fig. 12

Description

本発明は、プログラマブルロジックコントローラの技術に関する。 The present invention relates to the technology of programmable logic controllers.

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

制御装置による機器の制御において異常が発生した場合には、その異常の原因を特定することが望ましい。また、このような異常の発生の場合に限られず、機器の制御に関する情報を記録しておいて、その後に当該情報を検証したいという要望がある。そこで、ユーザが、データの履歴を残すための条件を予め制御装置に設定しておき、この条件に基づいて機器及び制御装置自体の動作状態を示すデータを制御装置がロギングするという第1の技術が知られている(例えば、特許文献1参照)。 When an abnormality occurs in the control of equipment by a control device, it is desirable to identify the cause of the abnormality. In addition, there is a demand for recording information related to device control and verifying the information afterward, not limited to the occurrence of such an abnormality. Therefore, a first technique is proposed in which a user presets conditions for recording data history in a control device, and the control device logs data indicating the operating states of the devices and the control device itself based on these conditions. is known (see, for example, Patent Document 1).

図1は、この第1の技術において制御装置が実行する各処理の実行期間の例を示している。図1における上側部分は、ロギング処理が実行されない場合の各処理の実行期間を示しており、制御周期の各周期において、入力処理、プログラム実行処理、及び出力処理の各処理がこの順序で実行されることを表している。また、図1における下側部分は、ロギング処理が実行される場合の各処理の実行期間を示しており、各制御周期において、入力処理、プログラム実行処理、及び出力処理の各処理に続いてロギング処理が実行されることを表している。 FIG. 1 shows an example of the execution period of each process executed by the control device in this first technique. The upper part in FIG. 1 shows the execution period of each process when the logging process is not executed, and each process of the input process, the program execution process, and the output process is executed in this order in each cycle of the control cycle. It means that In addition, the lower part in FIG. 1 shows the execution period of each process when the logging process is executed. Indicates that the process will be executed.

また、この他の背景技術として、これより説明する第2の技術が知られている。プログラマブルロジックコントローラにおいて、アプリケーションスケジューラで管理されない処理のうち、データ処理系のようにメッセージ応答性能に影響ある処理を優先したい場合とユーザアプリケーションの実行性能を優先したい場合とがある。この第2の技術は、両者の優先度をユーザが設定可能にするというものである(例えば、特許文献2参照)。 Also, as another background art, a second technique is known which will be described below. In programmable logic controllers, among the processes not managed by the application scheduler, there are cases where priority is given to processes that affect message response performance, such as data processing systems, and there are cases where priority is given to execution performance of user applications. This second technique allows the user to set the priority of both (see Patent Document 2, for example).

図2は、第2の技術における帯域割合の調整の例を示している。図2において、「タスク1」、「タスク2」、及び「タスク3」は、ユーザアプリケーションが実行されるタスクを表しており、「タスクA」及び「タスクB」は、通信処理やシステム維持のための処理などの、ユーザアプリケーション以外の処理のタスクを表している。また、この例では、制御周期の1周期がアプリ帯域の期間とシステム帯域の期間とに分割されており、アプリ帯域ではユーザアプリケーションのタスクが実行され、システム帯域では、ユーザアプリケーション以外の処理のタスクが実行される。また、各帯域内では、各タスクが、それぞれの優先度に応じた順序で実行される。 FIG. 2 shows an example of band ratio adjustment in the second technique. In FIG. 2, "task 1", "task 2", and "task 3" represent tasks in which user applications are executed, and "task A" and "task B" represent communication processing and system maintenance. It represents a task of processing other than the user application, such as processing for Also, in this example, one control cycle is divided into an application band period and a system band period. User application tasks are executed in the application band, and processing tasks other than the user application are executed in the system band. is executed. Also, within each band, each task is executed in an order according to its priority.

図2において、上側部分は帯域割合の調整前の様子を表しており、下側部分は調整後の様子を表している。第2の技術は、このように、ユーザの目的に応じて、各制御周期におけるアプリ帯域とシステム帯域との割合をユーザが調整可能とすることで、ユーザアプリケーション性能を優先するのか、システム処理の性能を優先するのかの変更を可能にしている。 In FIG. 2, the upper part shows the situation before adjustment of the band ratio, and the lower part shows the situation after adjustment. The second technique allows the user to adjust the ratio between the application bandwidth and the system bandwidth in each control cycle according to the user's purpose, thereby giving priority to user application performance or system processing. It is possible to change whether to give priority to performance.

特開2020-13526号公報Japanese Patent Application Laid-Open No. 2020-13526 特開2008-146357号公報JP 2008-146357 A

前述した第1の技術では、ロギング処理の実行が追加されることで制御周期が長くなるため、その他の入力処理、プログラム実行処理、及び出力処理の実行期間が遅延することになり、ユーザアプリケーションがユーザの意図した通りに動作しないことがあり得る。 In the above-described first technique, the addition of the logging process lengthens the control cycle, which delays the execution periods of other input processes, program execution processes, and output processes. It may not work as intended by the user.

1つの側面において、本発明は、ユーザアプリケーションの実行や機器の制御に影響なくロギングを行えるようにすることを目的とする。 In one aspect, an object of the present invention is to enable logging without affecting execution of user applications and control of devices.

実施形態のひとつでは、プログラマブルロジックコントローラが処理実行部とリングバッファとを備える。処理実行部は、入力処理、プログラム実行処理、出力処理、システム処理、及び、ロギング処理を含む制御処理のサイクルを繰り返し実行する。入力処理は、外部機器から送られてくる入力データを取り込む処理である。プログラム実行処理は、当該入力データを用いてユーザアプリケーションプログラムを実行する処理である。出力処理は、当該ユーザプログラムの実行結果を出力して外部機器を制御する処理である。システム処理は、当該プログラマブルロジックコントローラ自身の動作を管理する処理である。ロギング処理は、当該ユーザアプリケーションプログラムにおいて使用されている変数の値を収集する処理である。リングバッファは、当該ロギング処理による変数の値の収集時刻と当該収集時刻に収集された変数の値を対応付けた収集データを、当該変数の値を収集する度に保存する。ロギング処理は、当該制御処理の1サイクルの実行時間が、予め設定されている制御周期に収まるかどうかを判定して、当該実行時間が当該制御周期に収まらないと判定したサイクルの制御処理に含まれる当該ロギング処理において当該変数の値の収集を中断する処理として、当該実行時間が当該制御周期に収まらないと判定したサイクルの制御処理に含まれる当該ロギング処理おいて収集された変数の値を含む当該収集データをリングバッファから破棄する処理を含む。 In one embodiment, a programmable logic controller includes a process execution unit and a ring buffer . The processing execution unit repeatedly executes a cycle of control processing including input processing, program execution processing, output processing, system processing, and logging processing. The input process is a process of fetching input data sent from an external device. The program execution process is a process of executing a user application program using the input data. The output process is a process of outputting the execution result of the user program to control an external device. System processing is processing that manages the operation of the programmable logic controller itself. The logging process is a process of collecting values of variables used in the user application program. The ring buffer stores collected data in which the time when the value of the variable was collected by the logging process and the value of the variable collected at the time of collection are associated with each other each time the value of the variable is collected. The logging process determines whether the execution time of one cycle of the control process falls within a preset control cycle, and is included in the control process of the cycle determined that the execution time does not fall within the control cycle. In the logging process that is performed, as a process of interrupting the collection of the value of the variable, the value of the variable collected in the logging process included in the control process of the cycle determined that the execution time does not fit within the control cycle including processing for discarding the collected data from the ring buffer .

また、実施形態の別のひとつでは、上述した制御処理のサイクルを繰り返し実行するプログラマブルロジックコントローラの支援装置が、プログラム解析部、選択部、第1出力部、及び、第2出力部を備える。プログラム解析部は、ユーザアプリケーションプログラムを解析して、当該ユーザアプリケーションプログラムにおいて使用されている変数を抽出する。選択部は、プログラム解析部により抽出された当該変数のうちから、ロギング処理による収集の対象とする変数を対象変数として選択する。第1出力部は、当該対象変数を特定する情報を当該プログラマブルロジックコントローラに対するロギング設定データとして出力する。第2出力部は、選択部により選択された対象変数の全てについて当該ロギング処理を実行した場合における当該制御処理の1サイクルの実行時間が、予め設定されている制御周期に収まるかどうかを判定し、当該制御処理の当該実行時間が当該制御周期に収まらない場合に、注意情報を出力すると共に、選択部により選択された対象変数の全てについて当該ロギング処理を実行した場合における当該制御処理の1サイクルの実行に要すると推定される時間を推定制御周期として更に出力するIn another embodiment, a programmable logic controller support device that repeatedly executes the control processing cycle described above includes a program analysis unit, a selection unit, a first output unit, and a second output unit. The program analysis unit analyzes the user application program and extracts variables used in the user application program. The selection unit selects variables to be collected by the logging process from among the variables extracted by the program analysis unit as target variables. The first output unit outputs information specifying the target variable as logging setting data for the programmable logic controller. The second output unit determines whether the execution time of one cycle of the control process when the logging process is executed for all the target variables selected by the selection unit falls within a preset control cycle. , when the execution time of the control process does not fall within the control cycle, output caution information, and execute the logging process for all the target variables selected by the selection unit 1 cycle of the control process is further output as an estimated control period .

また、実施形態の更なる別のひとつでは、実施形態の別のひとつでは、上述した制御処理のサイクルを繰り返し実行するプログラマブルロジックコントローラによるロギング処理によって収集された変数の値を表示する表示装置が、読み出し部と、表示部と、表示制御部とを備える。読み出し部は、ロギング処理により収集された変数の値を当該変数の値の収集時刻に対応付けた収集データが収集時刻順に並べられているロギング収集データであって、プログラマブルロジックコントローラにより外部記憶装置に保存されたロギング収集データを当該外部記憶装置から読み出す。表示部は、当該外部記憶装置から読み出したロギング収集データに基づいて、収集時刻と変数の値とを関係付けて表示する。表示制御部は、当該外部記憶装置から読み出したロギング収集データから当該ロギング処理の中断の痕跡を発見した場合に、中断による変数の値の欠損を示す表示を、欠損した変数の値がロギング処理により収集されていた収集時刻に対応付けて、表示部に更に表示させる。 In still another embodiment, in another embodiment, a display device that displays values of variables collected by logging processing by a programmable logic controller that repeatedly executes the above-described control processing cycle, A reading unit, a display unit, and a display control unit are provided. The reading unit is logging collected data in which collected data in which the values of variables collected by the logging process are associated with the collection times of the values of the variables are arranged in the order of collection times, and stored in the external storage device by the programmable logic controller. The saved logging collection data is read from the external storage device. Based on the logging collection data read out from the external storage device, the display unit displays the collection time and the value of the variable in association with each other. When the display control unit finds traces of interruption of the logging process from the logging collection data read from the external storage device, the display control unit displays a display indicating the loss of the value of the variable due to the interruption. The information is further displayed on the display in association with the collected collection time.

1つの側面によれば、ロギングの実行がユーザアプリケーションの実行や機器の制御に与える影響を抑制することが可能になる。 According to one aspect, it is possible to suppress the influence of execution of logging on execution of user applications and control of devices.

第1の技術において制御装置が実行する各処理の実行期間の例を示した図である。FIG. 5 is a diagram showing an example of an execution period of each process executed by the control device in the first technology; 第2の技術における帯域割合の調整の例を示した図である。FIG. 10 is a diagram showing an example of band ratio adjustment in the second technique; PLCシステムの構成例を示す図である。It is a figure which shows the structural example of a PLC system. PLCが実行する各処理の実行期間の例を示した図である。It is the figure which showed the example of the execution period of each process which PLC performs. PLCのハードウェア構成例を示した図である。It is the figure which showed the hardware structural example of PLC. PCのハードウェア構成例を示した図である。It is the figure which showed the hardware structural example of PC. 支援装置の機能構成例を示した図である。It is the figure which showed the functional structural example of a support apparatus. ロギング処理の実行の条件の設定を行う方法を説明する図である。FIG. 7 is a diagram illustrating a method of setting conditions for executing logging processing; UI画面の画面例である。It is a screen example of a UI screen. ロギング設定データのデータ構造の一例を示した図である。FIG. 4 is a diagram showing an example of the data structure of logging setting data; 収集対象設定情報のデータ構造の一例を示した図である。FIG. 4 is a diagram showing an example of the data structure of collection target setting information; PLCの機能構成例を示した図である。It is the figure which showed the functional structural example of PLC. PLCによるロギング実行方法を説明する図である。It is a figure explaining the logging execution method by PLC. ロギング処理及び保存処理の処理内容の詳細を示したフローチャートである。5 is a flow chart showing details of processing contents of logging processing and saving processing; ロギング収集データのデータ構造の一例を示した図である。FIG. 4 is a diagram showing an example of the data structure of logging collection data; 収集データのデータ構造の一例を示した図である。It is the figure which showed an example of the data structure of collected data. 収集処理の処理内容の詳細を示したフローチャートである。8 is a flowchart showing details of processing contents of collection processing; 収集タイミングカウンタ値の用途を説明する図(その1)である。FIG. 11 is a diagram (part 1) for explaining the use of the collection timing counter value; 収集タイミングカウンタ値の用途を説明する図(その2)である。FIG. 12 is a diagram (part 2) for explaining the use of the collection timing counter value; 収集データ表示装置のハードウェア構成例を示した図である。It is the figure which showed the hardware structural example of the collection data display apparatus. 収集データ表示装置の機能構成例を示した図である。It is the figure which showed the functional structural example of the collection data display apparatus. 収集データを表示する方法の一例を説明する図である。It is a figure explaining an example of the method of displaying collection data. プログラム表示処理の詳細を説明する図である。It is a figure explaining the detail of a program display process. 収集データの表示図面の第1の例である。It is the 1st example of the display drawing of collected data. 警告画面の画面例である。It is a screen example of a warning screen. 波形表示処理の詳細を説明する図である。It is a figure explaining the detail of a waveform display process. 収集データの波形表示画面の第1の例である。It is a first example of a waveform display screen of acquired data. ロギングファイル解析・変換処理の詳細を説明する図である。FIG. 10 is a diagram illustrating details of logging file analysis/conversion processing; ロギングファイル解析・変換処理の処理内容を示したフローチャートである。FIG. 10 is a flow chart showing processing contents of logging file analysis/conversion processing; FIG. 表示制御処理の詳細を説明する図である。It is a figure explaining the detail of a display control process. 収集データの表示図面の第2の例である。FIG. 11 is a second example of a display drawing of collected data; FIG. 収集データの波形表示画面の第2の例である。It is a second example of a waveform display screen of collected data.

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

図3は、PLCシステム10の構成例を示している。このPLCシステム10は、PLC1と、PC2と、入出力モジュール3と、通信モジュール4とを備えている。PLC1とPC2とは通信ケーブル6を介して接続されている。なお、「PLC」とはプログラマブルロジックコントローラの略称である。また、「PC」とはパーソナルコンピュータの略称である。 FIG. 3 shows a configuration example of the PLC system 10. As shown in FIG. This PLC system 10 includes a PLC 1 , a PC 2 , an input/output module 3 and a communication module 4 . PLC 1 and PC 2 are connected via communication cable 6 . "PLC" is an abbreviation for programmable logic controller. "PC" is an abbreviation for personal computer.

PLC1は、工場等に設置される各種制御機器を統括的に制御する。 The PLC 1 comprehensively controls various control devices installed in a factory or the like.

PC2はPLC1を支援する支援装置としての機能を提供する。PC2は、例えば、ユーザアプリケーションプログラムの編集を行うために用いられる。なお、以降の説明では、ユーザアプリケーションプログラムを「ユーザプログラム」と称することもある。ユーザプログラムは、例えば、IEC61131-3準拠のラダー言語や、シーケンシャルファンクションチャート(SFC)などのフローチャート形式のモーションプログラムなどといったグラフィカルプログラミング言語を用いて作成されてもよい。また、ユーザプログラムは、例えば、C言語などの高級プログラミング言語を用いて作成されてもよい。 PC2 provides a function as a support device that supports PLC1. The PC 2 is used, for example, to edit user application programs. In the following description, the user application program may also be referred to as "user program". The user program may be created using a graphical programming language such as a ladder language conforming to IEC61131-3, or a motion program in the form of a flow chart such as a sequential function chart (SFC). Also, the user program may be created using a high-level programming language such as the C language, for example.

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

PLC1は、1以上の入出力モジュール3や通信モジュール4といった外部機器が着脱可能に構成されている。PLC1と入出力モジュール3及び通信モジュール4とは通信バス7を介して接続されている。 The PLC 1 is configured such that external devices such as one or more input/output modules 3 and communication modules 4 are detachable. PLC 1 , input/output module 3 and communication module 4 are connected via communication bus 7 .

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

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

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

PLC1は、入力処理、プログラム実行処理、出力処理、及びシステム処理を含む制御処理のサイクルを繰り返し実行する。入力処理は、外部機器である入出力モジュール3から受信した入力データを取り込む処理である。プログラム実行処理は、ユーザにより作成されたユーザプログラムを実行する処理である。このユーザプログラムの実行では、入力処理により取り込まれた入力データが用いられる。出力処理は、ユーザプログラムの実行結果を出力することによって入出力モジュール3を制御して、当該実行結果を入出力モジュール3の出力に反映させる処理である。システム処理は、PLC1自身の動作を管理して、適正な動作を維持するための処理である。 The PLC 1 repeatedly executes control processing cycles including input processing, program execution processing, output processing, and system processing. The input process is a process of fetching input data received from the input/output module 3, which is an external device. The program execution process is a process of executing a user program created by the user. Execution of this user program uses the input data taken in by the input process. The output process is a process of controlling the input/output module 3 by outputting the execution result of the user program and reflecting the execution result in the output of the input/output module 3 . The system processing is processing for managing the operation of the PLC 1 itself and maintaining proper operation.

図4の上側部分で表されているように、PLC1は、制御周期である各サイクルにおいて、入力処理、プログラム実行処理、出力処理、及びシステム処理を、この順序で実行する。なお、制御周期の長さは、ユーザによって指定される。 As shown in the upper part of FIG. 4, the PLC 1 executes input processing, program execution processing, output processing, and system processing in this order in each control cycle. Note that the length of the control cycle is designated by the user.

PLC1により実行される制御処理には、これらの処理に加えて、ロギング処理が更に含まれている。ロギング処理は、ユーザプログラムにおいて使用されている変数の値を収集する処理であって、PLC1自身を含むPLCシステム10の各構成機器の動作状態を示すデータを記録し、履歴として保存する処理である。 The control processing executed by the PLC 1 further includes logging processing in addition to these processing. The logging process is a process of collecting the values of variables used in the user program, recording data indicating the operating state of each component of the PLC system 10 including the PLC 1 itself, and storing it as a history. .

図4の下側部分で表されているように、PLC1は、ロギング処理を各制御周期における出力処理の実行期間に続くシステム処理の実行期間中に実行するようにする。PLC1は、このように、システム処理の実行期間であった期間にロギング処理を行うことによって、ユーザプログラムと機器の制御に関連する入力処理、プログラム実行処理、及び出力処理の実行期間に影響を与えることなくロギング処理を行うことを可能にする。 As shown in the lower part of FIG. 4, the PLC 1 executes the logging process during the execution period of the system process following the execution period of the output process in each control cycle. In this way, the PLC 1 performs the logging process during the execution period of the system process, thereby affecting the execution period of the input process, program execution process, and output process related to the control of the user program and equipment. It allows you to do the logging process without having to

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

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

まず、PLC1のハードウェア構成について、図5に示されているハードウェア構成例を参照しながら説明する。このPLC1は通信I/F11、CPU12、バスコントローラ13、メモリ14、及び記憶装置I/F15を備えている。これらの構成要素はいずれも内部バス16に接続されており、相互にデータの授受を行うことが可能である。なお、「CPU」とはセントラルプロセシングユニットの略称である。また、「I/F」とはインタフェースの略称である。 First, the hardware configuration of the PLC 1 will be described with reference to the hardware configuration example shown in FIG. This PLC 1 has a communication I/F 11 , a CPU 12 , a bus controller 13 , a memory 14 and a storage device I/F 15 . All of these components are connected to the internal bus 16 and can exchange data with each other. Note that "CPU" is an abbreviation for central processing unit. "I/F" is an abbreviation for interface.

通信I/F11は通信ケーブル6に接続されており、PC2との間で行われる各種のデータの授受を管理する。 The communication I/F 11 is connected to the communication cable 6 and manages the transfer 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 transmission and reception of various data between the input/output module 3 and the communication module 4 which are external devices.

メモリ14は、例えば半導体メモリであり、RAM領域及びROM領域を含む。RAM領域は、CPU12が各種のプログラムを実行する際に各種のデータを一時的に記憶しておく記憶領域として利用される。ROM領域は、各種のプログラムやデータが保存される領域であり、例えば不揮発性メモリが用いられる。なお、「RAM」とはランダムアクセスメモリの略称である。また、「ROM」とは、リードオンリメモリの略称である。 The memory 14 is, for example, a semiconductor memory and includes a RAM area and a ROM 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 in which various programs and data are stored, and non-volatile memory is used, for example. Note that "RAM" is an abbreviation for random access memory. "ROM" is an abbreviation for read-only memory.

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

次に、PC2のハードウェア構成について、図6に示されているハードウェア構成例を参照しながら説明する。このPC2はCPU21、メモリ22、入力装置23、表示装置24、補助記憶装置25、及び通信I/F26を備えている。これらの構成要素はいずれも内部バス27に接続されており、相互にデータの授受を行うことが可能である。 Next, the hardware configuration of the PC 2 will be described with reference to the hardware configuration example shown in FIG. This PC 2 has 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 connected to the internal bus 27 and can exchange data with each other.

CPU21は、例えば、メモリ22を利用して所定のプログラムを実行することにより、ユーザプログラムの編集機能や、ロギング処理の実行の条件の設定を行うための機能を提供する。 The CPU 21 provides, for example, a user program editing function and a function for setting conditions for executing logging processing 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 an inquiry or instruction to the user and to display and output the processing result.

補助記憶装置25は、磁気ディスク装置、光ディスク装置、光磁気ディスク装置等であり、例えば、ハードディスクドライブやフラッシュメモリであってもよい。PC2は、補助記憶装置25にプログラム及びデータを格納しておき、それらをメモリ22にロードして使用することができる。 The auxiliary storage device 25 is a magnetic disk device, an optical disk device, a magneto-optical disk device, or the like, 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 various data exchanges with the PLC 1 .

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

次に、図3のPLCシステム10において、ロギング処理の実行の条件をPLC1に設定する手法について説明する。 Next, in the PLC system 10 of FIG. 3, the method of setting the execution conditions of logging processing to PLC1 is demonstrated.

まず図7について説明する。図7は支援装置30の機能構成例を示した図である。この構成例は、PLC1によるロギング処理の実行の条件を設定する機能を支援装置30が提供する場合の一例である。PLCシステム10では、所定の設定ツールプログラムをPC2に実行させることによって、支援装置30の機能をPC2が提供する。 First, FIG. 7 will be described. FIG. 7 is a diagram showing an example of the functional configuration of the support device 30. As shown in FIG. 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 10, the PC 2 provides the functions of the support device 30 by causing the PC 2 to execute a predetermined setting tool program.

図7において、支援装置30は、プログラム解析部31、選択部32、第1出力部33、及び第2出力部34を備えている。なお、支援装置30には、前述の制御処理をPLC1に行わせるときの制御周期がユーザにより予め設定されているものとする。 7, the support device 30 includes a program analysis section 31, a selection section 32, a first output section 33, and a second output section . It is assumed that the control period for causing the PLC 1 to perform the aforementioned control processing is preset 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 variables used in the user program.

選択部32は、プログラム解析部31により抽出された変数のうちから、PLC1に行わせるロギング処理による収集の対象とする変数を選択する。この選択部32により選択された変数を、「対象変数」と称することとする。 The selection unit 32 selects variables to be collected by the logging process performed by the PLC 1 from among the variables extracted by the program analysis unit 31 . The variables selected by the selection unit 32 are called "target variables".

第1出力部33は、選択部32により選択された対象変数を特定する情報をロギング設定データ42として出力する。詳細は後述するが、このロギング設定データ42は、対象変数を特定する情報として、例えば、PLC1においてユーザプログラムが実行されたときに対象変数の値の保持に使用される記憶領域についてのメモリ14上の位置を特定する情報を含む。 The first output unit 33 outputs information specifying the target variable selected by the selection unit 32 as the logging setting data 42 . Although the details will be described later, the logging setting data 42 is, for example, a storage area on the memory 14 used to hold the value of the target variable when the user program is executed in the PLC 1 as information specifying the target variable. contains information that identifies the location of the

第2出力部34は、選択部32により選択された対象変数の全てについてPLC1がロギング処理を実行した場合における前述の制御処理の1サイクルの実行時間が、予め設定されている制御周期に収まるかどうかを判定する。ここで、当該実行時間が当該制御周期に収まらない場合には、そのことを注意喚起するための注意情報を出力する。このようにすることで、このときのロギング設定データ42に基づいたロギング処理をPLC1に行わせた場合には、ロギングデータの欠損の可能性があることをユーザに認識させることが可能になる。また、このようにすることで、収集の対象とする変数の個数の制限についての検討をユーザに促すことが可能になり、結果として、ロギングの実行がユーザプログラムの実行や機器の制御に与える影響が抑制される。 The second output unit 34 determines whether the execution time of one cycle of the above-described control processing when the PLC 1 executes the logging processing for all the target variables selected by the selection unit 32 falls within a preset control cycle. determine what Here, if the execution time does not fall within the control period, caution information is output to call attention to this fact. By doing so, it becomes possible for the user to recognize that the logging data may be lost when the PLC 1 is caused to perform the logging process based on the logging setting data 42 at this time. In addition, by doing so, it is possible to encourage the user to consider limiting the number of variables to be collected, and as a result, the effect of logging execution on user program execution and device control is suppressed.

なお、第2出力部34は、選択部32により選択された対象変数の全てについてロギング処理を実行した場合における前述の制御処理の1サイクルの実行に要すると推定される時間を推定制御周期として更に出力するようにしてもよい。 In addition, the second output unit 34 further sets the estimated control cycle to the time estimated to be required for executing one cycle of the above-described control processing when the logging processing is executed for all the target variables selected by the selection unit 32. You may make it output.

このような構成を備えている支援装置30によって行われる支援方法の一例である、ロギング処理の実行の条件の設定を行う方法について、図8を用いて更に詳細に説明する。 A method of setting conditions for execution of logging processing, which is an example of a support method performed by the support device 30 having such a configuration, 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 . The PC 2 provides the function of the setting tool 40 by causing the CPU 21 to execute a predetermined setting tool program.

設定ツール40にはプロジェクトデータ41が入力される。プロジェクトデータ41は、PLCシステム10のシステム構成の情報、PLC1で実行させるユーザプログラム、及び、PLCシステム10が備えている外部機器である入出力モジュール3や通信モジュール4などについての機能設定情報を含む情報である。ここでは、このプロジェクトデータ41は、例えばPC2において所定のプロジェクトデータ編集プログラムを実行することによりユーザによって既に作成されていて、例えば補助記憶装置25に既に記憶されているものとする。 Project data 41 is input to the setting tool 40 . The project data 41 includes information on the system configuration of the PLC system 10, a user program to be executed by the PLC 1, and function setting information on the input/output module 3, the communication module 4, etc., which are external devices provided in the PLC system 10. Information. 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, for example, and is already stored in the auxiliary storage device 25, for example.

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

ここで図9について説明する。図9は、S110の収集対象設定処理で用いられるUI画面100の画面例を表している。なお、「UI」とはユーザインタフェースの略称である。 FIG. 9 will now be described. FIG. 9 shows an example of the UI screen 100 used in the collection target setting process of S110. "UI" is an abbreviation for user interface.

図9の画面例では、UI画面100は、プログラム選択部101、抽出変数表示部102、及び対象変数表示部103を含む。支援装置30の機能を図6のPC2が提供する場合、このUI画面100は表示装置24によって表示される。 In the screen example of FIG. 9 , 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. 6 provides the functions of the support device 30 , this UI screen 100 is displayed by the display device 24 .

プログラム選択部101には、プロジェクトデータ41に含まれていたユーザプログラムを示す情報が表示される。なお、本実施形態では、複数のプログラムの集合体としてタスクが構成され、複数のタスクの集合体としてユーザプログラムが構成されているものとする。図9の画面例において、「アプリ名称」はユーザプログラムの名称であり、「タスク1」、「タスク2」、及び「タスク3」は各タスクのそれぞれの名称であり、「プログラム」、「プログラムN」は各タスクに属するプログラムそれぞれの名称である。この画面例では、ユーザプログラムと各タスクと各プログラムとの関係をツリー形式で表現することが表されている。 Information indicating the user program included in the project data 41 is displayed in the program selection portion 101 . In this embodiment, it is assumed that a task is configured as an aggregation of a plurality of programs, and a user program is configured as an aggregation of a plurality of tasks. In the screen example of FIG. 9, "application name" is the name of the user program, "task 1", "task 2", and "task 3" are the names of the respective tasks, and "program", "program N" is the name of each program belonging to each task. This screen example shows that 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 corresponding to the selected name is subjected to the program analysis processing of S111, and the program is used in the program. variables are extracted. Note that when an operation is performed to select a task name instead of a program name, variables are extracted from each program belonging to the task corresponding to the selected name. At this time, the extracted variable names are listed in 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 is selected as the target variable. selected. At this time, the names of the selected target variables are listed in the target variable display section 103 .

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

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

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

また、PLC1により実行される前述の制御処理の1サイクルにおける、前述した入力処理、プログラム実行処理、出力処理、及びシステム処理のそれぞれの実行時間は、プロジェクトデータ41から算出可能である。S110の収集対象設定処理では、これらの各処理の実行時間の算出と、以上のようにして選択された対象変数についてロギング処理を実行した場合に推定されるロギング処理の実行時間の算出とが行われ、得られた各処理の実行時間の合計値が算出される。この実行時間の合計値は、PLC1により実行される前述の制御処理の1サイクルの実行に要すると推定される時間である。この合計値は、UI画面100における推定制御周期表示部109に表示される。 Further, the execution time of each of the input processing, program execution processing, output processing, and system processing described above in one cycle of the control processing performed by the PLC 1 can be calculated from the project data 41 . In the collection target setting process of S110, the calculation of the execution time of each of these processes and the calculation of the execution time of the logging process estimated when the logging process is executed for the target variables selected as described above are performed. Then, the total value of the obtained execution time of each process is calculated. The total value of this execution time is the estimated time required for execution of one cycle of the aforementioned control processing executed by the PLC1. This total value is displayed in the estimated control cycle display section 109 on the UI screen 100 .

収集データサイズや推定制御周期についてのこれらの表示をUI画面100で行うことによって、例えば、予め設定されている制御周期に収めるための対象変数の選択の検討をユーザに想起させることが可能になる。また、ロギング処理を優先させる意向の場合には、予め設定されている制御周期に対する変更についての検討をユーザに想起させることが可能になる。 By displaying the collected data size and the estimated control cycle on the UI screen 100, for example, it is possible to remind the user to consider the selection of target variables to fit within the preset control cycle. . In addition, if the user intends to give priority to the logging process, it is possible to remind the user to consider changing the preset control cycle.

図8の説明に戻る。S120では収集動作設定処理が行われる。この処理はロギング処理の動作設定のための情報を作成する処理である。この情報によって、例えば、収集対象のデータである対象変数の値の収集タイミング、当該データの収集を行う期間、収集した当該データをPLC1が外部記憶装置17に保存させる保存タイミング等の設定がPLC1に対して行われる。 Returning to the description of FIG. In S120, collection operation setting processing is performed. This process is a process of creating information for setting the operation of the logging process. With this information, the PLC 1 can set, for example, the collection timing of the value of the target variable, which is the data to be collected, the period during which the data is collected, and the save timing for the PLC 1 to save the collected data in the external storage device 17. performed against.

上述したS110及びS120の処理に続いて、S130の設定内容確認処理が行われる。この処理は、S110の処理により選択された対象変数の全てについてPLC1がロギング処理を実行した場合における前述の制御処理の1サイクルの実行時間が、予め設定されている制御周期に収まるかどうかを判定する処理である。 Following the processing of S110 and S120 described above, the setting content confirmation processing of S130 is performed. This process determines whether or not the execution time of one cycle of the above-described control process when the PLC 1 executes the logging process for all the target variables selected by the process of S110 falls within a preset control cycle. It is a process to

この処理では、例えば、まず、PLC1により実行される前述の制御処理の1サイクルにおける、前述した入力処理、プログラム実行処理、出力処理、及びシステム処理の実行時間がプロジェクトデータ41から算出される。そして、これらの実行時間の合計が、予め設定されている制御周期から減算される。この減算によって得られる時間は、ロギング処理が実行可能な時間であり、この時間を「最大処理時間」と称することとする。次に、この最大処理時間に基づき、この時間内に収集可能なデータの最大サイズが求められる。そして、この最大サイズと、S110の処理により算出していた総データ量(UI画面100における収集データサイズ表示部108に表示される値)との大小比較が行われ、当該総データ量が当該最大サイズ以下であるかどうかが判定される。 In this process, for example, the execution time of the input process, program execution process, output process, and system process in one cycle of the control process executed by the PLC 1 is calculated from the project data 41 . Then, the total of these execution times is subtracted from the preset control cycle. The time obtained by this subtraction is the time during which the logging process can be executed, and this time is called "maximum processing time". Next, based on this maximum processing time, the maximum size of data that can be collected within this time is determined. Then, this maximum size is compared with the total data amount (the value displayed in the collected data size display section 108 on the UI screen 100) calculated by the process of S110, and the total data amount is compared with the maximum data amount. It is determined whether it is less than or equal to size.

ここで、当該総データ量が当該最大サイズを超えている場合には、選択された対象変数の全てについてPLC1がロギング処理を実行した場合における前述の制御処理の1サイクルの実行時間が、予め設定されている制御周期に収まらないとの判定結果が下される。このとき、選択された対象変数の全てについてPLC1がロギング処理を実行した場合には当該実行時間が予め設定されている制御周期に収まらないことを示す注意情報が出力される。支援装置30の機能を図6のPC2が提供する場合には、このような注意情報が表示装置24によって表示される。 Here, when the total data amount exceeds the maximum size, the execution time of one cycle of the above-described control processing when the PLC 1 executes the logging processing for all the selected target variables is set in advance. A determination result is made that it does not fit within the current control cycle. At this time, when the PLC 1 executes the logging process for all of the selected target variables, caution information is output indicating that the execution time does not fall within the preset control cycle. When the function of the support device 30 is provided by the PC 2 in FIG. 6, such caution information is displayed by the display device 24.

以上のように、S130の設定内容確認処理によって、図7の支援装置30における第2出力部34の機能が提供される。 As described above, the function of the second output unit 34 in the support device 30 of FIG. 7 is provided by the setting content confirmation process of S130.

次に、S140の設定ファイル作成処理が行われる。この設定ファイル作成処理は、図7の支援装置30における第1出力部33の機能を提供する処理である。 Next, a setting file creation process of S140 is performed. This setting file creation process is a process for providing the function of the first output unit 33 in the support device 30 of FIG.

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

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

ロギング設定データ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 specifying a user program to be executed by the PLC 1, and includes information such as the name given to the object code obtained by compiling the user program and the execution date and time of the compilation. Note that the project data information 51 is included as part of the project data 41 .

収集動作設定情報52はS120の収集動作設定処理によって作成される情報である。収集動作設定情報52には、例えば、データの収集タイミングや収集を行う期間、収集したデータをPLC1が外部記憶装置17に保存させる保存タイミング、収集したデータを保存させる保存先の外部記憶装置17を特定する情報が含まれている。 The collection operation setting information 52 is information created by the collection operation setting process of S120. The collection operation setting information 52 includes, for example, the data collection timing, the collection period, the save timing when the PLC 1 saves the collected data in the external storage device 17, and the external storage device 17 where the collected data is saved. Contains identifying information.

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

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

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

<ロギングの実行> <Run logging>

次に、図3のPLCシステム10において、支援装置30としてのPC2によって設定された条件に従ってPLC1により行われるロギング処理について説明する。 Next, in the PLC system 10 of FIG. 3, the logging process performed by PLC1 according to the conditions set by PC2 as the support apparatus 30 is demonstrated.

まず図12について説明する。図12はPLC1の機能構成例を示した図である。なお、PLC1には、前述の制御処理を行うときの制御周期がユーザにより予め設定されているものとする。 First, FIG. 12 will be described. FIG. 12 is a diagram showing an example of the functional configuration of the PLC1. It is assumed that the user presets a control cycle in the PLC 1 when performing the above-described control processing.

図12に示した構成例では、PLC1は、処理実行部61、リングバッファ62、及び保存部63を備えている。 In the configuration example shown in FIG. 12 , the PLC 1 includes a process executing section 61 , a ring buffer 62 and a storage section 63 .

前述したように、PLC1は、S210の入力処理、S220のプログラム実行処理、S230の出力処理、及びS240のシステム処理と、S250のロギング処理とを含むS200の制御処理のサイクルを繰り返し実行する。図12に示した機能構成例では、処理実行部61が、このS200の制御処理のサイクルを繰り返し実行する。図5に示したハードウェア構成例では、この制御処理はCPU12によって実行される。 As described above, the PLC 1 repeatedly executes the cycle of the input process of S210, the program execution process of S220, the output process of S230, the system process of S240, and the control process of S200 including the logging process of S250. In the functional configuration example shown in FIG. 12, the processing execution unit 61 repeatedly executes the control processing cycle of S200. In the hardware configuration example shown in FIG. 5, this control processing is executed by the CPU 12 .

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

S250のロギング処理は、S200の制御処理の1サイクルの実行時間が、予め設定されている制御周期に収まるかどうかを判定する処理を含む。このロギング処理は、更に、当該実行時間が当該制御周期に収まらないと判定したサイクルの制御処理に含まれるロギング処理において、対象変数の値の収集を中断する処理を含む。対象変数の値の収集の中断がこのような場合に行われることで、ロギング処理の処理期間の長期化が防止されるので、ユーザプログラムの実行や外部機器の制御に与える影響が抑制される。 The logging process of S250 includes a process of determining whether the execution time of one cycle of the control process of S200 falls within a preset control cycle. This logging process further includes a process of interrupting the collection of the values of the target variables in the logging process included in the control process of the cycle for which it is determined that the execution time does not fit within the control cycle. By interrupting the collection of the values of the target variables in such a case, the processing period of the logging process is prevented from prolonging, so that the influence on the execution of the user program and the control of the external device is suppressed.

なお、収集を中断する処理として、例えば、実行時間が制御周期に収まらないと判定したサイクルの制御処理に含まれるロギング処理において収集された変数の値を含む収集データをリングバッファ62から破棄する処理をロギング処理が含むようにしてもよい。 Note that, as the process of interrupting the collection, for example, the process of discarding from the ring buffer 62 the collected data including the values of the variables collected in the logging process included in the control process of the cycle for which it is determined that the execution time does not fit within the control period. may be included in the logging process.

また、リングバッファ62により保存される収集データには、例えば、収集時刻が到来した回数をカウントする収集タイミングカウンタ64の値が、当該収集時刻と当該収集時刻に収集された対象変数の値とに対応付けられて含まれていてもよい。この収集タイミングカウンタ64の値は、対象変数の値の収集結果の確認が後に行われるときにおいて、対象変数の値の収集の中断が生じていたことの認識を可能にする。 In the collected data stored by the ring buffer 62, for example, the value of the collection timing counter 64, which counts the number of times the collection time has come, is added to the collection time and the value of the target variable collected at the collection time. It may be associated and included. The value of the collection timing counter 64 makes it possible to recognize that the collection of the value of the target variable has been interrupted when the collection result of the value of the target variable is confirmed later.

保存部63は、リングバッファ62において破棄されずに保存されている収集データを順次読み出して外部記憶装置17に保存する。図5に示したハードウェア構成例では記憶装置I/F15がCPU12による制御の下で保存部63の機能を提供する。この記憶装置I/F15に対する制御を、例えば、CPU12によって提供される処理実行部61がロギング処理の一部として行ってもよい。 The storage unit 63 sequentially reads collected data stored in the ring buffer 62 without being discarded, and stores the collected data in the external storage device 17 . In the hardware configuration example shown in FIG. 5 , the storage device I/F 15 provides the function of the storage unit 63 under the control of the CPU 12 . For example, the processing execution unit 61 provided by the CPU 12 may control the storage device I/F 15 as part of the logging processing.

このような構成要素を備えているPLC1によって行われるロギング実行方法について、図13を用いて更に詳細に説明する。 A logging execution method performed by the PLC 1 having such components will be described in more detail with reference to FIG.

S200の制御処理において実行されるS220のプログラム実行処理は、S210の入力処理で取り込まれた、入出力モジュール3や通信モジュール4などの外部機器から送られてくる入力データを用いてユーザプログラムを実行する処理である。この実行結果は、当該外部機器の制御のためにS230の出力処理によって出力される。図5のハードウェア構成例において、このプログラム実行処理を実行するCPU12は、ユーザプログラムの実行のためにメモリ14の記憶領域を使用する。このときに使用される記憶領域を、プログラム使用領域14aと称することとする。 The program execution process of S220 executed in the control process of S200 executes the user program using the input data sent from the external device such as the input/output module 3 and the communication module 4, which is captured in the input process of S210. It is a process to This execution result is output by the output process of S230 for controlling the external device. 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 is called a program use area 14a.

S200の制御処理において実行されるS250のロギング処理は、S220のプログラム実行処理により実行されるユーザプログラムにおいて使用されている変数のうちの前述した対象変数のそれぞれの値を収集する処理である。この対象変数についての情報と、ロギング処理の動作設定情報とを含むロギング設定データ42は、支援装置30(PC2)において前述したようにして作成されてPLC1に予め提供されているものとする。 The logging process of S250 executed in the control process of S200 is a process of collecting the values of the aforementioned target variables 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 the information about the target variables and the operation setting information of the logging process is created in the support device 30 (PC2) as described above and provided to the PLC1 in advance.

PLC1のCPU12は、処理実行部61として実行するS200の制御処理と並行して、S260の時刻管理処理とS270の収集タイミング検知処理とを行っている。時刻管理処理は現在の時刻を計時する処理である。収集タイミング検知処理は、ロギング設定データ42に含まれている収集動作設定情報52により示されているデータの収集タイミングの到来を検知する処理である。 The CPU 12 of the PLC 1 performs the time management process of S260 and the collection timing detection process of S270 in parallel with the control process of S200 executed as the process execution unit 61 . The time management process is a process of counting the current time. The collection timing detection process is a process for 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 each value of the target variable is performed in accordance with the detection of the arrival of the collection timing by the collection timing detection process. Also, in the logging process, the collection time of the value is obtained from the time measurement result of the time management process, and the collection data in which the value and the collection time are associated with each other are stored in the ring buffer 62 .

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

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

図14において、S281及びS282の処理は保存処理の詳細を表しており、残余のS251からS254まで及びS290の各処理はロギング処理の詳細を表している。 In FIG. 14, the processes of S281 and S282 represent the details of the saving process, and the remaining processes of S251 to S254 and S290 represent the details of the logging process.

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

まず、S251において、S200の制御処理についての今回の実行サイクルにおけるロギング処理の実行時間の計測を開始する処理が行われる。 First, in S251, a process of starting measurement of the execution time of the logging process in the current execution cycle of the control process of S200 is performed.

次に、S252において、前述したS270の収集タイミング検知処理によって収集タイミングの到来が検知されたか否かを判定する処理が行われる。この判定処理において、収集タイミングの到来が検知されたと判定されたとき(判定結果がYESのとき)には、S290の収集処理が行われる。一方、この判定処理において、収集タイミングの到来が検知されないと判定されたとき(判定結果がNOのとき)には、図14に示されている処理が終了する。 Next, in S252, a process of determining whether or not the arrival of the collection timing is detected by the collection timing detection process of S270 is performed. In this determination process, when it is determined that the arrival of the collection timing has been detected (when the determination result is YES), the collection process of S290 is performed. On the other hand, when it is determined in this determination process that the collection timing has not been detected (when the determination result is NO), the process shown in FIG. 14 ends.

S290の収集処理は、対象変数のそれぞれの値を収集し、収集した値を、後述する収集データ73として、リングバッファ62に保存する処理である。この収集処理の詳細については後述する。 The collection process of S290 is a process of collecting the respective values of the target variables and storing the collected values in the ring buffer 62 as collected data 73, which will be described later. The details of this collection processing will be described later.

S290の処理に続き、S253では、S251の処理により計測を開始した今回のロギング処理の実行時間が、前述した最大処理時間内に収まっているか否かを判定する処理が行われる。この最大処理時間は、例えば、予め設定されている制御周期に基づいて、支援装置30により行われる手法と同様の手法を用いてPLC1において算出するようにしもよい。また、支援装置30によって既に算出されていた最大処理時間を、例えばロギング設定データ42に含める等して、支援装置30からPLC1が受け取るようにしてもよい。 Following the process of S290, in S253, a process is performed to determine whether or not the execution time of the current logging process whose measurement was started in the process of S251 is within the maximum processing time described above. This maximum processing time may be calculated in the PLC 1 using a method similar to that performed by the support device 30, for example, based on a preset control cycle. Also, the maximum processing time already calculated by the support device 30 may be included in the logging setting data 42, for example, so that the PLC 1 receives it from the support device 30. FIG.

S253の判定処理において、今回のロギング処理の実行時間が最大処理時間内に収まっていると判定されたとき(判定結果がYESのとき)にはS281に処理を進める。一方、S253の判定処理において、今回のロギング処理の実行時間が最大処理時間内に収まらなかったと判定されたとき(判定結果がNOのとき)にはS254に処理を進める。 In the determination process of S253, 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 proceeds to S281. On the other hand, in the judgment processing of S253, when it is judged that the execution time of the logging processing this time did not fall within the maximum processing time (when the judgment result is NO), the processing proceeds to S254.

S254では、今回実行中のロギング処理におけるS290の収集処理によりリングバッファ62に保存された収集データ73を破棄する処理が行われ、その後、図14に示されている処理が終了する。 In S254, a process of discarding the collected data 73 saved in the ring buffer 62 by the collection process of S290 in the logging process currently being executed is performed, and then the process shown in FIG. 14 ends.

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

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

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

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

プロジェクトデータ情報51は、PLC1で実行されたユーザプログラムを特定する情報であり、例えば、ユーザプログラムをコンパイルして得られるオブジェクトコードに付された名称や、当該コンパイルの実行日時の情報を含む。つまり、ロギング収集データ70に含まれているプロジェクトデータ情報51は、ロギング設定データ42に含まれていたプロジェクトデータ情報51と同様のものである。CPU12は、S290の収集処理において、ロギング設定データ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 the same as 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 collection process of S290.

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

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

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

また、収集データ73には、収集タイミングカウンタ値の情報が含まれている。収集タイミングカウンタ64は、前述したS270の収集タイミング検知処理による検知回数、すなわち、対象変数の値の収集を行う収集タイミングが到来した回数をカウントするカウンタである。従って、収集タイミングカウンタ64は、収集タイミングが到来する度にカウント値が1ずつカウントアップされる。なお、図15のデータ構造例においては、収集データ73に含まれている収集タイミングカウンタ値は、「収集データ1」では「1」であり、「収集データ2」では「2」であり、「収集データN」では「N」であるとする。この収集タイミングカウンタ値の用途については後述する。 The collection data 73 also includes information on the collection timing counter value. The collection timing counter 64 is a counter that counts the number of times of detection by the collection timing detection process of S270 described above, that is, the number of times the collection timing for collecting the value of the target variable has arrived. Therefore, the collection timing counter 64 counts up by one each time the collection timing arrives. In the data structure example of FIG. 15, the collection timing counter value included in the collected data 73 is "1" for "collected data 1", "2" for "collected data 2", and " Collected data N” is assumed to be “N”. The use of this collection timing counter value will be described later.

更に、収集データ73には、「タイムスタンプ」の時刻において収集された対象変数のそれぞれの値を表すデータが、「変数データ1」、「変数データ2」、…、「変数データN」として含まれている。 Further, the collected data 73 includes data representing respective values of the target variables collected at the time of the "timestamp" as "variable data 1", "variable data 2", ..., "variable data N". is

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

その後、S282の処理が終了すると、図14に示されている処理が終了する。 After that, when the process of S282 ends, the process shown in FIG. 14 ends.

なお、図14にフローチャートで示したロギング処理が終了したときには、CPU12は、ロギング設定データ42を外部記憶装置17に更に保存する処理も行うようにする。このロギング設定データ42は、後述する収集データ73の表示の際に使用される。 It should be noted that when the logging process shown in the flowchart of FIG. 14 is finished, 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 collecting data 73 to be described later is displayed.

次に、図14におけるS290の収集処理について、図17に示したフローチャートを用いて更に詳細に説明する。 Next, the collection processing of S290 in FIG. 14 will be described in more detail using the flowchart shown in FIG.

まず、S291において、前述したS260の時刻管理処理により計時されている現在の時刻をタイムスタンプとして取得し、得られたタイムスタンプを収集データ73の先頭位置のデータとしてリングバッファ62に書き込む処理が行われる。 First, in S291, the current time measured by the time management process in S260 described above is obtained as a time stamp, and the obtained time stamp is written in the ring buffer 62 as data at the head position of the collected data 73. will be

次に、S292において、収集タイミングカウンタ64の現在のカウント値、すなわち、収集タイミングが到来した回数を取得し、収集データ73のタイムスタンプの書き込み位置に続けて、得られたカウント値をリングバッファ62に書き込む処理が行われる。 Next, in S292, the current count value of the collection timing counter 64, that is, the number of times the collection timing has come is obtained, and the obtained count value is written to the ring buffer 62 following the write position of the time stamp of the collected data 73. is written to.

S293では、対象変数それぞれの現在の値を取得し、収集データ73の収集タイミングカウンタ値の書き込み位置に続けて、取得した各値を、変数データとして、対象変数のそれぞれに対応づけられた所定の順序でリングバッファ62に書き込む処理が行われる。 In S293, the current value of each target variable is acquired, and following the write position of the collection timing counter value of the collection data 73, each acquired value is used as variable data, and a predetermined value associated with each of the target variables is stored. The process of writing to the ring buffer 62 is performed in order.

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

次に、S294において、図14のS251の処理により計測を開始した今回のロギング処理の実行時間が、前述した最大処理時間内に収まっているか否かを判定する処理が行われる。この判定処理において、今回のロギング処理の実行時間が最大処理時間内に収まっていると判定されたとき(判定結果がYESのとき)にはS295に処理を進める。一方、この判定処理において、今回のロギング処理の実行時間が最大処理時間内に収まらなかったと判定されたとき(判定結果がNOのとき)には、今回の収集処理が終了する。なお、処理の高速化を目的として、このS294の処理を、次に説明するS295の判定処理における、対象変数の全てについて値の収集を済ませたと判定されたとき(判定結果がYESのとき)の後に行うようにしてもよい。 Next, in S294, a process is performed to determine whether or not the execution time of the current logging process whose measurement was started in the process of S251 of FIG. 14 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 proceeds to S295. On the other hand, when it is determined in this determination process that the execution time of the logging process of this time did not fall within the maximum processing time (when the determination result is NO), the collection process of this time ends. For the purpose of speeding up the processing, the processing of S294 is performed when it is determined that the values of all target variables have been collected (when the determination result is YES) in the determination processing of S295 described below. You can do it later.

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

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

次に、収集データ73に含まれている収集タイミングカウンタ値の用途について、図18及び図19を用いて説明する。 Next, the use of the collection timing counter value included in the collected data 73 will be described with reference to FIGS. 18 and 19. FIG.

図18及び図19に表されているS299の割り込み処理とは、例えば、図3のPLCシステム10においての入出力モジュール3の入出力リフレッシュや通信モジュール4からのメッセージ通信などに対応するための処理であって、優先度の高い処理である。PLC1の運転状況によっては、このような割り込み処理の実行によって、前述した最大処理時間内のロギング処理では全ての対象変数の値の収集が間に合わないことがある。 The interrupt processing of S299 shown in FIGS. 18 and 19 is, for example, processing for responding to input/output refresh of the input/output module 3 and message communication from the communication module 4 in the PLC system 10 of FIG. and is a process with a high priority. Depending on the operating conditions of the PLC 1, the logging process within the maximum processing time described above may not be able to collect the values of all the target variables due to the execution of such interrupt processing.

このような割り込み処理が発生した場合でもロギング処理により全ての対象変数についての値の収集を行った場合の例を図18は表している。この図18の例では、S299の割り込み処理を実行すると共に全ての対象変数の値の収集をS250のロギング処理を実行した制御周期の制御処理では、システム処理が実行されなくなってしまったことを表している。従って、この制御周期では、PLC1自身の動作管理が不十分となり、結果として、ロギング処理がユーザプログラムの実行や外部機器の制御に影響を及ぼしてしまう可能性が考えられる。 FIG. 18 shows an example in which values of all target variables are collected by logging processing even when such interrupt processing occurs. In the example of FIG. 18, system processing is no longer executed in the control processing of the control cycle in which the interrupt processing of S299 is executed and the values of all target variables are collected and the logging processing of S250 is executed. ing. Therefore, in this control cycle, the operation management of the PLC 1 itself becomes insufficient, and as a result, it is conceivable that the logging process may affect the execution of user programs and the control of external devices.

このような事態を防止するために、本実施形態のPLC1では、図14のS253及びS254の処理が実行される。この実行によって、図19で表現されているように、S250のロギング処理の実行時間が最大処理時間内に収まらない場合にはリングバッファ62の収集データ73を破棄してロギング処理を中断させるので、S240のシステム処理の実行時間が確保される。 In order to prevent such a situation, the PLC 1 of this embodiment executes the processes of S253 and S254 in FIG. As a result of this execution, as shown in FIG. 19, if the execution time of the logging process in S250 does not fall within the maximum processing time, the collected data 73 in the ring buffer 62 is discarded and the logging process is interrupted. The execution time of the system processing of S240 is ensured.

図19の下側部分では、ロギング処理の中断によって収集データ73が破棄されたときのリングバッファ62での収集データ73の格納状況を表している。より詳細には、「収集データN」に続く「収集データN+1」が破棄され、「収集データN+1」が破棄された制御周期に続く次の制御周期におけるロギング処理により、「収集データN」に続いて「収集データN+2」が格納された状況が表されている。 The lower part of FIG. 19 shows how the collected data 73 is stored in the ring buffer 62 when the collected data 73 is discarded due to interruption of the logging process. More specifically, "collected data N+1" following "collected data N" is discarded, and by logging processing in the next control period following the control period in which "collected data N+1" was discarded, A situation is shown in which "collected data N+2" is stored.

このとき、外部記憶装置17に保存されるロギング収集データ70には、収集データ73として、「収集データN」と「収集データN+2」とがこの順序で配置されることとなる。ここで、「収集データN」及び「収集データN+2」に含まれる収集タイミングカウンタ値はそれぞれ「N」及び「N+2」であり、両者の差の値は「1」ではなく「2」となる。このように、ロギング収集データ70において連続して配置されている2つの収集データ73それぞれの収集タイミングカウンタ値の差が1よりも大きいことを検出することで、ロギング処理の中断により収集データ73が破棄されたことの検知が可能になる。 At this time, “collected data N” and “collected data N+2” are arranged in this order as the collected data 73 in the logging collected data 70 stored in the external storage device 17 . Here, the collection timing counter values included in "collected data N" and "collected data N+2" are respectively "N" and "N+2", and the value of the difference between the two is "2" instead of "1". In this way, by detecting that the difference between the collection timing counter values of the two pieces of collected data 73 consecutively arranged in the logging collected data 70 is greater than 1, the collected data 73 is interrupted by interrupting the logging process. It becomes possible to detect that it has been discarded.

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

次に、図3のPLCシステム10における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 10 of FIG. 3 will be described.

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

図20の構成例では、収集データ表示装置80は、CPU81、メモリ82、入力装置83、補助記憶装置84、表示装置85、及び記憶装置I/F86を備えている。これらの構成要素はいずれも内部バス87に接続されており、相互にデータの授受を行うことが可能である。 In the configuration example of FIG. 20, 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/F86. All of these components are connected to the internal bus 87 and can exchange data with each other.

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

入力装置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, or the like, and may be, for example, a hard disk drive or a flash memory. 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, for making inquiries or instructions to the user and for displaying and outputting 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を構成するようにしてもよい。また、図3のPLCシステム10において支援装置30として機能させたPC2を更に用いて、収集データ表示装置80を構成するようにしてもよい。 The collected data display device 80 has the above hardware configuration. Since such a hardware configuration is a standard configuration that a general computer has, 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 functioning as the support device 30 in the PLC system 10 of FIG.

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

図21において、外部記憶装置17には、前述したロギング収集データ70がPLC1によって保存されているものとする。図15及び図16を用いて説明したように、ロギング収集データ70には、PLC1が実行したS250のロギング処理により収集された対象変数の値を当該対象変数の値の収集時刻に対応付けた収集データ73が当該収集時刻順に並べられている。また、収集データ73には、当該収集時刻が到来した回数をカウントする収集タイミングカウンタ64の値が、当該収集時刻と当該収集時刻に収集された対象変数の値とに対応付けられて含まれている。 In FIG. 21, it is assumed that the logging collection data 70 described above is stored in the external storage device 17 by the PLC 1 . As described with reference to FIGS. 15 and 16, the logging collection data 70 includes the values of the target variables collected by the logging process of S250 executed by the PLC 1, and the collection times of the values of the target variables. Data 73 are arranged in the order of collection time. The collected data 73 also includes the value of the collection timing counter 64 that counts the number of times the collection time has come, in association with the collection time and the value of the target variable collected at the collection time. there is

図21の構成例では、収集データ表示装置80は、読み出し部91、表示部92、及び表示制御部93を備えている。 In the configuration example of FIG. 21 , the collected data display device 80 includes a reading section 91 , a display section 92 and a display control section 93 .

読み出し部91は、ロギング収集データ70を外部記憶装置17から読み出す。 The reading unit 91 reads the logging collection data 70 from the external storage device 17 .

表示部92は、外部記憶装置17から読み出したロギング収集データ70に基づいて、収集時刻と当該収集時刻に収集された対象変数の値とを関係付けて表示する。 Based on the logging collection data 70 read from the external storage device 17, the display unit 92 displays the collection time and the values of the target variables collected at the collection time in association with each other.

表示制御部93は、外部記憶装置17から読み出したロギング収集データ70からロギング処理の中断の痕跡を発見した場合に、当該中断による対象変数の値の欠損を示す表示を表示部92に更に表示させる。この欠損を示す表示では、当該欠損した対象変数の値がロギング処理により収集されていた収集時刻に対応付けて表示させる。なお、表示制御部93は、対象変数の値の欠損を示す表示として、例えば、対象変数の値が不定値であることを示す表示を、欠損した対象変数の値がロギング処理により収集された収集時刻に対応付けて、表示部92に表示させるようにしてもよい。 When the display control unit 93 finds traces of interruption of the logging process from the logging collection data 70 read out from the external storage device 17, the display control unit 93 causes the display unit 92 to further display a display indicating that the value of the target variable is missing due to the interruption. . In the display indicating this loss, the value of the missing target variable is displayed in association with the collection time at which it was collected by the logging process. Note that the display control unit 93 displays, for example, a display indicating that the value of the target variable is an indeterminate value as a display indicating the missing value of the target variable. It may be displayed on the display unit 92 in association with the time.

このような対象変数の値の欠損を示す表示を行うことにより、ロギング処理の中断が生じたことをユーザに認識させることを可能にする。また、対象変数の値の表示において値の欠損を許容することで、ユーザアプリケーションの実行や機器の制御に影響を及ぼさない範囲でのロギングをPLC1に行わせることが可能になる。 By displaying such a missing value of the target variable, it is possible to make the user aware that the logging process has been interrupted. In addition, by allowing missing values in the display of the values of the target variables, it becomes possible to cause the PLC 1 to perform logging within a range that does not affect the execution of user applications and the control of devices.

なお、表示制御部93は、例えば、外部記憶装置17から読み出したロギング収集データ70において連続して並べられている2つの収集データ73それぞれに含まれる収集タイミングカウンタ64の値の差分値に基づいて、当該中断の痕跡を発見してもよい。 For example, the display control unit 93 can display data based on the difference between the values of the collection timing counter 64 included in each of the two pieces of collected data 73 consecutively arranged in the collected logging data 70 read from the external storage device 17. , may find traces of the interruption.

このような構成を備えている収集データ表示装置80によって行われる、収集データを表示する方法の一例について、図22を用いて更に詳細に説明する。 An example of a method of displaying collected data performed by the collected data display device 80 having such a configuration will be described in more detail with reference to FIG. 22 .

収集データ表示装置80は、S310のプログラム表示処理、S320の波形表示処理、S330のロギングファイル解析・変換処理、及びS340の表示制御処理を行う。これらの各処理を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. A program that causes the CPU 81 to perform each of these processes is sometimes called engineering software.

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

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

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

S340の表示制御処理は、S330のロギングファイル解析・変換処理によって得られる、収集タイミングが対応付けられている対象変数の値をS310のプログラム表示処理とS320の波形表示処理とに提供する処理を含む。また、この表示制御処理は、プログラム表示処理と波形表示処理との表示を連動させる処理を含む。 The display control process of S340 includes a process of providing the value of the target variable associated with the collection timing obtained by the logging file analysis/conversion process of S330 to the program display process of S310 and the waveform display process of S320. . Further, the display control processing includes processing for interlocking the display of the program display processing and the waveform display processing.

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

まず、S310のプログラム表示処理の詳細について、図23を用いて説明する。 First, the details of the program display processing of S310 will be described with reference to FIG.

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

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

S312の対象変数値表示制御処理は、S311の操作UI処理により受け付けられた入力の情報や、S340の表示制御処理からの連動の情報を受け付けて、対象変数の値の表示を制御する処理である。 The target variable value display control process of S312 is a process of receiving the input information accepted by the operation UI process of S311 and the linked information from the display control process of S340, and controlling the display of the value of the target variable. .

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

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

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

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

UI画面120は、収集タイミング毎に収集されている対象変数の値についての表示を順次更新させる指示を与えるコマ送りボタン121やシークバー122、表示させる対象変数の値の収集タイミングの時刻を直接入力する時刻入力欄123等を有している。なお、時刻入力欄123は、コマ送りボタン121やシークバー122への操作によって指定される収集タイミングの時刻を表示する表示欄としての機能も有している。 The UI screen 120 includes a frame advance button 121 and a seek bar 122 that give an instruction to sequentially update the display of the values of the target variables collected at each collection timing, and the time of the collection timing of the values of the target variables to be displayed. It has a time input field 123 and the like. The time input field 123 also has a function as a display field for displaying the time of collection timing designated by operating the frame advance button 121 or the seek bar 122 .

S311の操作UI処理によって、コマ送りボタン121やシークバー122への操作に応じて指定された収集タイミングが取得され、このタイミングの時刻が時刻入力欄123に表示される。また、時刻の入力操作が時刻入力欄123に対して行われた場合には、この操作UI処理によって、入力された時刻が、指定した収集タイミングとして取得される。 By the operation UI processing of S<b>311 , the collection timing specified according to the operation of the frame advance button 121 or the seek bar 122 is acquired, and the time of this timing 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 designated collection timing by this operation UI processing.

S312の対象変数値表示制御処理により、ロギング収集データ70において収集タイミングが対応付けられている対象変数の値や、S311の操作UI処理によって取得された収集タイミングの指定が取得される。なお、ロギング収集データ70はS330のロギングファイル解析・変換処理により取得されてS340の表示制御処理に送付されたものであり、対象変数値表示制御処理は、表示制御処理からロギング収集データ70の提供を受ける。また、この対象変数値表示制御処理により、指定された収集タイミングにおける対象変数の値がS313のユーザプログラム表示処理に送られ、ユーザプログラム表示処理により、当該対象変数の値についての表示が、ユーザプログラム表示画面110で行われる。 By the target variable value display control processing of S312, the value of the target variable associated with the collection timing in the logging collection data 70 and the specification of the collection timing obtained by the operation UI processing of S311 are acquired. The logging collection data 70 is acquired by the logging file analysis/conversion processing of S330 and sent to the display control processing of S340. receive. Further, by this target variable value display control processing, the value of the target variable at the specified collection timing is sent to the user program display processing of S313, and by the user program display processing, the display of the value of the target variable is displayed by the user program. This is done on the display screen 110 .

図24の画面例において、ON/OFF表示111や変数表示112は、対象変数の値を表示するものである。 In the screen example of FIG. 24, the ON/OFF display 111 and the variable display 112 display the values of the target variables.

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

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

以上のように、S311、S312、及びS313の処理によって、図24の画面例で表されているように、収集時刻と当該収集時刻に収集された対象変数の値とが関係付けされて表示装置85で表示される。 As described above, through the processes of S311, S312, and S313, the collection time and the values of the target variables collected at the collection time are associated with each other, as shown in the screen example of FIG. 85.

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

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

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

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

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

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

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

S322の対象変数値表示制御処理は、S312の処理と同様の処理であり、S321の操作UI処理により受け付けられた入力の情報や、S340の表示制御処理からの前述の連動の情報を受け付けて、対象変数の値の表示を制御する処理である。 The target variable value display control process of S322 is the same process as the process of S312. This is processing for controlling the display of the value of the target variable.

S323の波形作成処理は、S340の表示制御処理により提供される、収集タイミングが対応付けられている対象変数の値に基づいて、収集タイミングと当該対象変数との関係を表している波形を作成して表示する処理である。 The waveform creation processing of S323 creates a waveform representing the relationship between the collection timing and the target variable based on the value of the target variable associated with the collection timing provided by the display control processing of S340. This is the process of displaying

ここで図27について説明する。図27は、収集データの波形表示画面140の第1の例である。この波形表示画面140は、CPU81がS320の波形表示処理を実行することによって表示装置85に表示される。 FIG. 27 will now be described. FIG. 27 is a first example of the waveform display screen 140 of acquired data. This waveform display screen 140 is displayed on the display device 85 by the CPU 81 executing the waveform display processing of S320.

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

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

S322の対象変数値表示制御処理により、S340の表示制御処理により提供されるロギング収集データ70において収集タイミングが対応付けられている対象変数の値が取得される。また、このS322の対象変数値表示制御処理により、時刻表示欄144に表示された収集タイミングの時刻が取得される。更に、この対象変数値表示制御処理により、取得された収集タイミングにおける対象変数の値が、波形141と太線143との交点の位置で表される対象変数の値として、変数値表示欄145に表示される。 By the target variable value display control process of S322, the value of the target variable associated with the collection timing in the logging collection data 70 provided by the display control process of S340 is acquired. In addition, the time of the collection timing displayed in the time display field 144 is obtained by the target variable value display control processing of S322. Furthermore, by this target variable value display control processing, the value of the target variable at the acquired collection timing is displayed in the variable value display field 145 as the value of the target variable represented by the position of the intersection of the waveform 141 and the thick line 143. be done.

以上のように、S321、S322、及びS323の処理によって、図27の画面例で表されているように、収集時刻と当該収集時刻に収集された対象変数の値とが関係付けされて表示装置85で表示される。 As described above, through the processes of S321, S322, and S323, the collection time and the values of the target variables collected at the collection time are associated with each other, as shown in the screen example of FIG. 85.

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

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

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

S332のロギング収集データ取得処理は、ロギング収集データ70を外部記憶装置17から読み出して取り込む処理であり、図21に示した機能構成例における読み出し部91の機能を提供する処理である。 The logging collection data acquisition process of S332 is a process of reading and capturing the logging collection data 70 from the external storage device 17, and is a process of providing the function of the reading unit 91 in the functional configuration example shown in FIG.

S333の収集データ欠損判定処理は、外部記憶装置17から読み出したロギング収集データ70からロギング処理の中断の痕跡を発見する処理である。より具体的には、この収集データ欠損判定処理は、S332のロギング収集データ取得処理により取得されたロギング収集データ70に含まれている収集データ73を参照することによって、収集データ73の欠損が生じているかどうかを判定する処理である。 The collected data loss determination process of S333 is a process of finding traces of interruption of the logging process from the logging collected data 70 read out from the external storage device 17 . More specifically, in this collected data loss determination process, the collected data 73 is lost by referring to the collected data 73 included in the logging collected data 70 acquired by the logging collected data acquisition process of S332. This is the process of determining whether or not

S334の表示用データ作成処理は、S333の収集データ欠損判定処理によって欠損が生じていると判定された場合に、欠損していた収集データ73の代わりのデータとして、対象変数の値が不定値であることを示す欠損表示データを作成する処理である。 In the display data creation processing of S334, when it is determined that there is a loss by the collected data loss determination processing of S333, the value of the object variable whose value is an indefinite value is used as data instead of the missing collected data 73. This is a process of creating missing display data indicating that there is a missing image.

次に図29について説明する。図29は、S330のロギングファイル解析・変換処理の処理内容を示したフローチャートである。 Next, FIG. 29 will be described. FIG. 29 is a flow chart showing the processing contents of the logging file analysis/conversion processing of S330.

図29において、まず、S401では、ロギング設定データ42とロギング収集データ70とを外部記憶装置17から読み出して取り込む処理が行われる。この処理は、図28におけるS331のロギング設定データ取得処理とS332のロギング収集データ取得処理とに相当する処理である。 In FIG. 29, first, in S401, the logging setting data 42 and the logging collection data 70 are read from the external storage device 17 and imported. This process corresponds to the logging setting data acquisition process of S331 and the logging collection data acquisition process of S332 in FIG.

続くS402及びS403の処理は、図18及び図19を用いて説明した、ロギング処理の中断により収集データ73が破棄されたことの検知を、収集タイミングカウンタ値を用いて行う処理である。このS402及びS403の処理は、図28におけるS333の収集データ欠損判定処理に相当する処理である。 The subsequent processes of S402 and S403 are processes for detecting that the collected data 73 has been discarded due to interruption of the logging process, described using FIGS. 18 and 19, using the collection timing counter value. The processes of S402 and S403 correspond to the collected data loss determination process of S333 in FIG.

まず、S402において、ロギング収集データ70において前述した順序で含まれている収集データ73を1つ取り出し、当該収集データ73と1つ前の順序の収集データ73とのそれぞれの収集タイミングカウンタ値の差分値を算出する処理が行われる。つまり、ロギング収集データ70において連続して並べられている2つの収集データ73それぞれに含まれる収集タイミングカウンタ64の値の差分値を算出する処理がS402において行われる。なお、取り出した収集データ73がロギング収集データ70における先頭のものである場合には、差分値は「1」とする。 First, in S402, one collection data 73 included in the order described above is extracted from the logging collection data 70, and the difference in the collection timing counter value between the collection data 73 and the collection data 73 in the previous order is calculated. A process of calculating the value is performed. That is, in S402, the process of calculating the difference value between the values of the collection timing counter 64 included in each of the two collection data 73 consecutively arranged in the logging collection data 70 is performed. Note that if the collected data 73 that is taken out is the leading data in the collected logging data 70, the difference value is set to "1".

次に、S403において、S402の処理で算出された差分値が2以上であるか否か(すなわち1ではないか否か)を判定する処理が行われる。この判定処理において、差分値が2以上であると判定したとき(判定結果がYESのとき)には、収集データ73が破棄されて欠損しており、ロギング処理の中断の痕跡を発見したと判断してS404に処理を進める。一方、この判定処理において、差分値が2以上ではないと判定したとき(判定結果がNOのとき)には、S404の処理を実行せずにS405に処理を進める。 Next, in S403, a process of determining whether or not the difference value calculated in the process of S402 is 2 or more (that is, whether or not it is not 1) is performed. In this determination process, when it is determined that the difference value is 2 or more (when the determination result is YES), it is determined that the collected data 73 is discarded and missing, and that traces of interruption of the logging process have been found. Then, the process proceeds to S404. On the other hand, in this determination process, when it is determined that the difference value is not 2 or more (when the determination result is NO), the process proceeds to S405 without executing the process of S404.

S404では、欠損している収集データ73の代わりのデータとして前述の欠損表示データを作成し、ロギング収集データ70における、S402の処理で取り出した収集データ73と1つ前の順序の収集データ73との間に挿入する処理が行われる。 In S404, the aforementioned missing display data is created as data in place of the missing collected data 73, and in the logging collected data 70, the collected data 73 extracted in the processing of S402 and the collected data 73 in the previous order are combined. Insertion processing is performed between

このS404の処理により作成される欠損表示データの個数は、S402の処理で算出された差分値よりも1つ少なくする。また、作成される欠損表示データのデータ構造は、図16に示した収集データ73と同一の構造とし、対象変数のそれぞれの値として、不定値を示すデータ(例えばヌルデータ)を欠損表示データに配置する。 The number of missing display data created by the process of S404 is one less than the difference value calculated by the process of S402. Also, the data structure of the generated missing display data is the same as that of the collected data 73 shown in FIG. 16, and data indicating an indefinite value (for example, null data) is arranged in the missing display data as each value of the target variable. do.

S404の処理により作成される欠損表示データにおけるタイムスタンプの情報及び収集タイミングカウンタ値の情報には、それぞれの推定値が含まれようにする。すなわち、タイムスタンプの情報には、欠損している収集データ73に含まれているはずであった対象変数の値の収集が行われたと推定される時刻の情報が含まれるようにする。また、収集タイミングカウンタ値の情報には、欠損している収集データ73に含まれていたと推定される収集タイミングカウンタ値の情報が含まれるようにする。これらの推定値は、例えば、欠損表示データが挿入される前後の収集データ73のそれぞれに含まれている値を線形補間することによって得られる値とする。 The time stamp information and the collection timing counter value information in the missing display data created by the process of S404 contain their respective estimated values. That is, the time stamp information includes information about the estimated time when the value of the target variable that should have been included in the missing collected data 73 was collected. In addition, information on the collection timing counter value that is presumed to have been included in the missing collection data 73 is included in the information on the collection timing counter value. These estimated values are, for example, values obtained by linearly interpolating values included in each of the collected data 73 before and after the missing display data is inserted.

以上のS404の処理は、図28におけるS334の表示用データ作成処理に相当する処理である。 The processing of S404 described above corresponds to the display data creation processing of S334 in FIG.

S405では、S402の処理による収集データ73の取り出しの回数を計数する収集データ数カウントの値をインクリメントする(1増加させる)処理が行われる。 In S405, a process of incrementing (increase by 1) the value of the collected data number count that counts the number of times the collected data 73 is taken out by the process of S402 is performed.

S406では、収集データ数カウントの現在の値がロギング収集データ70に含まれている収集データ数71で示されている値に達したか否かを判定する処理が行われる。この判定処理において、収集データ数カウントの値が収集データ数71で示されている値に達したと判定したとき(判定結果がYESのとき)には、このロギングファイル解析・変換処理を終了する。一方、この判定処理において、収集データ数カウントの値が収集データ数71で示されている値には未だ達してはいないと判定したとき(判定結果がNOのとき)には、S402に処理を戻す。このときには、ロギング収集データ70から未だ取り出されていない残余の収集データ73についてS402以降の処理が行われる。 In S<b>406 , processing is performed to determine whether or not the current value of the collected data number count has reached the value indicated by the collected data number 71 included in the logging collected data 70 . In this determination process, when it is determined that the value of the collected data number count has reached the value indicated by the collected data number 71 (when the determination result is YES), this logging file analysis/conversion process is terminated. . On the other hand, when it is determined in this determination process that the value of the collected data number count has not yet reached the value indicated by the collected data number 71 (when the determination result is NO), the process proceeds to S402. return. At this time, the remaining collected data 73 that has not yet been extracted from the logging collected data 70 is processed after S402.

以上の処理がS330のロギングファイル解析・変換処理である。 The above processing is the logging file analysis/conversion processing of S330.

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

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

S341の変数値提供処理は、S330のロギングファイル解析・変換処理により得られたロギング収集データ70を、収集タイミングが対応付けられている対象変数の値として、S310のプログラム表示処理とS320の波形表示処理とに提供する処理である。なお、提供されるロギング収集データ70には、ロギングファイル解析・変換処理により作成された欠損表示データが含まれている場合がある。 In the variable value provision process of S341, the logging collection data 70 obtained by the logging file analysis/conversion process of S330 is used as the value of the target variable associated with the collection timing, and the program display process of S310 and the waveform display of S320 are performed. It is the processing provided to the processing. Note that the provided logging collection data 70 may include missing display data created by logging file analysis/conversion processing.

S342の再生制御処理は、所定の連動の指示を受けると、S310のプログラム表示処理とS320の波形表示処理とを制御して、それぞれの処理により表示される画面の内容を連動させる処理である。この再生制御処理により、例えば、図24の画面例におけるUI画面120に対する操作により指定された収集タイミングと、図27の画面例における太線143によって示される収集タイミングとを同一の時刻とする処理が行われる。 The reproduction control process of S342 is a process of controlling the program display process of S310 and the waveform display process of S320 when a predetermined interlocking instruction is received, and interlocking the contents of the screen displayed by each process. By this playback control processing, for example, processing is performed to set the collection timing designated by the operation on the UI screen 120 in the screen example of FIG. 24 and the collection timing indicated by the thick line 143 in the screen example of FIG. 27 to be the same time. will be

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

以上のように、S340の表示制御処理によって、S330のロギングファイル解析・変換処理により得られたロギング収集データ70が、S310のプログラム表示処理とS320の波形表示処理とに提供される。このときに提供されるロギング収集データ70には前述した表示欠損データが含まれている場合がある。次に、この場合にプログラム表示処理と波形表示処理とが表示装置85にそれぞれ表示させる画面について説明する。 As described above, the display control process of S340 provides the logging collection data 70 obtained by the logging file analysis/conversion process of S330 to the program display process of S310 and the waveform display process of S320. The logging collection data 70 provided at this time may include the above-described missing display data. Next, screens displayed on the display device 85 by the program display process and the waveform display process in this case will be described.

まず図31について説明する。図31は、収集データの表示画面の第2の例であって、ロギング処理の中断の痕跡が発見された場合に、当該中断による対象変数の値の欠損を示す表示がユーザプログラム表示画面110に含まれている画面例である。 First, FIG. 31 will be described. FIG. 31 shows a second example of the display screen of the collected data. When traces of interruption of the logging process are found, the user program display screen 110 displays a display indicating the loss of the value of the target variable due to the interruption. Included is an example screen.

図31の画面例を図24の画面例と比較すると分かるように、図31の画面例では、塗りつぶしが施されていないプログラム構成要素の表示が、ON/OFF不定表示113としてユーザプログラム表示画面110に含まれている。このON/OFF不定表示113は、ONとOFFとのどちらかの状態を有するプログラム構成要素の当該状態が対象変数として選択されており、且つ、当該対象変数の値が不定値であることがロギング収集データ70で示されている場合の表示である。 As can be seen by comparing the screen example of FIG. 31 with the screen example of FIG. 24, in the screen example of FIG. included in This ON/OFF undefined display 113 indicates that the state of a program component having either ON or OFF state is selected as a target variable and that the value of the target variable is an undefined value. It is a display when it is indicated by the collected data 70 .

また、図31の画面例では、プログラム構成要素に関する数値の表示として「???」なる表示が、ユーザプログラム表示画面110に変数不定値表示114として含まれている。この変数不定値表示114は、プログラム構成要素に関する数値が対象変数として選択されており、且つ、当該対象変数の値が不定値であることがロギング収集データ70で示されている場合の表示である。 In addition, in the screen example of FIG. 31, the user program display screen 110 includes a display of "??" This variable undefined value display 114 is displayed when a numeric value related to a program component is selected as a target variable and the logging collection data 70 indicates that the value of the target variable is an undefined value. .

S311の操作UI処理によって取得された収集タイミングに対応付けられている表示欠損データがロギング収集データ70に含まれている場合には、このON/OFF不定表示113や変数不定値表示114がユーザプログラム表示画面110で表示される。この表示はS313のユーザプログラム表示処理によって行われる。 If the logging collection data 70 includes missing display data associated with the collection timing acquired by the operation UI processing of S311, the ON/OFF indefinite display 113 and variable indefinite value display 114 are displayed by the user program. It is displayed on the display screen 110 . This display is performed by the user program display processing of S313.

次に図32について説明する。図32は、収集データの波形表示画面140の第2の例であって、ロギング処理の中断の痕跡が発見された場合に、当該中断による対象変数の値の欠損を示す表示が波形表示画面140に含まれている画面例である。 Next, FIG. 32 will be described. FIG. 32 shows a second example of the waveform display screen 140 of the collected data. When traces of interruption of the logging process are found, the waveform display screen 140 shows the loss of the value of the target variable due to the interruption. This is an example screen included in

図32の画面例を図27の画面例と比較すると分かるように、図32の画面例では、3つの対象変数のそれぞれについての波形141の一部を覆い隠す表示が、波形不定表示146として波形表示画面140に含まれている。この波形不定表示146は、選択されている対象変数の値が不定値であることがロギング収集データ70で示されている場合の表示である。 As can be seen by comparing the screen example of FIG. 32 with the screen example of FIG. 27, in the screen example of FIG. Included in display screen 140 . This waveform indeterminate display 146 is displayed when the logging collection data 70 indicates that the value of the selected target variable is indeterminate.

表示欠損データがロギング収集データ70に含まれている場合には、波形表示画面140における収集タイミングに対応する位置に、このような波形不定表示146が波形141の代わりに表示される。この表示はS323の波形作成処理によって作成される。 When the missing display data is included in the logging collection data 70 , such waveform indefinite display 146 is displayed instead of the waveform 141 at a position corresponding to the collection timing on the waveform display screen 140 . This display is created by the waveform creating process of S323.

以上のように、S310のプログラム制御処理やS320の波形表示処理によって、図21に示した機能構成例における表示部92の機能が提供される。また、S330のロギングファイル解析・変換処理及びS340の表示制御処理によって、図21に示した機能構成例における表示制御部93の機能が提供される。この結果、収集データ表示装置80による、対象変数の値の欠損を示す表示を含む、ロギング処理により収集された対象変数の値の表示が行われる。 As described above, the program control process of S310 and the waveform display process of S320 provide the function of the display unit 92 in the functional configuration example shown in FIG. Also, the function of the display control unit 93 in the functional configuration example shown in FIG. 21 is provided by the logging file analysis/conversion process of S330 and the display control process of S340. As a result, the collected data display device 80 displays the values of the target variables collected by the logging process, including the display indicating the missing values of the target variables.

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

1 PLC
2 PC
3 入出力モジュール
4 通信モジュール
6 通信ケーブル
7 通信バス
10 PLCシステム
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 第1出力部
34 第2出力部
40 設定ツール
41 プロジェクトデータ
42 ロギング設定データ
51 プロジェクトデータ情報
52 収集動作設定情報
53 収集対象設定情報
61 処理実行部
62 リングバッファ
63 保存部
64 収集タイミングカウンタ
70 ロギング収集データ
71 収集データ数
72 収集データサイズ
73 収集データ
80 収集データ表示装置
91 読み出し部
92 表示部
93 表示制御部
100、120 UI画面
101 プログラム選択部
102 抽出変数表示部
103 対象変数表示部
104 登録ボタン
105 解除ボタン
106 一括登録ボタン
107 一括解除ボタン
108 収集データサイズ表示部
109 推定制御周期表示部
110 ユーザプログラム表示画面
111 ON/OFF表示
112 変数表示
113 ON/OFF不定表示
114 変数不定値表示
120 UI画面
121 コマ送りボタン
122 シークバー
123 時刻入力欄
130 警告ダイアログ
140 波形表示画面
141 波形
142 時刻表示
143 太線
144 時刻表示欄
145 変数値表示欄
146 波形不定表示
1 PLC
2 PCs
3 input/output module 4 communication module 6 communication cable 7 communication bus 10 PLC system 11, 26 communication I/F
12, 21, 81 CPUs
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 unit 32 selection unit 33 first output unit 34 second output unit 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 process execution unit 62 ring buffer 63 storage unit 64 collection timing counter 70 logging collection data 71 number of collection data 72 collection data size 73 collection data 80 Collected data display device 91 Reading unit 92 Display unit 93 Display control unit 100, 120 UI screen 101 Program selection unit 102 Extraction variable display unit 103 Target variable display unit 104 Registration button 105 Release button 106 Batch registration button 107 Batch release button 108 Collection Data size display part 109 Estimated control cycle display part 110 User program display screen 111 ON/OFF display 112 Variable display 113 ON/OFF undefined display 114 Variable undefined value display 120 UI screen 121 Frame advance 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 146 Waveform indefinite display

Claims (11)

プログラマブルロジックコントローラであって、
外部機器から送られてくる入力データを取り込む入力処理、前記入力データを用いてユーザアプリケーションプログラムを実行するプログラム実行処理、前記ユーザアプリケーションプログラムの実行結果を出力して外部機器を制御する出力処理、前記プログラマブルロジックコントローラ自身の動作を管理するシステム処理、及び、前記ユーザアプリケーションプログラムにおいて使用されている変数の値を収集するロギング処理を含む制御処理のサイクルを繰り返し実行する処理実行部と、
前記ロギング処理による前記変数の値の収集時刻と前記収集時刻に収集された前記変数の値を対応付けた収集データを、前記変数の値を収集する度に保存するリングバッファと、
を備え
前記ロギング処理は、前記制御処理の1サイクルの実行時間が、予め設定されている制御周期に収まるかどうかを判定して、前記実行時間が前記制御周期に収まらないと判定したサイクルの制御処理に含まれる前記ロギング処理において前記変数の値の収集を中断する処理として、前記実行時間が前記制御周期に収まらないと判定したサイクルの制御処理に含まれる前記ロギング処理おいて収集された前記変数の値を含む前記収集データを前記リングバッファから破棄する処理を含む、
ことを特徴とするプログラマブルロジックコントローラ。
A programmable logic controller,
An input process for fetching input data sent from an external device, a program execution process for executing a user application program using the input data, an output process for outputting the execution result of the user application program and controlling the external device, a processing execution unit that repeatedly executes control processing cycles including system processing that manages the operation of the programmable logic controller itself and logging processing that collects the values of variables used in the user application program ;
a ring buffer for storing collected data in which the values of the variables collected by the logging process and the values of the variables collected at the collection times are associated each time the values of the variables are collected;
The logging process determines whether or not the execution time of one cycle of the control process falls within a preset control cycle, and controls the cycle for which it is determined that the execution time does not fall within the control cycle. In the logging process included in the process, as a process of interrupting the collection of the values of the variables, the collected in the logging process included in the control process of the cycle determined that the execution time does not fit within the control cycle Discarding the collected data, including variable values, from the ring buffer ;
A programmable logic controller characterized by:
前記収集データには、前記収集時刻が到来した回数をカウントする収集タイミングカウンタの値が、前記収集時刻と前記収集時刻に収集された前記変数の値とに対応付けられて含まれていることを特徴とする請求項に記載のプログラマブルロジックコントローラ。 The collected data includes a value of a collection timing counter that counts the number of times the collection time has come, in association with the collection time and the value of the variable collected at the collection time. 2. The programmable logic controller of claim 1 . 前記リングバッファにおいて破棄されずに保存されている前記収集データを順次読み出して外部記憶装置に保存する保存部を更に備えることを特徴とする請求項に記載のプログラマブルロジックコントローラ。 3. The programmable logic controller according to claim 2 , further comprising a storage unit that sequentially reads the collected data stored in the ring buffer without being discarded and stores the collected data in an external storage device. プログラマブルロジックコントローラであって、外部機器から送られてくる入力データを取り込む入力処理、前記入力データを用いてユーザアプリケーションプログラムを実行するプログラム実行処理、前記ユーザアプリケーションプログラムの実行結果を出力して外部機器を制御する出力処理、前記プログラマブルロジックコントローラ自身の動作を管理するシステム処理、及び、前記ユーザアプリケーションプログラムにおいて使用されている変数の値を収集するロギング処理を含む制御処理のサイクルを繰り返し実行する前記プログラマブルロジックコントローラの支援装置であって、
前記ユーザアプリケーションプログラムを解析して、前記ユーザアプリケーションプログラムにおいて使用されている変数を抽出するプログラム解析部と、
前記プログラム解析部により抽出された前記変数のうちから、前記ロギング処理による収集の対象とする変数を対象変数として選択する選択部と、
前記対象変数を特定する情報を前記プログラマブルロジックコントローラに対するロギング設定データとして出力する第1出力部と、
前記選択部により選択された前記対象変数の全てについて前記ロギング処理を実行した場合における前記制御処理の1サイクルの実行時間が、予め設定されている制御周期に収まるかどうかを判定し、前記制御処理の前記実行時間が前記制御周期に収まらない場合に、注意情報を出力すると共に、前記選択部により選択された前記対象変数の全てについて前記ロギング処理を実行した場合における前記制御処理の1サイクルの実行に要すると推定される時間を推定制御周期として更に出力する第2出力部と、
を備えることを特徴とする支援装置。
A programmable logic controller, comprising input processing for fetching input data sent from an external device, program execution processing for executing a user application program using the input data, and outputting the execution result of the user application program to an external device output processing for controlling the programmable logic controller, system processing for managing the operation of the programmable logic controller itself, and logging processing for collecting the values of variables used in the user application program. A support device for a logic controller, comprising:
a program analysis unit that analyzes the user application program and extracts variables used in the user application program;
a selection unit that selects, as a target variable, a variable to be collected by the logging process from among the variables extracted by the program analysis unit;
a first output unit that outputs information specifying the target variable as logging setting data for the programmable logic controller;
determining whether the execution time of one cycle of the control process when the logging process is executed for all the target variables selected by the selection unit falls within a preset control cycle; When the execution time of does not fall within the control cycle, caution information is output , and one cycle of the control process is executed when the logging process is executed for all of the target variables selected by the selection unit a second output unit that further outputs the time estimated to be required for the estimated control period as an estimated control period ;
A support device comprising:
前記ロギング設定データは、前記対象変数を特定する情報として、前記プログラマブルロジックコントローラが備えているメモリ上の記憶領域であって、前記プログラマブルロジックコントローラにおいて前記ユーザアプリケーションプログラムが実行されたときに前記対象変数の値の保持に使用される前記記憶領域についての前記メモリ上の位置を特定する情報を含むことを特徴とする請求項に記載の支援装置。 The logging setting data is a storage area on a memory provided in the programmable logic controller as information specifying the target variable, and is a storage area of the target variable when the user application program is executed in the programmable logic controller. 5. The support device according to claim 4 , further comprising information specifying a location on said memory of said storage area used for holding the value of . プログラマブルロジックコントローラであって、外部機器から送られてくる入力データを取り込む入力処理、前記入力データを用いてユーザアプリケーションプログラムを実行するプログラム実行処理、前記ユーザアプリケーションプログラムの実行結果を出力して外部機器を制御する出力処理、前記プログラマブルロジックコントローラ自身の動作を管理するシステム処理、及び、前記ユーザアプリケーションプログラムにおいて使用されている変数の値を収集するロギング処理を含む制御処理のサイクルを繰り返し実行する前記プログラマブルロジックコントローラによる前記ロギング処理によって収集された前記変数の値を表示する表示装置であって、
前記ロギング処理により収集された前記変数の値を前記変数の値の収集時刻に対応付けた収集データが前記収集時刻順に並べられているロギング収集データであって、前記プログラマブルロジックコントローラにより外部記憶装置に保存された前記ロギング収集データを前記外部記憶装置から読み出す読み出し部と、
前記外部記憶装置から読み出した前記ロギング収集データに基づいて、前記収集時刻と前記変数の値とを関係付けて表示する表示部と、
前記外部記憶装置から読み出した前記ロギング収集データから前記ロギング処理の中断の痕跡を発見した場合に、前記中断による前記変数の値の欠損を示す表示を、前記欠損した前記変数の値が前記ロギング処理により収集されていた収集時刻に対応付けて、前記表示部に更に表示させる表示制御部と、
を備えることを特徴とする表示装置。
A programmable logic controller, comprising input processing for fetching input data sent from an external device, program execution processing for executing a user application program using the input data, and outputting the execution result of the user application program to an external device output processing for controlling the programmable logic controller, system processing for managing the operation of the programmable logic controller itself, and logging processing for collecting the values of variables used in the user application program. A display device that displays the values of the variables collected by the logging process by the logic controller,
logging collected data in which collected data in which the values of the variables collected by the logging process are associated with collection times of the values of the variables are arranged in the order of the collection times, and stored in an external storage device by the programmable logic controller; a reading unit that reads the saved logging collection data from the external storage device;
a display unit for displaying the collection time and the value of the variable in association with each other based on the logging collection data read from the external storage device;
When traces of interruption of the logging process are found from the logging collection data read from the external storage device, a display indicating loss of the value of the variable due to the interruption is displayed. a display control unit that further displays on the display unit in association with the collection time collected by
A display device comprising:
前記ロギング収集データにおいて並べられている前記収集データのそれぞれには、前記収集時刻が到来した回数をカウントする収集タイミングカウンタの値が、前記収集時刻と前記収集時刻に収集された前記変数の値とに対応付けられて含まれており、
前記表示制御部は、前記外部記憶装置から読み出した前記ロギング収集データにおいて連続して並べられている2つの前記収集データそれぞれに含まれる前記収集タイミングカウンタの値の差分値に基づいて、前記ロギング処理の中断の痕跡を発見する、
ことを特徴とする請求項に記載の表示装置。
For each of the collected data arranged in the collected logging data, the value of a collection timing counter that counts the number of times the collection time has come is the value of the collection time and the value of the variable collected at the collection time. contains associated with
The display control unit performs the logging process based on the difference value between the values of the collection timing counters included in each of the two pieces of collected data that are consecutively arranged in the collected logging data read from the external storage device. discover traces of interruptions in
7. The display device according to claim 6 , wherein:
前記表示制御部は、前記変数の値の欠損を示す表示として、前記変数の値が不定値であることを示す表示を、前記欠損した前記変数の値が前記ロギング処理により収集された収集時刻に対応付けて、前記表示部に表示させることを特徴とする請求項又はに記載の表示装置。 The display control unit displays a display indicating that the value of the variable is an indefinite value as a display indicating the missing value of the variable at the collection time when the missing value of the variable is collected by the logging process. 8. The display device according to claim 6 or 7 , characterized in that it is associated with and displayed on the display unit. プログラマブルロジックコントローラが、
外部機器から送られてくる入力データを取り込む入力処理、前記入力データを用いてユーザアプリケーションプログラムを実行するプログラム実行処理、前記ユーザアプリケーションプログラムの実行結果を出力して外部機器を制御する出力処理、前記プログラマブルロジックコントローラ自身の動作を管理するシステム処理、及び、前記ユーザアプリケーションプログラムにおいて使用されている変数の値を収集するロギング処理を含む制御処理のサイクルを繰り返し実行し、
前記ロギング処理による前記変数の値の収集時刻と前記収集時刻に収集された前記変数の値を対応付けた収集データを、前記変数の値を収集する度に、前記プログラマブルロジックコントローラが備えるリングバッファに保存し、
前記ロギング処理の実行において、前記制御処理の1サイクルの実行時間が、予め設定されている制御周期に収まるかどうかを判定して、前記実行時間が前記制御周期に収まらないと判定したサイクルの制御処理に含まれる前記ロギング処理において前記変数の値の収集を中断する処理として、前記実行時間が前記制御周期に収まらないと判定したサイクルの制御処理に含まれる前記ロギング処理おいて収集された前記変数の値を含む前記収集データを前記リングバッファから破棄する処理を実行する、
ことを特徴とするロギング方法。
A programmable logic controller
An input process for fetching input data sent from an external device, a program execution process for executing a user application program using the input data, an output process for outputting the execution result of the user application program and controlling the external device, Repeatedly executing a cycle of control processing including system processing for managing the operation of the programmable logic controller itself and logging processing for collecting values of variables used in the user application program,
Collected data in which the values of the variables collected by the logging process and the values of the variables collected at the collection times are associated with each other are stored in a ring buffer provided in the programmable logic controller each time the values of the variables are collected. save and
In the execution of the logging process, it is determined whether or not the execution time of one cycle of the control process falls within a preset control cycle, and control of the cycle in which it is determined that the execution time does not fall within the control cycle In the logging process included in the process, as a process of interrupting the collection of the values of the variables, the collected in the logging process included in the control process of the cycle determined that the execution time does not fit within the control cycle performing a process of discarding the collected data, including variable values, from the ring buffer ;
A logging method characterized by:
プログラマブルロジックコントローラであって、外部機器から送られてくる入力データを取り込む入力処理、前記入力データを用いてユーザアプリケーションプログラムを実行するプログラム実行処理、前記ユーザアプリケーションプログラムの実行結果を出力して外部機器を制御する出力処理、前記プログラマブルロジックコントローラ自身の動作を管理するシステム処理、及び、前記ユーザアプリケーションプログラムにおいて使用されている変数の値を収集するロギング処理を含む制御処理のサイクルを繰り返し実行する前記プログラマブルロジックコントローラの支援装置が行う支援方法であって、
前記ユーザアプリケーションプログラムを解析して、前記ユーザアプリケーションプログラムにおいて使用されている変数を抽出し、
抽出された前記変数のうちから、前記ロギング処理による収集の対象とする変数を対象変数として選択し、
前記対象変数を特定する情報を前記プログラマブルロジックコントローラに対するロギング設定データとして出力し、
選択された前記対象変数の全てについて前記ロギング処理を実行した場合における前記制御処理の1サイクルの実行時間が、予め設定されている制御周期に収まるかどうかを判定し、
前記制御処理の前記実行時間が前記制御周期に収まらない場合に、注意情報を出力すると共に、選択された前記対象変数の全てについて前記ロギング処理を実行した場合における前記制御処理の1サイクルの実行に要すると推定される時間を推定制御周期として更に出力する
ことを特徴とする支援方法。
A programmable logic controller, comprising input processing for fetching input data sent from an external device, program execution processing for executing a user application program using the input data, and outputting the execution result of the user application program to an external device output processing for controlling the programmable logic controller, system processing for managing the operation of the programmable logic controller itself, and logging processing for collecting the values of variables used in the user application program. A support method performed by a support device for a logic controller,
parsing the user application program to extract variables used in the user application program;
Selecting a variable to be collected by the logging process from among the extracted variables as a target variable;
outputting information specifying the target variable as logging setting data for the programmable logic controller;
Determining whether the execution time of one cycle of the control process when the logging process is executed for all of the selected target variables falls within a preset control cycle,
When the execution time of the control process does not fall within the control cycle, outputting caution information, and performing one cycle of the control process when the logging process is executed for all of the selected target variables Further output the time estimated to be required as an estimated control period ,
A support method characterized by:
プログラマブルロジックコントローラであって、外部機器から送られてくる入力データを取り込む入力処理、前記入力データを用いてユーザアプリケーションプログラムを実行するプログラム実行処理、前記ユーザアプリケーションプログラムの実行結果を出力して外部機器を制御する出力処理、前記プログラマブルロジックコントローラ自身の動作を管理するシステム処理、及び、前記ユーザアプリケーションプログラムにおいて使用されている変数の値を収集するロギング処理を含む制御処理のサイクルを繰り返し実行する前記プログラマブルロジックコントローラによる前記ロギング処理によって収集された前記変数の値を表示する表示装置が行う表示方法であって、
前記ロギング処理により収集された前記変数の値を前記変数の値の収集時刻に対応付けた収集データが前記収集時刻順に並べられているロギング収集データであって、前記プログラマブルロジックコントローラにより外部記憶装置に保存された前記ロギング収集データを前記外部記憶装置から読み出し、
前記外部記憶装置から読み出した前記ロギング収集データに基づいて、前記収集時刻と前記変数の値とを関係付けて表示し、
前記外部記憶装置から読み出した前記ロギング収集データから前記ロギング処理の中断の痕跡を発見した場合に、前記中断による前記変数の値の欠損を示す表示を、前記欠損した前記変数の値が前記ロギング処理により収集された収集時刻に対応付けて更に表示する、
ことを特徴とする表示方法。
A programmable logic controller, comprising input processing for fetching input data sent from an external device, program execution processing for executing a user application program using the input data, and outputting the execution result of the user application program to an external device output processing for controlling the programmable logic controller, system processing for managing the operation of the programmable logic controller itself, and logging processing for collecting the values of variables used in the user application program. A display method performed by a display device that displays the values of the variables collected by the logging process by the logic controller,
logging collected data in which collected data in which the values of the variables collected by the logging process are associated with collection times of the values of the variables are arranged in the order of the collection times, and stored in an external storage device by the programmable logic controller; reading the saved logging collection data from the external storage device;
displaying the collection time and the value of the variable in association with each other based on the logging collection data read from the external storage device;
When traces of interruption of the logging process are found from the logging collection data read from the external storage device, a display indicating loss of the value of the variable due to the interruption is displayed. Further display in association with the collection time collected by
A display method characterized by:
JP2022078536A 2022-05-12 2022-05-12 Programmable logic controller, support device, display device, logging method, support method, display method Active JP7188631B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2022078536A JP7188631B1 (en) 2022-05-12 2022-05-12 Programmable logic controller, support device, display device, logging method, support method, display method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2022078536A JP7188631B1 (en) 2022-05-12 2022-05-12 Programmable logic controller, support device, display device, logging method, support method, display method

Publications (2)

Publication Number Publication Date
JP7188631B1 true JP7188631B1 (en) 2022-12-13
JP2023167381A JP2023167381A (en) 2023-11-24

Family

ID=84441432

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2022078536A Active JP7188631B1 (en) 2022-05-12 2022-05-12 Programmable logic controller, support device, display device, logging method, support method, display method

Country Status (1)

Country Link
JP (1) JP7188631B1 (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002149212A (en) 2000-11-13 2002-05-24 Fuji Electric Co Ltd Redundant programmable controller for equalizing control data and equalization method
JP2008146357A (en) 2006-12-11 2008-06-26 Fuji Electric Fa Components & Systems Co Ltd Programmable controller and support device thereof
JP2020013526A (en) 2018-10-23 2020-01-23 株式会社キーエンス Programmable logic controller and main unit

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002149212A (en) 2000-11-13 2002-05-24 Fuji Electric Co Ltd Redundant programmable controller for equalizing control data and equalization method
JP2008146357A (en) 2006-12-11 2008-06-26 Fuji Electric Fa Components & Systems Co Ltd Programmable controller and support device thereof
JP2020013526A (en) 2018-10-23 2020-01-23 株式会社キーエンス Programmable logic controller and main unit

Also Published As

Publication number Publication date
JP2023167381A (en) 2023-11-24

Similar Documents

Publication Publication Date Title
JP6757385B2 (en) Programmable logic controller and main unit
CN110262279B (en) Control system and control method
CN108693822B (en) Control device, storage medium, control system, and control method
US10503146B2 (en) Control system, control device, and control method
JP2020013527A (en) Programmable logic controller and program formation assistance device
EP3454144B1 (en) Control device and control method
JP5074896B2 (en) Inspection support system and image processing controller
JP7188631B1 (en) Programmable logic controller, support device, display device, logging method, support method, display method
JP2022016659A (en) Externally setting device, logging setting method and program
JP7102801B2 (en) Control system, control device and display device
JP7212496B2 (en) Programmable logic controller system, programming support device and computer program
JP7375977B1 (en) Programmable logic controller, support device, display device, logging method, support method, and display method
WO2015181921A1 (en) Programmable display device and rendering software
JP7226633B1 (en) Display device and display method
JP7168114B1 (en) Programmable logic controller, support device, display device, logging method, support method, display method
JP7226632B1 (en) Support device and support method
US11947328B2 (en) Control device, control program, and control system
CN103217942B (en) Retrieval of measurement values, diagnosis information or device parameters
US6992644B1 (en) Peripheral device of a programmable controller and monitoring method of the peripheral device
JPWO2021100308A1 (en) Machine tools, log output methods, and log output programs
US11971696B2 (en) Programmable logic controller
JP2001337722A (en) Trend display method of time-series data and its device
JP2020177713A (en) Programmable logic controller
US20220317650A1 (en) Analysis apparatus, control method thereof, and analysis system
WO2023053544A1 (en) Control system

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20220512

A871 Explanation of circumstances concerning accelerated examination

Free format text: JAPANESE INTERMEDIATE CODE: A871

Effective date: 20220512

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20220823

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20221006

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20221114

R150 Certificate of patent or registration of utility model

Ref document number: 7188631

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150