JP6921342B1 - Control device and logging method - Google Patents

Control device and logging method Download PDF

Info

Publication number
JP6921342B1
JP6921342B1 JP2020561926A JP2020561926A JP6921342B1 JP 6921342 B1 JP6921342 B1 JP 6921342B1 JP 2020561926 A JP2020561926 A JP 2020561926A JP 2020561926 A JP2020561926 A JP 2020561926A JP 6921342 B1 JP6921342 B1 JP 6921342B1
Authority
JP
Japan
Prior art keywords
data
processor
trace
difference
buffers
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
JP2020561926A
Other languages
Japanese (ja)
Other versions
JPWO2021199192A1 (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.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Application granted granted Critical
Publication of JP6921342B1 publication Critical patent/JP6921342B1/en
Publication of JPWO2021199192A1 publication Critical patent/JPWO2021199192A1/ja
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/04Programme control other than numerical control, i.e. in sequence controllers or logic controllers
    • G05B19/05Programmable logic controllers, e.g. simulating logic interconnections of signals according to ladder diagrams or function charts
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software

Abstract

制御装置(10)は、機器を制御するためのユーザプログラム(221)を繰り返し実行する。制御装置(10)は、ユーザプログラム(221)を実行するためのデータを記憶するデータメモリ(21)と、ユーザプログラム(221)を実行し、ユーザプログラム(221)を実行する毎にデータメモリ(21)からデータを読み出して出力する制御プロセッサ(231)と、制御プロセッサ(231)によって出力されたデータが予め定められた順に格納される複数のデータバッファ(33)と、複数のデータバッファ(33)のうちの2つのデータバッファ(33)に格納されたデータからデータの差分を算出する第2トレースプロセッサ(312)を有する処理部(31)と、第2トレースプロセッサ(312)によって算出された差分を蓄積して記憶する差分記憶部(34)と、を備える。The control device (10) repeatedly executes the user program (221) for controlling the device. The control device (10) executes a data memory (21) for storing data for executing the user program (221), executes the user program (221), and executes the user program (221) each time the data memory (21) is executed. A control processor (231) that reads data from the control processor (21) and outputs the data, a plurality of data buffers (33) that store the data output by the control processor (231) in a predetermined order, and a plurality of data buffers (33). ), The processing unit (31) having the second trace processor (312) which calculates the difference of the data from the data stored in the two data buffers (33), and the second trace processor (312) calculated. A difference storage unit (34) for accumulating and storing differences is provided.

Description

本開示は、制御装置及びロギング方法に関する。 The present disclosure relates to a control device and a logging method.

FA(Factory Automation)の現場では、制御装置が、産業用機械に代表される種々の機器を制御することで、生産工程、加工工程、検査工程、その他の工程が実現される。通常、制御装置は、ユーザから提供されるプログラムを実行することで、ユーザによって任意に規定された手順に従って制御処理を実行する。例えば、制御装置であるPLC(Programmable Logic Controller)は、被制御機器に関するデータが一時的に格納されるメモリを有し、ユーザから提供されたシーケンスプログラムに従って当該メモリ内のデータをリード又はライトすることにより被制御機器を制御する。 At the FA (Factory Automation) site, a control device controls various devices represented by industrial machines to realize a production process, a processing process, an inspection process, and other processes. Usually, the control device executes a control process according to a procedure arbitrarily defined by the user by executing a program provided by the user. For example, a PLC (Programmable Logic Controller), which is a control device, has a memory for temporarily storing data related to a controlled device, and reads or writes data in the memory according to a sequence program provided by a user. Controls the controlled device.

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

特許文献1には、トレース設定情報に設定された対象データについてデータメモリをトレースし、トレース結果が前回のトレース実行時から変化しているときに、トレース結果をトレースバッファに格納する演算ASICと、トレースバッファに格納されたトレース結果をローダに返信してユーザに提示する制御マイコンと、を備えるプログラマブルコントローラについて記載されている。このプログラマブルコントローラによれば、任意のデータの演算途中における変化をトレースすることができる。 Patent Document 1 describes an operation ASIC that traces a data memory for the target data set in the trace setting information and stores the trace result in a trace buffer when the trace result has changed since the previous trace execution. A programmable controller including a control microcomputer that returns the trace result stored in the trace buffer to the loader and presents it to the user is described. According to this programmable controller, it is possible to trace changes in the process of calculating arbitrary data.

特開2010−211555号公報Japanese Unexamined Patent Publication No. 2010-21155

近年、多数のデータをロギングしておいて、その後における工程管理及び品質改善のための大規模な分析を行いたいという要求が増している。特許文献1の技術では、制御対象装置の制御を行うプログラムを実行する演算ASICにおいて、プログラムに含まれる任意の命令をトレース条件として、プログラムの演算途中にトレース条件である命令を実行するときにトレース処理を行っている。特許文献1の技術において多数のデータをトレースする場合には、制御対象装置の制御を行うプログラムを実行する演算ASICにおいて、プログラムの実行途中にトレースを行うため、トレースを行うデータの数が増加すると演算ASICの演算負荷が大幅に増加してしまう。このため、演算ASICにおける制御対象装置の制御を行うプログラムの実行が中断するような事態が生じ、演算ASICによる制御対象装置の制御に影響が及ぶおそれがある。このため、ロギング対象のデータを多数にしたときに機器の制御に及ぶ影響を軽減する余地があった。また、ロギング対象のデータを多数にすると、記憶手段の記憶領域が不足してしまい、十分な量のロギング対象のデータを確保できない恐れがあった。 In recent years, there has been an increasing demand for logging a large amount of data and then performing a large-scale analysis for process control and quality improvement. In the technique of Patent Document 1, in an arithmetic ASIC that executes a program that controls a controlled device, an arbitrary instruction included in the program is used as a trace condition, and a trace is executed when an instruction that is a trace condition is executed during the operation of the program. Processing is being performed. When tracing a large amount of data in the technique of Patent Document 1, in the calculation ASIC that executes the program that controls the controlled device, the tracing is performed during the execution of the program, so that the number of data to be traced increases. The calculation load of the calculation ASIC will increase significantly. Therefore, a situation may occur in which the execution of the program for controlling the controlled target device in the arithmetic ASIC is interrupted, which may affect the control of the controlled target device by the arithmetic ASIC. Therefore, there is room for reducing the influence on the control of the device when the number of data to be logged is increased. Further, if the number of data to be logged is increased, the storage area of the storage means becomes insufficient, and there is a risk that a sufficient amount of data to be logged cannot be secured.

本開示は、ロギング対象のデータを多数にしたときに機器の制御に及ぶ影響を軽減し、多数のデータをロギングすることを目的とする。 An object of the present disclosure is to reduce the influence on the control of a device when a large number of data to be logged are used, and to log a large number of data.

上記目的を達成するため、本開示の制御装置は、機器を制御するためのプログラムを繰り返し実行する第1ユニットと、第2ユニットと、を備える制御装置であって、第1ユニットは、プログラムを実行するためのデータを記憶する第1記憶手段と、プログラムを実行し、プログラムの実行処理が終了する度に実行するエンド処理において、ユーザから履歴を残すことが指定された第1記憶手段の記憶領域からデータを読み出して出力する第1プロセッサと、を有し、第2ユニットは、第1プロセッサによって出力されたデータが予め定められた順に格納される複数のバッファと、複数のバッファのうちの2つのバッファに格納されたデータからデータの差分を算出する第2プロセッサを有する処理手段と、第2プロセッサによって算出された差分を蓄積して記憶する第2記憶手段と、を有し、第1プロセッサは、データの出力が完了したことを処理手段に通知し、第2プロセッサは、第1プロセッサからの通知に基づいて、第1プロセッサによるプログラムの次の実行処理と並列して、データの差分を算出するIn order to achieve the above object, the control device of the present disclosure is a control device including a first unit and a second unit that repeatedly execute a program for controlling the device, and the first unit is a control device including a program. a first storage means for storing data for executing, to run the program, in the end processing execution processing of the program is executed each time the termination, the first storage means can store a history of the user specified It has a first processor that reads data from a storage area and outputs the data , and the second unit has a plurality of buffers in which the data output by the first processor is stored in a predetermined order, and a plurality of buffers. It has a processing means having a second processor for calculating a data difference from the data stored in the two buffers of the above, and a second storage means for accumulating and storing the difference calculated by the second processor . The first processor notifies the processing means that the output of the data is completed, and the second processor, based on the notification from the first processor, parallels the next execution processing of the program by the first processor to obtain the data. Calculate the difference .

本開示によれば、機器を制御するためのプログラムを実行する第1プロセッサが、プログラムの実行処理が終了する度に実行するエンド処理において、第1記憶手段からデータを読み出して出力し、第2プロセッサが、複数のバッファのうちの2つのバッファに格納されたデータからデータの差分を算出する。データの差分が第2プロセッサによって算出されるため、この差分の算出を第1プロセッサが実行する必要はない。また、第2記憶手段が、データの差分を蓄積して記憶する。このため、第2記憶手段は、データをそのまま記憶する場合よりも多くのデータに関する情報を蓄積することができる。したがって、ロギング対象のデータを多数にしたときに機器の制御に及ぶ影響を軽減し、多数のデータをロギングすることができる。 According to the present disclosure, in the end processing executed by the first processor that executes the program for controlling the device each time the execution processing of the program is completed, the data is read from the first storage means and output, and the second The processor calculates the data difference from the data stored in two of the plurality of buffers. Since the data difference is calculated by the second processor, it is not necessary for the first processor to calculate this difference. Further, the second storage means accumulates and stores the difference of the data. Therefore, the second storage means can store more information about the data than when the data is stored as it is. Therefore, when the number of data to be logged is increased, the influence on the control of the device can be reduced and a large number of data can be logged.

実施の形態に係る制御システムの構成を示す図The figure which shows the structure of the control system which concerns on embodiment 実施の形態に係る制御装置の構成を示す図The figure which shows the structure of the control device which concerns on embodiment 実施の形態に係るデータメモリの構成を示す図The figure which shows the structure of the data memory which concerns on embodiment 実施の形態に係るデータバッファへのアクセスについて説明するための第1の図The first figure for demonstrating the access to the data buffer which concerns on embodiment. 実施の形態に係るデータバッファへのアクセスについて説明するための第2の図FIG. 2 for explaining access to the data buffer according to the embodiment. 実施の形態に係るデータのロギングについて説明するための第1の図The first figure for demonstrating the logging of the data which concerns on embodiment. 実施の形態に係るデータのロギングについて説明するための第2の図The second figure for demonstrating the logging of the data which concerns on embodiment. 実施の形態に係る制御処理を示すフローチャートFlow chart showing the control process according to the embodiment 実施の形態に係るトレース処理を示すフローチャートFlowchart showing trace processing according to the embodiment 実施の形態に係るデータの伝送について説明するための図The figure for demonstrating the transmission of data which concerns on embodiment 実施の形態に係る履歴出力処理を示すフローチャートFlowchart showing history output processing according to the embodiment 実施の形態に係るスキャンタイムと比較例に係るスキャンタイムとを示す図The figure which shows the scan time which concerns on embodiment and the scan time which concerns on a comparative example. 変形例に係る制御装置の構成を示す第1の図The first figure which shows the structure of the control device which concerns on a modification. 変形例に係る制御装置の構成を示す第2の図The second figure which shows the structure of the control device which concerns on the modification

以下、本開示の実施の形態に係る制御装置10について、図面を参照しつつ詳細に説明する。 Hereinafter, the control device 10 according to the embodiment of the present disclosure will be described in detail with reference to the drawings.

実施の形態
図1には、本実施の形態に係る制御装置10により形成される制御システム100の構成が示されている。制御システム100は、製造ラインを稼働させるために工場に構築されるシステムである。制御システム100は、産業用ネットワーク50を介して機器61,62を制御する制御装置10と、製造ラインに設置された機器61,62と、を有する。なお、図1には、2つの機器61,62が代表的に示されているが、制御装置10とともに制御システム100を構成する機器の数は、1つであってもよいし、2つより多くてもよい。
Embodiment FIG. 1 shows the configuration of a control system 100 formed by the control device 10 according to the present embodiment. The control system 100 is a system built in a factory to operate a production line. The control system 100 includes a control device 10 that controls the devices 61 and 62 via the industrial network 50, and devices 61 and 62 installed on the production line. Although two devices 61 and 62 are typically shown in FIG. 1, the number of devices constituting the control system 100 together with the control device 10 may be one, or more than two. There may be many.

機器61,62は、例えば、製造ラインに設置されるセンサ、アクチュエータ、ロボット、その他のFA機器である。機器61,62は、制御装置10からの指示に従って動作する。例えば、センサである機器61は、制御装置10から指定された周期で、センシング結果を制御装置10に通知する。また、アクチュエータである機器62は、制御装置10から指定されたタイミング及び速度でワークを移動させる。 The devices 61 and 62 are, for example, sensors, actuators, robots, and other FA devices installed on the production line. The devices 61 and 62 operate according to the instruction from the control device 10. For example, the device 61, which is a sensor, notifies the control device 10 of the sensing result at a cycle specified by the control device 10. Further, the device 62, which is an actuator, moves the work at the timing and speed specified by the control device 10.

制御装置10は、工場内の機器61,62を統括的に制御することで連動させて、一連の製造ラインを実現させるPLC(Programmable Logic Controller)である。制御装置10は、ユーザにより提供されたプログラムを受け付けて、当該プログラムにより規定される制御処理を実行することで機器61,62を制御する。 The control device 10 is a PLC (Programmable Logic Controller) that realizes a series of production lines by interlocking the devices 61 and 62 in the factory by controlling them in an integrated manner. The control device 10 receives the program provided by the user and controls the devices 61 and 62 by executing the control process specified by the program.

制御装置10は、プログラムを繰り返し実行するCPU(Central Processing Unit)ユニット20と、プログラムを実行するために利用されるデータの履歴を記憶するトレースユニット30と、機器61,62と通信するI/O(Input/Output)ユニット40と、を有する。CPUユニット20、トレースユニット30及びI/Oユニット40は、システムバス101を介して互いに信号を伝送する。システムバス101は、制御装置10において、第1ユニットとしてのCPUユニット20と第2ユニットとしてのトレースユニット30とが互いに信号を伝送するためのバスの一例に相当する。 The control device 10 communicates with the CPU (Central Processing Unit) unit 20 that repeatedly executes the program, the trace unit 30 that stores the history of data used for executing the program, and the devices 61 and 62. It has a (Input / Output) unit 40 and. The CPU unit 20, the trace unit 30, and the I / O unit 40 transmit signals to each other via the system bus 101. The system bus 101 corresponds to an example of a bus for the CPU unit 20 as the first unit and the trace unit 30 as the second unit to transmit signals to each other in the control device 10.

図2には、CPUユニット20及びトレースユニット30の構成が示されている。CPUユニット20は、システムバス101を有する不図示のベースユニットに脱着可能なモジュールである。制御装置10の用途に応じて必要な性能を有するCPUユニット20が、ユーザによってベースユニットに取り付けられることで制御装置10が構成される。CPUユニット20は、ユーザプログラム221を実行するためのデータを記憶するデータメモリ21と、機器61,62を制御するためのユーザプログラム221を記憶するプログラムメモリ22と、ユーザプログラム221を実行する処理部23と、を有する。 FIG. 2 shows the configurations of the CPU unit 20 and the trace unit 30. The CPU unit 20 is a module that can be attached to and detached from a base unit (not shown) having a system bus 101. The control device 10 is configured by attaching the CPU unit 20 having the required performance according to the application of the control device 10 to the base unit by the user. The CPU unit 20 has a data memory 21 for storing data for executing the user program 221, a program memory 22 for storing the user program 221 for controlling the devices 61 and 62, and a processing unit for executing the user program 221. 23 and.

データメモリ21は、RAM(Random Access Memory)及びEEPROM(Electrically Erasable Programmable Read-Only Memory)に代表される記憶装置を含む。データメモリ21は、図3に示されるように、一又は複数の領域211を有する。領域211はそれぞれ、ユーザによって履歴を残すことが指定されたデータ212が格納される記憶領域である。領域211は、例えば、「D10」というアドレスにより示される1ワードの記憶領域であって、データ212は、この記憶領域に格納された「50」という値を示す。データ212は、機器61によるセンシング結果を示す値であってもよいし、機器62に対する動作指令を示す値であってもよい。データ212は、デバイスデータとも呼称される。 The data memory 21 includes a storage device typified by a RAM (Random Access Memory) and an EEPROM (Electrically Erasable Programmable Read-Only Memory). The data memory 21 has one or more areas 211 as shown in FIG. Each of the areas 211 is a storage area in which data 212 designated to be left as a history by the user is stored. The area 211 is, for example, a one-word storage area indicated by the address "D10", and the data 212 indicates the value "50" stored in this storage area. The data 212 may be a value indicating a sensing result by the device 61, or may be a value indicating an operation command for the device 62. The data 212 is also referred to as device data.

制御装置10が機器61,62とのサイクリック通信を行う場合には、データメモリ21の特定の領域に格納されるデータが、I/Oユニット40を介して機器61,62のデータと同期される。このようなサイクリック通信により領域211のデータ212が同期される場合には、処理部23は、データ212を読み出すことにより機器61から送信されたデータを取得し、データ212を書き込むことにより機器62に対して動作内容を指示する。 When the control device 10 performs cyclic communication with the devices 61 and 62, the data stored in the specific area of the data memory 21 is synchronized with the data of the devices 61 and 62 via the I / O unit 40. NS. When the data 212 in the area 211 is synchronized by such cyclic communication, the processing unit 23 acquires the data transmitted from the device 61 by reading the data 212, and writes the data 212 to the device 62. Instruct the operation content to.

また、データ212は、制御装置10の外部で扱われることなく制御処理において利用される値であってもよい。制御処理において利用される値としては、例えば、制御処理を分岐させるためのフラグ値、及び、制御処理の実行に際して発生したエラーを示すエラーコードがある。以下では、1つのデータ212が変化する場合において、データ212の履歴が記録される例を中心に説明する。データメモリ21は、制御装置10において、プログラムを実行するためのデータを記憶する第1記憶手段の一例に相当する。 Further, the data 212 may be a value used in the control process without being handled outside the control device 10. The values used in the control process include, for example, a flag value for branching the control process and an error code indicating an error generated when the control process is executed. In the following, an example in which the history of the data 212 is recorded when one data 212 changes will be mainly described. The data memory 21 corresponds to an example of a first storage means for storing data for executing a program in the control device 10.

図2に戻り、プログラムメモリ22は、RAM及びEEPROMに代表される記憶装置を含む。プログラムメモリ22には、ユーザから提供されたユーザプログラム221が格納される。ユーザプログラム221は、例えば、制御処理の内容がラダー言語で記述されたラダープログラムから、ユーザの端末においてコンパイルされた実行形式のオブジェクトプログラムである。 Returning to FIG. 2, the program memory 22 includes a storage device typified by RAM and EEPROM. The user program 221 provided by the user is stored in the program memory 22. The user program 221 is, for example, an executable object program compiled on the user's terminal from a ladder program in which the content of the control process is described in the ladder language.

処理部23は、ASIC(Application Specific Integrated Circuit)を含む。処理部23は、ユーザプログラム221を実行する制御プロセッサ231と、制御プロセッサ231がデータ212を一時的に退避させるための外部ターゲットメモリ232と、を有する。 The processing unit 23 includes an ASIC (Application Specific Integrated Circuit). The processing unit 23 has a control processor 231 that executes the user program 221 and an external target memory 232 for the control processor 231 to temporarily save the data 212.

制御プロセッサ231は、制御装置10においてユーザプログラム221を実行するCPUに相当する。制御プロセッサ231は、ユーザプログラム221を繰り返し実行する。また、制御プロセッサ231は、ユーザプログラム221を実行する毎に、データメモリ21の各領域211に記憶されているデータ212をデータメモリ21から読み出して外部ターゲットメモリ232に書き込むことにより出力する。より詳細には、制御プロセッサ231は、ユーザプログラム221にて定義されている制御を1回実行完了すると、データ212の出力を実行する。そして、制御プロセッサ231は、データ212の出力が完了したら、ユーザプログラム221の次の実行を開始する。制御プロセッサ231は、制御装置10において、プログラムを実行し、プログラムを実行する毎に第1記憶手段からデータを読み出して出力する第1プロセッサの一例に相当する。 The control processor 231 corresponds to a CPU that executes the user program 221 in the control device 10. The control processor 231 repeatedly executes the user program 221. Further, each time the user program 221 is executed, the control processor 231 reads the data 212 stored in each area 211 of the data memory 21 from the data memory 21 and writes it to the external target memory 232 to output the data 212. More specifically, the control processor 231 executes the output of the data 212 when the control defined in the user program 221 is executed once. Then, when the output of the data 212 is completed, the control processor 231 starts the next execution of the user program 221. The control processor 231 corresponds to an example of a first processor that executes a program in the control device 10 and reads data from the first storage means and outputs the data each time the program is executed.

外部ターゲットメモリ232は、ASICである処理部23のレジスタに相当し、外部ターゲットメモリ232には、CPUユニット20の外部をターゲットとして出力される情報が格納される。外部ターゲットメモリ232に記憶されたデータ212は、システムバス101を介してトレースユニット30によって読み出される。外部ターゲットメモリ232は、制御装置10において、第1プロセッサにより出力されたデータを記憶する第3記憶手段の第1の例に相当する。 The external target memory 232 corresponds to a register of the processing unit 23 which is an ASIC, and the external target memory 232 stores information output targeting the outside of the CPU unit 20. The data 212 stored in the external target memory 232 is read by the trace unit 30 via the system bus 101. The external target memory 232 corresponds to the first example of the third storage means for storing the data output by the first processor in the control device 10.

トレースユニット30は、ベースユニットに脱着可能なモジュールであって、CPUユニット20から取得したデータ212をトレースする。ここで、トレースユニット30によるデータ212のトレースは、データ212のログを蓄積することを意味する。ロギングに関するユーザの要望に応じて必要な性能を有するトレースユニット30がベースユニットに取り付けられることで、制御装置10が構成される。トレースユニット30によって蓄積されたログは、将来においてユーザがデータ212の推移を追跡して分析するために利用される。トレースユニット30は、データ212のロギングのための処理を実行する処理部31と、データ212の履歴を示す情報が格納される大容量メモリ32と、を有する。 The trace unit 30 is a module that can be attached to and detached from the base unit, and traces data 212 acquired from the CPU unit 20. Here, tracing the data 212 by the trace unit 30 means accumulating the log of the data 212. The control device 10 is configured by attaching the trace unit 30 having the required performance according to the user's request regarding logging to the base unit. The log accumulated by the trace unit 30 will be used by the user in the future to track and analyze the transition of the data 212. The trace unit 30 has a processing unit 31 that executes a process for logging the data 212, and a large-capacity memory 32 that stores information indicating the history of the data 212.

処理部31は、一又は複数のASICを含む。処理部31は、CPUユニット20から読み出されたデータ212が一時的に格納される内部ターゲットメモリ310と、内部ターゲットメモリ310に格納されたデータ212を大容量メモリ32のデータバッファ331,332,333のいずれかに書き込む第1トレースプロセッサ311と、データバッファ331〜333のうちの2つのバッファに格納されたデータ212を用いてデータ212の差分を算出する第2トレースプロセッサ312と、を有する。以下では、データバッファ331〜333を総称してデータバッファ33と表記する。処理部31は、制御装置10において、第2プロセッサとしての第2トレースプロセッサ312を有する処理手段の一例に相当する。 The processing unit 31 includes one or more ASICs. The processing unit 31 temporarily stores the data 212 read from the CPU unit 20 and stores the data 212 stored in the internal target memory 310 in the data buffers 331 and 332 of the large-capacity memory 32. It has a first trace processor 311 that writes to any of the 333s, and a second trace processor 312 that calculates the difference between the data 212 using the data 212 stored in two of the data buffers 331 to 333. Hereinafter, the data buffers 331 to 333 are collectively referred to as the data buffer 33. The processing unit 31 corresponds to an example of processing means having a second trace processor 312 as a second processor in the control device 10.

内部ターゲットメモリ310は、第1トレースプロセッサ311とともにASICを構成し、当該ASICのレジスタに相当する。内部ターゲットメモリ310には、トレースユニット30の内部をターゲットとして出力される情報が格納される。詳細には、第1トレースプロセッサ311によってCPUユニット20の外部ターゲットメモリ232から読み出されたデータ212が、内部ターゲットメモリ310に一時的に格納されて、第1トレースプロセッサ311によって利用される。内部ターゲットメモリ310は、制御装置10において、第1プロセッサにより出力されたデータを記憶する第3記憶手段の第2の例に相当する。 The internal target memory 310 constitutes an ASIC together with the first trace processor 311 and corresponds to a register of the ASIC. The internal target memory 310 stores information output with the inside of the trace unit 30 as a target. Specifically, the data 212 read from the external target memory 232 of the CPU unit 20 by the first trace processor 311 is temporarily stored in the internal target memory 310 and used by the first trace processor 311. The internal target memory 310 corresponds to the second example of the third storage means for storing the data output by the first processor in the control device 10.

第1トレースプロセッサ311は、CPUユニット20の制御プロセッサ231によってデータ212が出力される毎に当該データ212を取得して、取得した全てのデータ212をデータバッファ33のいずれか1つに書き込む。詳細には、第1トレースプロセッサ311は、データ212を直前に書き込んだデータバッファ33とは異なる別のデータバッファ33にデータ212を書き込む。より詳細には、第1トレースプロセッサ311は、データバッファ331,332,333にこの順で循環させてデータを書き込む。すなわち、第1トレースプロセッサ311は、n回目に取得した全てのデータ212をデータバッファ331に書き込み、n+1回目に取得した全てのデータ212をデータバッファ332に書込み、n+2回目に取得した全てのデータ212をデータバッファ333に書き込む。データバッファ333の次には、第1トレースプロセッサ311は、データバッファ331に戻って取得した全てのデータ212を書き込む。第1トレースプロセッサ311は、データ212を取得してデータバッファ33に書き込む処理を、上述の制御プロセッサ231におけるユーザプログラム221の実行中に開始することができる。 The first trace processor 311 acquires the data 212 each time the data 212 is output by the control processor 231 of the CPU unit 20, and writes all the acquired data 212 to any one of the data buffers 33. Specifically, the first trace processor 311 writes the data 212 to another data buffer 33 different from the data buffer 33 to which the data 212 was written immediately before. More specifically, the first trace processor 311 writes data to the data buffers 331, 332, 333 in this order. That is, the first trace processor 311 writes all the data 212 acquired at the nth time to the data buffer 331, writes all the data 212 acquired at the n + 1th time to the data buffer 332, and writes all the data 212 acquired at the n + 2nd time. Is written to the data buffer 333. Next to the data buffer 333, the first trace processor 311 returns to the data buffer 331 and writes all the acquired data 212. The first trace processor 311 can start the process of acquiring the data 212 and writing it to the data buffer 33 during the execution of the user program 221 in the control processor 231 described above.

図2には、第1トレースプロセッサ311がデータバッファ331にデータ212を書き込むことが破線の矢印で示されている。そして、第1トレースプロセッサ311は、データバッファ331に書き込んだデータ212の取得の次に取得したデータ212を、図4に示されるように、データバッファ332に書き込む。さらに、第1トレースプロセッサ311は、データバッファ332に書き込んだデータ212の取得の次に取得したデータ212を、図5に示されるように、データバッファ333に書き込む。そして、第1トレースプロセッサ311は、データバッファ333に書き込んだデータ212の取得の次に取得したデータ212を図2に示されるように、データバッファ331に書き込む。以降、第1トレースプロセッサ311は、図2,4,5に示されるデータ212の書き込みを繰り返す。 In FIG. 2, the dashed arrow indicates that the first trace processor 311 writes the data 212 to the data buffer 331. Then, the first trace processor 311 writes the acquired data 212 after the acquisition of the data 212 written in the data buffer 331 to the data buffer 332 as shown in FIG. Further, the first trace processor 311 writes the acquired data 212 after the acquisition of the data 212 written in the data buffer 332 to the data buffer 333 as shown in FIG. Then, the first trace processor 311 writes the acquired data 212 after the acquisition of the data 212 written in the data buffer 333 to the data buffer 331 as shown in FIG. After that, the first trace processor 311 repeats the writing of the data 212 shown in FIGS.

なお、第1トレースプロセッサ311が、最新の3回分の制御プロセッサ231から出力されたデータ212をデータバッファ33それぞれに格納していれば、データ212がデータバッファ33に書き込まれる順番を変更してもよい。第1トレースプロセッサ311は、制御装置10において、第1プロセッサによりデータが出力される毎に、第3記憶手段からデータを読み出して、複数のバッファに予め定められた順に格納する第3プロセッサの一例に相当する。 If the first trace processor 311 stores the data 212 output from the latest three control processors 231 in each of the data buffers 33, even if the order in which the data 212 is written to the data buffer 33 is changed. good. The first trace processor 311 is an example of a third processor that reads data from the third storage means and stores the data in a plurality of buffers in a predetermined order each time the data is output by the first processor in the control device 10. Corresponds to.

第2トレースプロセッサ312は、第1トレースプロセッサ311として機能するASICによって発揮される他の機能として実現されてもよいし、第1トレースプロセッサ311とは異なるハードウェアによって実現されてもよい。第2トレースプロセッサ312は、2つのデータバッファ33に格納されているデータ212からデータ212の差分を算出して、算出した差分を大容量メモリ32の差分記憶部34に格納する。詳細には、第2トレースプロセッサ312は、第1トレースプロセッサ311によってアクセスされるデータバッファ33とは異なる2つのデータバッファ33それぞれに格納されているデータ212を読み出して、これらのデータ212のうち新しいデータ212から古いデータ212を減じて得る差分を示す情報を、差分記憶部34に追加する。つまり、データ212の差分とは、新しいデータ212において古いデータ212に比べて変更がされている箇所を示す情報である。 The second trace processor 312 may be realized as another function exhibited by the ASIC functioning as the first trace processor 311 or may be realized by hardware different from the first trace processor 311. The second trace processor 312 calculates the difference of the data 212 from the data 212 stored in the two data buffers 33, and stores the calculated difference in the difference storage unit 34 of the large-capacity memory 32. Specifically, the second trace processor 312 reads out the data 212 stored in each of the two data buffers 33 different from the data buffer 33 accessed by the first trace processor 311 and is new to these data 212. Information indicating the difference obtained by subtracting the old data 212 from the data 212 is added to the difference storage unit 34. That is, the difference of the data 212 is information indicating a place where the new data 212 is changed as compared with the old data 212.

図2の例では、第2トレースプロセッサ312が、データバッファ332,333からデータを読み出すことが破線の矢印で示されている。第2トレースプロセッサ312は、この例においては、データバッファ333から読み出したデータ212から、データバッファ332から読み出したデータ212を減算し、減算結果を示す差分データを差分記憶部34に書き込む。次に、第2トレースプロセッサ312は、図4に示されるように、データバッファ331から読み出したデータ212から、データバッファ333から読み出したデータ212を減算し、減算結果を示す差分データを差分記憶部34に書き込む。次に、第2トレースプロセッサ312は、図5に示されるように、データバッファ332から読み出したデータ212から、データバッファ331から読み出したデータ212を減算し、減算結果を示す差分データを差分記憶部34に書き込む。その後、第2トレースプロセッサ312は、図2の例に示されるように、データバッファ332,333から得た減算結果を差分記憶部34に書き込む。以降、第2トレースプロセッサ312は、図2,4,5に示されるデータ212の読み出し及び差分の算出を繰り返す。 In the example of FIG. 2, the dashed arrow indicates that the second trace processor 312 reads data from the data buffers 332 and 333. In this example, the second trace processor 312 subtracts the data 212 read from the data buffer 332 from the data 212 read from the data buffer 333, and writes the difference data indicating the subtraction result to the difference storage unit 34. Next, as shown in FIG. 4, the second trace processor 312 subtracts the data 212 read from the data buffer 333 from the data 212 read from the data buffer 331, and stores the difference data indicating the subtraction result in the difference storage unit. Write in 34. Next, as shown in FIG. 5, the second trace processor 312 subtracts the data 212 read from the data buffer 331 from the data 212 read from the data buffer 332, and stores the difference data indicating the subtraction result in the difference storage unit. Write in 34. After that, the second trace processor 312 writes the subtraction result obtained from the data buffers 332 and 333 to the difference storage unit 34, as shown in the example of FIG. After that, the second trace processor 312 repeats the reading of the data 212 and the calculation of the difference shown in FIGS.

第2トレースプロセッサ312は、第1トレースプロセッサ311によってデータバッファ33に書き込まれている最中の、又は書き込まれるべき最新のデータ212に対して、その前回及び前々回にデータバッファ33に格納されたデータ212の差分を順次算出することとなる。第2トレースプロセッサ312は、制御装置10において、複数のバッファのうちの2つのバッファに格納されたデータからデータの差分を算出する第2プロセッサの一例に相当する。この第2プロセッサは、データが書き込まれているバッファとは異なる2つのバッファ、又は、データが次に書き込まれるバッファとは異なる2つのバッファに格納されたデータからデータの差分を算出する。なお、第2トレースプロセッサ312は、データ212の差分を算出する処理を、上述の制御プロセッサ231によるユーザプログラム221の実行中に開始することができる。 The second trace processor 312 refers to the latest data 212 that is being written to or should be written to the data buffer 33 by the first trace processor 311 and is stored in the data buffer 33 last time and two times before. The difference of 212 will be calculated sequentially. The second trace processor 312 corresponds to an example of a second processor that calculates a data difference from data stored in two buffers among a plurality of buffers in the control device 10. The second processor calculates the data difference from the data stored in two buffers different from the buffer in which the data is written or in two buffers different from the buffer in which the data is written next. The second trace processor 312 can start the process of calculating the difference of the data 212 during the execution of the user program 221 by the control processor 231 described above.

大容量メモリ32は、EEPROM及びフラッシュメモリに代表される不揮発性の記憶装置を含む。大容量メモリ32は、少なくともデータメモリ21の領域211より大きな記憶容量を有する。大容量メモリ32は、制御プロセッサ231から出力された最新の3回分の制御プロセッサ231から出力されたデータ212が格納されるデータバッファ33と、第2トレースプロセッサ312によって算出された差分を順次蓄積する差分記憶部34と、を有する。 The large-capacity memory 32 includes a non-volatile storage device represented by an EEPROM and a flash memory. The large-capacity memory 32 has at least a storage capacity larger than that of the area 211 of the data memory 21. The large-capacity memory 32 sequentially accumulates the data buffer 33 in which the data 212 output from the latest three times of control processor 231 output from the control processor 231 is stored, and the difference calculated by the second trace processor 312. It has a difference storage unit 34 and.

データバッファ33はそれぞれ、大容量メモリ32が有する記憶領域の一部に相当する。データバッファ33として利用される記憶領域は、予め定められてもよいし、ユーザによって指定されたロギング対象のデータ212の個数に応じて割り当てられてもよい。データバッファ33には、第1トレースプロセッサ311によって図2,4,5に示されるように循環的に最新のデータ212が格納されて、他の2つのデータバッファ33からは、第2トレースプロセッサ312によって前回及び前々回のデータ212が読み出される。データバッファ33は、制御装置10において、第1プロセッサによって出力されたデータが予め定められた順に格納される複数のバッファの一例に相当する。 Each of the data buffers 33 corresponds to a part of the storage area of the large-capacity memory 32. The storage area used as the data buffer 33 may be predetermined or may be allocated according to the number of data 212 to be logged to be specified by the user. The latest data 212 is cyclically stored in the data buffer 33 by the first trace processor 311 as shown in FIGS. 2, 4 and 5, and the second trace processor 312 is stored in the data buffer 33 from the other two data buffers 33. The data 212 of the previous time and the time before the previous time is read out. The data buffer 33 corresponds to an example of a plurality of buffers in which the data output by the first processor is stored in a predetermined order in the control device 10.

差分記憶部34は、大容量メモリ32が有する記憶領域の一部に相当する。差分記憶部34として利用される記憶領域は、予め定められてもよいし、ロギングすべき一又は複数のデータ212それぞれについて残すべき履歴の数に応じて割り当てられてもよい。差分記憶部34には、第2トレースプロセッサ312によって差分データが書き込まれて蓄積される。ただし、差分記憶部34は、いわゆるリングバッファと同様に、その容量の上限まで差分データを記憶した後は、最も古い差分データを消去して最新の差分データを新たに記憶する。差分記憶部34は、制御装置10において、第2プロセッサによって算出された差分を蓄積して記憶する第2記憶手段の一例に相当する。 The difference storage unit 34 corresponds to a part of the storage area of the large-capacity memory 32. The storage area used as the difference storage unit 34 may be predetermined, or may be allocated according to the number of histories to be left for each of the one or a plurality of data 212 to be logged. Difference data is written and stored in the difference storage unit 34 by the second trace processor 312. However, like the so-called ring buffer, the difference storage unit 34 erases the oldest difference data and newly stores the latest difference data after storing the difference data up to the upper limit of the capacity. The difference storage unit 34 corresponds to an example of a second storage means for accumulating and storing the difference calculated by the second processor in the control device 10.

続いて、データバッファ33及び差分記憶部34に格納される情報がデータ212の履歴に等しいことについて、図6,7を参照して説明する。図6には、ユーザプログラム221の実行処理71と、実行処理71が終了する度に実行されるエンド処理72と、を含むスキャン70が、制御プロセッサ231によって繰り返し実行されることが示されている。初回のエンド処理72においては、データ212として「データ[1]」が出力されて、このデータ212がデータバッファ331に格納される。なお、図6においては、データバッファ33を識別するためにデータバッファ33それぞれの符号に等しい「331」、「332」及び「333」というIDが示されている。また、「データ[n]」に付されている番号「n」は、n番目に出力されたことを示している。 Subsequently, it will be described with reference to FIGS. 6 and 7 that the information stored in the data buffer 33 and the difference storage unit 34 is equal to the history of the data 212. FIG. 6 shows that the control processor 231 repeatedly executes the scan 70 including the execution process 71 of the user program 221 and the end process 72 that is executed each time the execution process 71 ends. .. In the first end processing 72, “data [1]” is output as data 212, and this data 212 is stored in the data buffer 331. In FIG. 6, IDs "331", "332", and "333", which are equal to the codes of the data buffers 33, are shown in order to identify the data buffers 33. Further, the number "n" attached to the "data [n]" indicates that the data was output in the nth position.

スキャン70が繰り返される度に、データバッファ332に「データ[2]」が書き込まれ、データバッファ333に「データ[3]」が書き込まれる。そして、次のスキャン70では、データバッファ331に「データ[4]」が上書きされて、「データ[1]」が削除される。 Each time the scan 70 is repeated, "data [2]" is written to the data buffer 332, and "data [3]" is written to the data buffer 333. Then, in the next scan 70, the “data [4]” is overwritten in the data buffer 331, and the “data [1]” is deleted.

ただし、差分記憶部34には、「データ[1]」と「データ[2]」の差分である「差分<1>」、及び、「データ[2]」と「データ[3]」の差分である「差分<2>」が格納される。なお、「差分<n>」に付されている番号「n」は、差分記憶部34にn番目に格納されたことを示している。ここで、「データ[2]」と「差分<1>」から「データ[1]」が復元されるため、「データ[2]」及び「差分<1>」は、「データ[1]」に等しい情報といえる。詳細には、「データ[2]」から「差分<1>」を減じることで「データ[1]」が復元される。 However, the difference storage unit 34 contains the "difference <1>" which is the difference between the "data [1]" and the "data [2]" and the difference between the "data [2]" and the "data [3]". "Difference <2>" is stored. The number "n" attached to the "difference <n>" indicates that the number "n" is stored in the difference storage unit 34 at the nth position. Here, since "data [1]" is restored from "data [2]" and "difference <1>", "data [2]" and "difference <1>" are "data [1]". It can be said that the information is equal to. Specifically, the "data [1]" is restored by subtracting the "difference <1>" from the "data [2]".

さらに古いデータ212が復元されることについて、図7の数値例を用いて説明する。図7の例では、データバッファ33に、「データ[N]」としての2541という値と、「データ[N+1]」としての2545という値と、「データ[N+2]」としての2542という値が格納されている。また、差分記憶部34には、最新の差分データである「差分<N>」としての+4という値から、最も古い「差分<N−99>」としての−2まで、100個の差分データが格納されている。この例において、図6と同様にして、「データ[N]」から「差分<N−1>」を減じることで、データバッファ33には格納されていない「データ[N−1]」として2538が復元される。また、このようにして得た「データ[N−1]」から「差分<N−2>」を減じることで、「データ[N−2]」が復元される。以降、同様にして「データ[N−3]」から「データ[N−99]」までのデータ212が復元される。すなわち、図7に示されるデータバッファ33及び差分記憶部34が保持する情報は、最新の「データ[N+2]」から「データ[N−99]」までのデータ212の履歴に等しいといえる。 The restoration of the older data 212 will be described with reference to the numerical example of FIG. In the example of FIG. 7, the value of 2541 as "data [N]", the value of 2545 as "data [N + 1]", and the value of 2542 as "data [N + 2]" are stored in the data buffer 33. Has been done. Further, the difference storage unit 34 contains 100 difference data from the latest difference data "difference <N>" of +4 to the oldest "difference <N-99>" of -2. It is stored. In this example, in the same manner as in FIG. 6, by subtracting the “difference <N-1>” from the “data [N]”, 2538 as “data [N-1]” not stored in the data buffer 33. Is restored. Further, by subtracting the "difference <N-2>" from the "data [N-1]" obtained in this way, the "data [N-2]" is restored. After that, the data 212 from "data [N-3]" to "data [N-99]" is restored in the same manner. That is, it can be said that the information held by the data buffer 33 and the difference storage unit 34 shown in FIG. 7 is equal to the history of the data 212 from the latest "data [N + 2]" to "data [N-99]".

続いて、制御装置10によって実行される処理について、図8〜11を参照して説明する。図8には、CPUユニット20の制御プロセッサ231によって実行される制御処理の流れが示されている。制御処理は、ユーザの操作によって制御処理の開始指示が入力されることで開始する。 Subsequently, the processing executed by the control device 10 will be described with reference to FIGS. 8 to 11. FIG. 8 shows a flow of control processing executed by the control processor 231 of the CPU unit 20. The control process is started by inputting a start instruction of the control process by the operation of the user.

制御処理では、制御プロセッサ231は、ユーザプログラム221を実行する(ステップS11)。このステップS11は、図6に示された実行処理71に対応する。この実行処理により、制御装置10は、機器61,62を制御して、製造ラインを稼働させる。 In the control process, the control processor 231 executes the user program 221 (step S11). This step S11 corresponds to the execution process 71 shown in FIG. By this execution process, the control device 10 controls the devices 61 and 62 to operate the production line.

次に、制御プロセッサ231は、実行処理が終了すると、エンド処理を開始する(ステップS12)。エンド処理は、ユーザプログラム221の1回の実行につき制御プロセッサ231が実行すべき処理であって、例えば、後述するステップS13〜S16の他に、エラーの有無の確認を含む。 Next, when the execution process is completed, the control processor 231 starts the end process (step S12). The end process is a process to be executed by the control processor 231 for each execution of the user program 221. For example, in addition to steps S13 to S16 described later, confirmation of the presence or absence of an error is included.

エンド処理が開始すると、制御プロセッサ231は、第1トレースプロセッサ311及び第2トレースプロセッサ312が、後述するトレース処理を実行可能か否かを判定する(ステップS13)。具体的には、制御プロセッサ231は、第1トレースプロセッサ311及び第2トレースプロセッサ312がトレース処理を実行中か否かを確認し、又は、後述のトレース処理におけるステップS23とステップS25とで第1トレースプロセッサ311及び第2トレースプロセッサ312から通知される完了通知を受け取っているか否かを確認する。 When the end processing is started, the control processor 231 determines whether or not the first trace processor 311 and the second trace processor 312 can execute the trace processing described later (step S13). Specifically, the control processor 231 confirms whether or not the first trace processor 311 and the second trace processor 312 are executing the trace process, or the first step S23 and step S25 in the trace process described later are the first steps. It is confirmed whether or not the completion notification notified from the trace processor 311 and the second trace processor 312 has been received.

第1トレースプロセッサ311及び第2トレースプロセッサ312がトレース処理を実行可能でないと判定した場合(ステップS13;No)、制御プロセッサ231は、ステップS13の判定を繰り返して、第1トレースプロセッサ311及び第2トレースプロセッサ312が後述のトレース処理を実行可能となるまで待機する。そして、制御プロセッサ231は、第1トレースプロセッサ311及び第2トレースプロセッサ312がトレース処理を実行できると判定した場合(ステップS13;Yes)、制御プロセッサ231は、データメモリ21から予め指定された領域211のデータ212を読み出して外部ターゲットメモリ232に出力する(ステップS14)。 When the first trace processor 311 and the second trace processor 312 determine that the trace processing cannot be executed (step S13; No), the control processor 231 repeats the determination in step S13 to repeat the determination of the first trace processor 311 and the second trace processor 311. It waits until the trace processor 312 can execute the trace process described later. Then, when the control processor 231 determines that the first trace processor 311 and the second trace processor 312 can execute the trace process (step S13; Yes), the control processor 231 determines the area 211 designated in advance from the data memory 21. Data 212 is read out and output to the external target memory 232 (step S14).

ステップS11の実行処理においては、データ212が変化してしまうため、データ212が一時的に固定されて変化しないエンド処理において、データ212がロギングのために読み出される。ステップS14は、制御装置10によって実行されるロギング方法において、プログラムを実行する第1プロセッサが、プログラムを実行するためのデータを、プログラムを実行する毎に第1記憶手段から読み出して出力する出力ステップの一例に相当する。 Since the data 212 changes in the execution process of step S11, the data 212 is read out for logging in the end process in which the data 212 is temporarily fixed and does not change. In step S14, in the logging method executed by the control device 10, the first processor that executes the program reads data for executing the program from the first storage means and outputs the data each time the program is executed. Corresponds to one example.

次に、制御プロセッサ231は、外部ターゲットメモリ232へのデータ212の書き込みが完了したか否かを判定する(ステップS15)。書き込みが完了していないと判定した場合(ステップS15;No)、制御プロセッサ231は、ステップS15の判定を繰り返して、書き込みが完了するまで待機する。 Next, the control processor 231 determines whether or not the writing of the data 212 to the external target memory 232 is completed (step S15). When it is determined that the writing is not completed (step S15; No), the control processor 231 repeats the determination in step S15 and waits until the writing is completed.

一方、書き込みが完了したと判定した場合(ステップS15;Yes)、制御プロセッサ231は、エンド処理の終了をトレースユニット30の処理部31に通知して、エンド処理を終了する(ステップS16)。エンド処理の終了の通知は、トレースユニット30によるロギングのための処理のトリガーとなる。これにより、制御プロセッサ231からデータ212が出力される毎に、トレースユニット30がロギングのための処理を実行する。その後、制御プロセッサ231は、ステップS11以降の処理を繰り返す。 On the other hand, when it is determined that the writing is completed (step S15; Yes), the control processor 231 notifies the processing unit 31 of the trace unit 30 of the end of the end processing, and ends the end processing (step S16). The notification of the end of the end process triggers the process for logging by the trace unit 30. As a result, every time the data 212 is output from the control processor 231 the trace unit 30 executes a processing for logging. After that, the control processor 231 repeats the processes after step S11.

図9には、トレースユニット30によって実行されるトレース処理の流れが示されている。トレース処理は、トレースユニット30の電源が投入されることで開始する。 FIG. 9 shows the flow of the trace process executed by the trace unit 30. The trace process starts when the power of the trace unit 30 is turned on.

トレース処理では、第1トレースプロセッサ311が、CPUユニット20からの通知があるか否かを判定する(ステップS21)。この通知は、エンド処理が終了した旨の通知であって、図8中のステップS16に対応する。通知がないと判定した場合(ステップS21;No)、第1トレースプロセッサ311は、ステップS21の判定を繰り返して、通知を受けるまで待機する。 In the trace process, the first trace processor 311 determines whether or not there is a notification from the CPU unit 20 (step S21). This notification is a notification that the end processing has been completed, and corresponds to step S16 in FIG. When it is determined that there is no notification (step S21; No), the first trace processor 311 repeats the determination in step S21 and waits until the notification is received.

一方、通知があると判定した場合(ステップS21;Yes)、第1トレースプロセッサ311は、外部ターゲットメモリ232からデータ212を読み出して内部ターゲットメモリ310に書き込むことによりデータ212を取得する(ステップS22)。そして、第1トレースプロセッサ311は、ステップS22で取得したデータを複数のデータバッファ33のいずれかに書き込み、書き込みが完了したことを制御プロセッサ231へ通知する(ステップS23)。具体的には、第1トレースプロセッサ311は、図2,4,5に示されたように、循環する順番でデータバッファ33にデータ212を格納する。ここで、第1トレースプロセッサ311は、データバッファ33にデータ212の格納する度に制御プロセッサ231へ書き込みの完了を通知する。 On the other hand, when it is determined that there is a notification (step S21; Yes), the first trace processor 311 acquires the data 212 by reading the data 212 from the external target memory 232 and writing it to the internal target memory 310 (step S22). .. Then, the first trace processor 311 writes the data acquired in step S22 to any of the plurality of data buffers 33, and notifies the control processor 231 that the writing is completed (step S23). Specifically, the first trace processor 311 stores the data 212 in the data buffer 33 in the order of circulation, as shown in FIGS. Here, the first trace processor 311 notifies the control processor 231 of the completion of writing each time the data 212 is stored in the data buffer 33.

次に、第2トレースプロセッサ312は、前回と前々回に書き込まれたデータ212をデータバッファ33から読み出して差分を算出する(ステップS24)。そして、第2トレースプロセッサ312は、算出した差分を差分記憶部34に書き込み、書き込みが完了したことを第1トレースプロセッサ311へ通知する(ステップS25)。これにより、差分記憶部34には、前々回のデータ212を復元するための差分データが追加される。その後、トレースユニット30は、ステップS21以降の処理を繰り返す。ステップS24は、第2プロセッサが、第1プロセッサによって出力されたデータが予め定められた順に格納される複数のバッファのうちの2つのバッファに格納されたデータからデータの差分を算出する算出ステップの一例に相当し、ステップS25は、差分を第2記憶手段に蓄積する蓄積ステップの一例に相当する。 Next, the second trace processor 312 reads the data 212 written in the previous time and the time before the previous time from the data buffer 33 and calculates the difference (step S24). Then, the second trace processor 312 writes the calculated difference to the difference storage unit 34, and notifies the first trace processor 311 that the writing is completed (step S25). As a result, the difference data for restoring the data 212 two times before is added to the difference storage unit 34. After that, the trace unit 30 repeats the processes after step S21. Step S24 is a calculation step in which the second processor calculates a data difference from the data stored in two of the plurality of buffers in which the data output by the first processor is stored in a predetermined order. Corresponding to one example, step S25 corresponds to an example of the accumulation step of accumulating the difference in the second storage means.

図10には、図8の制御処理及び図9のトレース処理を実行する制御装置10における情報の伝送について示されている。図10に示されるように、制御プロセッサ231は、実行処理(ステップS71)の後のエンド処理において(ステップS72)、データメモリ21からデータ212を読み出して出力する(ステップS81)。これにより、外部ターゲットメモリ232には、データ212が入力されて格納される(ステップS82)。外部ターゲットメモリ232へのデータ212の書き込みが完了すると、外部ターゲットメモリ232から制御プロセッサ231に、書き込みが完了した旨が通知される(ステップS83)。次に、制御プロセッサ231は、第1トレースプロセッサ311にエンド通知をする(ステップS84)。エンド通知は、エンド処理が終了した旨の通知である。 FIG. 10 shows the transmission of information in the control device 10 that executes the control process of FIG. 8 and the trace process of FIG. As shown in FIG. 10, the control processor 231 reads data 212 from the data memory 21 and outputs the data 212 in the end process (step S72) after the execution process (step S71) (step S81). As a result, the data 212 is input and stored in the external target memory 232 (step S82). When the writing of the data 212 to the external target memory 232 is completed, the external target memory 232 notifies the control processor 231 that the writing is completed (step S83). Next, the control processor 231 notifies the first trace processor 311 of the end (step S84). The end notification is a notification that the end processing has been completed.

エンド通知を受けて、第1トレースプロセッサ311は、転送処理を実行する(ステップS85)。転送処理において、第1トレースプロセッサ311は、外部ターゲットメモリ232からデータ212を読み出す(ステップS86)。これにより外部ターゲットメモリ232は、格納しているデータ212を出力する(ステップS87)。データ212の読み出しが完了すると(ステップS88)、第1トレースプロセッサ311は、ステップS88で読み出しが完了したデータ212を、大容量メモリ32のデータバッファ33に書き込む(ステップS89)。これにより、大容量メモリ32には、データ212が入力される(ステップS90)。データの書き込みが完了すると(ステップS91)、第1トレースプロセッサ311は、完了通知を制御プロセッサ231へ送って(ステップS92)、転送処理を終了する。なお、ステップS92の完了通知は、図9に示されるステップS23の通知に対応する。 Upon receiving the end notification, the first trace processor 311 executes the transfer process (step S85). In the transfer process, the first trace processor 311 reads the data 212 from the external target memory 232 (step S86). As a result, the external target memory 232 outputs the stored data 212 (step S87). When the reading of the data 212 is completed (step S88), the first trace processor 311 writes the data 212 whose reading is completed in step S88 to the data buffer 33 of the large-capacity memory 32 (step S89). As a result, the data 212 is input to the large-capacity memory 32 (step S90). When the writing of data is completed (step S91), the first trace processor 311 sends a completion notification to the control processor 231 (step S92), and ends the transfer process. The completion notification of step S92 corresponds to the notification of step S23 shown in FIG.

第2トレースプロセッサ312は、ステップS84のエンド通知を、第1トレースプロセッサ311を介して受けて(ステップS93)、差分の算出処理を実行する(ステップS94)。算出処理では、第2トレースプロセッサ312が、2つのデータバッファ33からデータ212を読み出す(ステップS95)。これにより、データバッファ33から過去の2つのデータ212が出力される(ステップS96)。2つのデータ212の読み出しが完了すると(ステップS97)、第2トレースプロセッサ312は、ステップS97で読み出しが完了した2つのデータ212の差分を大容量メモリ32の差分記憶部34に書き込む(ステップS98)。これにより、差分記憶部34には、差分データが入力されて追加される(ステップS99)。差分の書き込みが完了すると(ステップS100)、第2トレースプロセッサ312は、完了通知を第1トレースプロセッサ311へ送って(ステップS101)、算出処理を終了する。なお、第1トレースプロセッサ311は、第2トレースプロセッサ312の算出処理における完了通知を受け取ると、完了通知を制御プロセッサ231へ送信する(ステップS102)。ステップS102の完了通知は、図9に示されるステップS25の通知に対応する。 The second trace processor 312 receives the end notification of step S84 via the first trace processor 311 (step S93), and executes the difference calculation process (step S94). In the calculation process, the second trace processor 312 reads the data 212 from the two data buffers 33 (step S95). As a result, the past two data 212 are output from the data buffer 33 (step S96). When the reading of the two data 212 is completed (step S97), the second trace processor 312 writes the difference between the two data 212 whose reading is completed in step S97 to the difference storage unit 34 of the large-capacity memory 32 (step S98). .. As a result, the difference data is input to and added to the difference storage unit 34 (step S99). When the writing of the difference is completed (step S100), the second trace processor 312 sends a completion notification to the first trace processor 311 (step S101), and ends the calculation process. When the first trace processor 311 receives the completion notification in the calculation process of the second trace processor 312, the first trace processor 311 transmits the completion notification to the control processor 231 (step S102). The completion notification of step S102 corresponds to the notification of step S25 shown in FIG.

なお、図10では、第1トレースプロセッサ311による転送処理と、第2トレースプロセッサ312による算出処理と、が並列に実行されている。このため、第1トレースプロセッサ311によるデータ212の入出力と、第2トレースプロセッサ312による情報の入出力と、の順序が、図9に示されたトレース処理とは異なっている。第1トレースプロセッサ311と第2トレースプロセッサ312とは、並列処理が可能であるため、これらのプロセッサによって実行される処理の手順は、さらに任意に変更してもよい。 In FIG. 10, the transfer process by the first trace processor 311 and the calculation process by the second trace processor 312 are executed in parallel. Therefore, the order of the input / output of the data 212 by the first trace processor 311 and the input / output of the information by the second trace processor 312 is different from the trace processing shown in FIG. Since the first trace processor 311 and the second trace processor 312 can perform parallel processing, the processing procedure executed by these processors may be further arbitrarily changed.

例えば、制御プロセッサ231からの処理部31への通知は、データ212の出力が完了したことを示す通知であれば、エンド処理の完了の通知とは異なる通知であってもよい。制御プロセッサ231は、エンド処理が完了する前に、データ212の出力が完了した時点で、出力完了の旨を通知してもよい。また、処理部31は、制御プロセッサ231からの通知に基づいて、第1トレースプロセッサ311によるデータ212の格納と、第2トレースプロセッサによる差分データの算出と、の双方を並列に実行してもよいし、これら格納及び算出のうちの一方を実行してから他方を実行してもよい。 For example, the notification from the control processor 231 to the processing unit 31 may be a notification different from the notification of the completion of the end processing, as long as it is a notification indicating that the output of the data 212 is completed. The control processor 231 may notify that the output is completed when the output of the data 212 is completed before the end processing is completed. Further, the processing unit 31 may execute both the storage of the data 212 by the first trace processor 311 and the calculation of the difference data by the second trace processor in parallel based on the notification from the control processor 231. Then, one of these storages and calculations may be executed and then the other may be executed.

図11には、トレースユニット30が、ロギングされたデータ212の履歴を出力する履歴出力処理の一例が示されている。この履歴出力処理は、例えば、CPUユニット20からの要求に応答して第1トレースプロセッサ311によって実行される。 FIG. 11 shows an example of the history output process in which the trace unit 30 outputs the history of the logged data 212. This history output process is executed by the first trace processor 311 in response to a request from the CPU unit 20, for example.

履歴出力処理では、第1トレースプロセッサ311が、データバッファ33から最新のデータ212を読み出して出力し(ステップS31)、データバッファ33から2番目に新しいデータ212を読み出して出力する(ステップS32)。これにより、図7の例では、「データ[N+2]」及び「データ[N+1]」が出力される。 In the history output process, the first trace processor 311 reads and outputs the latest data 212 from the data buffer 33 (step S31), and reads and outputs the second newest data 212 from the data buffer 33 (step S32). As a result, in the example of FIG. 7, "data [N + 2]" and "data [N + 1]" are output.

次に、第1トレースプロセッサ311は、変数Kに初期値として1を代入して(ステップS33)、前回出力したデータ212と、差分記憶部34から読み出したK番目に新しい差分と、から(K+2)番目に新しいデータ212を逆算して出力する(ステップS34)。履歴出力処理においてステップS34が初めて実行される場合には、ステップS32で出力したデータ212と、最新の差分と、から3番目に新しいデータ212が復元されて出力される。 Next, the first trace processor 311 substitutes 1 as the initial value for the variable K (step S33), and from the previously output data 212 and the Kth newest difference read from the difference storage unit 34 (K + 2). ) The third newest data 212 is calculated back and output (step S34). When step S34 is executed for the first time in the history output process, the data 212 output in step S32, the latest difference, and the third newest data 212 are restored and output.

次に、第1トレースプロセッサ311は、差分記憶部34からすべての差分を読み出したか否かを判定する(ステップS35)。すべての差分を読み出してはいないと判定した場合(ステップS35;No)、第1トレースプロセッサ311は、変数Kに1を加算して(ステップS36)、ステップS34以降の処理を繰り返す。これにより、履歴出力処理における2回目以降のステップS34では、前回のステップS34で出力したデータ212に基づいて、1つ前のデータ212が復元されて出力される。 Next, the first trace processor 311 determines whether or not all the differences have been read from the difference storage unit 34 (step S35). When it is determined that all the differences have not been read (step S35; No), the first trace processor 311 adds 1 to the variable K (step S36), and repeats the processes after step S34. As a result, in the second and subsequent steps S34 in the history output process, the previous data 212 is restored and output based on the data 212 output in the previous step S34.

ステップS35にて、すべての差分を読み出したと判定した場合(ステップS35;Yes)、第1トレースプロセッサ311は、履歴出力処理を終了する。 When it is determined in step S35 that all the differences have been read (step S35; Yes), the first trace processor 311 ends the history output process.

なお、履歴出力処理は、図11を用いて説明した例に限定されない。例えば、第2トレースプロセッサ312が履歴出力処理を実行してもよい。また、処理部31が、過去のデータ212を復元することなく、データバッファ33及び差分記憶部34に記憶されている情報をそのままデータ212の履歴として出力してもよい。また、履歴が残っているすべてのデータ212を出力することなく、外部から指定された一部のデータ212を出力してもよい。 The history output process is not limited to the example described with reference to FIG. For example, the second trace processor 312 may execute the history output process. Further, the processing unit 31 may output the information stored in the data buffer 33 and the difference storage unit 34 as it is as the history of the data 212 without restoring the past data 212. Further, some data 212 designated from the outside may be output without outputting all the data 212 whose history remains.

以上、説明したように、ユーザプログラム221を実行する制御プロセッサ231が、ユーザプログラム221を実行する毎にデータメモリ21からデータ212を読み出して出力し、第2トレースプロセッサ312が、2つのデータバッファ33に格納されたデータ212の差分を算出する。ロギング対象であるデータ212の差分が第2トレースプロセッサ312によって算出されるため、この差分の算出を制御プロセッサ231が実行する必要はない。また、差分記憶部34が、データ212の差分を蓄積して記憶する。このため、制御プロセッサ231は、データ212の出力を完了した後、ユーザプログラム221を実行することが可能となる。さらに、差分記憶部34は、データ212をそのまま記憶する場合よりも多くのデータ212に関する情報を蓄積することができる。したがって、ロギング対象のデータ212を多数にしたときに機器61,62の制御に及ぶ影響を軽減し、多数のデータ212をロギングすることができる。 As described above, the control processor 231 that executes the user program 221 reads the data 212 from the data memory 21 and outputs the data 212 each time the user program 221 is executed, and the second trace processor 312 reads the data 212 and outputs the data 212 to the two data buffers 33. The difference of the data 212 stored in is calculated. Since the difference of the data 212 to be logged is calculated by the second trace processor 312, it is not necessary for the control processor 231 to execute the calculation of this difference. Further, the difference storage unit 34 accumulates and stores the difference of the data 212. Therefore, the control processor 231 can execute the user program 221 after completing the output of the data 212. Further, the difference storage unit 34 can store more information about the data 212 than when the data 212 is stored as it is. Therefore, when the number of data 212 to be logged is increased, the influence on the control of the devices 61 and 62 can be reduced, and a large number of data 212 can be logged.

図12には、本実施の形態に係る制御プロセッサ231が制御処理を実行するスキャンタイムと、比較例に係るスキャンタイムと、が比較されている。スキャンタイムは、ユーザプログラム221を実行してから再度ユーザプログラム221を実行するまでの1スキャンにかかる時間である。 In FIG. 12, the scan time in which the control processor 231 according to the present embodiment executes the control process and the scan time according to the comparative example are compared. The scan time is the time required for one scan from the execution of the user program 221 to the execution of the user program 221 again.

図12に示される比較例では、ユーザプログラム221の一部に相当するユーザプログラムX,Y,Z,Wを実行するCPUユニットのプロセッサが、ユーザプログラムX,Y,Z,Wそれぞれを実行する度に、データ212を参照して前回の値からの変化を確認し、必要に応じてデータ212を退避している。このため、比較例に係るプロセッサが担う演算負荷は大きく、スキャンタイムの時間長80は、比較的長い。 In the comparative example shown in FIG. 12, each time the processor of the CPU unit that executes the user programs X, Y, Z, W corresponding to a part of the user program 221 executes each of the user programs X, Y, Z, W. In addition, the change from the previous value is confirmed by referring to the data 212, and the data 212 is saved as necessary. Therefore, the computing load of the processor according to the comparative example is large, and the scan time time length 80 is relatively long.

一方、本実施の形態に係る制御プロセッサ231は、ユーザプログラムX,Y,Z,Wを実行した後に、データの参照、比較、又は演算を実行することなく、エンド処理において単にデータ212を出力する。そして、第1トレースプロセッサ311がデータ212を取得してデータバッファ33に書き込むとともに、第2トレースプロセッサ312が差分を算出して差分記憶部34に書き込む。このため、制御プロセッサ231、第1トレースプロセッサ311及び第2トレースプロセッサ312がロギングに必要な処理を分担することとなる。したがって、制御プロセッサ231によるスキャンタイムの時間長81は、比較例に係る時間長80より短い。ひいては、ロギング対象のデータ212の個数が多くなった場合において、スキャンタイムが比較例のように大幅に増加することがない。 On the other hand, the control processor 231 according to the present embodiment simply outputs the data 212 in the end processing without executing the data reference, comparison, or calculation after executing the user programs X, Y, Z, and W. .. Then, the first trace processor 311 acquires the data 212 and writes it to the data buffer 33, and the second trace processor 312 calculates the difference and writes it to the difference storage unit 34. Therefore, the control processor 231 and the first trace processor 311 and the second trace processor 312 share the processing required for logging. Therefore, the time length 81 of the scan time by the control processor 231 is shorter than the time length 80 according to the comparative example. As a result, when the number of data 212 to be logged increases, the scan time does not increase significantly as in the comparative example.

また、制御プロセッサ231がデータ212を外部に出力する時間、第1トレースプロセッサ311がデータ212を取得する時間、及び、第1トレースプロセッサ311がデータ212をデータバッファ33に書き込む時間は、ユーザプログラム221の実行処理にかかる時間より大幅に短いケースが多い。このため、ユーザプログラム221の実行処理と、トレースユニット30によるトレース処理と、を並列に実行して、スキャンタイムの大幅な増加を避けることができる。 The time for the control processor 231 to output the data 212 to the outside, the time for the first trace processor 311 to acquire the data 212, and the time for the first trace processor 311 to write the data 212 to the data buffer 33 are the time for the user program 221. In many cases, it is significantly shorter than the time required for the execution process of. Therefore, the execution process of the user program 221 and the trace process by the trace unit 30 can be executed in parallel to avoid a significant increase in the scan time.

また、制御装置10は、制御プロセッサ231から出力されたデータ212が格納される外部ターゲットメモリ232を備え、処理部31が、この外部ターゲットメモリ232からデータ212を読み出した。通常、大容量メモリ32のように記憶容量が大きいメモリは、アクセス速度が低いことが多い。一方、最新のデータ212が格納される外部ターゲットメモリ232に必要な記憶容量は小さく、アクセス速度の速い記憶装置を外部ターゲットメモリ232とすることができる。このため、制御プロセッサ231によるデータの出力にかかる時間を短くすることができる。 Further, the control device 10 includes an external target memory 232 in which the data 212 output from the control processor 231 is stored, and the processing unit 31 reads the data 212 from the external target memory 232. Generally, a memory having a large storage capacity such as the large-capacity memory 32 often has a low access speed. On the other hand, the storage capacity required for the external target memory 232 in which the latest data 212 is stored is small, and a storage device having a high access speed can be used as the external target memory 232. Therefore, the time required for data output by the control processor 231 can be shortened.

また、処理部31は、第1トレースプロセッサ311と、第2トレースプロセッサ312と、を有する。これにより、処理部31が実行すべきトレース処理を2つのプロセッサで分担して、トレース処理を高速に実行することができる。つまり、上述したように、第1トレースプロセッサ311で転送処理を実行させ、第2トレースプロセッサ312で差分の算出処理を実行させることで、転送処理と差分の算出処理とを並行して実行することができるため、トレース処理を高速に実行することができる。 Further, the processing unit 31 has a first trace processor 311 and a second trace processor 312. As a result, the trace processing to be executed by the processing unit 31 can be shared by the two processors, and the trace processing can be executed at high speed. That is, as described above, the transfer process and the difference calculation process are executed in parallel by causing the first trace processor 311 to execute the transfer process and the second trace processor 312 to execute the difference calculation process. Therefore, the trace process can be executed at high speed.

また、大容量メモリ32は、3つ以上のデータバッファ33を有し、第2トレースプロセッサ312は、最新のデータ212が書き込まれているデータバッファ33とは異なる2つのデータバッファ33、又は、最新のデータが次に書き込まれるデータバッファ33とは異なる2つのデータバッファ33に格納されたデータ212から、データ212の差分を算出する。これにより、最新のデータ212のデータバッファ33への書き込みと、差分を算出するためのデータバッファ33からのデータ212の読み出しと、が競合することがない。 Further, the large-capacity memory 32 has three or more data buffers 33, and the second trace processor 312 has two data buffers 33 different from the data buffer 33 in which the latest data 212 is written, or the latest data buffer 33. The difference between the data 212 is calculated from the data 212 stored in the two data buffers 33 different from the data buffer 33 to which the data of 1 is written next. As a result, the writing of the latest data 212 to the data buffer 33 and the reading of the data 212 from the data buffer 33 for calculating the difference do not conflict with each other.

また、制御プロセッサ231は、データ212の出力が完了したことを処理部31に通知し、処理部31は、制御プロセッサ231からの通知に基づいて、第1トレースプロセッサ311によるデータ212のデータバッファ33への格納と、第2トレースプロセッサ312による差分データの算出と、の少なくとも一方を行う。これにより、制御プロセッサ231による処理と、処理部31による処理と、を効率よく並列に実行することができる。 Further, the control processor 231 notifies the processing unit 31 that the output of the data 212 has been completed, and the processing unit 31 notifies the data buffer 33 of the data 212 by the first trace processor 311 based on the notification from the control processor 231. At least one of the storage in the data and the calculation of the difference data by the second trace processor 312 is performed. As a result, the processing by the control processor 231 and the processing by the processing unit 31 can be efficiently executed in parallel.

また、制御装置10は、CPUユニット20と、トレースユニット30と、を備える。これにより、制御装置10を構成するユニットが大型化してしまうことを抑制するとともに、ユニットの配置の自由度を確保することができる。 Further, the control device 10 includes a CPU unit 20 and a trace unit 30. As a result, it is possible to prevent the units constituting the control device 10 from becoming large in size and to secure the degree of freedom in arranging the units.

以上、本開示の実施の形態について説明したが、本開示は上記実施の形態によって限定されるものではない。 Although the embodiments of the present disclosure have been described above, the present disclosure is not limited to the above embodiments.

例えば、上記実施の形態では、制御装置10が、CPUユニット20及びトレースユニット30を含む例について説明したが、これには限定されない。例えば、図13に示されるように、制御装置10は、上記実施の形態に係るCPUユニット20及びトレースユニット30双方の機能を備える一体型の装置であってもよい。図13の例では、外部ターゲットメモリ232を省略して処理部23が構成され、内部ターゲットメモリ310を省略して処理部31が構成される。この例において、処理部23の制御プロセッサ231は、処理部23,31によって共有される共有メモリ233にデータ212を出力し、処理部31は、共有メモリ233から読み出したデータ212を大容量メモリのデータバッファ33に転送すればよい。共有メモリ233は、制御装置10において、第1プロセッサにより出力されたデータを記憶する第3記憶手段の第3の例に相当する。 For example, in the above embodiment, the example in which the control device 10 includes the CPU unit 20 and the trace unit 30 has been described, but the present invention is not limited thereto. For example, as shown in FIG. 13, the control device 10 may be an integrated device having the functions of both the CPU unit 20 and the trace unit 30 according to the above embodiment. In the example of FIG. 13, the external target memory 232 is omitted to configure the processing unit 23, and the internal target memory 310 is omitted to configure the processing unit 31. In this example, the control processor 231 of the processing unit 23 outputs the data 212 to the shared memory 233 shared by the processing units 23 and 31, and the processing unit 31 outputs the data 212 read from the shared memory 233 to the large-capacity memory. It may be transferred to the data buffer 33. The shared memory 233 corresponds to the third example of the third storage means for storing the data output by the first processor in the control device 10.

また、図13に示されるように、処理部31は、上記実施の形態に係る第1トレースプロセッサ311及び第2トレースプロセッサ312双方の機能を有する1つのトレースプロセッサ313を有してもよい。 Further, as shown in FIG. 13, the processing unit 31 may have one trace processor 313 having the functions of both the first trace processor 311 and the second trace processor 312 according to the above embodiment.

また、上記実施の形態では、制御プロセッサ231と第1トレースプロセッサ311との間にデータ212を伝送するための記憶装置が介在したが、これには限定されない。例えば、図14に示されるように、第1トレースプロセッサ311を省略して制御装置10を構成し、制御プロセッサ231は、データバッファ33に直接データを書き込んでもよい。図14に示される例では、データバッファ33を有するメモリ35が、ある程度高速に書き込み可能な装置であることが好ましい。 Further, in the above embodiment, a storage device for transmitting data 212 is interposed between the control processor 231 and the first trace processor 311, but the present invention is not limited to this. For example, as shown in FIG. 14, the control device 10 may be configured by omitting the first trace processor 311 and the control processor 231 may write data directly to the data buffer 33. In the example shown in FIG. 14, it is preferable that the memory 35 having the data buffer 33 is a device capable of writing at a relatively high speed.

また、図14に示されるようにデータバッファ33の数は3つより多くてもよい。制御装置10は、複数のデータバッファ33を有していればよい。 Further, as shown in FIG. 14, the number of data buffers 33 may be more than three. The control device 10 may have a plurality of data buffers 33.

また、上記実施の形態では、制御システム100が、工場で製造ラインを稼働させる製造システムである例について説明したが、これには限定されない。制御システム100は、加工システム、検査システム、その他の処理システムであってもよいし、プラントにおけるプロセス制御を実行するシステムであってもよい。 Further, in the above embodiment, an example in which the control system 100 is a manufacturing system for operating a manufacturing line in a factory has been described, but the present invention is not limited to this. The control system 100 may be a processing system, an inspection system, or other processing system, or may be a system that executes process control in a plant.

本開示は、本開示の広義の精神と範囲を逸脱することなく、様々な実施の形態及び変形が可能とされるものである。また、上述した実施の形態は、本開示を説明するためのものであり、本開示の範囲を限定するものではない。つまり、本開示の範囲は、実施の形態ではなく、請求の範囲によって示される。そして、請求の範囲内及びそれと同等の開示の意義の範囲内で施される様々な変形が、本開示の範囲内とみなされる。 The present disclosure allows for various embodiments and variations without departing from the broad spirit and scope of the present disclosure. Moreover, the above-described embodiment is for explaining the present disclosure, and does not limit the scope of the present disclosure. That is, the scope of the present disclosure is indicated by the scope of claims, not by the embodiment. And various modifications made within the scope of the claims and within the equivalent meaning of disclosure are considered to be within the scope of the present disclosure.

本開示は、データのロギングに適している。 The present disclosure is suitable for logging data.

100 制御システム、 10 制御装置、 101 システムバス、 20 CPUユニット、 21 データメモリ、 211 領域、 212 データ、 22 プログラムメモリ、 221 ユーザプログラム、 23 処理部、 231 制御プロセッサ、 232 外部ターゲットメモリ、 233 共有メモリ、 30 トレースユニット、 31 処理部、 310 内部ターゲットメモリ、 311 第1トレースプロセッサ、 312 第2トレースプロセッサ、 313 トレースプロセッサ、 32 大容量メモリ、 33,331〜333 データバッファ、 34 差分記憶部、 35 メモリ、 40 I/Oユニット、 50 産業用ネットワーク、 61,62 機器、 70 スキャン、 71 実行処理、 72 エンド処理。 100 control system, 10 control unit, 101 system bus, 20 CPU unit, 21 data memory, 211 area, 212 data, 22 program memory, 221 user program, 23 processing unit, 231 control processor, 232 external target memory, 233 shared memory , 30 Trace unit, 31 Processing unit, 310 Internal target memory, 311 1st trace processor, 312 2nd trace processor, 313 trace processor, 32 Large capacity memory, 33,331-333 data buffer, 34 Difference storage, 35 memory , 40 I / O units, 50 industrial networks, 61, 62 equipment, 70 scans, 71 execution processing, 72 end processing.

Claims (8)

機器を制御するためのプログラムを繰り返し実行する第1ユニットと、第2ユニットと、を備える制御装置であって、
前記第1ユニットは、
前記プログラムを実行するためのデータを記憶する第1記憶手段と、
前記プログラムを実行し、前記プログラムの実行処理が終了する度に実行するエンド処理において、ユーザから履歴を残すことが指定された前記第1記憶手段の記憶領域から前記データを読み出して出力する第1プロセッサと、を有し、
前記第2ユニットは、
前記第1プロセッサによって出力された前記データが予め定められた順に格納される複数のバッファと、
前記複数のバッファのうちの2つの前記バッファに格納された前記データから前記データの差分を算出する第2プロセッサを有する処理手段と、
前記第2プロセッサによって算出された前記差分を蓄積して記憶する第2記憶手段と、を有し、
前記第1プロセッサは、前記データの出力が完了したことを前記処理手段に通知し、
前記第2プロセッサは、前記第1プロセッサからの通知に基づいて、前記第1プロセッサによる前記プログラムの次の実行処理と並列して、前記データの前記差分を算出する、
御装置。
A control device including a first unit and a second unit that repeatedly execute a program for controlling a device.
The first unit is
A first storage means for storing data for executing the program,
In the end process of executing the program and executing each time the execution process of the program is completed, a first method of reading and outputting the data from the storage area of the first storage means specified by the user to keep a history. With a processor ,
The second unit is
A plurality of buffers in which the data output by the first processor is stored in a predetermined order, and
A processing means having a second processor that calculates a difference between the data stored in the two buffers of the plurality of buffers, and a processing means having a second processor that calculates a difference between the data.
It has a second storage means for accumulating and storing the difference calculated by the second processor .
The first processor notifies the processing means that the output of the data is completed, and the first processor notifies the processing means.
The second processor calculates the difference of the data in parallel with the next execution process of the program by the first processor based on the notification from the first processor.
Control apparatus.
前記第1プロセッサは、前記エンド処理において、前記データの比較又は演算を実行することなく、前記第1記憶手段から前記データを読み出して出力する、
請求項1に記載の制御装置。
The first processor reads and outputs the data from the first storage means in the end processing without executing the comparison or calculation of the data.
The control device according to claim 1.
前記第1プロセッサにより出力された前記データを記憶する第3記憶手段、をさらに備え、
前記処理手段は、前記第1プロセッサにより前記データが出力される毎に、前記第3記憶手段から前記データを読み出して、前記複数のバッファに予め定められた順に格納する、
請求項1又は2に記載の制御装置。
A third storage means for storing the data output by the first processor is further provided.
Each time the data is output by the first processor, the processing means reads the data from the third storage means and stores the data in the plurality of buffers in a predetermined order.
The control device according to claim 1 or 2.
前記処理手段は、前記第2プロセッサと、前記第3記憶手段から前記データを読み出して、前記複数のバッファに予め定められた順に格納する第3プロセッサと、を有する、
請求項3に記載の制御装置。
The processing means includes the second processor and a third processor that reads the data from the third storage means and stores the data in the plurality of buffers in a predetermined order.
The control device according to claim 3.
前記第1プロセッサは、前記エンド処理が完了したことを前記処理手段に通知し、
前記処理手段は、前記エンド処理が完了したことの通知に基づいて、前記第2プロセッサにおける前記算出、及び、前記第3プロセッサにおける前記格納を行って、前記算出及び前記格納が完了したことを前記第1プロセッサに通知し、
前記第1プロセッサは、前記エンド処理が開始すると、前記算出及び前記格納が完了したことが通知されたと判定した場合に、前記第1記憶手段から前記データを読み出して出力する、
請求項4に記載の制御装置。
The first processor notifies the processing means that the end processing has been completed, and the first processor notifies the processing means.
The processing means performs the calculation in the second processor and the storage in the third processor based on the notification that the end processing is completed, and the calculation and the storage are completed. Notify the first processor
When the end processing is started, the first processor reads the data from the first storage means and outputs the data when it is determined that the calculation and the storage are completed.
The control device according to claim 4.
前記第1ユニットと前記第2ユニットとが互いに信号を伝送するためのバス、を備える、
請求項から5のいずれか一項に記載の制御装置。
Comprising a bus, for the first unit and the second unit transmits a signal to each other,
The control device according to any one of claims 1 to 5.
前記複数のバッファは、3つ以上の前記バッファを有し、
前記第2プロセッサは、前記データが書き込まれている前記バッファとは異なる2つの前記バッファ、又は、前記データが次に書き込まれる前記バッファとは異なる2つの前記バッファに格納された前記データから前記データの前記差分を算出する、
請求項1から6のいずれか一項に記載の制御装置。
The plurality of buffers have three or more of the buffers.
The second processor uses the data from the data stored in two buffers different from the buffer in which the data is written, or in two buffers different from the buffer in which the data is written next. Calculate the difference of
The control device according to any one of claims 1 to 6.
機器を制御するためのプログラムを繰り返し実行する制御装置によって実行されるロギング方法であって、
前記プログラムを実行する第1プロセッサが、前記プログラムを実行するためのデータを、前記プログラムの実行処理が終了する度に実行するエンド処理において、ユーザから履歴を残すことが指定された第1記憶手段の記憶領域から読み出して出力する出力ステップと、
第2プロセッサが、前記第1プロセッサによって出力された前記データが予め定められた順に格納される複数のバッファのうちの2つの前記バッファに格納された前記データから前記データの差分を算出する算出ステップと、
前記差分を第2記憶手段に蓄積する蓄積ステップと、
を含み、
前記第1プロセッサは、前記データの出力が完了したことを、前記第2プロセッサを有する処理手段に通知し、
前記第2プロセッサは、前記第1プロセッサからの通知に基づいて、前記第1プロセッサによる前記プログラムの次の実行処理と並列して、前記データの前記差分を算出する、
ロギング方法。
A logging method executed by a control device that repeatedly executes a program for controlling a device.
First processor for executing the program, the data for executing the program, in the end processing to be executed every time the execution of the program ends, a first memory which can store a history of the user specified An output step that reads from the storage area of the means and outputs it,
A calculation step in which the second processor calculates the difference between the data stored in the two buffers of the plurality of buffers in which the data output by the first processor is stored in a predetermined order. When,
A storage step of accumulating the difference in the second storage means, and
Only including,
The first processor notifies the processing means having the second processor that the output of the data is completed.
The second processor calculates the difference of the data in parallel with the next execution process of the program by the first processor based on the notification from the first processor.
Logging method.
JP2020561926A 2020-03-30 2020-03-30 Control device and logging method Active JP6921342B1 (en)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2020/014642 WO2021199192A1 (en) 2020-03-30 2020-03-30 Control device and logging method

Publications (2)

Publication Number Publication Date
JP6921342B1 true JP6921342B1 (en) 2021-08-18
JPWO2021199192A1 JPWO2021199192A1 (en) 2021-10-07

Family

ID=77269522

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2020561926A Active JP6921342B1 (en) 2020-03-30 2020-03-30 Control device and logging method

Country Status (2)

Country Link
JP (1) JP6921342B1 (en)
WO (1) WO2021199192A1 (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS56111905A (en) * 1980-02-07 1981-09-04 Mitsubishi Electric Corp Programmable sequence controller
JPS607814B2 (en) * 1980-11-17 1985-02-27 富士通株式会社 Log data acquisition device
JP2010211555A (en) * 2009-03-11 2010-09-24 Meidensha Corp Data trace method for programmable controller
JP2011113443A (en) * 2009-11-30 2011-06-09 Mitsubishi Electric Corp Log compression device, log collection system, computer program, and log compression method
WO2012056537A1 (en) * 2010-10-27 2012-05-03 三菱電機株式会社 Programmable controller
JP2020013526A (en) * 2018-10-23 2020-01-23 株式会社キーエンス Programmable logic controller and main unit

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS56111905A (en) * 1980-02-07 1981-09-04 Mitsubishi Electric Corp Programmable sequence controller
JPS607814B2 (en) * 1980-11-17 1985-02-27 富士通株式会社 Log data acquisition device
JP2010211555A (en) * 2009-03-11 2010-09-24 Meidensha Corp Data trace method for programmable controller
JP2011113443A (en) * 2009-11-30 2011-06-09 Mitsubishi Electric Corp Log compression device, log collection system, computer program, and log compression method
WO2012056537A1 (en) * 2010-10-27 2012-05-03 三菱電機株式会社 Programmable controller
JP2020013526A (en) * 2018-10-23 2020-01-23 株式会社キーエンス Programmable logic controller and main unit

Also Published As

Publication number Publication date
JPWO2021199192A1 (en) 2021-10-07
WO2021199192A1 (en) 2021-10-07

Similar Documents

Publication Publication Date Title
US9778630B2 (en) Control device and system program for maintaining global variable and reference data consistency during parallel processing of multiple tasks
US20130318260A1 (en) Data transfer device
EP1953645A2 (en) Information processing apparatus, history management method
KR20110076432A (en) System for upgrading multi-program by using can communication and method thereof
JP6921342B1 (en) Control device and logging method
CN111095138B (en) Control device, control method for control device, information processing program, and recording medium
JP4993208B2 (en) Industrial controller equipment
JPH09330106A (en) Control system with backup function
JP2013175118A (en) Control device, memory failure detection method thereof and self-diagnostic method thereof
EP3015931B1 (en) Plc system with a webserver and a partitioned memory
JP6808090B1 (en) Control device and distributed processing method
CN110278716B (en) PLC, network unit, CPU unit, and data transfer method
US11953882B2 (en) Production system, control method, and information storage medium
CN114174939A (en) Programmable logic controller, setting tool and program
JP2020147250A (en) Electronic control device
JP6686521B2 (en) Control system and control method
JP6469330B1 (en) MONITOR SUPPORT DEVICE, MONITOR SUPPORT METHOD, AND MONITOR SUPPORT PROGRAM
JP5365875B2 (en) Industrial controller
CN110442074B (en) Processing device for programmable logic controller program
US10914580B2 (en) Measurement system, measurement program, and control method
JP4232589B2 (en) Duplex controller and its equalization mode decision method
JP4810488B2 (en) Duplex control apparatus and tracking method thereof
JP6309919B2 (en) Numerical control device with data acquisition function
JP7076654B1 (en) Programmable controller communication unit, received data storage method and program
JP7010863B2 (en) Controls, programs, and wireless communication equipment

Legal Events

Date Code Title Description
A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20201104

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20201104

A871 Explanation of circumstances concerning accelerated examination

Free format text: JAPANESE INTERMEDIATE CODE: A871

Effective date: 20201104

A975 Report on accelerated examination

Free format text: JAPANESE INTERMEDIATE CODE: A971005

Effective date: 20201203

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20210112

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20210308

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20210413

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20210611

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20210727

R150 Certificate of patent or registration of utility model

Ref document number: 6921342

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150